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

[#55529] encode collection key correctly

Eric Schubert2d30b4be4ea5
diff --git a/frontend/src/app/shared/components/storages/functions/storages.functions.ts b/frontend/src/app/shared/components/storages/functions/storages.functions.ts
index 8f949a8dc5d..ad337f059ca 100644
--- a/frontend/src/app/shared/components/storages/functions/storages.functions.ts
+++ b/frontend/src/app/shared/components/storages/functions/storages.functions.ts
@@ -56,7 +56,7 @@ export function getIconForStorageType(storageType?:string):string {
}
export function makeFilesCollectionLink(storageLink:IHalResourceLink, location:string):IHalResourceLink {
- const query = location !== '/' ? `?parent=${location}` : '';
+ const query = location !== '/' ? `?parent=${encodeURIComponent(location)}` : '';
return {
href: `${storageLink.href}/files${query}`,
diff --git a/frontend/src/app/shared/components/storages/storage/storage.component.ts b/frontend/src/app/shared/components/storages/storage/storage.component.ts
index bcd8524f9d2..4a9ddaff23f 100644
--- a/frontend/src/app/shared/components/storages/storage/storage.component.ts
+++ b/frontend/src/app/shared/components/storages/storage/storage.component.ts
@@ -184,7 +184,7 @@ export class StorageComponent extends UntilDestroyedMixin implements OnInit, OnD
return this.pathHelperService.fileLinksPath();
}
- return (this.resource.$links as unknown&{ addFileLink:IHalResourceLink }).addFileLink.href;
+ return (this.resource.$links as { addFileLink:IHalResourceLink }).addFileLink.href;
}
private onGlobalDragLeave:(_event:DragEvent) => void = (_event) => {
@@ -311,6 +311,7 @@ export class StorageComponent extends UntilDestroyedMixin implements OnInit, OnD
collectionKey,
fileLinks,
};
+
this.opModalService.show<FilePickerModalComponent>(FilePickerModalComponent, 'global', locals);
});
}
@@ -500,7 +501,7 @@ export class StorageComponent extends UntilDestroyedMixin implements OnInit, OnD
}
private uploadResourceLink(storage:IStorage, fileName:string, location:string):IPrepareUploadLink {
- const project = (this.resource.project as unknown&{ id:string }).id;
+ const project = (this.resource.project as { id:string }).id;
const link = storage._links.prepareUpload.filter((value) => project === value.payload.projectId.toString());
if (link.length === 0) {
throw new Error('Cannot upload to this storage. Missing permissions in project.');
@@ -532,7 +533,7 @@ export class StorageComponent extends UntilDestroyedMixin implements OnInit, OnD
}
private fileLinkSelfLink(storage:IStorage):string {
- const fileLinks = this.resource.fileLinks as unknown&{ href:string };
+ const fileLinks = this.resource.fileLinks as { href:string };
return `${fileLinks.href}?filters=[{"storage":{"operator":"=","values":["${storage.id}"]}}]`;
}