-
-
Notifications
You must be signed in to change notification settings - Fork 18
Improve permissions UI with grouped policies and member previews #1681
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
lyubov-voloshko
merged 8 commits into
rocket-admin:main
from
karinakharchenko:permissions-change-ui
Mar 25, 2026
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
e8d7f28
feat: improve permissions UI with grouped policies, member previews, …
karinakharchenko e1fe489
Merge branch 'main' into permissions-change-ui
lyubov-voloshko 9d518d4
cedar policy editor: add close confirmation and form improvements
lyubov-voloshko 2bbd28a
permissions: fix badge colors
lyubov-voloshko a010864
permissions: move Add policy to the actions footer and scroll dialog …
lyubov-voloshko 6b1d2e5
Merge branch 'main' into permissions-change-ui
lyubov-voloshko 9c06734
permissions: fix unit tests
lyubov-voloshko 8bae806
Merge branch 'permissions-change-ui' of https://github.com/karinakhar…
lyubov-voloshko File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
85 changes: 46 additions & 39 deletions
85
...app/components/users/cedar-policy-editor-dialog/cedar-policy-editor-dialog.component.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,44 +1,51 @@ | ||
| <h1 mat-dialog-title>Policy — {{ data.groupTitle }}</h1> | ||
| <mat-dialog-content> | ||
| <div class="editor-mode-toggle"> | ||
| <mat-button-toggle-group [value]="editorMode" (change)="onEditorModeChange($event.value)"> | ||
| <mat-button-toggle value="form">Form</mat-button-toggle> | ||
| <mat-button-toggle value="code">Code</mat-button-toggle> | ||
| </mat-button-toggle-group> | ||
| </div> | ||
| <form (ngSubmit)="savePolicy()"> | ||
| <mat-dialog-content #dialogContent> | ||
| <div class="editor-mode-toggle"> | ||
| <mat-button-toggle-group [value]="editorMode" (change)="onEditorModeChange($event.value)"> | ||
| <mat-button-toggle value="form">Form</mat-button-toggle> | ||
| <mat-button-toggle value="code">Code</mat-button-toggle> | ||
| </mat-button-toggle-group> | ||
| </div> | ||
|
|
||
| <div *ngIf="formParseError" class="form-parse-warning"> | ||
| <mat-icon>warning</mat-icon> | ||
| <span>This policy uses advanced Cedar syntax that cannot be represented in form mode. Please use the code editor.</span> | ||
| </div> | ||
| <div *ngIf="formParseError" class="form-parse-warning"> | ||
| <mat-icon>warning</mat-icon> | ||
| <span>This policy uses advanced Cedar syntax that cannot be represented in form mode. Please use the code editor.</span> | ||
| </div> | ||
|
|
||
| <div *ngIf="editorMode === 'form' && !formParseError"> | ||
| <app-cedar-policy-list | ||
| [policies]="policyItems" | ||
| [availableTables]="availableTables" | ||
| [availableDashboards]="availableDashboards" | ||
| [loading]="loading" | ||
| (policiesChange)="onPolicyItemsChange($event)"> | ||
| </app-cedar-policy-list> | ||
| </div> | ||
| <div *ngIf="editorMode === 'form' && !formParseError"> | ||
| <app-cedar-policy-list | ||
| [policies]="policyItems" | ||
| [availableTables]="availableTables" | ||
| [availableDashboards]="availableDashboards" | ||
| [loading]="loading" | ||
| (policiesChange)="onPolicyItemsChange($event)"> | ||
| </app-cedar-policy-list> | ||
| </div> | ||
|
|
||
| <div *ngIf="editorMode === 'code'"> | ||
| <p class="cedar-hint">Edit policy in <a href="https://www.cedarpolicy.com/en" target="_blank" rel="noopener">Cedar</a> format</p> | ||
| <div class="code-editor-box"> | ||
| <ngs-code-editor | ||
| [theme]="codeEditorTheme" | ||
| [codeModel]="cedarPolicyModel" | ||
| [options]="codeEditorOptions" | ||
| (valueChanged)="onCedarPolicyChange($event)"> | ||
| </ngs-code-editor> | ||
| <div *ngIf="editorMode === 'code'"> | ||
| <p class="cedar-hint">Edit policy in <a href="https://www.cedarpolicy.com/en" target="_blank" rel="noopener">Cedar</a> format</p> | ||
| <div class="code-editor-box"> | ||
| <ngs-code-editor | ||
| [theme]="codeEditorTheme" | ||
| [codeModel]="cedarPolicyModel" | ||
| [options]="codeEditorOptions" | ||
| (valueChanged)="onCedarPolicyChange($event)"> | ||
| </ngs-code-editor> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </mat-dialog-content> | ||
| <mat-dialog-actions align="end"> | ||
| <button type="button" mat-flat-button mat-dialog-close>Cancel</button> | ||
| <button type="button" mat-flat-button color="primary" | ||
| [disabled]="submitting" | ||
| (click)="savePolicy()"> | ||
| Save | ||
| </button> | ||
| </mat-dialog-actions> | ||
| </mat-dialog-content> | ||
| <mat-dialog-actions> | ||
| <button *ngIf="editorMode === 'form' && !formParseError && !loading && !policyList?.showAddForm" | ||
| type="button" mat-button color="primary" | ||
| (click)="onAddPolicyClick()"> | ||
| <mat-icon>add</mat-icon> Add policy | ||
| </button> | ||
| <span class="dialog-actions-spacer"></span> | ||
| <button type="button" mat-flat-button (click)="confirmClose()">Cancel</button> | ||
| <button type="submit" mat-flat-button color="primary" | ||
| [disabled]="submitting"> | ||
| Save | ||
| </button> | ||
| </mat-dialog-actions> | ||
| </form> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using
window.confirm()here is inconsistent with the rest of the app’s confirmation flows (which useMatDialogconfirmation dialogs) and is not themeable/test-friendly. Consider replacing this with a Material dialog-based confirmation, and ensure the message is localized consistently with the rest of the UI.