Skip to content

Commit 51ed9a5

Browse files
[DSC-1309] enable Mirador download plugin from configuration
1 parent 2afc37d commit 51ed9a5

6 files changed

Lines changed: 20 additions & 1 deletion

File tree

src/app/item-page/mirador-viewer/mirador-viewer.component.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ export class MiradorViewerComponent implements OnInit {
8787
if (this.notMobile) {
8888
viewerPath += '&notMobile=true';
8989
}
90+
if (environment.mirador.enableDownloadPlugin) {
91+
viewerPath += '&enableDownloadPlugin=true';
92+
}
9093

9194
// TODO: Should the query term be trusted here?
9295
return this.sanitizer.bypassSecurityTrustResourceUrl(viewerPath);

src/config/app-config.interface.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import { FollowAuthorityMetadata } from './search-follow-metadata.interface';
3131
import { AdvancedAttachmentRenderingConfig } from './advanced-attachment-rendering.config';
3232
import { AttachmentRenderingConfig } from './attachment-rendering.config';
3333
import { SearchResultConfig } from './search-result-config.interface';
34+
import { MiradorConfig } from './mirador-config.interfaces';
3435

3536
interface AppConfig extends Config {
3637
ui: UIServerConfig;
@@ -68,6 +69,7 @@ interface AppConfig extends Config {
6869
attachmentRendering: AttachmentRenderingConfig;
6970
advancedAttachmentRendering: AdvancedAttachmentRenderingConfig;
7071
searchResult: SearchResultConfig;
72+
mirador: MiradorConfig;
7173
}
7274

7375
/**

src/config/default-app-config.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import {
3434
} from './advanced-attachment-rendering.config';
3535
import { AttachmentRenderingConfig } from './attachment-rendering.config';
3636
import { SearchResultConfig } from './search-result-config.interface';
37+
import { MiradorConfig } from './mirador-config.interfaces';
3738

3839
export class DefaultAppConfig implements AppConfig {
3940
production = false;
@@ -750,4 +751,8 @@ export class DefaultAppConfig implements AppConfig {
750751
additionalMetadataFields: [],
751752
authorMetadata: ['dc.contributor.author', 'dc.creator', 'dc.contributor.*'],
752753
};
754+
755+
mirador: MiradorConfig = {
756+
enableDownloadPlugin: true,
757+
};
753758
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { Config } from './config.interface';
2+
3+
export interface MiradorConfig extends Config {
4+
enableDownloadPlugin: boolean;
5+
}

src/environments/environment.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,4 +568,8 @@ export const environment: BuildConfig = {
568568
],
569569
authorMetadata: ['dc.contributor.author', 'dc.contributor.editor', 'dc.contributor.contributor', 'dc.creator'],
570570
},
571+
572+
mirador: {
573+
enableDownloadPlugin: true,
574+
},
571575
};

src/mirador-viewer/config.default.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ const searchOption = params.get('searchable');
2424
const query = params.get('query');
2525
const multi = params.get('multi');
2626
const notMobile = params.get('notMobile');
27+
const isDownloadPluginEnabled = (params.get('enableDownloadPlugin') === 'true');
2728

28-
let isDownloadPluginEnabled = true;
2929
let windowSettings = {};
3030
let sideBarPanel = 'info';
3131
let defaultView = 'single';

0 commit comments

Comments
 (0)