From 14b1fd463dd6930586d0fc5f5dad321afe0c8f49 Mon Sep 17 00:00:00 2001 From: Yura Date: Wed, 20 Oct 2021 11:27:55 +0200 Subject: [PATCH 01/18] 84367: SearchForm/SearchComponent: add option to hide scope selection dropdown --- .../search-page/configuration-search-page.component.ts | 6 ++++++ src/app/search-page/search.component.html | 1 + src/app/search-page/search.component.ts | 5 +++++ src/app/shared/search-form/search-form.component.html | 4 ++-- .../shared/search-form/search-form.component.spec.ts | 10 ++++++++++ src/app/shared/search-form/search-form.component.ts | 5 +++++ 6 files changed, 29 insertions(+), 2 deletions(-) diff --git a/src/app/search-page/configuration-search-page.component.ts b/src/app/search-page/configuration-search-page.component.ts index 1eefeeb569..5ba318b850 100644 --- a/src/app/search-page/configuration-search-page.component.ts +++ b/src/app/search-page/configuration-search-page.component.ts @@ -47,6 +47,12 @@ export class ConfigurationSearchPageComponent extends SearchComponent implements */ @Input() fixedFilterQuery: string; + + /** + * Whether to show the scope selection dropdown + */ + @Input() scopeSelectable = true; + constructor(protected service: SearchService, protected sidebarService: SidebarService, protected windowService: HostWindowService, diff --git a/src/app/search-page/search.component.html b/src/app/search-page/search.component.html index d8aa25e4a3..499f652200 100644 --- a/src/app/search-page/search.component.html +++ b/src/app/search-page/search.component.html @@ -45,6 +45,7 @@ -
+
-
+
diff --git a/src/app/shared/search-form/search-form.component.spec.ts b/src/app/shared/search-form/search-form.component.spec.ts index 1469eac566..bbaee5709d 100644 --- a/src/app/shared/search-form/search-form.component.spec.ts +++ b/src/app/shared/search-form/search-form.component.spec.ts @@ -72,6 +72,16 @@ describe('SearchFormComponent', () => { expect(select).toBeNull(); }); + it('should not display scopes when scopeSelectable is false', () => { + comp.scopeSelectable = false; + comp.scopes = objects; + comp.scope = objects[1].id; + + fixture.detectChanges(); + const select = de.query(By.css('select')); + expect(select).toBeNull(); + }); + it('should display set query value in input field', fakeAsync(() => { const testString = 'This is a test query'; comp.query = testString; diff --git a/src/app/shared/search-form/search-form.component.ts b/src/app/shared/search-form/search-form.component.ts index 2791aee378..1cf3c11913 100644 --- a/src/app/shared/search-form/search-form.component.ts +++ b/src/app/shared/search-form/search-form.component.ts @@ -66,6 +66,11 @@ export class SearchFormComponent { */ @Output() submitSearch = new EventEmitter(); + /** + * Whether to show the scope selection dropdown + */ + @Input() scopeSelectable = true; + constructor(private router: Router, private searchService: SearchService, private paginationService: PaginationService, private searchConfig: SearchConfigurationService From 931560ee2627c2b7d130ea22006251e53adf1224 Mon Sep 17 00:00:00 2001 From: Yura Date: Thu, 21 Oct 2021 10:22:23 +0200 Subject: [PATCH 02/18] 84367: Make ComcolPageBrowseByComponent themeable --- .../browse-by-metadata-page.component.html | 2 +- .../collection-page.component.html | 4 +-- .../community-page.component.html | 4 +-- .../themed-comcol-page-browse-by.component.ts | 33 +++++++++++++++++++ src/app/shared/shared.module.ts | 2 ++ 5 files changed, 40 insertions(+), 5 deletions(-) create mode 100644 src/app/shared/comcol-page-browse-by/themed-comcol-page-browse-by.component.ts 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 2321da0204..324a581ae0 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 @@ -18,7 +18,7 @@ - +
diff --git a/src/app/collection-page/collection-page.component.html b/src/app/collection-page/collection-page.component.html index 9d598a3b69..6eceb696bd 100644 --- a/src/app/collection-page/collection-page.component.html +++ b/src/app/collection-page/collection-page.component.html @@ -40,10 +40,10 @@
- - +
diff --git a/src/app/community-page/community-page.component.html b/src/app/community-page/community-page.component.html index cf7282eb4b..27420e95b3 100644 --- a/src/app/community-page/community-page.component.html +++ b/src/app/community-page/community-page.component.html @@ -26,8 +26,8 @@
- - + + diff --git a/src/app/shared/comcol-page-browse-by/themed-comcol-page-browse-by.component.ts b/src/app/shared/comcol-page-browse-by/themed-comcol-page-browse-by.component.ts new file mode 100644 index 0000000000..410c1f53da --- /dev/null +++ b/src/app/shared/comcol-page-browse-by/themed-comcol-page-browse-by.component.ts @@ -0,0 +1,33 @@ +import { Component, Input } from '@angular/core'; +import { ThemedComponent } from '../theme-support/themed.component'; +import { ComcolPageBrowseByComponent } from './comcol-page-browse-by.component'; + +/** + * Themed wrapper for ComcolPageBrowseByComponent + */ +@Component({ + selector: 'ds-themed-comcol-page-browse-by', + styleUrls: [], + templateUrl: '../theme-support/themed.component.html', +}) +export class ThemedComcolPageBrowseByComponent extends ThemedComponent { + /** + * The ID of the Community or Collection + */ + @Input() id: string; + @Input() contentType: string; + + inAndOutputNames: (keyof ComcolPageBrowseByComponent & keyof this)[] = ['id', 'contentType']; + + protected getComponentName(): string { + return 'ComcolPageBrowseByComponent'; + } + + protected importThemedComponent(themeName: string): Promise { + return import(`../../../themes/${themeName}/app/shared/comcol-page-browse-by/comcol-page-browse-by.component`); + } + + protected importUnthemedComponent(): Promise { + return import('./comcol-page-browse-by.component'); + } +} diff --git a/src/app/shared/shared.module.ts b/src/app/shared/shared.module.ts index 9b993e551f..9d5a0151c4 100644 --- a/src/app/shared/shared.module.ts +++ b/src/app/shared/shared.module.ts @@ -233,6 +233,7 @@ import { OnClickMenuItemComponent } from './menu/menu-item/onclick-menu-item.com import { TextMenuItemComponent } from './menu/menu-item/text-menu-item.component'; import { ThemedConfigurationSearchPageComponent } from '../search-page/themed-configuration-search-page.component'; import { SearchNavbarComponent } from '../search-navbar/search-navbar.component'; +import { ThemedComcolPageBrowseByComponent } from './comcol-page-browse-by/themed-comcol-page-browse-by.component'; /** * Declaration needed to make sure all decorator functions are called in time @@ -303,6 +304,7 @@ const COMPONENTS = [ EditComColPageComponent, DeleteComColPageComponent, ComcolPageBrowseByComponent, + ThemedComcolPageBrowseByComponent, ComcolRoleComponent, DsDynamicFormComponent, DsDynamicFormControlContainerComponent, From 859ff4a2f5e06c3c73fee0d8654fe4f391e76a4c Mon Sep 17 00:00:00 2001 From: Yura Date: Thu, 21 Oct 2021 10:33:17 +0200 Subject: [PATCH 03/18] 84367: Use DSONameService for ds-dso-selector names --- .../authorized-collection-selector.component.ts | 14 +++++++++----- .../dso-selector/dso-selector.component.html | 2 +- .../dso-selector/dso-selector.component.ts | 14 +++++++++++--- 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/src/app/shared/dso-selector/dso-selector/authorized-collection-selector/authorized-collection-selector.component.ts b/src/app/shared/dso-selector/dso-selector/authorized-collection-selector/authorized-collection-selector.component.ts index bca1727542..08853307b0 100644 --- a/src/app/shared/dso-selector/dso-selector/authorized-collection-selector/authorized-collection-selector.component.ts +++ b/src/app/shared/dso-selector/dso-selector/authorized-collection-selector/authorized-collection-selector.component.ts @@ -14,6 +14,7 @@ import { RemoteData } from '../../../../core/data/remote-data'; import { hasValue } from '../../../empty.util'; import { NotificationsService } from '../../../notifications/notifications.service'; import { TranslateService } from '@ngx-translate/core'; +import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; @Component({ selector: 'ds-authorized-collection-selector', @@ -24,11 +25,14 @@ import { TranslateService } from '@ngx-translate/core'; * Component rendering a list of collections to select from */ export class AuthorizedCollectionSelectorComponent extends DSOSelectorComponent { - constructor(protected searchService: SearchService, - protected collectionDataService: CollectionDataService, - protected notifcationsService: NotificationsService, - protected translate: TranslateService) { - super(searchService, notifcationsService, translate); + constructor( + protected searchService: SearchService, + protected collectionDataService: CollectionDataService, + protected notifcationsService: NotificationsService, + protected translate: TranslateService, + protected dsoNameService: DSONameService, + ) { + super(searchService, notifcationsService, translate, dsoNameService); } /** diff --git a/src/app/shared/dso-selector/dso-selector/dso-selector.component.html b/src/app/shared/dso-selector/dso-selector/dso-selector.component.html index ab2ea6cd8b..a3b460fe90 100644 --- a/src/app/shared/dso-selector/dso-selector/dso-selector.component.html +++ b/src/app/shared/dso-selector/dso-selector/dso-selector.component.html @@ -22,7 +22,7 @@ +
diff --git a/src/app/shared/bitstream-download-page/bitstream-download-page.component.ts b/src/app/shared/bitstream-download-page/bitstream-download-page.component.ts index a09d7e8b3e..312f2a4c0c 100644 --- a/src/app/shared/bitstream-download-page/bitstream-download-page.component.ts +++ b/src/app/shared/bitstream-download-page/bitstream-download-page.component.ts @@ -12,6 +12,7 @@ import { FileService } from '../../core/shared/file.service'; import { HardRedirectService } from '../../core/services/hard-redirect.service'; import { getForbiddenRoute } from '../../app-routing-paths'; import { RemoteData } from '../../core/data/remote-data'; +import { Location } from '@angular/common'; @Component({ selector: 'ds-bitstream-download-page', @@ -33,10 +34,15 @@ export class BitstreamDownloadPageComponent implements OnInit { private auth: AuthService, private fileService: FileService, private hardRedirectService: HardRedirectService, + private location: Location, ) { } + back(): void { + this.location.back(); + } + ngOnInit(): void { this.bitstreamRD$ = this.route.data.pipe( diff --git a/src/assets/i18n/en.json5 b/src/assets/i18n/en.json5 index f742273edb..f33a195cfe 100644 --- a/src/assets/i18n/en.json5 +++ b/src/assets/i18n/en.json5 @@ -551,6 +551,7 @@ "bitstream.download.page": "Now downloading {{bitstream}}..." , + "bitstream.download.page.back": "Back" , "bitstream.edit.authorizations.link": "Edit bitstream's Policies", From fba1dfb689b18263b5c7ef9e92f301f6d2e2b528 Mon Sep 17 00:00:00 2001 From: Yura Bondarenko Date: Thu, 17 Feb 2022 23:28:46 +0100 Subject: [PATCH 14/18] Add missing provider to custom ds-search-page --- .../custom/app/search-page/search-page.component.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/themes/custom/app/search-page/search-page.component.ts b/src/themes/custom/app/search-page/search-page.component.ts index e8973975b5..44314b7183 100644 --- a/src/themes/custom/app/search-page/search-page.component.ts +++ b/src/themes/custom/app/search-page/search-page.component.ts @@ -1,11 +1,19 @@ import { Component } from '@angular/core'; import { SearchPageComponent as BaseComponent } from '../../../../app/search-page/search-page.component'; +import { SEARCH_CONFIG_SERVICE } from '../../../../app/my-dspace-page/my-dspace-page.component'; +import { SearchConfigurationService } from '../../../../app/core/shared/search/search-configuration.service'; @Component({ selector: 'ds-search-page', // styleUrls: ['./search-page.component.scss'], // templateUrl: './search-page.component.html' - templateUrl: '../../../../app/search-page/search-page.component.html' + templateUrl: '../../../../app/search-page/search-page.component.html', + providers: [ + { + provide: SEARCH_CONFIG_SERVICE, + useClass: SearchConfigurationService + } + ] }) /** From 2830da955739b61c91c15f587051b0d75f4e5464 Mon Sep 17 00:00:00 2001 From: Yura Bondarenko Date: Fri, 18 Feb 2022 08:23:41 +0100 Subject: [PATCH 15/18] Fix undefined injector issue --- src/app/navbar/navbar.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/navbar/navbar.component.html b/src/app/navbar/navbar.component.html index fc5d1a2ef3..63f308fb32 100644 --- a/src/app/navbar/navbar.component.html +++ b/src/app/navbar/navbar.component.html @@ -6,7 +6,7 @@
From 4a6c896eeafc9411bcb15ce0942ca1cceb4f7741 Mon Sep 17 00:00:00 2001 From: Davide Negretti Date: Fri, 18 Feb 2022 16:56:06 +0100 Subject: [PATCH 16/18] [CST-5341] Back button moved below the page title --- .../bitstream-download-page.component.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/shared/bitstream-download-page/bitstream-download-page.component.html b/src/app/shared/bitstream-download-page/bitstream-download-page.component.html index 8a18acb251..eddc5e345a 100644 --- a/src/app/shared/bitstream-download-page/bitstream-download-page.component.html +++ b/src/app/shared/bitstream-download-page/bitstream-download-page.component.html @@ -1,6 +1,6 @@
-
-

{{'bitstream.download.page' | translate:{bitstream: (bitstream$ | async)?.name} }}

+

{{'bitstream.download.page' | translate:{bitstream: (bitstream$ | async)?.name} }}

+
From dc00fd4c759898431686c65fa30cd56fc5012749 Mon Sep 17 00:00:00 2001 From: Art Lowel Date: Tue, 22 Feb 2022 12:20:19 +0100 Subject: [PATCH 17/18] add themed community list component --- .../community-list-page.component.html | 2 +- .../community-list-page.module.ts | 4 +++- .../themed-community-list.component.ts | 23 +++++++++++++++++++ .../community-list.component.html | 1 + .../community-list.component.scss | 0 .../community-list.component.ts | 18 +++++++++++++++ src/themes/custom/theme.module.ts | 4 +++- 7 files changed, 49 insertions(+), 3 deletions(-) create mode 100644 src/app/community-list-page/community-list/themed-community-list.component.ts create mode 100644 src/themes/custom/app/community-list-page/community-list/community-list.component.html create mode 100644 src/themes/custom/app/community-list-page/community-list/community-list.component.scss create mode 100644 src/themes/custom/app/community-list-page/community-list/community-list.component.ts diff --git a/src/app/community-list-page/community-list-page.component.html b/src/app/community-list-page/community-list-page.component.html index 08accdc0e5..9759f4405d 100644 --- a/src/app/community-list-page/community-list-page.component.html +++ b/src/app/community-list-page/community-list-page.component.html @@ -1,4 +1,4 @@

{{ 'communityList.title' | translate }}

- +
diff --git a/src/app/community-list-page/community-list-page.module.ts b/src/app/community-list-page/community-list-page.module.ts index 3b009e227c..18c28068be 100644 --- a/src/app/community-list-page/community-list-page.module.ts +++ b/src/app/community-list-page/community-list-page.module.ts @@ -5,12 +5,14 @@ import { CommunityListPageComponent } from './community-list-page.component'; import { CommunityListPageRoutingModule } from './community-list-page.routing.module'; import { CommunityListComponent } from './community-list/community-list.component'; import { ThemedCommunityListPageComponent } from './themed-community-list-page.component'; +import { ThemedCommunityListComponent } from './community-list/themed-community-list.component'; const DECLARATIONS = [ CommunityListPageComponent, CommunityListComponent, - ThemedCommunityListPageComponent + ThemedCommunityListPageComponent, + ThemedCommunityListComponent ]; /** * The page which houses a title and the community list, as described in community-list.component diff --git a/src/app/community-list-page/community-list/themed-community-list.component.ts b/src/app/community-list-page/community-list/themed-community-list.component.ts new file mode 100644 index 0000000000..adbfed85f3 --- /dev/null +++ b/src/app/community-list-page/community-list/themed-community-list.component.ts @@ -0,0 +1,23 @@ +import { ThemedComponent } from '../../shared/theme-support/themed.component'; +import { CommunityListComponent } from './community-list.component'; +import { Component } from '@angular/core'; + + +@Component({ + selector: 'ds-themed-community-list', + styleUrls: [], + templateUrl: '../../shared/theme-support/themed.component.html', +})export class ThemedCommunityListComponent extends ThemedComponent { + protected getComponentName(): string { + return 'CommunityListComponent'; + } + + protected importThemedComponent(themeName: string): Promise { + return import(`../../../themes/${themeName}/app/community-list-page/community-list/community-list.component`); + } + + protected importUnthemedComponent(): Promise { + return import(`./community-list.component`); + } + +} diff --git a/src/themes/custom/app/community-list-page/community-list/community-list.component.html b/src/themes/custom/app/community-list-page/community-list/community-list.component.html new file mode 100644 index 0000000000..b0129e419d --- /dev/null +++ b/src/themes/custom/app/community-list-page/community-list/community-list.component.html @@ -0,0 +1 @@ +BINGO diff --git a/src/themes/custom/app/community-list-page/community-list/community-list.component.scss b/src/themes/custom/app/community-list-page/community-list/community-list.component.scss new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/themes/custom/app/community-list-page/community-list/community-list.component.ts b/src/themes/custom/app/community-list-page/community-list/community-list.component.ts new file mode 100644 index 0000000000..61b538d641 --- /dev/null +++ b/src/themes/custom/app/community-list-page/community-list/community-list.component.ts @@ -0,0 +1,18 @@ +import { Component } from '@angular/core'; +import { CommunityListComponent as BaseComponent } from '../../../../../app/community-list-page/community-list/community-list.component'; + +/** + * A tree-structured list of nodes representing the communities, their subCommunities and collections. + * Initially only the page-restricted top communities are shown. + * Each node can be expanded to show its children and all children are also page-limited. + * More pages of a page-limited result can be shown by pressing a show more node/link. + * Which nodes were expanded is kept in the store, so this persists across pages. + */ +@Component({ + selector: 'ds-community-list', + // styleUrls: ['./community-list.component.scss'], + // templateUrl: './community-list.component.html' + templateUrl: '../../../../../app/community-list-page/community-list/community-list.component.html' +}) +export class CommunityListComponent extends BaseComponent {} + diff --git a/src/themes/custom/theme.module.ts b/src/themes/custom/theme.module.ts index dac941546b..035b0b1fd3 100644 --- a/src/themes/custom/theme.module.ts +++ b/src/themes/custom/theme.module.ts @@ -79,6 +79,7 @@ import { HeaderComponent } from './app/header/header.component'; import { FooterComponent } from './app/footer/footer.component'; import { BreadcrumbsComponent } from './app/breadcrumbs/breadcrumbs.component'; import { HeaderNavbarWrapperComponent } from './app/header-nav-wrapper/header-navbar-wrapper.component'; +import { CommunityListComponent } from './app/community-list-page/community-list/community-list.component'; const DECLARATIONS = [ HomePageComponent, @@ -119,7 +120,8 @@ const DECLARATIONS = [ HeaderComponent, NavbarComponent, HeaderNavbarWrapperComponent, - BreadcrumbsComponent + BreadcrumbsComponent, + CommunityListComponent ]; @NgModule({ From b66c5030f4f2c48fc6a61297e04fcba9e0e28567 Mon Sep 17 00:00:00 2001 From: Art Lowel Date: Tue, 22 Feb 2022 12:29:40 +0100 Subject: [PATCH 18/18] remove test contents --- .../community-list/community-list.component.html | 1 - 1 file changed, 1 deletion(-) diff --git a/src/themes/custom/app/community-list-page/community-list/community-list.component.html b/src/themes/custom/app/community-list-page/community-list/community-list.component.html index b0129e419d..e69de29bb2 100644 --- a/src/themes/custom/app/community-list-page/community-list/community-list.component.html +++ b/src/themes/custom/app/community-list-page/community-list/community-list.component.html @@ -1 +0,0 @@ -BINGO