[DURACOM-191] fix item submission

This commit is contained in:
Andrea Barbasso
2024-01-12 15:52:35 +01:00
parent 6313d42937
commit 061ff519d7
8 changed files with 23 additions and 11 deletions

View File

@@ -1,16 +1,25 @@
import { SectionsType } from './sections-type';
import { defer } from 'rxjs';
const submissionSectionsMap = new Map();
const submissionSectionsMap = {
[SectionsType.AccessesCondition]: defer(() => import('./accesses/section-accesses.component').then(m => m.SubmissionSectionAccessesComponent)),
[SectionsType.License]: defer(() => import('./license/section-license.component').then(m => m.SubmissionSectionLicenseComponent)),
[SectionsType.CcLicense]: defer(() => import('./cc-license/submission-section-cc-licenses.component').then(m => m.SubmissionSectionCcLicensesComponent)),
[SectionsType.SherpaPolicies]: defer(() => import('./sherpa-policies/section-sherpa-policies.component').then(m => m.SubmissionSectionSherpaPoliciesComponent)),
[SectionsType.Upload]: defer(() => import('./upload/file/section-upload-file.component').then(m => m.SubmissionSectionUploadFileComponent)),
[SectionsType.SubmissionForm]: defer(() => import('./form/section-form.component').then(m => m.SubmissionSectionFormComponent)),
[SectionsType.Identifiers]: defer(() => import('./identifiers/section-identifiers.component').then(m => m.SubmissionSectionIdentifiersComponent))
};
export function renderSectionFor(sectionType: SectionsType) {
return function decorator(objectElement: any) {
if (!objectElement) {
return;
}
submissionSectionsMap.set(sectionType, objectElement);
// submissionSectionsMap.set(sectionType, objectElement);
};
}
export function rendersSectionType(sectionType: SectionsType) {
return submissionSectionsMap.get(sectionType);
return submissionSectionsMap[sectionType];
}