From 34b73cc4f7dc9f223f93e92a6bf4ed29cfd3dddb Mon Sep 17 00:00:00 2001 From: Giuseppe Digilio Date: Tue, 14 Dec 2021 11:55:33 +0100 Subject: [PATCH 1/3] [DSC-370] Fix SSR issue with submission after migrate to angular 11 --- src/app/submission/submission.module.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/app/submission/submission.module.ts b/src/app/submission/submission.module.ts index 13cf2016dd..2c04c47290 100644 --- a/src/app/submission/submission.module.ts +++ b/src/app/submission/submission.module.ts @@ -65,6 +65,14 @@ const DECLARATIONS = [ SubmissionImportExternalCollectionComponent ]; +const ENTRY_COMPONENTS = [ + SubmissionSectionUploadComponent, + SubmissionSectionformComponent, + SubmissionSectionLicenseComponent, + SubmissionSectionCcLicensesComponent, + SubmissionSectionDetectDuplicateComponent +]; + @NgModule({ imports: [ CommonModule, @@ -88,4 +96,14 @@ const DECLARATIONS = [ * This module handles all components that are necessary for the submission process */ export class SubmissionModule { + /** + * NOTE: this method allows to resolve issue with components that using a custom decorator + * which are not loaded during CSR otherwise + */ + static withEntryComponents() { + return { + ngModule: SubmissionModule, + providers: ENTRY_COMPONENTS.map((component) => ({provide: component})) + }; + } } From 662f846caad37a32bc91dc67e15a3d151b644635 Mon Sep 17 00:00:00 2001 From: Giuseppe Digilio Date: Tue, 14 Dec 2021 15:37:44 +0100 Subject: [PATCH 2/3] [CST-5033] fix issue with cherry-pick --- src/app/submission/submission.module.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/app/submission/submission.module.ts b/src/app/submission/submission.module.ts index 2c04c47290..fccd41fd14 100644 --- a/src/app/submission/submission.module.ts +++ b/src/app/submission/submission.module.ts @@ -69,8 +69,7 @@ const ENTRY_COMPONENTS = [ SubmissionSectionUploadComponent, SubmissionSectionformComponent, SubmissionSectionLicenseComponent, - SubmissionSectionCcLicensesComponent, - SubmissionSectionDetectDuplicateComponent + SubmissionSectionCcLicensesComponent ]; @NgModule({ From a952438247018e495d356c5161dc7bbb6bf443dc Mon Sep 17 00:00:00 2001 From: Giuseppe Digilio Date: Tue, 14 Dec 2021 15:44:43 +0100 Subject: [PATCH 3/3] [CST-5033] fix comments --- src/app/admin/admin-search-page/admin-search.module.ts | 2 +- src/app/admin/admin-workflow-page/admin-workflow.module.ts | 2 +- src/app/admin/admin.module.ts | 2 +- src/app/browse-by/browse-by.module.ts | 2 +- .../entity-groups/journal-entities/journal-entities.module.ts | 2 +- .../research-entities/research-entities.module.ts | 2 +- src/app/item-page/item-page.module.ts | 4 ++-- src/app/my-dspace-page/my-dspace-search.module.ts | 2 +- src/app/navbar/navbar.module.ts | 2 +- src/app/shared/shared.module.ts | 2 +- src/app/submission/submission.module.ts | 2 +- 11 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/app/admin/admin-search-page/admin-search.module.ts b/src/app/admin/admin-search-page/admin-search.module.ts index 0b3b7df9bb..ecf8d8a2d2 100644 --- a/src/app/admin/admin-search-page/admin-search.module.ts +++ b/src/app/admin/admin-search-page/admin-search.module.ts @@ -36,7 +36,7 @@ const ENTRY_COMPONENTS = [ export class AdminSearchModule { /** * NOTE: this method allows to resolve issue with components that using a custom decorator - * which are not loaded during CSR otherwise + * which are not loaded during SSR otherwise */ static withEntryComponents() { return { diff --git a/src/app/admin/admin-workflow-page/admin-workflow.module.ts b/src/app/admin/admin-workflow-page/admin-workflow.module.ts index 4715ae16f4..02e5e01023 100644 --- a/src/app/admin/admin-workflow-page/admin-workflow.module.ts +++ b/src/app/admin/admin-workflow-page/admin-workflow.module.ts @@ -28,7 +28,7 @@ const ENTRY_COMPONENTS = [ export class AdminWorkflowModuleModule { /** * NOTE: this method allows to resolve issue with components that using a custom decorator - * which are not loaded during CSR otherwise + * which are not loaded during SSR otherwise */ static withEntryComponents() { return { diff --git a/src/app/admin/admin.module.ts b/src/app/admin/admin.module.ts index 25cdd67dcf..6c756dd851 100644 --- a/src/app/admin/admin.module.ts +++ b/src/app/admin/admin.module.ts @@ -34,7 +34,7 @@ const ENTRY_COMPONENTS = [ export class AdminModule { /** * NOTE: this method allows to resolve issue with components that using a custom decorator - * which are not loaded during CSR otherwise + * which are not loaded during SSR otherwise */ static withEntryComponents() { return { diff --git a/src/app/browse-by/browse-by.module.ts b/src/app/browse-by/browse-by.module.ts index 2d3618aae6..cd44e52b81 100644 --- a/src/app/browse-by/browse-by.module.ts +++ b/src/app/browse-by/browse-by.module.ts @@ -31,7 +31,7 @@ const ENTRY_COMPONENTS = [ export class BrowseByModule { /** * NOTE: this method allows to resolve issue with components that using a custom decorator - * which are not loaded during CSR otherwise + * which are not loaded during SSR otherwise */ static withEntryComponents() { return { diff --git a/src/app/entity-groups/journal-entities/journal-entities.module.ts b/src/app/entity-groups/journal-entities/journal-entities.module.ts index e23a729d6a..dc88490eac 100644 --- a/src/app/entity-groups/journal-entities/journal-entities.module.ts +++ b/src/app/entity-groups/journal-entities/journal-entities.module.ts @@ -54,7 +54,7 @@ const ENTRY_COMPONENTS = [ export class JournalEntitiesModule { /** * NOTE: this method allows to resolve issue with components that using a custom decorator - * which are not loaded during CSR otherwise + * which are not loaded during SSR otherwise */ static withEntryComponents() { return { diff --git a/src/app/entity-groups/research-entities/research-entities.module.ts b/src/app/entity-groups/research-entities/research-entities.module.ts index 2e91a6f1e7..c9d6c2d5b6 100644 --- a/src/app/entity-groups/research-entities/research-entities.module.ts +++ b/src/app/entity-groups/research-entities/research-entities.module.ts @@ -74,7 +74,7 @@ const COMPONENTS = [ export class ResearchEntitiesModule { /** * NOTE: this method allows to resolve issue with components that using a custom decorator - * which are not loaded during CSR otherwise + * which are not loaded during SSR otherwise */ static withEntryComponents() { return { diff --git a/src/app/item-page/item-page.module.ts b/src/app/item-page/item-page.module.ts index 2e3e248692..80cb1f61a2 100644 --- a/src/app/item-page/item-page.module.ts +++ b/src/app/item-page/item-page.module.ts @@ -33,7 +33,7 @@ import { NgxGalleryModule } from '@kolkov/ngx-gallery'; import { MiradorViewerComponent } from './mirador-viewer/mirador-viewer.component'; import { VersionPageComponent } from './version-page/version-page/version-page.component'; import { VersionedItemComponent } from './simple/item-types/versioned-item/versioned-item.component'; -import { ThemedFileSectionComponent} from './simple/field-components/file-section/themed-file-section.component'; +import { ThemedFileSectionComponent } from './simple/field-components/file-section/themed-file-section.component'; const ENTRY_COMPONENTS = [ @@ -91,7 +91,7 @@ const DECLARATIONS = [ export class ItemPageModule { /** * NOTE: this method allows to resolve issue with components that using a custom decorator - * which are not loaded during CSR otherwise + * which are not loaded during SSR otherwise */ static withEntryComponents() { return { diff --git a/src/app/my-dspace-page/my-dspace-search.module.ts b/src/app/my-dspace-page/my-dspace-search.module.ts index a97f2207e7..67a4f0818e 100644 --- a/src/app/my-dspace-page/my-dspace-search.module.ts +++ b/src/app/my-dspace-page/my-dspace-search.module.ts @@ -50,7 +50,7 @@ const ENTRY_COMPONENTS = [ export class MyDspaceSearchModule { /** * NOTE: this method allows to resolve issue with components that using a custom decorator - * which are not loaded during CSR otherwise + * which are not loaded during SSR otherwise */ static withEntryComponents() { return { diff --git a/src/app/navbar/navbar.module.ts b/src/app/navbar/navbar.module.ts index 6591cd3453..c84e732fd5 100644 --- a/src/app/navbar/navbar.module.ts +++ b/src/app/navbar/navbar.module.ts @@ -58,7 +58,7 @@ const ENTRY_COMPONENTS = [ export class NavbarModule { /** * NOTE: this method allows to resolve issue with components that using a custom decorator - * which are not loaded during CSR otherwise + * which are not loaded during SSR otherwise */ static withEntryComponents() { return { diff --git a/src/app/shared/shared.module.ts b/src/app/shared/shared.module.ts index abc42cb08a..2b64260f46 100644 --- a/src/app/shared/shared.module.ts +++ b/src/app/shared/shared.module.ts @@ -623,7 +623,7 @@ const DIRECTIVES = [ export class SharedModule { /** * NOTE: this method allows to resolve issue with components that using a custom decorator - * which are not loaded during CSR otherwise + * which are not loaded during SSR otherwise */ static withEntryComponents() { return { diff --git a/src/app/submission/submission.module.ts b/src/app/submission/submission.module.ts index fccd41fd14..e8c96284c0 100644 --- a/src/app/submission/submission.module.ts +++ b/src/app/submission/submission.module.ts @@ -97,7 +97,7 @@ const ENTRY_COMPONENTS = [ export class SubmissionModule { /** * NOTE: this method allows to resolve issue with components that using a custom decorator - * which are not loaded during CSR otherwise + * which are not loaded during SSR otherwise */ static withEntryComponents() { return {