Skip to content

Commit

Permalink
disable new folder when the user does not have write permission
Browse files Browse the repository at this point in the history
  • Loading branch information
brunopagno committed Dec 15, 2024
1 parent 755e181 commit b3c299b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
<button
type="button"
class="button spot-action-bar--action"
[disabled]="!canCreateFolder"
(click)="createAndNavigateToFolder()"
>
<span class="spot-icon spot-icon_folder-add op-files-tab--icon op-files-tab--icon_forums"></span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,14 @@ export class LocationPickerModalComponent extends FilePickerBaseModalComponent {
return this.currentDirectory.permissions.some((value) => value === 'writeable');
}

public get canCreateFolder():boolean {
if (!this.currentDirectory) {
return false;
}

return this.currentDirectory.permissions.some((value) => value === 'writeable');
}

public get alertText():Observable<string> {
return this.showAlert
.pipe(
Expand Down

0 comments on commit b3c299b

Please sign in to comment.