diff --git a/src/app/my-dspace-page/my-dspace-search.module.ts b/src/app/my-dspace-page/my-dspace-search.module.ts index 71d1343a30..b9f92518a3 100644 --- a/src/app/my-dspace-page/my-dspace-search.module.ts +++ b/src/app/my-dspace-page/my-dspace-search.module.ts @@ -26,6 +26,7 @@ import { ThemedItemListPreviewComponent } from '../shared/object-list/my-dspace- import { JournalEntitiesModule } from '../entity-groups/journal-entities/journal-entities.module'; import { MyDSpaceActionsModule } from '../shared/mydspace-actions/mydspace-actions.module'; import { ClaimedDeclinedTaskSearchResultListElementComponent } from '../shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-declined-task-search-result/claimed-declined-task-search-result-list-element.component'; +import { ThemedItemDetailPreviewFieldComponent } from '../shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview-field/themed-item-detail-preview-field.component'; const ENTRY_COMPONENTS = [ WorkspaceItemSearchResultListElementComponent, @@ -49,6 +50,7 @@ const DECLARATIONS = [ ItemCollectionComponent, ItemDetailPreviewComponent, ItemDetailPreviewFieldComponent, + ThemedItemDetailPreviewFieldComponent, ItemListPreviewComponent, ThemedItemListPreviewComponent, ]; diff --git a/src/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview-field/themed-item-detail-preview-field.component.ts b/src/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview-field/themed-item-detail-preview-field.component.ts new file mode 100644 index 0000000000..b2ebe94b30 --- /dev/null +++ b/src/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview-field/themed-item-detail-preview-field.component.ts @@ -0,0 +1,49 @@ +import { Component, Input } from '@angular/core'; +import { Item } from '../../../../../core/shared/item.model'; +import { SearchResult } from '../../../../search/models/search-result.model'; +import { ThemedComponent } from '../../../../theme-support/themed.component'; +import { ItemDetailPreviewFieldComponent } from './item-detail-preview-field.component'; + +/** + * Themed wrapper for ItemDetailPreviewFieldComponent + */ +@Component({ + selector: 'ds-themed-item-detail-preview-field', + styleUrls: [], + templateUrl: '../../../../theme-support/themed.component.html' +}) +export class ThemedItemDetailPreviewFieldComponent extends ThemedComponent { + + protected inAndOutputNames: (keyof ItemDetailPreviewFieldComponent & keyof this)[] = [ + 'item', + 'object', + 'label', + 'metadata', + 'placeholder', + 'separator', + ]; + + @Input() item: Item; + + @Input() object: SearchResult; + + @Input() label: string; + + @Input() metadata: string | string[]; + + @Input() placeholder: string; + + @Input() separator: string; + + protected getComponentName(): string { + return 'ItemDetailPreviewFieldComponent'; + } + + protected importThemedComponent(themeName: string): Promise { + return import(`../../../../../../themes/${themeName}/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview-field/item-detail-preview-field.component`); + } + + protected importUnthemedComponent(): Promise { + return import('./item-detail-preview-field.component'); + } +} diff --git a/src/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview.component.html b/src/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview.component.html index bd00c9411f..39b46f2ec3 100644 --- a/src/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview.component.html +++ b/src/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview.component.html @@ -22,32 +22,32 @@ - - + + [placeholder]="('mydspace.results.no-authors' | translate)">
- - + + [placeholder]="('mydspace.results.no-uri' | translate)">
diff --git a/src/themes/custom/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview-field/item-detail-preview-field.component.html b/src/themes/custom/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview-field/item-detail-preview-field.component.html new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/themes/custom/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview-field/item-detail-preview-field.component.ts b/src/themes/custom/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview-field/item-detail-preview-field.component.ts new file mode 100644 index 0000000000..adbe8f3e06 --- /dev/null +++ b/src/themes/custom/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview-field/item-detail-preview-field.component.ts @@ -0,0 +1,14 @@ +import { Component } from '@angular/core'; +import { ItemDetailPreviewFieldComponent as BaseComponent } from '../../../../../../../../app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview-field/item-detail-preview-field.component'; + +/** + * This component show values for the given item metadata + */ +@Component({ + selector: 'ds-item-detail-preview-field', + // templateUrl: './item-detail-preview-field.component.html' + templateUrl: '../../../../../../../../app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview-field/item-detail-preview-field.component.html' +}) +export class ItemDetailPreviewFieldComponent extends BaseComponent { + +} diff --git a/src/themes/custom/lazy-theme.module.ts b/src/themes/custom/lazy-theme.module.ts index edb3f5478c..2c7b0f94c9 100644 --- a/src/themes/custom/lazy-theme.module.ts +++ b/src/themes/custom/lazy-theme.module.ts @@ -156,6 +156,9 @@ import { ItemStatusComponent } from './app/item-page/edit-item-page/item-status/ import { EditBitstreamPageComponent } from './app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component'; import { FormModule } from '../../app/shared/form/form.module'; import { RequestCopyModule } from 'src/app/request-copy/request-copy.module'; +import { + ItemDetailPreviewFieldComponent +} from './app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview-field/item-detail-preview-field.component'; const DECLARATIONS = [ FileSectionComponent, @@ -239,6 +242,7 @@ const DECLARATIONS = [ SubmissionSectionUploadFileComponent, ItemStatusComponent, EditBitstreamPageComponent, + ItemDetailPreviewFieldComponent, ]; @NgModule({