diff --git a/src/app/admin/admin-sidebar/admin-sidebar.component.ts b/src/app/admin/admin-sidebar/admin-sidebar.component.ts index c81b2e6e93..dc9d2a817f 100644 --- a/src/app/admin/admin-sidebar/admin-sidebar.component.ts +++ b/src/app/admin/admin-sidebar/admin-sidebar.component.ts @@ -63,13 +63,14 @@ export class AdminSidebarComponent extends MenuComponent implements OnInit { inFocus$: BehaviorSubject; - constructor(protected menuService: MenuService, + constructor( + protected menuService: MenuService, protected injector: Injector, - private variableService: CSSVariableService, - private authService: AuthService, - private modalService: NgbModal, + protected variableService: CSSVariableService, + protected authService: AuthService, + protected modalService: NgbModal, public authorizationService: AuthorizationDataService, - private scriptDataService: ScriptDataService, + protected scriptDataService: ScriptDataService, public route: ActivatedRoute ) { super(menuService, injector, authorizationService, route); diff --git a/src/app/admin/admin-sidebar/themed-admin-sidebar.component.ts b/src/app/admin/admin-sidebar/themed-admin-sidebar.component.ts new file mode 100644 index 0000000000..f2f35725e8 --- /dev/null +++ b/src/app/admin/admin-sidebar/themed-admin-sidebar.component.ts @@ -0,0 +1,25 @@ +import { Component } from '@angular/core'; +import { ThemedComponent } from '../../shared/theme-support/themed.component'; +import { AdminSidebarComponent } from './admin-sidebar.component'; + +/** + * Themed wrapper for AdminSidebarComponent + */ +@Component({ + selector: 'ds-themed-admin-sidebar', + styleUrls: [], + templateUrl: '../../shared/theme-support/themed.component.html', +}) +export class ThemedAdminSidebarComponent extends ThemedComponent { + protected getComponentName(): string { + return 'AdminSidebarComponent'; + } + + protected importThemedComponent(themeName: string): Promise { + return import(`../../../themes/${themeName}/app/admin/admin-sidebar/admin-sidebar.component`); + } + + protected importUnthemedComponent(): Promise { + return import('./admin-sidebar.component'); + } +} diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 67bccd9105..0885eea83b 100755 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -56,6 +56,7 @@ import { ThemedHeaderNavbarWrapperComponent } from './header-nav-wrapper/themed- import { IdleModalComponent } from './shared/idle-modal/idle-modal.component'; import { ThemedPageInternalServerErrorComponent } from './page-internal-server-error/themed-page-internal-server-error.component'; import { PageInternalServerErrorComponent } from './page-internal-server-error/page-internal-server-error.component'; +import { ThemedAdminSidebarComponent } from './admin/admin-sidebar/themed-admin-sidebar.component'; import { APP_CONFIG, AppConfig } from '../config/app-config.interface'; @@ -171,6 +172,7 @@ const DECLARATIONS = [ HeaderNavbarWrapperComponent, ThemedHeaderNavbarWrapperComponent, AdminSidebarComponent, + ThemedAdminSidebarComponent, AdminSidebarSectionComponent, ExpandableAdminSidebarSectionComponent, FooterComponent, 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 dd37cf6db5..cd5f4f03a2 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-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/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/my-dspace-page/my-dspace-page.component.html b/src/app/my-dspace-page/my-dspace-page.component.html index 45cade0804..ea5784170f 100644 --- a/src/app/my-dspace-page/my-dspace-page.component.html +++ b/src/app/my-dspace-page/my-dspace-page.component.html @@ -2,9 +2,9 @@ - +> 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 @@
diff --git a/src/app/root/root.component.html b/src/app/root/root.component.html index 898074352c..0fcc169681 100644 --- a/src/app/root/root.component.html +++ b/src/app/root/root.component.html @@ -1,5 +1,5 @@
- +
-

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

+

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

+
+ +
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/app/shared/comcol/comcol-page-browse-by/themed-comcol-page-browse-by.component.ts b/src/app/shared/comcol/comcol-page-browse-by/themed-comcol-page-browse-by.component.ts new file mode 100644 index 0000000000..08a13eddf8 --- /dev/null +++ b/src/app/shared/comcol/comcol-page-browse-by/themed-comcol-page-browse-by.component.ts @@ -0,0 +1,33 @@ +import { Component, Input } from '@angular/core'; +import { ComcolPageBrowseByComponent } from './comcol-page-browse-by.component'; +import { ThemedComponent } from '../../theme-support/themed.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/comcol/comcol.module.ts b/src/app/shared/comcol/comcol.module.ts index 664f14a098..6e779a24db 100644 --- a/src/app/shared/comcol/comcol.module.ts +++ b/src/app/shared/comcol/comcol.module.ts @@ -9,6 +9,7 @@ import { CreateComColPageComponent } from './comcol-forms/create-comcol-page/cre import { EditComColPageComponent } from './comcol-forms/edit-comcol-page/edit-comcol-page.component'; import { DeleteComColPageComponent } from './comcol-forms/delete-comcol-page/delete-comcol-page.component'; import { ComcolPageBrowseByComponent } from './comcol-page-browse-by/comcol-page-browse-by.component'; +import { ThemedComcolPageBrowseByComponent } from './comcol-page-browse-by/themed-comcol-page-browse-by.component'; import { ComcolRoleComponent } from './comcol-forms/edit-comcol-page/comcol-role/comcol-role.component'; import { SharedModule } from '../shared.module'; import { FormModule } from '../form/form.module'; @@ -23,6 +24,7 @@ const COMPONENTS = [ EditComColPageComponent, DeleteComColPageComponent, ComcolPageBrowseByComponent, + ThemedComcolPageBrowseByComponent, ComcolRoleComponent, ]; 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 176d131566..44ac27515d 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 @@ -16,6 +16,7 @@ import { NotificationsService } from '../../../notifications/notifications.servi import { TranslateService } from '@ngx-translate/core'; import { Collection } from '../../../../core/shared/collection.model'; import { FindListOptions } from '../../../../core/data/request.models'; +import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; @Component({ selector: 'ds-authorized-collection-selector', @@ -31,11 +32,14 @@ export class AuthorizedCollectionSelectorComponent extends DSOSelectorComponent */ @Input() entityType: string; - 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 4b46d3bc3f..198da8d3ed 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/object-grid/object-grid.component.scss b/src/app/shared/object-grid/object-grid.component.scss index 68a7f2f991..4254c7d29f 100644 --- a/src/app/shared/object-grid/object-grid.component.scss +++ b/src/app/shared/object-grid/object-grid.component.scss @@ -1,18 +1,19 @@ :host ::ng-deep { --ds-wrapper-grid-spacing: calc(var(--bs-spacer) / 2); - div.thumbnail > .thumbnail-content { - height: var(--ds-card-thumbnail-height); - width: 100%; - display: block; - min-width: 100%; - min-height: 100%; - object-fit: cover; - object-position: 50% 15%; - } div.card { margin-top: var(--ds-wrapper-grid-spacing); margin-bottom: var(--ds-wrapper-grid-spacing); + + div.thumbnail > .thumbnail-content { + height: var(--ds-card-thumbnail-height); + width: 100%; + display: block; + min-width: 100%; + min-height: 100%; + object-fit: cover; + object-position: 50% 15%; + } } } @@ -26,4 +27,3 @@ padding-right: var(--ds-wrapper-grid-spacing); } } - diff --git a/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-approved-search-result/claimed-approved-search-result-list-element.component.html b/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-approved-search-result/claimed-approved-search-result-list-element.component.html index 8ebcdbd69a..544c1ebea8 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-approved-search-result/claimed-approved-search-result-list-element.component.html +++ b/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-approved-search-result/claimed-approved-search-result-list-element.component.html @@ -1,10 +1,10 @@ diff --git a/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-declined-search-result/claimed-declined-search-result-list-element.component.html b/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-declined-search-result/claimed-declined-search-result-list-element.component.html index f20696823c..b642aef585 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-declined-search-result/claimed-declined-search-result-list-element.component.html +++ b/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-declined-search-result/claimed-declined-search-result-list-element.component.html @@ -1,10 +1,10 @@ diff --git a/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-search-result-list-element.component.html b/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-search-result-list-element.component.html index 30aac357a4..747fb9bc36 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-search-result-list-element.component.html +++ b/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-search-result-list-element.component.html @@ -1,9 +1,9 @@ - + [status]="status"> diff --git a/src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/themed-item-list-preview.component.ts b/src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/themed-item-list-preview.component.ts new file mode 100644 index 0000000000..982a04207f --- /dev/null +++ b/src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/themed-item-list-preview.component.ts @@ -0,0 +1,38 @@ +import { Component, Input } from '@angular/core'; +import { ThemedComponent } from '../../../theme-support/themed.component'; +import { ItemListPreviewComponent } from './item-list-preview.component'; +import { Item } from '../../../../core/shared/item.model'; +import { MyDspaceItemStatusType } from '../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type'; +import { SearchResult } from '../../../search/models/search-result.model'; + +/** + * Themed wrapper for ItemListPreviewComponent + */ +@Component({ + selector: 'ds-themed-item-list-preview', + styleUrls: [], + templateUrl: '../../../theme-support/themed.component.html', +}) +export class ThemedItemListPreviewComponent extends ThemedComponent { + protected inAndOutputNames: (keyof ItemListPreviewComponent & keyof this)[] = ['item', 'object', 'status', 'showSubmitter']; + + @Input() item: Item; + + @Input() object: SearchResult; + + @Input() status: MyDspaceItemStatusType; + + @Input() showSubmitter = false; + + protected getComponentName(): string { + return 'ItemListPreviewComponent'; + } + + protected importThemedComponent(themeName: string): Promise { + return import(`../../../../../themes/${themeName}/app/shared/object-list/my-dspace-result-list-element/item-list-preview/item-list-preview.component`); + } + + protected importUnthemedComponent(): Promise { + return import('./item-list-preview.component'); + } +} diff --git a/src/app/shared/object-list/my-dspace-result-list-element/item-search-result/item-search-result-list-element-submission.component.html b/src/app/shared/object-list/my-dspace-result-list-element/item-search-result/item-search-result-list-element-submission.component.html index e422a84641..6c012dd641 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/item-search-result/item-search-result-list-element-submission.component.html +++ b/src/app/shared/object-list/my-dspace-result-list-element/item-search-result/item-search-result-list-element-submission.component.html @@ -1,5 +1,5 @@ - + [status]="status"> diff --git a/src/app/shared/object-list/my-dspace-result-list-element/pool-search-result/pool-search-result-list-element.component.html b/src/app/shared/object-list/my-dspace-result-list-element/pool-search-result/pool-search-result-list-element.component.html index 25e2c4f8c4..346f9b249a 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/pool-search-result/pool-search-result-list-element.component.html +++ b/src/app/shared/object-list/my-dspace-result-list-element/pool-search-result/pool-search-result-list-element.component.html @@ -1,8 +1,8 @@ - + [status]="status"> diff --git a/src/app/shared/object-list/my-dspace-result-list-element/workflow-item-search-result/workflow-item-search-result-list-element.component.html b/src/app/shared/object-list/my-dspace-result-list-element/workflow-item-search-result/workflow-item-search-result-list-element.component.html index 74fc5fd06d..2f2ff50352 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/workflow-item-search-result/workflow-item-search-result-list-element.component.html +++ b/src/app/shared/object-list/my-dspace-result-list-element/workflow-item-search-result/workflow-item-search-result-list-element.component.html @@ -1,8 +1,8 @@ - + [status]="status"> diff --git a/src/app/shared/object-list/my-dspace-result-list-element/workspace-item-search-result/workspace-item-search-result-list-element.component.html b/src/app/shared/object-list/my-dspace-result-list-element/workspace-item-search-result/workspace-item-search-result-list-element.component.html index 41d95b87af..97302aac54 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/workspace-item-search-result/workspace-item-search-result-list-element.component.html +++ b/src/app/shared/object-list/my-dspace-result-list-element/workspace-item-search-result/workspace-item-search-result-list-element.component.html @@ -1,8 +1,8 @@ - + [status]="status"> 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 333e48336d..36e83d9fc5 100644 --- a/src/app/shared/search-form/search-form.component.spec.ts +++ b/src/app/shared/search-form/search-form.component.spec.ts @@ -47,11 +47,23 @@ describe('SearchFormComponent', () => { el = de.nativeElement; }); - it('should not display scopes when empty', () => { + it('should not display scopes when showScopeSelector is false', fakeAsync(() => { + comp.showScopeSelector = false; + fixture.detectChanges(); - const select = de.query(By.css('select')); - expect(select).toBeNull(); - }); + tick(); + + expect(de.query(By.css('.scope-button'))).toBeFalsy(); + })); + + it('should display scopes when showScopeSelector is true', fakeAsync(() => { + comp.showScopeSelector = true; + + fixture.detectChanges(); + tick(); + + expect(de.query(By.css('.scope-button'))).toBeTruthy(); + })); it('should display set query value in input field', fakeAsync(() => { const testString = 'This is a test query'; diff --git a/src/app/shared/search/search.component.html b/src/app/shared/search/search.component.html index 5ca3e925a5..c292c94c44 100644 --- a/src/app/shared/search/search.component.html +++ b/src/app/shared/search/search.component.html @@ -78,7 +78,7 @@ [query]="(searchOptions$ | async)?.query" [scope]="(searchOptions$ | async)?.scope" [currentUrl]="searchLink" - [showScopeSelector]="true" + [showScopeSelector]="showScopeSelector" [inPlaceSearch]="inPlaceSearch" [searchPlaceholder]="searchFormPlaceholder | translate"> diff --git a/src/app/shared/search/search.component.ts b/src/app/shared/search/search.component.ts index c017a5065b..0fd59346f8 100644 --- a/src/app/shared/search/search.component.ts +++ b/src/app/shared/search/search.component.ts @@ -134,6 +134,11 @@ export class SearchComponent implements OnInit { */ @Input() viewModeList: ViewMode[]; + /** + * Defines whether or not to show the scope selector + */ + @Input() showScopeSelector = false; + /** * The current configuration used during the search */ diff --git a/src/app/shared/search/search.module.ts b/src/app/shared/search/search.module.ts index 668d260c23..797d35d88f 100644 --- a/src/app/shared/search/search.module.ts +++ b/src/app/shared/search/search.module.ts @@ -28,9 +28,11 @@ import { MissingTranslationHelper } from '../translate/missing-translation.helpe import { SharedModule } from '../shared.module'; import { SearchResultsComponent } from './search-results/search-results.component'; import { SearchComponent } from './search.component'; +import { ThemedSearchComponent } from './themed-search.component'; const COMPONENTS = [ SearchComponent, + ThemedSearchComponent, SearchResultsComponent, SearchSidebarComponent, SearchSettingsComponent, diff --git a/src/app/shared/search/themed-search.component.ts b/src/app/shared/search/themed-search.component.ts new file mode 100644 index 0000000000..ce6fa24831 --- /dev/null +++ b/src/app/shared/search/themed-search.component.ts @@ -0,0 +1,75 @@ +import { Component, Input, Output, EventEmitter } from '@angular/core'; +import { ThemedComponent } from '../theme-support/themed.component'; +import { SearchComponent } from './search.component'; +import { SearchConfigurationOption } from './search-switch-configuration/search-configuration-option.model'; +import { Context } from '../../core/shared/context.model'; +import { CollectionElementLinkType } from '../object-collection/collection-element-link.type'; +import { SelectionConfig } from './search-results/search-results.component'; +import { ViewMode } from '../../core/shared/view-mode.model'; +import { SearchObjects } from './models/search-objects.model'; +import { DSpaceObject } from '../../core/shared/dspace-object.model'; +import { ListableObject } from '../object-collection/shared/listable-object.model'; + +/** + * Themed wrapper for SearchComponent + */ +@Component({ + selector: 'ds-themed-search', + styleUrls: [], + templateUrl: '../theme-support/themed.component.html', +}) +export class ThemedSearchComponent extends ThemedComponent { + protected inAndOutputNames: (keyof SearchComponent & keyof this)[] = ['configurationList', 'context', 'configuration', 'fixedFilterQuery', 'useCachedVersionIfAvailable', 'inPlaceSearch', 'linkType', 'paginationId', 'searchEnabled', 'sideBarWidth', 'searchFormPlaceholder', 'selectable', 'selectionConfig', 'showSidebar', 'showViewModes', 'useUniquePageId', 'viewModeList', 'resultFound', 'deselectObject', 'selectObject']; + + @Input() configurationList: SearchConfigurationOption[] = []; + + @Input() context: Context = Context.Search; + + @Input() configuration = 'default'; + + @Input() fixedFilterQuery: string; + + @Input() useCachedVersionIfAvailable = true; + + @Input() inPlaceSearch = true; + + @Input() linkType: CollectionElementLinkType; + + @Input() paginationId = 'spc'; + + @Input() searchEnabled = true; + + @Input() sideBarWidth = 3; + + @Input() searchFormPlaceholder = 'search.search-form.placeholder'; + + @Input() selectable = false; + + @Input() selectionConfig: SelectionConfig; + + @Input() showSidebar = true; + + @Input() showViewModes = true; + + @Input() useUniquePageId: false; + + @Input() viewModeList: ViewMode[]; + + @Output() resultFound: EventEmitter> = new EventEmitter>(); + + @Output() deselectObject: EventEmitter = new EventEmitter(); + + @Output() selectObject: EventEmitter = new EventEmitter(); + + protected getComponentName(): string { + return 'SearchComponent'; + } + + protected importThemedComponent(themeName: string): Promise { + return import(`../../../themes/${themeName}/app/shared/search/search.component`); + } + + protected importUnthemedComponent(): Promise { + return import('./search.component'); + } +} diff --git a/src/app/shared/shared.module.ts b/src/app/shared/shared.module.ts index 715ee66a99..7b799bfaea 100644 --- a/src/app/shared/shared.module.ts +++ b/src/app/shared/shared.module.ts @@ -7,13 +7,8 @@ import { DragDropModule } from '@angular/cdk/drag-drop'; import { NouisliderModule } from 'ng2-nouislider'; import { - NgbDatepickerModule, - NgbDropdownModule, - NgbNavModule, - NgbPaginationModule, - NgbTimepickerModule, - NgbTooltipModule, - NgbTypeaheadModule + NgbDatepickerModule, NgbDropdownModule, NgbNavModule, NgbPaginationModule, NgbTimepickerModule, NgbTooltipModule, + NgbTypeaheadModule, } from '@ng-bootstrap/ng-bootstrap'; import { MissingTranslationHandler, TranslateModule } from '@ngx-translate/core'; import { NgxPaginationModule } from 'ngx-pagination'; @@ -177,6 +172,7 @@ import { ScopeSelectorModalComponent } from './search-form/scope-selector-modal/ import { BitstreamRequestACopyPageComponent } from './bitstream-request-a-copy-page/bitstream-request-a-copy-page.component'; import { DsSelectComponent } from './ds-select/ds-select.component'; import { LogInOidcComponent } from './log-in/methods/oidc/log-in-oidc.component'; +import { ThemedItemListPreviewComponent } from './object-list/my-dspace-result-list-element/item-list-preview/themed-item-list-preview.component'; const MODULES = [ // Do NOT include UniversalModule, HttpModule, or JsonpModule here @@ -252,6 +248,7 @@ const COMPONENTS = [ UploaderComponent, FileDropzoneNoUploaderComponent, ItemListPreviewComponent, + ThemedItemListPreviewComponent, MyDSpaceItemStatusComponent, ItemSubmitterComponent, ItemDetailPreviewComponent, diff --git a/src/app/shared/theme-support/themed.component.ts b/src/app/shared/theme-support/themed.component.ts index 2ff0713f46..7ddd76f1d3 100644 --- a/src/app/shared/theme-support/themed.component.ts +++ b/src/app/shared/theme-support/themed.component.ts @@ -46,6 +46,9 @@ export abstract class ThemedComponent implements OnInit, OnDestroy, OnChanges // if an input or output has changed if (this.inAndOutputNames.some((name: any) => hasValue(changes[name]))) { this.connectInputsAndOutputs(); + if (this.compRef?.instance && 'ngOnChanges' in this.compRef?.instance) { + (this.compRef.instance as any).ngOnChanges(changes); + } } } diff --git a/src/app/thumbnail/thumbnail.component.ts b/src/app/thumbnail/thumbnail.component.ts index 3e122cde78..23889648f1 100644 --- a/src/app/thumbnail/thumbnail.component.ts +++ b/src/app/thumbnail/thumbnail.component.ts @@ -12,6 +12,7 @@ import { RemoteData } from '../core/data/remote-data'; selector: 'ds-thumbnail', styleUrls: ['./thumbnail.component.scss'], templateUrl: './thumbnail.component.html', + preserveWhitespaces: false, }) export class ThumbnailComponent implements OnChanges { /** diff --git a/src/assets/i18n/en.json5 b/src/assets/i18n/en.json5 index a6b9d12ae8..538f667986 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", diff --git a/src/styles/_truncatable-part.component.scss b/src/styles/_truncatable-part.component.scss index b938f3a199..d9158a6751 100644 --- a/src/styles/_truncatable-part.component.scss +++ b/src/styles/_truncatable-part.component.scss @@ -19,7 +19,7 @@ min-width: 75px; max-width: 150px; height: $height; - background: linear-gradient(to right, rgba(255, 255, 255, 0), $bg 70%); + background: linear-gradient(to right, rgba(255, 255, 255, 0), rgba($bg, 1) 70%); pointer-events: none; } } @@ -61,6 +61,15 @@ $h4-factor: strip-unit($h4-font-size); .ds-hover .clamp-primary-#{$i} { @include clamp-with-titles($i, darken($primary, 10%)); } + + .clamp-light-#{$i} { + @include clamp-with-titles($i, $light); + } + + :focus .clamp-light-#{$i}, + .ds-hover .clamp-light-#{$i} { + @include clamp-with-titles($i, darken($light, 10%)); + } } .clamp-none { 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..e69de29bb2 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/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 + } + ] }) /** diff --git a/src/themes/custom/theme.module.ts b/src/themes/custom/theme.module.ts index e2e97b9087..dea61daf0a 100644 --- a/src/themes/custom/theme.module.ts +++ b/src/themes/custom/theme.module.ts @@ -84,6 +84,7 @@ import { SearchModule } from '../../app/shared/search/search.module'; import { ResourcePoliciesModule } from '../../app/shared/resource-policies/resource-policies.module'; import { ComcolModule } from '../../app/shared/comcol/comcol.module'; import { FeedbackComponent } from './app/info/feedback/feedback.component'; +import { CommunityListComponent } from './app/community-list-page/community-list/community-list.component'; const DECLARATIONS = [ FileSectionComponent, @@ -126,7 +127,8 @@ const DECLARATIONS = [ NavbarComponent, HeaderNavbarWrapperComponent, BreadcrumbsComponent, - FeedbackComponent + FeedbackComponent, + CommunityListComponent ]; @NgModule({