Skip to content

Commit

Permalink
Make theme-able.
Browse files Browse the repository at this point in the history
  • Loading branch information
mwoodiupui committed Apr 21, 2023
1 parent 4f83eaa commit 6adc9a1
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -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<SubmissionSectionUploadFileComponent> {

/**
* 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<any> {
return import(`../../../../../themes/${themeName}/app/submission/sections/upload/file/section-upload-file.component`);
}

protected importUnthemedComponent(): Promise<any> {
return import(`./section-upload-file.component`);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ <h3 class="text-center"><span class="text-muted">{{'submission.sections.upload.n
</div>

<ng-container *ngFor="let fileEntry of fileList">
<ds-submission-upload-section-file
<ds-themed-submission-upload-section-file
[availableAccessConditionOptions]="availableAccessConditionOptions"
[collectionId]="collectionId"
[collectionPolicyType]="collectionPolicyType"
Expand All @@ -37,7 +37,7 @@ <h3 class="text-center"><span class="text-muted">{{'submission.sections.upload.n
[fileIndex]="fileList.indexOf(fileEntry)"
[fileName]="fileNames[fileList.indexOf(fileEntry)]"
[sectionId]="sectionData.id"
[submissionId]="submissionId"></ds-submission-upload-section-file>
[submissionId]="submissionId"></ds-themed-submission-upload-section-file>
<div class="row">
<div class="col-md-12">
<hr/>
Expand Down
2 changes: 2 additions & 0 deletions src/app/submission/submission.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -104,6 +105,7 @@ const DECLARATIONS = [
PublisherPolicyComponent,
PublicationInformationComponent,
MetadataInformationComponent,
ThemedSubmissionSectionUploadFileComponent,
];

@NgModule({
Expand Down

0 comments on commit 6adc9a1

Please sign in to comment.