-
Notifications
You must be signed in to change notification settings - Fork 5.1k
fix(ui): Update bindings in Project Policy Config #22694
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
base: main
Are you sure you want to change the base?
Conversation
|
To the maintainers @bupd @Vad1mo @chlins @MinerYang, This will enable only the |
|
@vg006 Project admins should be able to configure proxy cache. |
325ca7c to
83c5d93
Compare
|
Initially the component is configured only to be accessed by the - *ngIf="isSystemAdmin"
+ *ngIf="hasChangeConfigRole"@bupd Can you review the changes[1][2] once and ensure whether it satisfies the requirements? |
Signed-off-by: vg006 <[email protected]>
Signed-off-by: vg006 <[email protected]>
|
@bupd |
bupd
left a comment
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.
@vg006 Thanks for your contribution,
you cannot update a proxy cache to normal and vice versa so the checkbox should always be in disabled state.
| type="checkbox" | ||
| clrCheckbox | ||
| disabled="!allowUpdateProxyCacheConfiguration" | ||
| [disabled]="!allowUpdateProxyCacheConfiguration" |
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.
this should always be disabled, since backend does not allow converting a normal project into proxy cache and vice versa. this should be set to disabled=true indefinitely.
| </clr-control-helper> | ||
| </clr-checkbox-container> | ||
| <clr-checkbox-container *ngIf="isSystemAdmin" clrInline> | ||
| <clr-checkbox-container *ngIf="hasChangeConfigRole" clrInline> |
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.
good to go.
Thank you for contributing to Harbor!
Comprehensive Summary of your change
Issue being fixed
Fixes #22688
Summary
This PR fixes the improper bindings of the attribute
disabledin theproject-policy-config.component.htmlcomponent file.Overview of changes made
project-policy-config.component.htmlproject-policy-config.component.tsprivate getPermission(): void { this.userPermission .getPermission( this.projectId, USERSTATICPERMISSION.CONFIGURATION.KEY, USERSTATICPERMISSION.CONFIGURATION.VALUE.UPDATE ) .subscribe(permissins => { this.hasChangeConfigRole = permissins as boolean; + this.allowUpdateProxyCacheConfiguration = + this.hasChangeConfigRole && !this.isProxyCacheProject; }); }Result:
Please indicate you've done the following:
release-note/update,release-note/enhancement