Skip to content

Pre develop#7

Merged
cz-lucas merged 108 commits intodevelopfrom
pre_develop
Sep 25, 2025
Merged

Pre develop#7
cz-lucas merged 108 commits intodevelopfrom
pre_develop

Conversation

@cz-lucas
Copy link
Member

No description provided.

LeonZebelein and others added 30 commits August 11, 2025 15:37
…arlier commits is probably not working correctly
@cz-lucas cz-lucas requested review from JonasGoseberg, Klausw-1 and Copilot and removed request for Copilot September 24, 2025 08:52

on:
push:
branches: ['develope, master']
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

develop not develope ?


$table->unsignedBigInteger('permission_group_id');
$table->unsignedInteger('created_by');
$table->timestamps();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if the should keep the timestamps in the predefined_filter_permissions table. If we remove it public $timestamps = false; needs to be added in the model.

),

'create' => array(
'not_allowed' => "Du hast nicht die Berechtigungen um diesen Filter zu erstellen",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this version for Germany is with Sie


/**
* Categories API routes
* Categpries API routes
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo

$user = auth()->user();
$validated = $request->validate((new PredefinedFilter)->getRules());

if (!empty($validated['is_public']) && !$user->hasAccess('predefinedFilter.create')) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$user-> hasAccess() vs $filter-> userHasPermission()

return (new SelectlistTransformer)->transformSelectlist($filters);
}

// Optional: You can refactor the permission syncing methods similarly

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needed?

$permission = $this->service->store($validated);

return response()->json([
'message' => __('admin/reports/message.create.success'),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this has to be "'message' => trans('admin[...]')

$this->service->delete($id);

return response()->json([
'message' => __('admin/reports/message.delete.success'),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also with trans()

->get();

return view('hardware/index')->with('company', $company);
return view('hardware/index')->with('company', $company)->with('predefined_filters', $predefined_filters); // TODO maybe switch later to user / role based view

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

open TODO


public function test_index_unauthenticated_gets_302()
{
$this->getJson('api/v1/predefinedFilters')->assertStatus(302);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

routes are now predefined-filters

->assertOk();
}
}
} No newline at end of file

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What a sensational change! 🎉

$currently_set_permssions = $this->predefinedFilterPermissionService->getPermissionsById($filter->id);
$new_permissions = $validated['permissions'];
$permission_diff = $this->syncPermissions($currently_set_permssions->toArray(), $new_permissions);
//dump($permission_diff);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dump :)

DB::transaction(function () use ($permission_diff, $filter) {
if (!empty($permission_diff['to_delete'])) {
foreach ($permission_diff['to_delete'] as $permission) {
//dump($permission);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dump :)

if (!empty($permission_diff['to_add'])) {
foreach ($permission_diff['to_add'] as $permission) {
$permission['predefined_filter_id'] = $filter->id;
//dump($permission);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dump :)

$this->authorize('index', Asset::class);
$company = Company::find($request->input('company_id'));
// $predefined_filters = PredefinedFilter::Auth();
// $predefined_filters = PredefinedFilter::orderBy('name')->get();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here is some commented-out code

/**
* PredefinedFilter API routes
*/
//Route::middleware('auth:api')->group(function () {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is the route still commented out.

Copy link
Collaborator

@Klausw-1 Klausw-1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review was conducted and changes commented on.

@cz-lucas cz-lucas merged commit c47297e into develop Sep 25, 2025
2 of 6 checks passed
@cz-lucas cz-lucas deleted the pre_develop branch September 29, 2025 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants