Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

[#45945] File linking modal bahaves bad on group folders

Andreas Pfohladbab25bb133
diff --git a/frontend/src/app/shared/components/storages/file-picker-modal/file-picker-modal.component.ts b/frontend/src/app/shared/components/storages/file-picker-modal/file-picker-modal.component.ts
index 7e5af3ee05e..c0566809809 100644
--- a/frontend/src/app/shared/components/storages/file-picker-modal/file-picker-modal.component.ts
+++ b/frontend/src/app/shared/components/storages/file-picker-modal/file-picker-modal.component.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),
diff --git a/frontend/src/app/shared/components/storages/location-picker-modal/location-picker-modal.component.ts b/frontend/src/app/shared/components/storages/location-picker-modal/location-picker-modal.component.ts
index 68b55b617e9..66b17ca0987 100644
--- a/frontend/src/app/shared/components/storages/location-picker-modal/location-picker-modal.component.ts
+++ b/frontend/src/app/shared/components/storages/location-picker-modal/location-picker-modal.component.ts
@@ -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')
diff --git a/frontend/src/app/shared/components/storages/storage-file-list-item/storage-file-list-item.html b/frontend/src/app/shared/components/storages/storage-file-list-item/storage-file-list-item.html
index d017f9858d4..311e4d1a31f 100644
--- a/frontend/src/app/shared/components/storages/storage-file-list-item/storage-file-list-item.html
+++ b/frontend/src/app/shared/components/storages/storage-file-list-item/storage-file-list-item.html
@@ -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
diff --git a/frontend/src/app/shared/components/storages/storage-file-list-item/storage-file-list-item.ts b/frontend/src/app/shared/components/storages/storage-file-list-item/storage-file-list-item.ts
index 8b532462c10..3af90f4566b 100644
--- a/frontend/src/app/shared/components/storages/storage-file-list-item/storage-file-list-item.ts
+++ b/frontend/src/app/shared/components/storages/storage-file-list-item/storage-file-list-item.ts
@@ -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,
) {}