From 2451bbbd34bb0044056567411cc8ff386012e8be Mon Sep 17 00:00:00 2001 From: Alexandre Vryghem Date: Wed, 21 Dec 2022 13:35:54 +0100 Subject: [PATCH] 97729: Themed ItemAlertsComponent --- .../full/full-item-page.component.html | 2 +- .../item-page/simple/item-page.component.html | 2 +- .../themed-item-alerts.component.ts | 30 +++++++++++++++++++ src/app/shared/shared.module.ts | 2 ++ .../item-alerts/item-alerts.component.html | 0 .../item-alerts/item-alerts.component.scss | 0 .../item/item-alerts/item-alerts.component.ts | 12 ++++++++ src/themes/custom/lazy-theme.module.ts | 4 +-- 8 files changed, 48 insertions(+), 4 deletions(-) create mode 100644 src/app/shared/item/item-alerts/themed-item-alerts.component.ts create mode 100644 src/themes/custom/app/shared/item/item-alerts/item-alerts.component.html create mode 100644 src/themes/custom/app/shared/item/item-alerts/item-alerts.component.scss create mode 100644 src/themes/custom/app/shared/item/item-alerts/item-alerts.component.ts diff --git a/src/app/item-page/full/full-item-page.component.html b/src/app/item-page/full/full-item-page.component.html index ee4ead2835..9fbfa08cfd 100644 --- a/src/app/item-page/full/full-item-page.component.html +++ b/src/app/item-page/full/full-item-page.component.html @@ -1,7 +1,7 @@
- +
diff --git a/src/app/item-page/simple/item-page.component.html b/src/app/item-page/simple/item-page.component.html index 0fc423c195..cc9983bb35 100644 --- a/src/app/item-page/simple/item-page.component.html +++ b/src/app/item-page/simple/item-page.component.html @@ -1,7 +1,7 @@
- + diff --git a/src/app/shared/item/item-alerts/themed-item-alerts.component.ts b/src/app/shared/item/item-alerts/themed-item-alerts.component.ts new file mode 100644 index 0000000000..a650699984 --- /dev/null +++ b/src/app/shared/item/item-alerts/themed-item-alerts.component.ts @@ -0,0 +1,30 @@ +import { Component, Input } from '@angular/core'; +import { Item } from '../../../core/shared/item.model'; +import { ItemAlertsComponent } from './item-alerts.component'; +import { ThemedComponent } from '../../theme-support/themed.component'; + +/** + * Themed wrapper for {@link ItemAlertsComponent} + */ +@Component({ + selector: 'ds-themed-item-alerts', + styleUrls: [], + templateUrl: '../../theme-support/themed.component.html', +}) +export class ThemedItemAlertsComponent extends ThemedComponent { + protected inAndOutputNames: (keyof ItemAlertsComponent & keyof this)[] = ['item']; + + @Input() item: Item; + + protected getComponentName(): string { + return 'ItemAlertsComponent'; + } + + protected importThemedComponent(themeName: string): Promise { + return import(`../../../../themes/${themeName}/app/shared/item/item-alerts/item-alerts.component`); + } + + protected importUnthemedComponent(): Promise { + return import('./item-alerts.component'); + } +} diff --git a/src/app/shared/shared.module.ts b/src/app/shared/shared.module.ts index 45e9764151..342077eb05 100644 --- a/src/app/shared/shared.module.ts +++ b/src/app/shared/shared.module.ts @@ -324,6 +324,7 @@ import { } from '../item-page/simple/field-components/specific-field/title/item-page-title-field.component'; import { MarkdownPipe } from './utils/markdown.pipe'; import { GoogleRecaptchaModule } from '../core/google-recaptcha/google-recaptcha.module'; +import { ThemedItemAlertsComponent } from './item/item-alerts/themed-item-alerts.component'; const MODULES = [ CommonModule, @@ -587,6 +588,7 @@ const SHARED_ITEM_PAGE_COMPONENTS = [ DsoPageVersionButtonComponent, PersonPageClaimButtonComponent, ItemAlertsComponent, + ThemedItemAlertsComponent, GenericItemPageFieldComponent, MetadataRepresentationListComponent, RelatedItemsComponent, diff --git a/src/themes/custom/app/shared/item/item-alerts/item-alerts.component.html b/src/themes/custom/app/shared/item/item-alerts/item-alerts.component.html new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/themes/custom/app/shared/item/item-alerts/item-alerts.component.scss b/src/themes/custom/app/shared/item/item-alerts/item-alerts.component.scss new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/themes/custom/app/shared/item/item-alerts/item-alerts.component.ts b/src/themes/custom/app/shared/item/item-alerts/item-alerts.component.ts new file mode 100644 index 0000000000..3b63a1e69d --- /dev/null +++ b/src/themes/custom/app/shared/item/item-alerts/item-alerts.component.ts @@ -0,0 +1,12 @@ +import { Component } from '@angular/core'; +import { ItemAlertsComponent as BaseComponent } from '../../../../../../app/shared/item/item-alerts/item-alerts.component'; + +@Component({ + selector: 'ds-item-alerts', + // templateUrl: './item-alerts.component.html', + templateUrl: '../../../../../../app/shared/item/item-alerts/item-alerts.component.html', + // styleUrls: ['./item-alerts.component.scss'], + styleUrls: ['../../../../../../app/shared/item/item-alerts/item-alerts.component.scss'], +}) +export class ItemAlertsComponent extends BaseComponent { +} diff --git a/src/themes/custom/lazy-theme.module.ts b/src/themes/custom/lazy-theme.module.ts index d2ac0ae787..3a76150621 100644 --- a/src/themes/custom/lazy-theme.module.ts +++ b/src/themes/custom/lazy-theme.module.ts @@ -114,6 +114,7 @@ import { ObjectListComponent } from './app/shared/object-list/object-list.compon import { BrowseByMetadataPageComponent } from './app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component'; import { BrowseByDatePageComponent } from './app/browse-by/browse-by-date-page/browse-by-date-page.component'; import { BrowseByTitlePageComponent } from './app/browse-by/browse-by-title-page/browse-by-title-page.component'; +import { ItemAlertsComponent } from './app/shared/item/item-alerts/item-alerts.component'; const DECLARATIONS = [ FileSectionComponent, @@ -168,8 +169,7 @@ const DECLARATIONS = [ BrowseByMetadataPageComponent, BrowseByDatePageComponent, BrowseByTitlePageComponent, - - + ItemAlertsComponent, ]; @NgModule({