Merge pull request #11997 from opf/bug/45945-file-linking-modal-bahaves-bad-on-group-folders

[#45945] File linking modal bahaves bad on group folders
pull/12003/merge
Andreas Pfohl 2 years ago committed by GitHub
commit 04473b327b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      frontend/src/app/shared/components/storages/file-picker-modal/file-picker-modal.component.ts
  2. 5
      frontend/src/app/shared/components/storages/location-picker-modal/location-picker-modal.component.ts
  3. 2
      frontend/src/app/shared/components/storages/storage-file-list-item/storage-file-list-item.html
  4. 9
      frontend/src/app/shared/components/storages/storage-file-list-item/storage-file-list-item.ts

@ -149,6 +149,7 @@ export class FilePickerModalComponent extends FilePickerBaseModalComponent {
this.isAlreadyLinked(file),
index === 0,
this.enterDirectoryCallback(file),
false,
this.tooltip(file),
{
selected: this.selection.has(file.id as string),

@ -113,11 +113,16 @@ export class LocationPickerModalComponent extends FilePickerBaseModalComponent {
!isDirectory(file),
index === 0,
this.enterDirectoryCallback(file),
this.isConstrained(file),
this.tooltip(file),
undefined,
);
}
private isConstrained(file:IStorageFile):boolean {
return !file.permissions.some((permission) => permission === 'writeable');
}
private tooltip(file:IStorageFile):string|undefined {
if (isDirectory(file)) {
return file.permissions.some((permission) => permission === 'writeable')

@ -13,7 +13,7 @@
data-qa-selector="op-files-picker-modal--list-item"
[ngClass]="{
'spot-list--item-action_disabled': content.disabled,
'op-file-list--item-action_view-not-allowed': !content.isWriteable
'op-file-list--item-action_view-not-allowed': content.isConstrained
}"
>
<spot-checkbox

@ -63,20 +63,13 @@ export class StorageFileListItem {
return isDirectory(this.storageFile);
}
get isWriteable():boolean {
return this.storageFile.permissions.some((permission) => permission === 'writeable');
}
get isReadable():boolean {
return this.storageFile.permissions.some((permission) => permission === 'readable');
}
constructor(
private readonly timezoneService:TimezoneService,
private readonly storageFile:IStorageFile,
public readonly disabled:boolean,
public readonly isFirst:boolean,
public readonly enterDirectory:() => void,
public readonly isConstrained:boolean,
public readonly tooltip?:string,
public readonly checkbox?:StorageFileListItemCheckbox,
) {}

Loading…
Cancel
Save