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), this.isAlreadyLinked(file),
index === 0, index === 0,
this.enterDirectoryCallback(file), this.enterDirectoryCallback(file),
false,
this.tooltip(file), this.tooltip(file),
{ {
selected: this.selection.has(file.id as string), selected: this.selection.has(file.id as string),

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

@ -13,7 +13,7 @@
data-qa-selector="op-files-picker-modal--list-item" data-qa-selector="op-files-picker-modal--list-item"
[ngClass]="{ [ngClass]="{
'spot-list--item-action_disabled': content.disabled, '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 <spot-checkbox

@ -63,20 +63,13 @@ export class StorageFileListItem {
return isDirectory(this.storageFile); 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( constructor(
private readonly timezoneService:TimezoneService, private readonly timezoneService:TimezoneService,
private readonly storageFile:IStorageFile, private readonly storageFile:IStorageFile,
public readonly disabled:boolean, public readonly disabled:boolean,
public readonly isFirst:boolean, public readonly isFirst:boolean,
public readonly enterDirectory:() => void, public readonly enterDirectory:() => void,
public readonly isConstrained:boolean,
public readonly tooltip?:string, public readonly tooltip?:string,
public readonly checkbox?:StorageFileListItemCheckbox, public readonly checkbox?:StorageFileListItemCheckbox,
) {} ) {}

Loading…
Cancel
Save