From 6adc9a1742b24bcf22da14bf73aad53161e97098 Mon Sep 17 00:00:00 2001 From: "Mark H. Wood" Date: Fri, 21 Apr 2023 09:55:18 -0400 Subject: [PATCH] Make theme-able. --- .../themed-section-upload-file.component.ts | 93 +++++++++++++++++++ .../upload/section-upload.component.html | 4 +- src/app/submission/submission.module.ts | 2 + 3 files changed, 97 insertions(+), 2 deletions(-) create mode 100644 src/app/submission/sections/upload/file/themed-section-upload-file.component.ts diff --git a/src/app/submission/sections/upload/file/themed-section-upload-file.component.ts b/src/app/submission/sections/upload/file/themed-section-upload-file.component.ts new file mode 100644 index 0000000000..9e0a265c3c --- /dev/null +++ b/src/app/submission/sections/upload/file/themed-section-upload-file.component.ts @@ -0,0 +1,93 @@ +import { Component, Input } from '@angular/core'; +import { SubmissionFormsModel } from 'src/app/core/config/models/config-submission-forms.model'; +import { ThemedComponent } from 'src/app/shared/theme-support/themed.component'; +import { SubmissionSectionUploadFileComponent } from './section-upload-file.component'; + +@Component({ + selector: 'ds-themed-submission-upload-section-file', + styleUrls: [], + templateUrl: '../../../../shared/theme-support/themed.component.html' +}) +export class ThemedSubmissionSectionUploadFileComponent + extends ThemedComponent { + + /** + * The list of available access condition + * @type {Array} + */ + @Input() availableAccessConditionOptions: any[]; + + /** + * The submission id + * @type {string} + */ + @Input() collectionId: string; + + /** + * Define if collection access conditions policy type : + * POLICY_DEFAULT_NO_LIST : is not possible to define additional access group/s for the single file + * POLICY_DEFAULT_WITH_LIST : is possible to define additional access group/s for the single file + * @type {number} + */ + @Input() collectionPolicyType: number; + + /** + * The configuration for the bitstream's metadata form + * @type {SubmissionFormsModel} + */ + @Input() configMetadataForm: SubmissionFormsModel; + + /** + * The bitstream id + * @type {string} + */ + @Input() fileId: string; + + /** + * The bitstream array key + * @type {string} + */ + @Input() fileIndex: string; + + /** + * The bitstream id + * @type {string} + */ + @Input() fileName: string; + + /** + * The section id + * @type {string} + */ + @Input() sectionId: string; + + /** + * The submission id + * @type {string} + */ + @Input() submissionId: string; + + protected inAndOutputNames: (keyof SubmissionSectionUploadFileComponent & keyof this)[] = [ + 'availableAccessConditionOptions', + 'collectionId', + 'collectionPolicyType', + 'configMetadataForm', + 'fileId', + 'fileIndex', + 'fileName', + 'sectionId', + 'submissionId' + ]; + + protected getComponentName(): string { + return 'SubmissionSectionUploadFileComponent'; + } + + protected importThemedComponent(themeName: string): Promise { + return import(`../../../../../themes/${themeName}/app/submission/sections/upload/file/section-upload-file.component`); + } + + protected importUnthemedComponent(): Promise { + return import(`./section-upload-file.component`); + } +} diff --git a/src/app/submission/sections/upload/section-upload.component.html b/src/app/submission/sections/upload/section-upload.component.html index 8a19f66220..b57b454288 100644 --- a/src/app/submission/sections/upload/section-upload.component.html +++ b/src/app/submission/sections/upload/section-upload.component.html @@ -28,7 +28,7 @@ - + [submissionId]="submissionId">

diff --git a/src/app/submission/submission.module.ts b/src/app/submission/submission.module.ts index 91f782225a..cf0ab2b369 100644 --- a/src/app/submission/submission.module.ts +++ b/src/app/submission/submission.module.ts @@ -49,6 +49,7 @@ import { ResearchEntitiesModule } from '../entity-groups/research-entities/resea import { ThemedSubmissionEditComponent } from './edit/themed-submission-edit.component'; import { ThemedSubmissionSubmitComponent } from './submit/themed-submission-submit.component'; import { ThemedSubmissionImportExternalComponent } from './import-external/themed-submission-import-external.component'; +import { ThemedSubmissionSectionUploadFileComponent } from './sections/upload/file/themed-section-upload-file.component'; import { FormModule } from '../shared/form/form.module'; import { NgbAccordionModule, NgbCollapseModule, NgbModalModule } from '@ng-bootstrap/ng-bootstrap'; import { SubmissionSectionAccessesComponent } from './sections/accesses/section-accesses.component'; @@ -104,6 +105,7 @@ const DECLARATIONS = [ PublisherPolicyComponent, PublicationInformationComponent, MetadataInformationComponent, + ThemedSubmissionSectionUploadFileComponent, ]; @NgModule({