Skip to content

Commit

Permalink
Make ItemSearchResultListElementComponent themeable.
Browse files Browse the repository at this point in the history
  • Loading branch information
mwoodiupui committed Feb 21, 2024
1 parent 32bac12 commit ad8e57a
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<ds-item-search-result-list-element [showLabel]="showLabel" [object]="{ indexableObject: object, hitHighlights: {} }" [linkType]="linkType"></ds-item-search-result-list-element>
<ds-themed-item-search-result-list-element [showLabel]="showLabel" [object]="{ indexableObject: object, hitHighlights: {} }" [linkType]="linkType"></ds-themed-item-search-result-list-element>
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { Component, Input } from '@angular/core';
import { CollectionElementLinkType } from 'src/app/shared/object-collection/collection-element-link.type';
import { ThemedComponent } from 'src/app/shared/theme-support/themed.component';
import { ItemSearchResultListElementComponent } from './item-search-result-list-element.component';

/*
* Themed wrapper for ItemSearchResultListElementComponent
*/

@Component({
selector: 'ds-themed-item-search-result-list-element',
styleUrls: [],
templateUrl: '../../../../../../../app/shared/theme-support/themed.component.html',
})
export class ThemedItemSearchResultListElementComponent
extends ThemedComponent<ItemSearchResultListElementComponent> {
@Input() showLabel: boolean;
@Input() object: any;
@Input() linkType: CollectionElementLinkType;
protected inAndOutputNames: (keyof ItemSearchResultListElementComponent & keyof this)[] = [
'showLabel',
'object',
'linkType',
];

protected getComponentName(): string {
return 'ItemSearchResultListElementComponent';
}

protected importThemedComponent(themeName: string): Promise<any> {
return import(`../../../../../../../themes/${themeName}/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component`);
}

protected importUnthemedComponent(): Promise<any> {
return import('./item-search-result-list-element.component');
}
}
4 changes: 4 additions & 0 deletions src/app/shared/shared.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,9 @@ import {
import {
ItemSearchResultListElementComponent
} from './object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component';
import {
ThemedItemSearchResultListElementComponent
} from './object-list/search-result-list-element/item-search-result/item-types/item/themed-item-search-result-list-element.component';
import {
ItemMetadataRepresentationListElementComponent
} from './object-list/metadata-representation-list-element/item/item-metadata-representation-list-element.component';
Expand Down Expand Up @@ -422,6 +425,7 @@ const ENTRY_COMPONENTS = [
ItemGridElementComponent,
BitstreamListItemComponent,
ItemSearchResultListElementComponent,
ThemedItemSearchResultListElementComponent,
ItemSearchResultGridElementComponent,
BrowseEntryListElementComponent,
SearchResultDetailElementComponent,
Expand Down

0 comments on commit ad8e57a

Please sign in to comment.