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

Use new URN constants in FileLinkList and added StorageInformation button gap

Andreas Pfohld093f311ed24
diff --git a/frontend/src/app/shared/components/file-links/file-link-list/file-link-list.component.ts b/frontend/src/app/shared/components/file-links/file-link-list/file-link-list.component.ts
index edddb1987c1..1d6c2d8a9b1 100644
--- a/frontend/src/app/shared/components/file-links/file-link-list/file-link-list.component.ts
+++ b/frontend/src/app/shared/components/file-links/file-link-list/file-link-list.component.ts
@@ -32,12 +32,16 @@ import {
Input,
OnInit,
} from '@angular/core';
+import { BehaviorSubject, Observable } from 'rxjs';
+import { CookieService } from 'ngx-cookie-service';
+import { v4 as uuidv4 } from 'uuid';
+
import { HalResource } from 'core-app/features/hal/resources/hal-resource';
import { IFileLink } from 'core-app/core/state/file-links/file-link.model';
import { IStorage } from 'core-app/core/state/storages/storage.model';
import { FileLinksResourceService } from 'core-app/core/state/file-links/file-links.service';
import {
- fileLinkViewAllowed,
+ fileLinkViewAllowed, nextcloud,
storageAuthorizationError,
storageConnected,
storageFailedAuthorization,
@@ -48,10 +52,6 @@ import { I18nService } from 'core-app/core/i18n/i18n.service';
import isNewResource from 'core-app/features/hal/helpers/is-new-resource';
import { StorageActionButton } from 'core-app/shared/components/file-links/file-link-list/storage-action-button';
-import { BehaviorSubject, Observable } from 'rxjs';
-import { CookieService } from 'ngx-cookie-service';
-import { v4 as uuidv4 } from 'uuid';
-
@Component({
selector: 'op-file-link-list',
templateUrl: './file-link-list.html',
@@ -78,9 +78,7 @@ export class FileLinkListComponent extends UntilDestroyedMixin implements OnInit
buttons = new BehaviorSubject<StorageActionButton[]>([]);
- private readonly storageTypeMap:{ [urn:string]:string; } = {
- 'urn:openproject-org:api:v3:storages:Nextcloud': 'Nextcloud',
- };
+ private readonly storageTypeMap:Record<string, string> = {};
text:{
infoBox:{
@@ -112,6 +110,7 @@ export class FileLinkListComponent extends UntilDestroyedMixin implements OnInit
}
ngOnInit():void {
+ this.initializeStorageTypes();
this.initializeLocales();
this.fileLinks$ = this.fileLinkResourceService.collection(this.collectionKey);
@@ -243,6 +242,12 @@ export class FileLinkListComponent extends UntilDestroyedMixin implements OnInit
window.open(this.storageLocation, '_blank');
},
),
+ new StorageActionButton(
+ this.text.infoBox.emptyStorageButton,
+ () => {
+ window.open(this.storageLocation, '_blank');
+ },
+ ),
]);
this.showInformationBox$.next(true);
@@ -273,4 +278,8 @@ export class FileLinkListComponent extends UntilDestroyedMixin implements OnInit
},
};
}
+
+ private initializeStorageTypes() {
+ this.storageTypeMap[nextcloud] = this.i18n.t('js.label_nextcloud');
+ }
}
diff --git a/frontend/src/app/shared/components/file-links/file-links-constants.const.ts b/frontend/src/app/shared/components/file-links/file-links-constants.const.ts
index cdb675c5840..4017ea0f4c0 100644
--- a/frontend/src/app/shared/components/file-links/file-links-constants.const.ts
+++ b/frontend/src/app/shared/components/file-links/file-links-constants.const.ts
@@ -1,3 +1,6 @@
+// Storage types
+export const nextcloud = 'urn:openproject-org:api:v3:storages:Nextcloud';
+
// Storage authorization state
export const storageConnected = 'urn:openproject-org:api:v3:storages:authorization:Connected';
export const storageFailedAuthorization = 'urn:openproject-org:api:v3:storages:authorization:FailedAuthorization';
diff --git a/frontend/src/global_styles/content/work_packages/tabs/_files.sass b/frontend/src/global_styles/content/work_packages/tabs/_files.sass
index 4fa99c048d8..d1b699f59b9 100644
--- a/frontend/src/global_styles/content/work_packages/tabs/_files.sass
+++ b/frontend/src/global_styles/content/work_packages/tabs/_files.sass
@@ -120,6 +120,9 @@
&-button
margin: $spot_spacing-0-75 0 0
+ &:not(:last-child)
+ margin-right: $spot-spacing-0-5
+
&--icon
&_pdf
color: #B93A33