From c3d71cbdd615ff707482852fd3d76f688950e1f1 Mon Sep 17 00:00:00 2001 From: Kristof De Langhe Date: Wed, 11 Jan 2023 14:18:20 +0100 Subject: [PATCH 1/3] 98422: Themed ItemStatusComponent and EditBitstreamPageComponent --- .../bitstream-page-routing.module.ts | 4 ++-- .../bitstream-page/bitstream-page.module.ts | 4 +++- .../themed-edit-bitstream-page.component.ts | 22 ++++++++++++++++++ .../edit-item-page/edit-item-page.module.ts | 2 ++ .../edit-item-page.routing.module.ts | 4 ++-- .../themed-item-status.component.ts | 23 +++++++++++++++++++ .../edit-bitstream-page.component.html | 0 .../edit-bitstream-page.component.scss | 0 .../edit-bitstream-page.component.ts | 13 +++++++++++ .../item-status/item-status.component.html | 0 .../item-status/item-status.component.ts | 16 +++++++++++++ src/themes/custom/theme.module.ts | 6 ++++- 12 files changed, 88 insertions(+), 6 deletions(-) create mode 100644 src/app/bitstream-page/edit-bitstream-page/themed-edit-bitstream-page.component.ts create mode 100644 src/app/item-page/edit-item-page/item-status/themed-item-status.component.ts create mode 100644 src/themes/custom/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.html create mode 100644 src/themes/custom/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.scss create mode 100644 src/themes/custom/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.ts create mode 100644 src/themes/custom/app/item-page/edit-item-page/item-status/item-status.component.html create mode 100644 src/themes/custom/app/item-page/edit-item-page/item-status/item-status.component.ts diff --git a/src/app/bitstream-page/bitstream-page-routing.module.ts b/src/app/bitstream-page/bitstream-page-routing.module.ts index 27b9db9a05..bab5e91467 100644 --- a/src/app/bitstream-page/bitstream-page-routing.module.ts +++ b/src/app/bitstream-page/bitstream-page-routing.module.ts @@ -1,6 +1,5 @@ import { NgModule } from '@angular/core'; import { RouterModule } from '@angular/router'; -import { EditBitstreamPageComponent } from './edit-bitstream-page/edit-bitstream-page.component'; import { AuthenticatedGuard } from '../core/auth/authenticated.guard'; import { BitstreamPageResolver } from './bitstream-page.resolver'; import { BitstreamDownloadPageComponent } from '../shared/bitstream-download-page/bitstream-download-page.component'; @@ -10,6 +9,7 @@ import { ResourcePolicyResolver } from '../shared/resource-policies/resolvers/re import { ResourcePolicyEditComponent } from '../shared/resource-policies/edit/resource-policy-edit.component'; import { BitstreamAuthorizationsComponent } from './bitstream-authorizations/bitstream-authorizations.component'; import { LegacyBitstreamUrlResolver } from './legacy-bitstream-url.resolver'; +import { ThemedEditBitstreamPageComponent } from './edit-bitstream-page/themed-edit-bitstream-page.component'; const EDIT_BITSTREAM_PATH = ':id/edit'; const EDIT_BITSTREAM_AUTHORIZATIONS_PATH = ':id/authorizations'; @@ -46,7 +46,7 @@ const EDIT_BITSTREAM_AUTHORIZATIONS_PATH = ':id/authorizations'; }, { path: EDIT_BITSTREAM_PATH, - component: EditBitstreamPageComponent, + component: ThemedEditBitstreamPageComponent, resolve: { bitstream: BitstreamPageResolver }, diff --git a/src/app/bitstream-page/bitstream-page.module.ts b/src/app/bitstream-page/bitstream-page.module.ts index d168a06db2..ea8ed510e1 100644 --- a/src/app/bitstream-page/bitstream-page.module.ts +++ b/src/app/bitstream-page/bitstream-page.module.ts @@ -6,6 +6,7 @@ import { BitstreamPageRoutingModule } from './bitstream-page-routing.module'; import { BitstreamAuthorizationsComponent } from './bitstream-authorizations/bitstream-authorizations.component'; import { FormModule } from '../shared/form/form.module'; import { ResourcePoliciesModule } from '../shared/resource-policies/resource-policies.module'; +import { ThemedEditBitstreamPageComponent } from './edit-bitstream-page/themed-edit-bitstream-page.component'; /** * This module handles all components that are necessary for Bitstream related pages @@ -20,7 +21,8 @@ import { ResourcePoliciesModule } from '../shared/resource-policies/resource-pol ], declarations: [ BitstreamAuthorizationsComponent, - EditBitstreamPageComponent + EditBitstreamPageComponent, + ThemedEditBitstreamPageComponent, ] }) export class BitstreamPageModule { diff --git a/src/app/bitstream-page/edit-bitstream-page/themed-edit-bitstream-page.component.ts b/src/app/bitstream-page/edit-bitstream-page/themed-edit-bitstream-page.component.ts new file mode 100644 index 0000000000..dcca28a495 --- /dev/null +++ b/src/app/bitstream-page/edit-bitstream-page/themed-edit-bitstream-page.component.ts @@ -0,0 +1,22 @@ +import { Component } from '@angular/core'; +import { EditBitstreamPageComponent } from './edit-bitstream-page.component'; +import { ThemedComponent } from '../../shared/theme-support/themed.component'; + +@Component({ + selector: 'ds-themed-edit-bitstream-page', + styleUrls: [], + templateUrl: '../../shared/theme-support/themed.component.html', +}) +export class ThemedEditBitstreamPageComponent extends ThemedComponent { + protected getComponentName(): string { + return 'EditBitstreamPageComponent'; + } + + protected importThemedComponent(themeName: string): Promise { + return import(`../../../themes/${themeName}/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component`); + } + + protected importUnthemedComponent(): Promise { + return import('./edit-bitstream-page.component'); + } +} diff --git a/src/app/item-page/edit-item-page/edit-item-page.module.ts b/src/app/item-page/edit-item-page/edit-item-page.module.ts index 97901bd7c8..e033919dba 100644 --- a/src/app/item-page/edit-item-page/edit-item-page.module.ts +++ b/src/app/item-page/edit-item-page/edit-item-page.module.ts @@ -35,6 +35,7 @@ import { ItemVersionHistoryComponent } from './item-version-history/item-version import { ItemAuthorizationsComponent } from './item-authorizations/item-authorizations.component'; import { ObjectValuesPipe } from '../../shared/utils/object-values-pipe'; import { ResourcePoliciesModule } from '../../shared/resource-policies/resource-policies.module'; +import { ThemedItemStatusComponent } from './item-status/themed-item-status.component'; /** @@ -61,6 +62,7 @@ import { ResourcePoliciesModule } from '../../shared/resource-policies/resource- ItemPublicComponent, ItemDeleteComponent, ItemStatusComponent, + ThemedItemStatusComponent, ItemMetadataComponent, ItemRelationshipsComponent, ItemBitstreamsComponent, diff --git a/src/app/item-page/edit-item-page/edit-item-page.routing.module.ts b/src/app/item-page/edit-item-page/edit-item-page.routing.module.ts index 2535e42216..6deffe47a8 100644 --- a/src/app/item-page/edit-item-page/edit-item-page.routing.module.ts +++ b/src/app/item-page/edit-item-page/edit-item-page.routing.module.ts @@ -6,7 +6,6 @@ import { ItemReinstateComponent } from './item-reinstate/item-reinstate.componen import { ItemPrivateComponent } from './item-private/item-private.component'; import { ItemPublicComponent } from './item-public/item-public.component'; import { ItemDeleteComponent } from './item-delete/item-delete.component'; -import { ItemStatusComponent } from './item-status/item-status.component'; import { ItemMetadataComponent } from './item-metadata/item-metadata.component'; import { ItemBitstreamsComponent } from './item-bitstreams/item-bitstreams.component'; import { ItemCollectionMapperComponent } from './item-collection-mapper/item-collection-mapper.component'; @@ -38,6 +37,7 @@ import { ItemPageBitstreamsGuard } from './item-page-bitstreams.guard'; import { ItemPageRelationshipsGuard } from './item-page-relationships.guard'; import { ItemPageVersionHistoryGuard } from './item-page-version-history.guard'; import { ItemPageCollectionMapperGuard } from './item-page-collection-mapper.guard'; +import { ThemedItemPageComponent } from '../simple/themed-item-page.component'; /** * Routing module that handles the routing for the Edit Item page administrator functionality @@ -63,7 +63,7 @@ import { ItemPageCollectionMapperGuard } from './item-page-collection-mapper.gua }, { path: 'status', - component: ItemStatusComponent, + component: ThemedItemPageComponent, data: { title: 'item.edit.tabs.status.title', showBreadcrumbs: true }, canActivate: [ItemPageStatusGuard] }, diff --git a/src/app/item-page/edit-item-page/item-status/themed-item-status.component.ts b/src/app/item-page/edit-item-page/item-status/themed-item-status.component.ts new file mode 100644 index 0000000000..eac5a53702 --- /dev/null +++ b/src/app/item-page/edit-item-page/item-status/themed-item-status.component.ts @@ -0,0 +1,23 @@ +import { Component } from '@angular/core'; +import { ThemedComponent } from '../../../shared/theme-support/themed.component'; +import { ItemStatusComponent } from './item-status.component'; + +@Component({ + selector: 'ds-themed-item-status', + styleUrls: [], + templateUrl: '../../../shared/theme-support/themed.component.html', +}) +export class ThemedItemStatusComponent extends ThemedComponent { + protected getComponentName(): string { + return 'ItemStatusComponent'; + } + + protected importThemedComponent(themeName: string): Promise { + return import(`../../../../themes/${themeName}/app/item-page/edit-item-page/item-status/item-status.component`); + } + + protected importUnthemedComponent(): Promise { + return import('./item-status.component'); + } + +} diff --git a/src/themes/custom/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.html b/src/themes/custom/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.html new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/themes/custom/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.scss b/src/themes/custom/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.scss new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/themes/custom/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.ts b/src/themes/custom/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.ts new file mode 100644 index 0000000000..f8ca14addb --- /dev/null +++ b/src/themes/custom/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.ts @@ -0,0 +1,13 @@ +import { EditBitstreamPageComponent as BaseComponent } from '../../../../../app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component'; +import { ChangeDetectionStrategy, Component } from '@angular/core'; + +@Component({ + selector: 'ds-edit-bitstream-page', + // styleUrls: ['./edit-bitstream-page.component.scss'], + styleUrls: ['../../../../../app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.scss'], + // templateUrl: './edit-bitstream-page.component.html', + templateUrl: '../../../../../app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.html', + changeDetection: ChangeDetectionStrategy.OnPush +}) +export class EditBitstreamPageComponent extends BaseComponent { +} diff --git a/src/themes/custom/app/item-page/edit-item-page/item-status/item-status.component.html b/src/themes/custom/app/item-page/edit-item-page/item-status/item-status.component.html new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/themes/custom/app/item-page/edit-item-page/item-status/item-status.component.ts b/src/themes/custom/app/item-page/edit-item-page/item-status/item-status.component.ts new file mode 100644 index 0000000000..95acec2275 --- /dev/null +++ b/src/themes/custom/app/item-page/edit-item-page/item-status/item-status.component.ts @@ -0,0 +1,16 @@ +import { ChangeDetectionStrategy, Component } from '@angular/core'; +import { fadeIn, fadeInOut } from '../../../../../../app/shared/animations/fade'; +import { ItemStatusComponent as BaseComponent } from '../../../../../../app/item-page/edit-item-page/item-status/item-status.component'; + +@Component({ + selector: 'ds-item-status', + // templateUrl: './item-status.component.html', + templateUrl: '../../../../../../app/item-page/edit-item-page/item-status/item-status.component.html', + changeDetection: ChangeDetectionStrategy.Default, + animations: [ + fadeIn, + fadeInOut + ] +}) +export class ItemStatusComponent extends BaseComponent { +} diff --git a/src/themes/custom/theme.module.ts b/src/themes/custom/theme.module.ts index e2e97b9087..ab69e86a8e 100644 --- a/src/themes/custom/theme.module.ts +++ b/src/themes/custom/theme.module.ts @@ -84,6 +84,8 @@ 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 { ItemStatusComponent } from './app/item-page/edit-item-page/item-status/item-status.component'; +import { EditBitstreamPageComponent } from './app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component'; const DECLARATIONS = [ FileSectionComponent, @@ -126,7 +128,9 @@ const DECLARATIONS = [ NavbarComponent, HeaderNavbarWrapperComponent, BreadcrumbsComponent, - FeedbackComponent + FeedbackComponent, + ItemStatusComponent, + EditBitstreamPageComponent, ]; @NgModule({ From de7fcb30da5711b73bd9d88c37923de913aacdc6 Mon Sep 17 00:00:00 2001 From: Kristof De Langhe Date: Wed, 11 Jan 2023 14:49:21 +0100 Subject: [PATCH 2/3] 98422: Themed component import fixes --- src/app/item-page/edit-item-page/edit-item-page.module.ts | 3 ++- .../item-page/edit-item-page/edit-item-page.routing.module.ts | 3 ++- src/themes/custom/theme.module.ts | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/app/item-page/edit-item-page/edit-item-page.module.ts b/src/app/item-page/edit-item-page/edit-item-page.module.ts index e033919dba..8ef9c9f82f 100644 --- a/src/app/item-page/edit-item-page/edit-item-page.module.ts +++ b/src/app/item-page/edit-item-page/edit-item-page.module.ts @@ -85,7 +85,8 @@ import { ThemedItemStatusComponent } from './item-status/themed-item-status.comp ObjectValuesPipe ], exports: [ - ItemMetadataComponent + ItemMetadataComponent, + ItemOperationComponent, ] }) export class EditItemPageModule { diff --git a/src/app/item-page/edit-item-page/edit-item-page.routing.module.ts b/src/app/item-page/edit-item-page/edit-item-page.routing.module.ts index 6deffe47a8..0221043d55 100644 --- a/src/app/item-page/edit-item-page/edit-item-page.routing.module.ts +++ b/src/app/item-page/edit-item-page/edit-item-page.routing.module.ts @@ -38,6 +38,7 @@ import { ItemPageRelationshipsGuard } from './item-page-relationships.guard'; import { ItemPageVersionHistoryGuard } from './item-page-version-history.guard'; import { ItemPageCollectionMapperGuard } from './item-page-collection-mapper.guard'; import { ThemedItemPageComponent } from '../simple/themed-item-page.component'; +import { ThemedItemStatusComponent } from './item-status/themed-item-status.component'; /** * Routing module that handles the routing for the Edit Item page administrator functionality @@ -63,7 +64,7 @@ import { ThemedItemPageComponent } from '../simple/themed-item-page.component'; }, { path: 'status', - component: ThemedItemPageComponent, + component: ThemedItemStatusComponent, data: { title: 'item.edit.tabs.status.title', showBreadcrumbs: true }, canActivate: [ItemPageStatusGuard] }, diff --git a/src/themes/custom/theme.module.ts b/src/themes/custom/theme.module.ts index ab69e86a8e..964909b3c1 100644 --- a/src/themes/custom/theme.module.ts +++ b/src/themes/custom/theme.module.ts @@ -86,6 +86,7 @@ import { ComcolModule } from '../../app/shared/comcol/comcol.module'; import { FeedbackComponent } from './app/info/feedback/feedback.component'; import { ItemStatusComponent } from './app/item-page/edit-item-page/item-status/item-status.component'; import { EditBitstreamPageComponent } from './app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component'; +import { FormModule } from '../../app/shared/form/form.module'; const DECLARATIONS = [ FileSectionComponent, @@ -180,7 +181,8 @@ const DECLARATIONS = [ SearchModule, FormsModule, ResourcePoliciesModule, - ComcolModule + ComcolModule, + FormModule, ], declarations: DECLARATIONS }) From 4ba64fdfcc5b2a7ac6c291b712f14b3623d104d8 Mon Sep 17 00:00:00 2001 From: Kristof De Langhe Date: Wed, 11 Jan 2023 14:55:16 +0100 Subject: [PATCH 3/3] 98422: Remove unused import --- .../item-page/edit-item-page/edit-item-page.routing.module.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/app/item-page/edit-item-page/edit-item-page.routing.module.ts b/src/app/item-page/edit-item-page/edit-item-page.routing.module.ts index 0221043d55..bc8b614643 100644 --- a/src/app/item-page/edit-item-page/edit-item-page.routing.module.ts +++ b/src/app/item-page/edit-item-page/edit-item-page.routing.module.ts @@ -37,7 +37,6 @@ import { ItemPageBitstreamsGuard } from './item-page-bitstreams.guard'; import { ItemPageRelationshipsGuard } from './item-page-relationships.guard'; import { ItemPageVersionHistoryGuard } from './item-page-version-history.guard'; import { ItemPageCollectionMapperGuard } from './item-page-collection-mapper.guard'; -import { ThemedItemPageComponent } from '../simple/themed-item-page.component'; import { ThemedItemStatusComponent } from './item-status/themed-item-status.component'; /**