Skip to content

feat(frontend): add user permissions CRUD page#1

Open
camachoti wants to merge 2 commits into
mainfrom
codex/add-user-permission-crud-functionality
Open

feat(frontend): add user permissions CRUD page#1
camachoti wants to merge 2 commits into
mainfrom
codex/add-user-permission-crud-functionality

Conversation

@camachoti
Copy link
Copy Markdown
Owner

Motivation

  • Provide a simple CRUD screen to manage user permissions inside the logged-in area to replace the demo products CRUD and support create/read/update/delete and bulk-delete flows.
  • Expose a dedicated permissions route and menu entry so administrators can manage permission codes, modules and status from the app UI.

Description

  • Replace the demo products CRUD UI with a UserPermission CRUD implementation in frontend/src/app/pages/crud/crud.ts and frontend/src/app/pages/crud/crud.html, including a dialog for create/edit with client-side validation for id, name and module.
  • Add in-memory seed permissions and new form fields module and status with select options and status badges; remove dependency on the product service and export features not needed for this screen.
  • Register a new route path /logedin/pages/permissions by updating frontend/src/app/pages/pages.routes.ts while keeping the existing crud path available.
  • Update the logged-in sidebar to show User Permissions and link it to /logedin/pages/permissions in frontend/src/app/layout/component/app.menu.ts.

Testing

  • Ran the frontend production build with cd frontend && npm run build, which completed successfully (Angular build finished; a bundle-size budget warning was reported).

Codex Task

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b477078bd8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

<div class="flex flex-col gap-4">
<div>
<label for="permissionId" class="block font-bold mb-2">Code</label>
<input id="permissionId" type="text" pInputText [(ngModel)]="permission.id" required fluid [disabled]="!!permission.id && !submitted" />
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Keep permission code editable while creating records

The Code input is bound with [disabled]="!!permission.id && !submitted", which disables the field immediately after the first character is typed during creation (submitted is still false). In practice this prevents entering normal multi-character permission IDs and breaks the main create flow; after failed submits it can also re-enable the field in edit mode, allowing accidental ID changes even though savePermission() uses id as the update key.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant