Commits
Giuseppe Digilio authored 34b73cc4f7d
58 58 | SubmissionSectionUploadFileComponent, |
59 59 | SubmissionSectionUploadFileEditComponent, |
60 60 | SubmissionSectionUploadFileViewComponent, |
61 61 | SubmissionImportExternalComponent, |
62 62 | ThemedSubmissionImportExternalComponent, |
63 63 | SubmissionImportExternalSearchbarComponent, |
64 64 | SubmissionImportExternalPreviewComponent, |
65 65 | SubmissionImportExternalCollectionComponent |
66 66 | ]; |
67 67 | |
68 + | const ENTRY_COMPONENTS = [ |
69 + | SubmissionSectionUploadComponent, |
70 + | SubmissionSectionformComponent, |
71 + | SubmissionSectionLicenseComponent, |
72 + | SubmissionSectionCcLicensesComponent, |
73 + | SubmissionSectionDetectDuplicateComponent |
74 + | ]; |
75 + | |
68 76 | @NgModule({ |
69 77 | imports: [ |
70 78 | CommonModule, |
71 79 | CoreModule.forRoot(), |
72 80 | SharedModule, |
73 81 | StoreModule.forFeature('submission', submissionReducers, storeModuleConfig as StoreConfig<SubmissionState, Action>), |
74 82 | EffectsModule.forFeature(submissionEffects), |
75 83 | JournalEntitiesModule.withEntryComponents(), |
76 84 | ResearchEntitiesModule.withEntryComponents(), |
77 85 | ], |
81 89 | SectionUploadService, |
82 90 | SectionsService, |
83 91 | SubmissionUploadsConfigService |
84 92 | ] |
85 93 | }) |
86 94 | |
87 95 | /** |
88 96 | * This module handles all components that are necessary for the submission process |
89 97 | */ |
90 98 | export class SubmissionModule { |
99 + | /** |
100 + | * NOTE: this method allows to resolve issue with components that using a custom decorator |
101 + | * which are not loaded during CSR otherwise |
102 + | */ |
103 + | static withEntryComponents() { |
104 + | return { |
105 + | ngModule: SubmissionModule, |
106 + | providers: ENTRY_COMPONENTS.map((component) => ({provide: component})) |
107 + | }; |
108 + | } |
91 109 | } |