mirror of
https://github.com/goharbor/harbor.git
synced 2025-02-16 11:51:47 +01:00
Disable edit default quota button when not editable
Signed-off-by: Henning Poettker <Henning.Poettker@c24.de>
This commit is contained in:
parent
ad8c5df52e
commit
4aa1ffa2d0
@ -25,6 +25,7 @@
|
||||
<button
|
||||
id="open-edit"
|
||||
class="btn btn-link btn-sm default-quota-edit-button"
|
||||
[disabled]="!allConfig.storage_per_project.editable"
|
||||
(click)="editDefaultQuota(quotaHardLimitValue)">
|
||||
{{ 'QUOTA.EDIT' | translate }}
|
||||
</button>
|
||||
|
@ -111,6 +111,7 @@ describe('ProjectQuotasComponent', () => {
|
||||
await fixture.whenStable();
|
||||
const openEditButton: HTMLButtonElement =
|
||||
fixture.nativeElement.querySelector('#open-edit');
|
||||
expect(openEditButton.disabled).toBeFalse();
|
||||
openEditButton.dispatchEvent(new Event('click'));
|
||||
fixture.detectChanges();
|
||||
await fixture.whenStable();
|
||||
@ -118,6 +119,14 @@ describe('ProjectQuotasComponent', () => {
|
||||
fixture.nativeElement.querySelector('clr-modal');
|
||||
expect(modal).toBeTruthy();
|
||||
});
|
||||
it('edit quota should be disabled when storage per project not editable', async () => {
|
||||
component.config.storage_per_project.editable = false;
|
||||
fixture.detectChanges();
|
||||
await fixture.whenStable();
|
||||
const openEditButton: HTMLButtonElement =
|
||||
fixture.nativeElement.querySelector('#open-edit');
|
||||
expect(openEditButton.disabled).toBeTrue();
|
||||
});
|
||||
it('should call navigate function', async () => {
|
||||
// wait getting list and rendering
|
||||
await timeout(10);
|
||||
|
Loading…
Reference in New Issue
Block a user