Skip to content

Commit

Permalink
Disable edit default quota button when not editable
Browse files Browse the repository at this point in the history
Signed-off-by: Henning Poettker <[email protected]>
  • Loading branch information
hpoettker committed Aug 5, 2024
1 parent 5deedf4 commit d7d39b8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,22 @@ 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();
const modal: HTMLElement =
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);
Expand Down

0 comments on commit d7d39b8

Please sign in to comment.