From 91b4d3dcd10cbd8248a41505eac96586707bac2b Mon Sep 17 00:00:00 2001 From: Vincenzo Mecca Date: Fri, 10 Nov 2023 16:13:20 +0100 Subject: [PATCH 01/25] [DURACOM-204][#2622] Makes forgot-password link removable --- .../data/feature-authorization/feature-id.ts | 1 + .../password/log-in-password.component.html | 16 ++++++------ .../password/log-in-password.component.ts | 26 ++++++++++++++++--- 3 files changed, 31 insertions(+), 12 deletions(-) diff --git a/src/app/core/data/feature-authorization/feature-id.ts b/src/app/core/data/feature-authorization/feature-id.ts index 8fef45a953..bd1f65b72d 100644 --- a/src/app/core/data/feature-authorization/feature-id.ts +++ b/src/app/core/data/feature-authorization/feature-id.ts @@ -34,4 +34,5 @@ export enum FeatureID { CanEditItem = 'canEditItem', CanRegisterDOI = 'canRegisterDOI', CanSubscribe = 'canSubscribeDso', + EPersonForgotPassword = 'epersonForgotPassword', } diff --git a/src/app/shared/log-in/methods/password/log-in-password.component.html b/src/app/shared/log-in/methods/password/log-in-password.component.html index 60477d141d..52f28e7190 100644 --- a/src/app/shared/log-in/methods/password/log-in-password.component.html +++ b/src/app/shared/log-in/methods/password/log-in-password.component.html @@ -29,11 +29,11 @@ [disabled]="!form.valid"> {{"login.form.submit" | translate}} -
- - {{ 'login.form.new-user' | translate }} - - - {{ 'login.form.forgot-password' | translate }} - -
+ + + diff --git a/src/app/shared/log-in/methods/password/log-in-password.component.ts b/src/app/shared/log-in/methods/password/log-in-password.component.ts index 6132394019..1f96c4c0d8 100644 --- a/src/app/shared/log-in/methods/password/log-in-password.component.ts +++ b/src/app/shared/log-in/methods/password/log-in-password.component.ts @@ -1,9 +1,9 @@ -import { map } from 'rxjs/operators'; +import { combineLatest, Observable, shareReplay } from 'rxjs'; +import { filter, map } from 'rxjs/operators'; import { Component, Inject, OnInit } from '@angular/core'; import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms'; import { select, Store } from '@ngrx/store'; -import { Observable } from 'rxjs'; import { AuthenticateAction, ResetAuthenticationMessagesAction } from '../../../../core/auth/auth.actions'; import { getAuthenticationError, getAuthenticationInfo, } from '../../../../core/auth/selectors'; @@ -73,6 +73,17 @@ export class LogInPasswordComponent implements OnInit { */ public canRegister$: Observable; + /** + * Whether or not the current user (or anonymous) is authorized to register an account + */ + canForgot$: Observable; + + /** + * Shows the divider only if contains at least one link to show + */ + canShowDivider$: Observable; + + constructor( @Inject('authMethodProvider') public injectedAuthMethodModel: AuthMethod, @Inject('isStandalonePage') public isStandalonePage: boolean, @@ -114,8 +125,15 @@ export class LogInPasswordComponent implements OnInit { return message; }) ); - - this.canRegister$ = this.authorizationService.isAuthorized(FeatureID.EPersonRegistration); + + this.canRegister$ = this.authorizationService.isAuthorized(FeatureID.EPersonRegistration).pipe(shareReplay(1)); + this.canForgot$ = this.authorizationService.isAuthorized(FeatureID.EPersonForgotPassword).pipe(shareReplay(1)); + this.canShowDivider$ = + combineLatest([this.canRegister$, this.canForgot$]) + .pipe( + map(([canRegister, canForgot]) => canRegister || canForgot), + filter(Boolean) + ); } getRegisterRoute() { From 2429c3660b8ae370a8da945a9c3483b185b201e9 Mon Sep 17 00:00:00 2001 From: Vincenzo Mecca Date: Fri, 10 Nov 2023 16:49:06 +0100 Subject: [PATCH 02/25] [DURACOM-204][#2622] Makes forgot-password link removable --- .../log-in/methods/password/log-in-password.component.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/shared/log-in/methods/password/log-in-password.component.ts b/src/app/shared/log-in/methods/password/log-in-password.component.ts index 1f96c4c0d8..008eb11eef 100644 --- a/src/app/shared/log-in/methods/password/log-in-password.component.ts +++ b/src/app/shared/log-in/methods/password/log-in-password.component.ts @@ -64,7 +64,7 @@ export class LogInPasswordComponent implements OnInit { /** * The authentication form. - * @type {FormGroup} + * @type {UntypedFormGroup} */ public form: UntypedFormGroup; @@ -125,7 +125,7 @@ export class LogInPasswordComponent implements OnInit { return message; }) ); - + this.canRegister$ = this.authorizationService.isAuthorized(FeatureID.EPersonRegistration).pipe(shareReplay(1)); this.canForgot$ = this.authorizationService.isAuthorized(FeatureID.EPersonForgotPassword).pipe(shareReplay(1)); this.canShowDivider$ = From e7f5c48d8cf499024b1efbf6b0a19a1bf4dfb0bf Mon Sep 17 00:00:00 2001 From: Vincenzo Mecca Date: Wed, 13 Dec 2023 18:00:06 +0100 Subject: [PATCH 03/25] [CST-12825] Ror integration --- .../org-unit/org-unit.component.html | 8 +++++ .../metadata-values.component.html | 11 +++++-- .../metadata-values.component.ts | 2 ++ src/app/item-page/item-shared.module.ts | 33 ++++++++++++++----- .../generic-item-page-field.component.ts | 2 ++ .../item-page-field.component.html | 1 + .../item-page-field.component.ts | 2 ++ src/assets/i18n/en.json5 | 24 +++++++++++++- src/assets/images/ror-icon.svg | 16 +++++++++ 9 files changed, 87 insertions(+), 12 deletions(-) create mode 100644 src/assets/images/ror-icon.svg diff --git a/src/app/entity-groups/research-entities/item-pages/org-unit/org-unit.component.html b/src/app/entity-groups/research-entities/item-pages/org-unit/org-unit.component.html index c79d19e267..30bf7c4083 100644 --- a/src/app/entity-groups/research-entities/item-pages/org-unit/org-unit.component.html +++ b/src/app/entity-groups/research-entities/item-pages/org-unit/org-unit.component.html @@ -14,6 +14,14 @@ > + + diff --git a/src/app/item-page/field-components/metadata-values/metadata-values.component.html b/src/app/item-page/field-components/metadata-values/metadata-values.component.html index 61088edd16..2f822e11be 100644 --- a/src/app/item-page/field-components/metadata-values/metadata-values.component.html +++ b/src/app/item-page/field-components/metadata-values/metadata-values.component.html @@ -3,8 +3,8 @@ - + @@ -23,6 +23,13 @@ + + + + + {{value}} diff --git a/src/app/item-page/field-components/metadata-values/metadata-values.component.ts b/src/app/item-page/field-components/metadata-values/metadata-values.component.ts index cbbae9006d..2ec31159bc 100644 --- a/src/app/item-page/field-components/metadata-values/metadata-values.component.ts +++ b/src/app/item-page/field-components/metadata-values/metadata-values.component.ts @@ -55,6 +55,8 @@ export class MetadataValuesComponent implements OnChanges { @Input() browseDefinition?: BrowseDefinition; + @Input() img?: string; + ngOnChanges(changes: SimpleChanges): void { this.renderMarkdown = !!this.appConfig.markdown.enabled && this.enableMarkdown; } diff --git a/src/app/item-page/item-shared.module.ts b/src/app/item-page/item-shared.module.ts index 9c2bbba619..7a0ac43629 100644 --- a/src/app/item-page/item-shared.module.ts +++ b/src/app/item-page/item-shared.module.ts @@ -1,17 +1,31 @@ -import { RelatedEntitiesSearchComponent } from './simple/related-entities/related-entities-search/related-entities-search.component'; +import { + RelatedEntitiesSearchComponent +} from './simple/related-entities/related-entities-search/related-entities-search.component'; import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; +import { CommonModule, NgOptimizedImage } from '@angular/common'; import { SearchModule } from '../shared/search/search.module'; import { SharedModule } from '../shared/shared.module'; import { TranslateModule } from '@ngx-translate/core'; import { DYNAMIC_FORM_CONTROL_MAP_FN } from '@ng-dynamic-forms/core'; -import { dsDynamicFormControlMapFn } from '../shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-container.component'; -import { TabbedRelatedEntitiesSearchComponent } from './simple/related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component'; -import { ItemVersionsDeleteModalComponent } from './versions/item-versions-delete-modal/item-versions-delete-modal.component'; -import { ItemVersionsSummaryModalComponent } from './versions/item-versions-summary-modal/item-versions-summary-modal.component'; +import { + dsDynamicFormControlMapFn +} from '../shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-container.component'; +import { + TabbedRelatedEntitiesSearchComponent +} from './simple/related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component'; +import { + ItemVersionsDeleteModalComponent +} from './versions/item-versions-delete-modal/item-versions-delete-modal.component'; +import { + ItemVersionsSummaryModalComponent +} from './versions/item-versions-summary-modal/item-versions-summary-modal.component'; import { MetadataValuesComponent } from './field-components/metadata-values/metadata-values.component'; -import { GenericItemPageFieldComponent } from './simple/field-components/specific-field/generic/generic-item-page-field.component'; -import { MetadataRepresentationListComponent } from './simple/metadata-representation-list/metadata-representation-list.component'; +import { + GenericItemPageFieldComponent +} from './simple/field-components/specific-field/generic/generic-item-page-field.component'; +import { + MetadataRepresentationListComponent +} from './simple/metadata-representation-list/metadata-representation-list.component'; import { RelatedItemsComponent } from './simple/related-items/related-items-component'; import { ThemedMetadataRepresentationListComponent @@ -42,7 +56,8 @@ const COMPONENTS = [ CommonModule, SearchModule, SharedModule, - TranslateModule + TranslateModule, + NgOptimizedImage ], exports: [ ...COMPONENTS diff --git a/src/app/item-page/simple/field-components/specific-field/generic/generic-item-page-field.component.ts b/src/app/item-page/simple/field-components/specific-field/generic/generic-item-page-field.component.ts index 53d2f6aa20..99a68745c1 100644 --- a/src/app/item-page/simple/field-components/specific-field/generic/generic-item-page-field.component.ts +++ b/src/app/item-page/simple/field-components/specific-field/generic/generic-item-page-field.component.ts @@ -45,5 +45,7 @@ export class GenericItemPageFieldComponent extends ItemPageFieldComponent { */ @Input() urlRegex?: string; + @Input() img?: string; + } diff --git a/src/app/item-page/simple/field-components/specific-field/item-page-field.component.html b/src/app/item-page/simple/field-components/specific-field/item-page-field.component.html index 91d40b0ad7..f45d4657a4 100644 --- a/src/app/item-page/simple/field-components/specific-field/item-page-field.component.html +++ b/src/app/item-page/simple/field-components/specific-field/item-page-field.component.html @@ -6,5 +6,6 @@ [enableMarkdown]="enableMarkdown" [urlRegex]="urlRegex" [browseDefinition]="browseDefinition|async" + [img]="img" > diff --git a/src/app/item-page/simple/field-components/specific-field/item-page-field.component.ts b/src/app/item-page/simple/field-components/specific-field/item-page-field.component.ts index fc526dabcc..99e5ae7d36 100644 --- a/src/app/item-page/simple/field-components/specific-field/item-page-field.component.ts +++ b/src/app/item-page/simple/field-components/specific-field/item-page-field.component.ts @@ -51,6 +51,8 @@ export class ItemPageFieldComponent { */ urlRegex?: string; + img?: string; + /** * Return browse definition that matches any field used in this component if it is configured as a browse * link in dspace.cfg (webui.browse.link.) diff --git a/src/assets/i18n/en.json5 b/src/assets/i18n/en.json5 index 643a3ce0d1..325dc9daab 100644 --- a/src/assets/i18n/en.json5 +++ b/src/assets/i18n/en.json5 @@ -3114,6 +3114,8 @@ "orgunit.page.titleprefix": "Organizational Unit: ", + "orgunit.page.ror": "ROR Identifier", + "pagination.options.description": "Pagination options", "pagination.results-per-page": "Results Per Page", @@ -4074,6 +4076,8 @@ "submission.import-external.source.lcname": "Library of Congress Names", + "submission.import-external.source.ror": "Research Organization Registry (ROR)", + "submission.import-external.preview.title": "Item Preview", "submission.import-external.preview.title.Publication": "Publication Preview", @@ -4166,6 +4170,8 @@ "submission.sections.describe.relationship-lookup.external-source.import-modal.head.arxiv": "Importing from arXiv", + "submission.sections.describe.relationship-lookup.external-source.import-modal.head.ror": "Import from ROR", + "submission.sections.describe.relationship-lookup.external-source.import-modal.import": "Import", "submission.sections.describe.relationship-lookup.external-source.import-modal.Journal.title": "Import Remote Journal", @@ -4188,6 +4194,12 @@ "submission.sections.describe.relationship-lookup.external-source.import-modal.select": "Select a local match:", + "submission.sections.describe.relationship-lookup.external-source.import-modal.isOrgUnitOfProject.title": "Import Remote Organization", + + "submission.sections.describe.relationship-lookup.external-source.import-modal.isOrgUnitOfProject.added.local-entity": "Successfully added local organization to the selection", + + "submission.sections.describe.relationship-lookup.external-source.import-modal.isOrgUnitOfProject.added.new-entity": "Successfully imported and added external organization to the selection", + "submission.sections.describe.relationship-lookup.search-tab.deselect-all": "Deselect all", "submission.sections.describe.relationship-lookup.search-tab.deselect-page": "Deselect page", @@ -4244,6 +4256,8 @@ "submission.sections.describe.relationship-lookup.search-tab.tab-title.arxiv": "arXiv ({{ count }})", + "submission.sections.describe.relationship-lookup.search-tab.tab-title.ror": "ROR ({{ count }})", + "submission.sections.describe.relationship-lookup.search-tab.tab-title.isFundingAgencyOfPublication": "Search for Funding Agencies", "submission.sections.describe.relationship-lookup.search-tab.tab-title.isFundingOfPublication": "Search for Funding", @@ -4258,6 +4272,8 @@ "submission.sections.describe.relationship-lookup.search-tab.tab-title.isPublicationOfAuthor": "Publication of the Author", + "submission.sections.describe.relationship-lookup.search-tab.tab-title.isOrgUnitOfProject": "OrgUnit of the Project", + "submission.sections.describe.relationship-lookup.selection-tab.title.openAIREFunding": "Funding OpenAIRE API", "submission.sections.describe.relationship-lookup.selection-tab.title.isProjectOfPublication": "Project", @@ -4304,6 +4320,8 @@ "submission.sections.describe.relationship-lookup.title.isPublicationOfAuthor": "Publication", + "submission.sections.describe.relationship-lookup.title.isOrgUnitOfProject": "OrgUnit", + "submission.sections.describe.relationship-lookup.search-tab.toggle-dropdown": "Toggle dropdown", "submission.sections.describe.relationship-lookup.selection-tab.settings": "Settings", @@ -4366,6 +4384,8 @@ "submission.sections.describe.relationship-lookup.selection-tab.title.wos": "Search Results", + "submission.sections.describe.relationship-lookup.selection-tab.title.ror": "Search Results", + "submission.sections.describe.relationship-lookup.selection-tab.title": "Search Results", "submission.sections.describe.relationship-lookup.name-variant.notification.content": "Would you like to save \"{{ value }}\" as a name variant for this person so you and others can reuse it for future submissions? If you don't you can still use it for this submission.", @@ -4836,6 +4856,8 @@ "supervision.search.results.head": "Workflow and Workspace tasks", + "orgunit.search.results.head": "Organizational Unit Search Results", + "workflow-item.edit.breadcrumbs": "Edit workflowitem", "workflow-item.edit.title": "Edit workflowitem", @@ -5294,6 +5316,6 @@ "access-control-option-end-date-note": "Select the date until which the related access condition is applied", - "vocabulary-treeview.search.form.add": "Add", + "vocabulary-treeview.search.form.add": "Add" } diff --git a/src/assets/images/ror-icon.svg b/src/assets/images/ror-icon.svg new file mode 100644 index 0000000000..24735df519 --- /dev/null +++ b/src/assets/images/ror-icon.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + From 56d33387b5d5345ed38c8a8078d3aa2228e855a6 Mon Sep 17 00:00:00 2001 From: Vincenzo Mecca Date: Fri, 15 Dec 2023 10:05:03 +0100 Subject: [PATCH 04/25] [CST-12825] Fixes ROR metadata display --- .../item-pages/org-unit/org-unit.component.html | 16 ++++++++-------- .../metadata-values.component.html | 3 ++- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/app/entity-groups/research-entities/item-pages/org-unit/org-unit.component.html b/src/app/entity-groups/research-entities/item-pages/org-unit/org-unit.component.html index 30bf7c4083..2fd9031c9b 100644 --- a/src/app/entity-groups/research-entities/item-pages/org-unit/org-unit.component.html +++ b/src/app/entity-groups/research-entities/item-pages/org-unit/org-unit.component.html @@ -14,14 +14,6 @@ > - - @@ -40,6 +32,14 @@
+ + From d979ea5c9f4dc8ae8d0020398ea8262c4785ffbb Mon Sep 17 00:00:00 2001 From: Vincenzo Mecca Date: Wed, 20 Dec 2023 11:47:33 +0100 Subject: [PATCH 05/25] [CST-12825] Removed unecessary escape --- .../item-pages/org-unit/org-unit.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/entity-groups/research-entities/item-pages/org-unit/org-unit.component.html b/src/app/entity-groups/research-entities/item-pages/org-unit/org-unit.component.html index 2fd9031c9b..92a13e9672 100644 --- a/src/app/entity-groups/research-entities/item-pages/org-unit/org-unit.component.html +++ b/src/app/entity-groups/research-entities/item-pages/org-unit/org-unit.component.html @@ -37,7 +37,7 @@ [img]="'./assets/images/ror-icon.svg'" [item]="object" [label]="'orgunit.page.ror'" - [urlRegex]="'(.*)ror\.org'" + [urlRegex]="'(.*)ror.org'" > Date: Wed, 20 Dec 2023 11:56:25 +0100 Subject: [PATCH 06/25] [CST-12825] Fixes comma in en.json5 --- src/assets/i18n/en.json5 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/assets/i18n/en.json5 b/src/assets/i18n/en.json5 index 325dc9daab..a3a6942909 100644 --- a/src/assets/i18n/en.json5 +++ b/src/assets/i18n/en.json5 @@ -5316,6 +5316,6 @@ "access-control-option-end-date-note": "Select the date until which the related access condition is applied", - "vocabulary-treeview.search.form.add": "Add" + "vocabulary-treeview.search.form.add": "Add", } From 048361281982dcbe1617275b6e987a8fc083ace1 Mon Sep 17 00:00:00 2001 From: Alexandre Vryghem Date: Sun, 19 Nov 2023 03:22:37 +0100 Subject: [PATCH 07/25] 108588: Moved CommunityPageSubCommunityListComponent & CommunityPageSubCollectionListComponent to a custom sections folder --- .../community-page/community-page.module.ts | 8 ++-- ...ty-page-sub-collection-list.component.html | 0 ...ty-page-sub-collection-list.component.scss | 0 ...page-sub-collection-list.component.spec.ts | 42 +++++++++---------- ...nity-page-sub-collection-list.component.ts | 22 +++++----- ...nity-page-sub-collection-list.component.ts | 8 ++-- ...ity-page-sub-community-list.component.html | 0 ...ity-page-sub-community-list.component.scss | 0 ...-page-sub-community-list.component.spec.ts | 42 +++++++++---------- ...unity-page-sub-community-list.component.ts | 18 ++++---- ...unity-page-sub-community-list.component.ts | 8 ++-- ...ty-page-sub-collection-list.component.html | 0 ...ty-page-sub-collection-list.component.scss | 0 ...nity-page-sub-collection-list.component.ts | 12 ++++++ ...ity-page-sub-community-list.component.html | 0 ...ity-page-sub-community-list.component.scss | 0 ...unity-page-sub-community-list.component.ts | 12 ++++++ ...nity-page-sub-collection-list.component.ts | 12 ------ ...unity-page-sub-community-list.component.ts | 12 ------ src/themes/custom/lazy-theme.module.ts | 7 +--- 20 files changed, 99 insertions(+), 104 deletions(-) rename src/app/community-page/{ => sections/sub-com-col-section}/sub-collection-list/community-page-sub-collection-list.component.html (100%) rename src/app/community-page/{ => sections/sub-com-col-section}/sub-collection-list/community-page-sub-collection-list.component.scss (100%) rename src/app/community-page/{ => sections/sub-com-col-section}/sub-collection-list/community-page-sub-collection-list.component.spec.ts (76%) rename src/app/community-page/{ => sections/sub-com-col-section}/sub-collection-list/community-page-sub-collection-list.component.ts (78%) rename src/app/community-page/{ => sections/sub-com-col-section}/sub-collection-list/themed-community-page-sub-collection-list.component.ts (68%) rename src/app/community-page/{ => sections/sub-com-col-section}/sub-community-list/community-page-sub-community-list.component.html (100%) rename src/app/community-page/{ => sections/sub-com-col-section}/sub-community-list/community-page-sub-community-list.component.scss (100%) rename src/app/community-page/{ => sections/sub-com-col-section}/sub-community-list/community-page-sub-community-list.component.spec.ts (76%) rename src/app/community-page/{ => sections/sub-com-col-section}/sub-community-list/community-page-sub-community-list.component.ts (80%) rename src/app/community-page/{ => sections/sub-com-col-section}/sub-community-list/themed-community-page-sub-community-list.component.ts (68%) rename src/themes/custom/app/community-page/{ => sections/sub-com-col-section}/sub-collection-list/community-page-sub-collection-list.component.html (100%) rename src/themes/custom/app/community-page/{ => sections/sub-com-col-section}/sub-collection-list/community-page-sub-collection-list.component.scss (100%) create mode 100644 src/themes/custom/app/community-page/sections/sub-com-col-section/sub-collection-list/community-page-sub-collection-list.component.ts rename src/themes/custom/app/community-page/{ => sections/sub-com-col-section}/sub-community-list/community-page-sub-community-list.component.html (100%) rename src/themes/custom/app/community-page/{ => sections/sub-com-col-section}/sub-community-list/community-page-sub-community-list.component.scss (100%) create mode 100644 src/themes/custom/app/community-page/sections/sub-com-col-section/sub-community-list/community-page-sub-community-list.component.ts delete mode 100644 src/themes/custom/app/community-page/sub-collection-list/community-page-sub-collection-list.component.ts delete mode 100644 src/themes/custom/app/community-page/sub-community-list/community-page-sub-community-list.component.ts diff --git a/src/app/community-page/community-page.module.ts b/src/app/community-page/community-page.module.ts index 45ffb2a786..499e9092e3 100644 --- a/src/app/community-page/community-page.module.ts +++ b/src/app/community-page/community-page.module.ts @@ -4,9 +4,9 @@ import { CommonModule } from '@angular/common'; import { SharedModule } from '../shared/shared.module'; import { CommunityPageComponent } from './community-page.component'; -import { CommunityPageSubCollectionListComponent } from './sub-collection-list/community-page-sub-collection-list.component'; +import { CommunityPageSubCollectionListComponent } from './sections/sub-com-col-section/sub-collection-list/community-page-sub-collection-list.component'; import { CommunityPageRoutingModule } from './community-page-routing.module'; -import { CommunityPageSubCommunityListComponent } from './sub-community-list/community-page-sub-community-list.component'; +import { CommunityPageSubCommunityListComponent } from './sections/sub-com-col-section/sub-community-list/community-page-sub-community-list.component'; import { CreateCommunityPageComponent } from './create-community-page/create-community-page.component'; import { DeleteCommunityPageComponent } from './delete-community-page/delete-community-page.component'; import { StatisticsModule } from '../statistics/statistics.module'; @@ -15,10 +15,10 @@ import { ThemedCommunityPageComponent } from './themed-community-page.component' import { ComcolModule } from '../shared/comcol/comcol.module'; import { ThemedCommunityPageSubCommunityListComponent -} from './sub-community-list/themed-community-page-sub-community-list.component'; +} from './sections/sub-com-col-section/sub-community-list/themed-community-page-sub-community-list.component'; import { ThemedCollectionPageSubCollectionListComponent -} from './sub-collection-list/themed-community-page-sub-collection-list.component'; +} from './sections/sub-com-col-section/sub-collection-list/themed-community-page-sub-collection-list.component'; import { DsoPageModule } from '../shared/dso-page/dso-page.module'; const DECLARATIONS = [CommunityPageComponent, diff --git a/src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.html b/src/app/community-page/sections/sub-com-col-section/sub-collection-list/community-page-sub-collection-list.component.html similarity index 100% rename from src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.html rename to src/app/community-page/sections/sub-com-col-section/sub-collection-list/community-page-sub-collection-list.component.html diff --git a/src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.scss b/src/app/community-page/sections/sub-com-col-section/sub-collection-list/community-page-sub-collection-list.component.scss similarity index 100% rename from src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.scss rename to src/app/community-page/sections/sub-com-col-section/sub-collection-list/community-page-sub-collection-list.component.scss diff --git a/src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.spec.ts b/src/app/community-page/sections/sub-com-col-section/sub-collection-list/community-page-sub-collection-list.component.spec.ts similarity index 76% rename from src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.spec.ts rename to src/app/community-page/sections/sub-com-col-section/sub-collection-list/community-page-sub-collection-list.component.spec.ts index bca3c42a95..8c4af30991 100644 --- a/src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.spec.ts +++ b/src/app/community-page/sections/sub-com-col-section/sub-collection-list/community-page-sub-collection-list.component.spec.ts @@ -8,27 +8,27 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { CommunityPageSubCollectionListComponent } from './community-page-sub-collection-list.component'; -import { Community } from '../../core/shared/community.model'; -import { SharedModule } from '../../shared/shared.module'; -import { CollectionDataService } from '../../core/data/collection-data.service'; -import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils'; -import { buildPaginatedList } from '../../core/data/paginated-list.model'; -import { PageInfo } from '../../core/shared/page-info.model'; -import { HostWindowService } from '../../shared/host-window.service'; -import { HostWindowServiceStub } from '../../shared/testing/host-window-service.stub'; -import { SelectableListService } from '../../shared/object-list/selectable-list/selectable-list.service'; -import { PaginationService } from '../../core/pagination/pagination.service'; -import { getMockThemeService } from '../../shared/mocks/theme-service.mock'; -import { ThemeService } from '../../shared/theme-support/theme.service'; -import { PaginationServiceStub } from '../../shared/testing/pagination-service.stub'; -import { FindListOptions } from '../../core/data/find-list-options.model'; -import { GroupDataService } from '../../core/eperson/group-data.service'; -import { LinkHeadService } from '../../core/services/link-head.service'; -import { ConfigurationDataService } from '../../core/data/configuration-data.service'; -import { SearchConfigurationService } from '../../core/shared/search/search-configuration.service'; -import { ConfigurationProperty } from '../../core/shared/configuration-property.model'; -import { createPaginatedList } from '../../shared/testing/utils.test'; -import { SearchConfigurationServiceStub } from '../../shared/testing/search-configuration-service.stub'; +import { Community } from '../../../../core/shared/community.model'; +import { SharedModule } from '../../../../shared/shared.module'; +import { CollectionDataService } from '../../../../core/data/collection-data.service'; +import { createSuccessfulRemoteDataObject$ } from '../../../../shared/remote-data.utils'; +import { buildPaginatedList } from '../../../../core/data/paginated-list.model'; +import { PageInfo } from '../../../../core/shared/page-info.model'; +import { HostWindowService } from '../../../../shared/host-window.service'; +import { HostWindowServiceStub } from '../../../../shared/testing/host-window-service.stub'; +import { SelectableListService } from '../../../../shared/object-list/selectable-list/selectable-list.service'; +import { PaginationService } from '../../../../core/pagination/pagination.service'; +import { getMockThemeService } from '../../../../shared/mocks/theme-service.mock'; +import { ThemeService } from '../../../../shared/theme-support/theme.service'; +import { PaginationServiceStub } from '../../../../shared/testing/pagination-service.stub'; +import { FindListOptions } from '../../../../core/data/find-list-options.model'; +import { GroupDataService } from '../../../../core/eperson/group-data.service'; +import { LinkHeadService } from '../../../../core/services/link-head.service'; +import { ConfigurationDataService } from '../../../../core/data/configuration-data.service'; +import { SearchConfigurationService } from '../../../../core/shared/search/search-configuration.service'; +import { ConfigurationProperty } from '../../../../core/shared/configuration-property.model'; +import { createPaginatedList } from '../../../../shared/testing/utils.test'; +import { SearchConfigurationServiceStub } from '../../../../shared/testing/search-configuration-service.stub'; describe('CommunityPageSubCollectionList Component', () => { let comp: CommunityPageSubCollectionListComponent; diff --git a/src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.ts b/src/app/community-page/sections/sub-com-col-section/sub-collection-list/community-page-sub-collection-list.component.ts similarity index 78% rename from src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.ts rename to src/app/community-page/sections/sub-com-col-section/sub-collection-list/community-page-sub-collection-list.component.ts index 3a77149e5b..bd506882ee 100644 --- a/src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.ts +++ b/src/app/community-page/sections/sub-com-col-section/sub-collection-list/community-page-sub-collection-list.component.ts @@ -1,19 +1,17 @@ import { Component, Input, OnDestroy, OnInit } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; - import { BehaviorSubject, combineLatest as observableCombineLatest } from 'rxjs'; - -import { RemoteData } from '../../core/data/remote-data'; -import { Collection } from '../../core/shared/collection.model'; -import { Community } from '../../core/shared/community.model'; -import { fadeIn } from '../../shared/animations/fade'; -import { PaginatedList } from '../../core/data/paginated-list.model'; -import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model'; -import { SortDirection, SortOptions } from '../../core/cache/models/sort-options.model'; -import { CollectionDataService } from '../../core/data/collection-data.service'; -import { PaginationService } from '../../core/pagination/pagination.service'; +import { RemoteData } from '../../../../core/data/remote-data'; +import { Collection } from '../../../../core/shared/collection.model'; +import { Community } from '../../../../core/shared/community.model'; +import { fadeIn } from '../../../../shared/animations/fade'; +import { PaginatedList } from '../../../../core/data/paginated-list.model'; +import { PaginationComponentOptions } from '../../../../shared/pagination/pagination-component-options.model'; +import { SortDirection, SortOptions } from '../../../../core/cache/models/sort-options.model'; +import { CollectionDataService } from '../../../../core/data/collection-data.service'; +import { PaginationService } from '../../../../core/pagination/pagination.service'; import { switchMap } from 'rxjs/operators'; -import { hasValue } from '../../shared/empty.util'; +import { hasValue } from '../../../../shared/empty.util'; @Component({ selector: 'ds-community-page-sub-collection-list', diff --git a/src/app/community-page/sub-collection-list/themed-community-page-sub-collection-list.component.ts b/src/app/community-page/sections/sub-com-col-section/sub-collection-list/themed-community-page-sub-collection-list.component.ts similarity index 68% rename from src/app/community-page/sub-collection-list/themed-community-page-sub-collection-list.component.ts rename to src/app/community-page/sections/sub-com-col-section/sub-collection-list/themed-community-page-sub-collection-list.component.ts index f1f49f204c..ebbec33e8e 100644 --- a/src/app/community-page/sub-collection-list/themed-community-page-sub-collection-list.component.ts +++ b/src/app/community-page/sections/sub-com-col-section/sub-collection-list/themed-community-page-sub-collection-list.component.ts @@ -1,12 +1,12 @@ -import { ThemedComponent } from '../../shared/theme-support/themed.component'; +import { ThemedComponent } from '../../../../shared/theme-support/themed.component'; import { CommunityPageSubCollectionListComponent } from './community-page-sub-collection-list.component'; import { Component, Input } from '@angular/core'; -import { Community } from '../../core/shared/community.model'; +import { Community } from '../../../../core/shared/community.model'; @Component({ selector: 'ds-themed-community-page-sub-collection-list', styleUrls: [], - templateUrl: '../../shared/theme-support/themed.component.html', + templateUrl: '../../../../shared/theme-support/themed.component.html', }) export class ThemedCollectionPageSubCollectionListComponent extends ThemedComponent { @Input() community: Community; @@ -18,7 +18,7 @@ export class ThemedCollectionPageSubCollectionListComponent extends ThemedCompon } protected importThemedComponent(themeName: string): Promise { - return import(`../../../themes/${themeName}/app/community-page/sub-collection-list/community-page-sub-collection-list.component`); + return import(`../../../../../themes/${themeName}/app/community-page/sections/sub-com-col-section/sub-collection-list/community-page-sub-collection-list.component`); } protected importUnthemedComponent(): Promise { diff --git a/src/app/community-page/sub-community-list/community-page-sub-community-list.component.html b/src/app/community-page/sections/sub-com-col-section/sub-community-list/community-page-sub-community-list.component.html similarity index 100% rename from src/app/community-page/sub-community-list/community-page-sub-community-list.component.html rename to src/app/community-page/sections/sub-com-col-section/sub-community-list/community-page-sub-community-list.component.html diff --git a/src/app/community-page/sub-community-list/community-page-sub-community-list.component.scss b/src/app/community-page/sections/sub-com-col-section/sub-community-list/community-page-sub-community-list.component.scss similarity index 100% rename from src/app/community-page/sub-community-list/community-page-sub-community-list.component.scss rename to src/app/community-page/sections/sub-com-col-section/sub-community-list/community-page-sub-community-list.component.scss diff --git a/src/app/community-page/sub-community-list/community-page-sub-community-list.component.spec.ts b/src/app/community-page/sections/sub-com-col-section/sub-community-list/community-page-sub-community-list.component.spec.ts similarity index 76% rename from src/app/community-page/sub-community-list/community-page-sub-community-list.component.spec.ts rename to src/app/community-page/sections/sub-com-col-section/sub-community-list/community-page-sub-community-list.component.spec.ts index 0a14fe6dd1..c5efc9c2c1 100644 --- a/src/app/community-page/sub-community-list/community-page-sub-community-list.component.spec.ts +++ b/src/app/community-page/sections/sub-com-col-section/sub-community-list/community-page-sub-community-list.component.spec.ts @@ -8,27 +8,27 @@ import { By } from '@angular/platform-browser'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { CommunityPageSubCommunityListComponent } from './community-page-sub-community-list.component'; -import { Community } from '../../core/shared/community.model'; -import { buildPaginatedList } from '../../core/data/paginated-list.model'; -import { PageInfo } from '../../core/shared/page-info.model'; -import { SharedModule } from '../../shared/shared.module'; -import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils'; -import { HostWindowService } from '../../shared/host-window.service'; -import { HostWindowServiceStub } from '../../shared/testing/host-window-service.stub'; -import { CommunityDataService } from '../../core/data/community-data.service'; -import { SelectableListService } from '../../shared/object-list/selectable-list/selectable-list.service'; -import { PaginationService } from '../../core/pagination/pagination.service'; -import { getMockThemeService } from '../../shared/mocks/theme-service.mock'; -import { ThemeService } from '../../shared/theme-support/theme.service'; -import { PaginationServiceStub } from '../../shared/testing/pagination-service.stub'; -import { FindListOptions } from '../../core/data/find-list-options.model'; -import { GroupDataService } from '../../core/eperson/group-data.service'; -import { LinkHeadService } from '../../core/services/link-head.service'; -import { ConfigurationDataService } from '../../core/data/configuration-data.service'; -import { SearchConfigurationService } from '../../core/shared/search/search-configuration.service'; -import { SearchConfigurationServiceStub } from '../../shared/testing/search-configuration-service.stub'; -import { ConfigurationProperty } from '../../core/shared/configuration-property.model'; -import { createPaginatedList } from '../../shared/testing/utils.test'; +import { Community } from '../../../../core/shared/community.model'; +import { buildPaginatedList } from '../../../../core/data/paginated-list.model'; +import { PageInfo } from '../../../../core/shared/page-info.model'; +import { SharedModule } from '../../../../shared/shared.module'; +import { createSuccessfulRemoteDataObject$ } from '../../../../shared/remote-data.utils'; +import { HostWindowService } from '../../../../shared/host-window.service'; +import { HostWindowServiceStub } from '../../../../shared/testing/host-window-service.stub'; +import { CommunityDataService } from '../../../../core/data/community-data.service'; +import { SelectableListService } from '../../../../shared/object-list/selectable-list/selectable-list.service'; +import { PaginationService } from '../../../../core/pagination/pagination.service'; +import { getMockThemeService } from '../../../../shared/mocks/theme-service.mock'; +import { ThemeService } from '../../../../shared/theme-support/theme.service'; +import { PaginationServiceStub } from '../../../../shared/testing/pagination-service.stub'; +import { FindListOptions } from '../../../../core/data/find-list-options.model'; +import { GroupDataService } from '../../../../core/eperson/group-data.service'; +import { LinkHeadService } from '../../../../core/services/link-head.service'; +import { ConfigurationDataService } from '../../../../core/data/configuration-data.service'; +import { SearchConfigurationService } from '../../../../core/shared/search/search-configuration.service'; +import { SearchConfigurationServiceStub } from '../../../../shared/testing/search-configuration-service.stub'; +import { ConfigurationProperty } from '../../../../core/shared/configuration-property.model'; +import { createPaginatedList } from '../../../../shared/testing/utils.test'; describe('CommunityPageSubCommunityListComponent Component', () => { let comp: CommunityPageSubCommunityListComponent; diff --git a/src/app/community-page/sub-community-list/community-page-sub-community-list.component.ts b/src/app/community-page/sections/sub-com-col-section/sub-community-list/community-page-sub-community-list.component.ts similarity index 80% rename from src/app/community-page/sub-community-list/community-page-sub-community-list.component.ts rename to src/app/community-page/sections/sub-com-col-section/sub-community-list/community-page-sub-community-list.component.ts index 5a0409a051..61633e5128 100644 --- a/src/app/community-page/sub-community-list/community-page-sub-community-list.component.ts +++ b/src/app/community-page/sections/sub-com-col-section/sub-community-list/community-page-sub-community-list.component.ts @@ -3,16 +3,16 @@ import { ActivatedRoute } from '@angular/router'; import { BehaviorSubject, combineLatest as observableCombineLatest } from 'rxjs'; -import { RemoteData } from '../../core/data/remote-data'; -import { Community } from '../../core/shared/community.model'; -import { fadeIn } from '../../shared/animations/fade'; -import { PaginatedList } from '../../core/data/paginated-list.model'; -import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model'; -import { SortDirection, SortOptions } from '../../core/cache/models/sort-options.model'; -import { CommunityDataService } from '../../core/data/community-data.service'; +import { RemoteData } from '../../../../core/data/remote-data'; +import { Community } from '../../../../core/shared/community.model'; +import { fadeIn } from '../../../../shared/animations/fade'; +import { PaginatedList } from '../../../../core/data/paginated-list.model'; +import { PaginationComponentOptions } from '../../../../shared/pagination/pagination-component-options.model'; +import { SortDirection, SortOptions } from '../../../../core/cache/models/sort-options.model'; +import { CommunityDataService } from '../../../../core/data/community-data.service'; import { switchMap } from 'rxjs/operators'; -import { PaginationService } from '../../core/pagination/pagination.service'; -import { hasValue } from '../../shared/empty.util'; +import { PaginationService } from '../../../../core/pagination/pagination.service'; +import { hasValue } from '../../../../shared/empty.util'; @Component({ selector: 'ds-community-page-sub-community-list', diff --git a/src/app/community-page/sub-community-list/themed-community-page-sub-community-list.component.ts b/src/app/community-page/sections/sub-com-col-section/sub-community-list/themed-community-page-sub-community-list.component.ts similarity index 68% rename from src/app/community-page/sub-community-list/themed-community-page-sub-community-list.component.ts rename to src/app/community-page/sections/sub-com-col-section/sub-community-list/themed-community-page-sub-community-list.component.ts index 852c53186e..9c500cac10 100644 --- a/src/app/community-page/sub-community-list/themed-community-page-sub-community-list.component.ts +++ b/src/app/community-page/sections/sub-com-col-section/sub-community-list/themed-community-page-sub-community-list.component.ts @@ -1,12 +1,12 @@ -import { ThemedComponent } from '../../shared/theme-support/themed.component'; +import { ThemedComponent } from '../../../../shared/theme-support/themed.component'; import { CommunityPageSubCommunityListComponent } from './community-page-sub-community-list.component'; import { Component, Input } from '@angular/core'; -import { Community } from '../../core/shared/community.model'; +import { Community } from '../../../../core/shared/community.model'; @Component({ selector: 'ds-themed-community-page-sub-community-list', styleUrls: [], - templateUrl: '../../shared/theme-support/themed.component.html', + templateUrl: '../../../../shared/theme-support/themed.component.html', }) export class ThemedCommunityPageSubCommunityListComponent extends ThemedComponent { @@ -19,7 +19,7 @@ export class ThemedCommunityPageSubCommunityListComponent extends ThemedComponen } protected importThemedComponent(themeName: string): Promise { - return import(`../../../themes/${themeName}/app/community-page/sub-community-list/community-page-sub-community-list.component`); + return import(`../../../../../themes/${themeName}/app/community-page/sections/sub-com-col-section/sub-community-list/community-page-sub-community-list.component`); } protected importUnthemedComponent(): Promise { diff --git a/src/themes/custom/app/community-page/sub-collection-list/community-page-sub-collection-list.component.html b/src/themes/custom/app/community-page/sections/sub-com-col-section/sub-collection-list/community-page-sub-collection-list.component.html similarity index 100% rename from src/themes/custom/app/community-page/sub-collection-list/community-page-sub-collection-list.component.html rename to src/themes/custom/app/community-page/sections/sub-com-col-section/sub-collection-list/community-page-sub-collection-list.component.html diff --git a/src/themes/custom/app/community-page/sub-collection-list/community-page-sub-collection-list.component.scss b/src/themes/custom/app/community-page/sections/sub-com-col-section/sub-collection-list/community-page-sub-collection-list.component.scss similarity index 100% rename from src/themes/custom/app/community-page/sub-collection-list/community-page-sub-collection-list.component.scss rename to src/themes/custom/app/community-page/sections/sub-com-col-section/sub-collection-list/community-page-sub-collection-list.component.scss diff --git a/src/themes/custom/app/community-page/sections/sub-com-col-section/sub-collection-list/community-page-sub-collection-list.component.ts b/src/themes/custom/app/community-page/sections/sub-com-col-section/sub-collection-list/community-page-sub-collection-list.component.ts new file mode 100644 index 0000000000..a3f51bf916 --- /dev/null +++ b/src/themes/custom/app/community-page/sections/sub-com-col-section/sub-collection-list/community-page-sub-collection-list.component.ts @@ -0,0 +1,12 @@ +import { Component } from '@angular/core'; +import { CommunityPageSubCollectionListComponent as BaseComponent } from '../../../../../../../app/community-page/sections/sub-com-col-section/sub-collection-list/community-page-sub-collection-list.component'; + +@Component({ + selector: 'ds-community-page-sub-collection-list', + // styleUrls: ['./community-page-sub-collection-list.component.scss'], + styleUrls: ['../../../../../app/community-page/sections/sub-com-col-section/sub-collection-list/community-page-sub-collection-list.component.scss'], + // templateUrl: './community-page-sub-collection-list.component.html', + templateUrl: '../../../../../app/community-page/sections/sub-com-col-section/sub-collection-list/community-page-sub-collection-list.component.html', +}) +export class CommunityPageSubCollectionListComponent extends BaseComponent { +} diff --git a/src/themes/custom/app/community-page/sub-community-list/community-page-sub-community-list.component.html b/src/themes/custom/app/community-page/sections/sub-com-col-section/sub-community-list/community-page-sub-community-list.component.html similarity index 100% rename from src/themes/custom/app/community-page/sub-community-list/community-page-sub-community-list.component.html rename to src/themes/custom/app/community-page/sections/sub-com-col-section/sub-community-list/community-page-sub-community-list.component.html diff --git a/src/themes/custom/app/community-page/sub-community-list/community-page-sub-community-list.component.scss b/src/themes/custom/app/community-page/sections/sub-com-col-section/sub-community-list/community-page-sub-community-list.component.scss similarity index 100% rename from src/themes/custom/app/community-page/sub-community-list/community-page-sub-community-list.component.scss rename to src/themes/custom/app/community-page/sections/sub-com-col-section/sub-community-list/community-page-sub-community-list.component.scss diff --git a/src/themes/custom/app/community-page/sections/sub-com-col-section/sub-community-list/community-page-sub-community-list.component.ts b/src/themes/custom/app/community-page/sections/sub-com-col-section/sub-community-list/community-page-sub-community-list.component.ts new file mode 100644 index 0000000000..68af7dddd0 --- /dev/null +++ b/src/themes/custom/app/community-page/sections/sub-com-col-section/sub-community-list/community-page-sub-community-list.component.ts @@ -0,0 +1,12 @@ +import { Component } from '@angular/core'; +import { CommunityPageSubCommunityListComponent as BaseComponent } from '../../../../../../../app/community-page/sections/sub-com-col-section/sub-community-list/community-page-sub-community-list.component'; + +@Component({ + selector: 'ds-community-page-sub-community-list', + // styleUrls: ['./community-page-sub-community-list.component.scss'], + styleUrls: ['../../../../../../../app/community-page/sections/sub-com-col-section/sub-community-list/community-page-sub-community-list.component.scss'], + // templateUrl: './community-page-sub-community-list.component.html', + templateUrl: '../../../../../../../app/community-page/sections/sub-com-col-section/sub-community-list/community-page-sub-community-list.component.html', +}) +export class CommunityPageSubCommunityListComponent extends BaseComponent { +} diff --git a/src/themes/custom/app/community-page/sub-collection-list/community-page-sub-collection-list.component.ts b/src/themes/custom/app/community-page/sub-collection-list/community-page-sub-collection-list.component.ts deleted file mode 100644 index a228fe1071..0000000000 --- a/src/themes/custom/app/community-page/sub-collection-list/community-page-sub-collection-list.component.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Component } from '@angular/core'; -import { CommunityPageSubCollectionListComponent as BaseComponent } - from '../../../../../app/community-page/sub-collection-list/community-page-sub-collection-list.component'; - -@Component({ - selector: 'ds-community-page-sub-collection-list', - // styleUrls: ['./community-page-sub-collection-list.component.scss'], - styleUrls: ['../../../../../app/community-page/sub-collection-list/community-page-sub-collection-list.component.scss'], - // templateUrl: './community-page-sub-collection-list.component.html', - templateUrl: '../../../../../app/community-page/sub-collection-list/community-page-sub-collection-list.component.html' -}) -export class CommunityPageSubCollectionListComponent extends BaseComponent {} diff --git a/src/themes/custom/app/community-page/sub-community-list/community-page-sub-community-list.component.ts b/src/themes/custom/app/community-page/sub-community-list/community-page-sub-community-list.component.ts deleted file mode 100644 index 1db265a844..0000000000 --- a/src/themes/custom/app/community-page/sub-community-list/community-page-sub-community-list.component.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Component } from '@angular/core'; -import { CommunityPageSubCommunityListComponent as BaseComponent } - from '../../../../../app/community-page/sub-community-list/community-page-sub-community-list.component'; - -@Component({ - selector: 'ds-community-page-sub-community-list', - // styleUrls: ['./community-page-sub-community-list.component.scss'], - styleUrls: ['../../../../../app/community-page/sub-community-list/community-page-sub-community-list.component.scss'], - // templateUrl: './community-page-sub-community-list.component.html', - templateUrl: '../../../../../app/community-page/sub-community-list/community-page-sub-community-list.component.html' -}) -export class CommunityPageSubCommunityListComponent extends BaseComponent {} diff --git a/src/themes/custom/lazy-theme.module.ts b/src/themes/custom/lazy-theme.module.ts index e102089361..3bef57cb18 100644 --- a/src/themes/custom/lazy-theme.module.ts +++ b/src/themes/custom/lazy-theme.module.ts @@ -93,8 +93,8 @@ import { SearchResultsComponent } from './app/shared/search/search-results/searc import { AdminSidebarComponent } from './app/admin/admin-sidebar/admin-sidebar.component'; import { ComcolPageBrowseByComponent } from './app/shared/comcol-page-browse-by/comcol-page-browse-by.component'; import { SearchSettingsComponent } from './app/shared/search/search-settings/search-settings.component'; -import { CommunityPageSubCommunityListComponent } from './app/community-page/sub-community-list/community-page-sub-community-list.component'; -import { CommunityPageSubCollectionListComponent } from './app/community-page/sub-collection-list/community-page-sub-collection-list.component'; +import { CommunityPageSubCommunityListComponent } from './app/community-page/sections/sub-com-col-section/sub-community-list/community-page-sub-community-list.component'; +import { CommunityPageSubCollectionListComponent } from './app/community-page/sections/sub-com-col-section/sub-collection-list/community-page-sub-collection-list.component'; import { ObjectListComponent } from './app/shared/object-list/object-list.component'; import { BrowseByMetadataPageComponent } from './app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component'; @@ -299,9 +299,6 @@ const DECLARATIONS = [ RequestCopyModule, ], declarations: DECLARATIONS, - exports: [ - CommunityPageSubCollectionListComponent - ] }) /** From bb0b66f927a368f8bb35329eab242ad57f6f33b7 Mon Sep 17 00:00:00 2001 From: Alexandre Vryghem Date: Sun, 19 Nov 2023 03:39:25 +0100 Subject: [PATCH 08/25] 108588: Moved sub communities & collections from community page to new component --- .../community-page-routing.module.ts | 9 +++++- .../community-page/community-page.module.ts | 5 ++- .../sub-com-col-section.component.html | 8 +++++ .../sub-com-col-section.component.scss | 0 .../sub-com-col-section.component.spec.ts | 32 +++++++++++++++++++ .../sub-com-col-section.component.ts | 28 ++++++++++++++++ 6 files changed, 80 insertions(+), 2 deletions(-) create mode 100644 src/app/community-page/sections/sub-com-col-section/sub-com-col-section.component.html create mode 100644 src/app/community-page/sections/sub-com-col-section/sub-com-col-section.component.scss create mode 100644 src/app/community-page/sections/sub-com-col-section/sub-com-col-section.component.spec.ts create mode 100644 src/app/community-page/sections/sub-com-col-section/sub-com-col-section.component.ts diff --git a/src/app/community-page/community-page-routing.module.ts b/src/app/community-page/community-page-routing.module.ts index c37f8832f8..a2d727218e 100644 --- a/src/app/community-page/community-page-routing.module.ts +++ b/src/app/community-page/community-page-routing.module.ts @@ -15,6 +15,7 @@ import { LinkMenuItemModel } from '../shared/menu/menu-item/models/link.model'; import { ThemedCommunityPageComponent } from './themed-community-page.component'; import { MenuItemType } from '../shared/menu/menu-item-type.model'; import { DSOEditMenuResolver } from '../shared/dso-page/dso-edit-menu.resolver'; +import { SubComColSectionComponent } from './sections/sub-com-col-section/sub-com-col-section.component'; @NgModule({ imports: [ @@ -46,9 +47,15 @@ import { DSOEditMenuResolver } from '../shared/dso-page/dso-edit-menu.resolver'; canActivate: [AuthenticatedGuard], }, { - path: '', + path: '**', component: ThemedCommunityPageComponent, pathMatch: 'full', + children: [ + { + path: '', + component: SubComColSectionComponent, + }, + ], } ], data: { diff --git a/src/app/community-page/community-page.module.ts b/src/app/community-page/community-page.module.ts index 499e9092e3..61c17de8fa 100644 --- a/src/app/community-page/community-page.module.ts +++ b/src/app/community-page/community-page.module.ts @@ -20,6 +20,7 @@ import { ThemedCollectionPageSubCollectionListComponent } from './sections/sub-com-col-section/sub-collection-list/themed-community-page-sub-collection-list.component'; import { DsoPageModule } from '../shared/dso-page/dso-page.module'; +import { SubComColSectionComponent } from './sections/sub-com-col-section/sub-com-col-section.component'; const DECLARATIONS = [CommunityPageComponent, ThemedCommunityPageComponent, @@ -28,7 +29,9 @@ const DECLARATIONS = [CommunityPageComponent, ThemedCollectionPageSubCollectionListComponent, CommunityPageSubCommunityListComponent, CreateCommunityPageComponent, - DeleteCommunityPageComponent]; + DeleteCommunityPageComponent, + SubComColSectionComponent, +]; @NgModule({ imports: [ diff --git a/src/app/community-page/sections/sub-com-col-section/sub-com-col-section.component.html b/src/app/community-page/sections/sub-com-col-section/sub-com-col-section.component.html new file mode 100644 index 0000000000..515e08ffdf --- /dev/null +++ b/src/app/community-page/sections/sub-com-col-section/sub-com-col-section.component.html @@ -0,0 +1,8 @@ + + + + + + diff --git a/src/app/community-page/sections/sub-com-col-section/sub-com-col-section.component.scss b/src/app/community-page/sections/sub-com-col-section/sub-com-col-section.component.scss new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/app/community-page/sections/sub-com-col-section/sub-com-col-section.component.spec.ts b/src/app/community-page/sections/sub-com-col-section/sub-com-col-section.component.spec.ts new file mode 100644 index 0000000000..804299d3d9 --- /dev/null +++ b/src/app/community-page/sections/sub-com-col-section/sub-com-col-section.component.spec.ts @@ -0,0 +1,32 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { SubComColSectionComponent } from './sub-com-col-section.component'; +import { ActivatedRoute } from '@angular/router'; +import { ActivatedRouteStub } from '../../../shared/testing/active-router.stub'; + +describe('SubComColSectionComponent', () => { + let component: SubComColSectionComponent; + let fixture: ComponentFixture; + + let activatedRoute: ActivatedRouteStub; + + beforeEach(async () => { + activatedRoute = new ActivatedRouteStub(); + + await TestBed.configureTestingModule({ + declarations: [ + SubComColSectionComponent, + ], + providers: [ + { provide: ActivatedRoute, useValue: activatedRoute }, + ], + }).compileComponents(); + + fixture = TestBed.createComponent(SubComColSectionComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/community-page/sections/sub-com-col-section/sub-com-col-section.component.ts b/src/app/community-page/sections/sub-com-col-section/sub-com-col-section.component.ts new file mode 100644 index 0000000000..ff30e51607 --- /dev/null +++ b/src/app/community-page/sections/sub-com-col-section/sub-com-col-section.component.ts @@ -0,0 +1,28 @@ +import { Component, OnInit } from '@angular/core'; +import { Observable } from 'rxjs'; +import { RemoteData } from '../../../core/data/remote-data'; +import { Community } from '../../../core/shared/community.model'; +import { ActivatedRoute, Data } from '@angular/router'; +import { map } from 'rxjs/operators'; + +@Component({ + selector: 'ds-sub-com-col-section', + templateUrl: './sub-com-col-section.component.html', + styleUrls: ['./sub-com-col-section.component.scss'], +}) +export class SubComColSectionComponent implements OnInit { + + community$: Observable; + + constructor( + private route: ActivatedRoute, + ) { + } + + ngOnInit(): void { + this.community$ = this.route.data.pipe( + map((data: Data) => (data.dso as RemoteData).payload), + ); + } + +} From 2c543ad570e7e20d287060e41d9f1e8ac721fea7 Mon Sep 17 00:00:00 2001 From: Alexandre Vryghem Date: Sun, 19 Nov 2023 18:29:27 +0100 Subject: [PATCH 09/25] 108588: Updated CommunityPageRoutingModule to use custom sections --- .../browse-by-metadata-page.component.html | 83 ++++------------ .../community-page-routing.module.ts | 17 +++- .../community-page.component.html | 7 +- .../community-page.component.ts | 8 -- .../community-page/community-page.module.ts | 5 +- .../community-browse-section.component.html | 0 .../comcol-page-browse-by.component.html | 14 ++- .../comcol-page-browse-by.component.ts | 99 ++++++++++++------- 8 files changed, 113 insertions(+), 120 deletions(-) create mode 100644 src/app/community-page/sections/community-browse-section/community-browse-section.component.html diff --git a/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.html b/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.html index 8d062d739f..bac74736cf 100644 --- a/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.html +++ b/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.html @@ -1,67 +1,24 @@
- - -
- -
- - - - - - - - - - - - - - - -
- -
- - -
- -
+
-
- - -
-
- - - - + + +
-
-
-
+
diff --git a/src/app/community-page/community-page-routing.module.ts b/src/app/community-page/community-page-routing.module.ts index a2d727218e..f84fa1c9f7 100644 --- a/src/app/community-page/community-page-routing.module.ts +++ b/src/app/community-page/community-page-routing.module.ts @@ -16,6 +16,9 @@ import { ThemedCommunityPageComponent } from './themed-community-page.component' import { MenuItemType } from '../shared/menu/menu-item-type.model'; import { DSOEditMenuResolver } from '../shared/dso-page/dso-edit-menu.resolver'; import { SubComColSectionComponent } from './sections/sub-com-col-section/sub-com-col-section.component'; +import { BrowseByI18nBreadcrumbResolver } from '../browse-by/browse-by-i18n-breadcrumb.resolver'; +import { BrowseByGuard } from '../browse-by/browse-by-guard'; +import { BrowseBySwitcherComponent } from '../browse-by/browse-by-switcher/browse-by-switcher.component'; @NgModule({ imports: [ @@ -47,14 +50,24 @@ import { SubComColSectionComponent } from './sections/sub-com-col-section/sub-co canActivate: [AuthenticatedGuard], }, { - path: '**', + path: '', component: ThemedCommunityPageComponent, - pathMatch: 'full', children: [ { path: '', + pathMatch: 'full', component: SubComColSectionComponent, }, + { + path: 'browse/:id', + pathMatch: 'full', + component: BrowseBySwitcherComponent, + canActivate: [BrowseByGuard], + resolve: { + breadcrumb: BrowseByI18nBreadcrumbResolver, + }, + data: { breadcrumbKey: 'browse.metadata' }, + }, ], } ], diff --git a/src/app/community-page/community-page.component.html b/src/app/community-page/community-page.component.html index 6d5262d933..fdefccdd51 100644 --- a/src/app/community-page/community-page.component.html +++ b/src/app/community-page/community-page.component.html @@ -17,7 +17,7 @@ + [title]="'community.page.news'"> @@ -31,10 +31,9 @@ - - + -
+
diff --git a/src/app/community-page/community-page.component.ts b/src/app/community-page/community-page.component.ts index a5bbff3cee..206aa54cb0 100644 --- a/src/app/community-page/community-page.component.ts +++ b/src/app/community-page/community-page.component.ts @@ -1,16 +1,10 @@ import { mergeMap, filter, map } from 'rxjs/operators'; import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; - import { Observable } from 'rxjs'; -import { CommunityDataService } from '../core/data/community-data.service'; import { RemoteData } from '../core/data/remote-data'; import { Bitstream } from '../core/shared/bitstream.model'; - import { Community } from '../core/shared/community.model'; - -import { MetadataService } from '../core/metadata/metadata.service'; - import { fadeInOut } from '../shared/animations/fade'; import { hasValue } from '../shared/empty.util'; import { getAllSucceededRemoteDataPayload} from '../core/shared/operators'; @@ -53,8 +47,6 @@ export class CommunityPageComponent implements OnInit { communityPageRoute$: Observable; constructor( - private communityDataService: CommunityDataService, - private metadata: MetadataService, private route: ActivatedRoute, private router: Router, private authService: AuthService, diff --git a/src/app/community-page/community-page.module.ts b/src/app/community-page/community-page.module.ts index 61c17de8fa..5ebd7c3057 100644 --- a/src/app/community-page/community-page.module.ts +++ b/src/app/community-page/community-page.module.ts @@ -21,8 +21,10 @@ import { } from './sections/sub-com-col-section/sub-collection-list/themed-community-page-sub-collection-list.component'; import { DsoPageModule } from '../shared/dso-page/dso-page.module'; import { SubComColSectionComponent } from './sections/sub-com-col-section/sub-com-col-section.component'; +import { BrowseByPageModule } from '../browse-by/browse-by-page.module'; -const DECLARATIONS = [CommunityPageComponent, +const DECLARATIONS = [ + CommunityPageComponent, ThemedCommunityPageComponent, ThemedCommunityPageSubCommunityListComponent, CommunityPageSubCollectionListComponent, @@ -42,6 +44,7 @@ const DECLARATIONS = [CommunityPageComponent, CommunityFormModule, ComcolModule, DsoPageModule, + BrowseByPageModule, ], declarations: [ ...DECLARATIONS diff --git a/src/app/community-page/sections/community-browse-section/community-browse-section.component.html b/src/app/community-page/sections/community-browse-section/community-browse-section.component.html new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/app/shared/comcol/comcol-page-browse-by/comcol-page-browse-by.component.html b/src/app/shared/comcol/comcol-page-browse-by/comcol-page-browse-by.component.html index 504d9f4bcd..dd7d8d12f7 100644 --- a/src/app/shared/comcol/comcol-page-browse-by/comcol-page-browse-by.component.html +++ b/src/app/shared/comcol/comcol-page-browse-by/comcol-page-browse-by.component.html @@ -1,5 +1,5 @@

{{'browse.comcol.head' | translate}}

-
diff --git a/src/app/shared/comcol/comcol-page-browse-by/comcol-page-browse-by.component.ts b/src/app/shared/comcol/comcol-page-browse-by/comcol-page-browse-by.component.ts index 0527d283f0..2a3ec220d6 100644 --- a/src/app/shared/comcol/comcol-page-browse-by/comcol-page-browse-by.component.ts +++ b/src/app/shared/comcol/comcol-page-browse-by/comcol-page-browse-by.component.ts @@ -1,7 +1,7 @@ -import { Component, Input, OnInit } from '@angular/core'; -import { Observable } from 'rxjs'; -import { map } from 'rxjs/operators'; -import { ActivatedRoute, Params, Router } from '@angular/router'; +import { Component, Input, OnInit, OnDestroy } from '@angular/core'; +import { BehaviorSubject, combineLatest, Observable, Subscription } from 'rxjs'; +import { map, take } from 'rxjs/operators'; +import { Router, EventType, Scroll } from '@angular/router'; import { getCommunityPageRoute } from '../../../community-page/community-page-routing-paths'; import { getCollectionPageRoute } from '../../../collection-page/collection-page-routing-paths'; import { getFirstCompletedRemoteData } from '../../../core/shared/operators'; @@ -26,62 +26,87 @@ export interface ComColPageNavOption { styleUrls: ['./comcol-page-browse-by.component.scss'], templateUrl: './comcol-page-browse-by.component.html' }) -export class ComcolPageBrowseByComponent implements OnInit { +export class ComcolPageBrowseByComponent implements OnDestroy, OnInit { /** * The ID of the Community or Collection */ @Input() id: string; @Input() contentType: string; - allOptions: ComColPageNavOption[]; + allOptions$: Observable; - currentOptionId$: Observable; + currentOption$: BehaviorSubject = new BehaviorSubject(undefined); + + subs: Subscription[] = []; constructor( - private route: ActivatedRoute, - private router: Router, + public router: Router, private browseService: BrowseService ) { } ngOnInit(): void { - this.browseService.getBrowseDefinitions() - .pipe(getFirstCompletedRemoteData>()) - .subscribe((browseDefListRD: RemoteData>) => { + this.allOptions$ = this.browseService.getBrowseDefinitions().pipe( + getFirstCompletedRemoteData(), + map((browseDefListRD: RemoteData>) => { + const allOptions: ComColPageNavOption[] = []; if (browseDefListRD.hasSucceeded) { - this.allOptions = browseDefListRD.payload.page - .map((config: BrowseDefinition) => ({ - id: config.id, - label: `browse.comcol.by.${config.id}`, - routerLink: `/browse/${config.id}`, - params: { scope: this.id } - })); - + let comColRoute: string; if (this.contentType === 'collection') { - this.allOptions = [{ - id: this.id, + comColRoute = getCollectionPageRoute(this.id); + allOptions.push({ + id: 'recent_submissions', label: 'collection.page.browse.recent.head', - routerLink: getCollectionPageRoute(this.id) - }, ...this.allOptions]; + routerLink: comColRoute, + }); } else if (this.contentType === 'community') { - this.allOptions = [{ - id: this.id, + comColRoute = getCommunityPageRoute(this.id); + allOptions.push({ + id: 'comcols', label: 'community.all-lists.head', - routerLink: getCommunityPageRoute(this.id) - }, ...this.allOptions]; + routerLink: comColRoute, + }); + } + + allOptions.push(...browseDefListRD.payload.page.map((config: BrowseDefinition) => ({ + id: `browse_${config.id}`, + label: `browse.comcol.by.${config.id}`, + routerLink: `${comColRoute}/browse/${config.id}`, + }))); + } + return allOptions; + }), + ); + + this.subs.push(combineLatest([ + this.allOptions$, + this.router.events, + ]).subscribe(([navOptions, scrollEvent]: [ComColPageNavOption[], Scroll]) => { + if (scrollEvent.type === EventType.Scroll) { + for (let option of navOptions) { + if (option.routerLink === scrollEvent.routerEvent.urlAfterRedirects.split('?')[0]) { + this.currentOption$.next(option); } } - }); - - this.currentOptionId$ = this.route.params.pipe( - map((params: Params) => params.id) - ); + } + })); } - onSelectChange(newId: string) { - const selectedOption = this.allOptions - .find((option: ComColPageNavOption) => option.id === newId); + ngOnDestroy(): void { + this.subs.forEach((sub: Subscription) => sub.unsubscribe()); + } - this.router.navigate([selectedOption.routerLink], { queryParams: selectedOption.params }); + onSelectChange(event: any): void { + this.allOptions$.pipe( + take(1), + ).subscribe((allOptions: ComColPageNavOption[]) => { + for (let option of allOptions) { + if (option.id === event.target.value) { + this.currentOption$.next(option[0]); + void this.router.navigate([option.routerLink], { queryParams: option.params }); + break; + } + } + }); } } From e66a14cffd6b754b347346f21ed3f034b4733f26 Mon Sep 17 00:00:00 2001 From: Alexandre Vryghem Date: Tue, 5 Dec 2023 00:45:19 +0100 Subject: [PATCH 10/25] 108588: Fixed accessibility issues on ds-comcol-page-browse-by --- .../comcol-page-browse-by.component.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app/shared/comcol/comcol-page-browse-by/comcol-page-browse-by.component.html b/src/app/shared/comcol/comcol-page-browse-by/comcol-page-browse-by.component.html index dd7d8d12f7..d0fd33a834 100644 --- a/src/app/shared/comcol/comcol-page-browse-by/comcol-page-browse-by.component.html +++ b/src/app/shared/comcol/comcol-page-browse-by/comcol-page-browse-by.component.html @@ -2,9 +2,11 @@