diff --git a/src/app/app.module.ts b/src/app/app.module.ts index d58dfb6d19..a792ca983e 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -36,6 +36,7 @@ import { metadataRepresentations } from './core/provide-metadata-representation' import { renderStartsWith } from './core/provide-render-starts-with'; import { renderBrowseBy } from './core/provide-render-browse-by'; import { renderAuthMethod } from './core/provide-render-auth-method'; +import { NgxMaskModule } from 'ngx-mask'; export function getConfig() { return environment; @@ -119,6 +120,7 @@ const PROVIDERS = [ imports: [ BrowserModule.withServerTransition({appId: 'dspace-angular'}), ...IMPORTS, + NgxMaskModule.forRoot(), ThemedRootComponent ], providers: [ diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-type-bind-relation.service.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-type-bind-relation.service.ts index 5f7e2e3e22..7540354a8b 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-type-bind-relation.service.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-type-bind-relation.service.ts @@ -24,7 +24,7 @@ import { DYNAMIC_FORM_CONTROL_TYPE_RELATION_GROUP } from './ds-dynamic-form-cons * Service to manage type binding for submission input fields * Any form component with the typeBindRelations DynamicFormControlRelation property can be controlled this way */ -@Injectable() +@Injectable({providedIn: 'root'}) export class DsDynamicTypeBindRelationService { constructor(@Optional() @Inject(DYNAMIC_MATCHERS) private dynamicMatchers: DynamicFormControlMatcher[], diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/models/array-group/dynamic-form-array.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/models/array-group/dynamic-form-array.component.ts index 8c85cf143d..b6079f4278 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/array-group/dynamic-form-array.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/array-group/dynamic-form-array.component.ts @@ -30,7 +30,8 @@ import { DsDynamicFormControlContainerComponent } from '../../ds-dynamic-form-co CdkDrag, CdkDragHandle, forwardRef(() => DsDynamicFormControlContainerComponent), - NgTemplateOutlet + NgTemplateOutlet, + DsDynamicFormControlContainerComponent ], standalone: true }) @@ -82,7 +83,7 @@ export class DsDynamicFormArrayComponent extends DynamicFormArrayComponent { update(event: any, index: number) { const $event = Object.assign({}, event, { - context: { index: index - 1} + context: {index: index - 1} }); this.onChange($event); diff --git a/src/app/submission/sections/container/section-container.component.html b/src/app/submission/sections/container/section-container.component.html index e6ae9d1b9c..598ae4ef86 100644 --- a/src/app/submission/sections/container/section-container.component.html +++ b/src/app/submission/sections/container/section-container.component.html @@ -43,9 +43,9 @@ [type]="AlertTypeEnum.Error" (close)="sectionRef.removeError(i)">
- +
- \ No newline at end of file + diff --git a/src/app/submission/sections/container/section-container.component.ts b/src/app/submission/sections/container/section-container.component.ts index a5f71936b4..0900c7478a 100644 --- a/src/app/submission/sections/container/section-container.component.ts +++ b/src/app/submission/sections/container/section-container.component.ts @@ -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); } } diff --git a/src/app/submission/sections/form/section-form-operations.service.ts b/src/app/submission/sections/form/section-form-operations.service.ts index 778063dd31..ace452765d 100644 --- a/src/app/submission/sections/form/section-form-operations.service.ts +++ b/src/app/submission/sections/form/section-form-operations.service.ts @@ -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 { /** diff --git a/src/app/submission/sections/sections-decorator.ts b/src/app/submission/sections/sections-decorator.ts index 7e7840adfd..09ec36cb0b 100644 --- a/src/app/submission/sections/sections-decorator.ts +++ b/src/app/submission/sections/sections-decorator.ts @@ -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]; } diff --git a/src/app/submission/sections/upload/section-upload.service.ts b/src/app/submission/sections/upload/section-upload.service.ts index a851fa9daf..45ff9efaea 100644 --- a/src/app/submission/sections/upload/section-upload.service.ts +++ b/src/app/submission/sections/upload/section-upload.service.ts @@ -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 { /**