From 99aee55efa77f570e54c395cd3f9d3e4e36c24b4 Mon Sep 17 00:00:00 2001 From: Alexandre Vryghem Date: Tue, 19 Apr 2022 12:57:43 +0200 Subject: [PATCH] 90873: Add environment.standardBundles.bundle --- config/config.example.yml | 6 ++++++ src/config/app-config.interface.ts | 2 ++ src/config/default-app-config.ts | 7 +++++++ src/config/standard-bundle-config.interface.ts | 10 ++++++++++ src/environments/environment.test.ts | 5 +++++ 5 files changed, 30 insertions(+) create mode 100644 src/config/standard-bundle-config.interface.ts diff --git a/config/config.example.yml b/config/config.example.yml index ecb2a3cfb9..c87f94284c 100644 --- a/config/config.example.yml +++ b/config/config.example.yml @@ -228,6 +228,12 @@ themes: rel: manifest href: assets/dspace/images/favicons/manifest.webmanifest +# The default bundles that should always be displayed as suggestions when you upload a new bundle +standardBundles: + - bundle: ORIGINAL + - bundle: THUMBNAIL + - bundle: LICENSE + # Whether to enable media viewer for image and/or video Bitstreams (i.e. Bitstreams whose MIME type starts with 'image' or 'video'). # For images, this enables a gallery viewer where you can zoom or page through images. # For videos, this enables embedded video streaming diff --git a/src/config/app-config.interface.ts b/src/config/app-config.interface.ts index 121e80cd74..1355e5cb46 100644 --- a/src/config/app-config.interface.ts +++ b/src/config/app-config.interface.ts @@ -14,6 +14,7 @@ import { AuthConfig } from './auth-config.interfaces'; import { UIServerConfig } from './ui-server-config.interface'; import { MediaViewerConfig } from './media-viewer-config.interface'; import { BrowseByConfig } from './browse-by-config.interface'; +import { StandardBundleConfig } from './standard-bundle-config.interface'; interface AppConfig extends Config { ui: UIServerConfig; @@ -32,6 +33,7 @@ interface AppConfig extends Config { collection: CollectionPageConfig; themes: ThemeConfig[]; mediaViewer: MediaViewerConfig; + standardBundles: StandardBundleConfig[]; } const APP_CONFIG = new InjectionToken('APP_CONFIG'); diff --git a/src/config/default-app-config.ts b/src/config/default-app-config.ts index 263cfa0cdd..886242adf9 100644 --- a/src/config/default-app-config.ts +++ b/src/config/default-app-config.ts @@ -299,6 +299,13 @@ export class DefaultAppConfig implements AppConfig { ] }, ]; + // The default bundles that should always be displayed when you edit or add a bundle even when no bundle has been + // added to the item yet. + standardBundles: [ + { bundle: 'ORIGINAL' }, + { bundle: 'THUMBNAIL' }, + { bundle: 'LICENSE' } + ]; // Whether to enable media viewer for image and/or video Bitstreams (i.e. Bitstreams whose MIME type starts with "image" or "video"). // For images, this enables a gallery viewer where you can zoom or page through images. // For videos, this enables embedded video streaming diff --git a/src/config/standard-bundle-config.interface.ts b/src/config/standard-bundle-config.interface.ts new file mode 100644 index 0000000000..6567454603 --- /dev/null +++ b/src/config/standard-bundle-config.interface.ts @@ -0,0 +1,10 @@ +import { Config } from './config.interface'; + +export interface StandardBundleConfig extends Config { + + /** + * Used by {@link UploadBitstreamComponent}. + */ + bundle: string; + +} diff --git a/src/environments/environment.test.ts b/src/environments/environment.test.ts index 1cbdca762e..23c41a6cf6 100644 --- a/src/environments/environment.test.ts +++ b/src/environments/environment.test.ts @@ -224,6 +224,11 @@ export const environment: BuildConfig = { name: 'base', }, ], + standardBundles: [ + { bundle: 'ORIGINAL' }, + { bundle: 'THUMBNAIL' }, + { bundle: 'LICENSE' } + ], mediaViewer: { image: true, video: true