mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-18 07:23:03 +00:00
[DURACOM-191] fix item submission
This commit is contained in:
@@ -43,9 +43,9 @@
|
||||
[type]="AlertTypeEnum.Error" (close)="sectionRef.removeError(i)"></ds-alert>
|
||||
</div>
|
||||
<div id="sectionContent_{{sectionData.id}}" (click)="sectionRef.setFocus($event)">
|
||||
<ng-container *ngComponentOutlet="getSectionContent(); injector: objectInjector;"></ng-container>
|
||||
<ng-container *ngComponentOutlet="(getSectionContent() | async); injector: objectInjector;"></ng-container>
|
||||
</div>
|
||||
</ng-template>
|
||||
</ngb-panel>
|
||||
</ngb-accordion>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -103,7 +103,7 @@ export class SubmissionSectionContainerComponent implements OnInit {
|
||||
/**
|
||||
* Find the correct component based on the section's type
|
||||
*/
|
||||
getSectionContent(): string {
|
||||
getSectionContent() {
|
||||
return rendersSectionType(this.sectionData.sectionType);
|
||||
}
|
||||
}
|
||||
|
@@ -30,7 +30,7 @@ import { DynamicRowArrayModel } from '../../../shared/form/builder/ds-dynamic-fo
|
||||
/**
|
||||
* The service handling all form section operations
|
||||
*/
|
||||
@Injectable()
|
||||
@Injectable({providedIn: 'root'})
|
||||
export class SectionFormOperationsService {
|
||||
|
||||
/**
|
||||
|
@@ -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];
|
||||
}
|
||||
|
@@ -17,7 +17,7 @@ import { WorkspaceitemSectionUploadFileObject } from '../../../core/submission/m
|
||||
/**
|
||||
* A service that provides methods to handle submission's bitstream state.
|
||||
*/
|
||||
@Injectable()
|
||||
@Injectable({providedIn: 'root'})
|
||||
export class SectionUploadService {
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user