From b2e3cf781801a16b8c7508302ac88049afb27789 Mon Sep 17 00:00:00 2001 From: Nona Luypaert Date: Wed, 25 Sep 2024 09:35:20 +0200 Subject: [PATCH] 118639: Theme ItemAccessControlSelectBitstreamsModalComponent --- ...access-control-form-container.component.ts | 4 +-- .../access-control-form.module.ts | 4 ++- ...ntrol-select-bitstreams-modal.component.ts | 35 +++++++++++++++++++ ...rol-select-bitstreams-modal.component.html | 0 ...ntrol-select-bitstreams-modal.component.ts | 10 ++++++ src/themes/custom/lazy-theme.module.ts | 2 ++ 6 files changed, 52 insertions(+), 3 deletions(-) create mode 100644 src/app/shared/access-control-form-container/item-access-control-select-bitstreams-modal/themed-item-access-control-select-bitstreams-modal.component.ts create mode 100644 src/themes/custom/app/shared/access-control-form-container/item-access-control-select-bitstreams-modal/item-access-control-select-bitstreams-modal.component.html create mode 100644 src/themes/custom/app/shared/access-control-form-container/item-access-control-select-bitstreams-modal/item-access-control-select-bitstreams-modal.component.ts diff --git a/src/app/shared/access-control-form-container/access-control-form-container.component.ts b/src/app/shared/access-control-form-container/access-control-form-container.component.ts index 69a598f7ce8..96c30502efa 100644 --- a/src/app/shared/access-control-form-container/access-control-form-container.component.ts +++ b/src/app/shared/access-control-form-container/access-control-form-container.component.ts @@ -10,7 +10,6 @@ import { map, take } from 'rxjs/operators'; import { DSpaceObject } from '../../core/shared/dspace-object.model'; import { ITEM_ACCESS_CONTROL_SELECT_BITSTREAMS_LIST_ID, - ItemAccessControlSelectBitstreamsModalComponent } from './item-access-control-select-bitstreams-modal/item-access-control-select-bitstreams-modal.component'; import { BulkAccessConfigDataService } from '../../core/config/bulk-access-config-data.service'; import { getFirstCompletedRemoteData } from '../../core/shared/operators'; @@ -19,6 +18,7 @@ import { AlertType } from '../alert/aletr-type'; import { createAccessControlInitialFormState } from './access-control-form-container-intial-state'; +import { ThemedItemAccessControlSelectBitstreamsModalComponent } from './item-access-control-select-bitstreams-modal/themed-item-access-control-select-bitstreams-modal.component'; @Component({ selector: 'ds-access-control-form-container', @@ -139,7 +139,7 @@ export class AccessControlFormContainerComponent impleme * @param item The item for which to change the access control */ openSelectBitstreamsModal(item: Item) { - const ref = this.modalService.open(ItemAccessControlSelectBitstreamsModalComponent); + const ref = this.modalService.open(ThemedItemAccessControlSelectBitstreamsModalComponent); ref.componentInstance.selectedBitstreams = this.state.bitstream.selectedBitstreams; ref.componentInstance.item = item; diff --git a/src/app/shared/access-control-form-container/access-control-form.module.ts b/src/app/shared/access-control-form-container/access-control-form.module.ts index 3bbdb3ab5d7..d6e03759039 100644 --- a/src/app/shared/access-control-form-container/access-control-form.module.ts +++ b/src/app/shared/access-control-form-container/access-control-form.module.ts @@ -12,6 +12,7 @@ import { import {AccessControlFormContainerComponent} from './access-control-form-container.component'; import {NgbDatepickerModule} from '@ng-bootstrap/ng-bootstrap'; import {ToDatePipe} from './access-control-array-form/to-date.pipe'; +import { ThemedItemAccessControlSelectBitstreamsModalComponent } from './item-access-control-select-bitstreams-modal/themed-item-access-control-select-bitstreams-modal.component'; @NgModule({ imports: [ @@ -25,7 +26,8 @@ import {ToDatePipe} from './access-control-array-form/to-date.pipe'; AccessControlFormContainerComponent, AccessControlArrayFormComponent, ItemAccessControlSelectBitstreamsModalComponent, - ToDatePipe + ThemedItemAccessControlSelectBitstreamsModalComponent, + ToDatePipe, ], exports: [ AccessControlFormContainerComponent, AccessControlArrayFormComponent ], }) diff --git a/src/app/shared/access-control-form-container/item-access-control-select-bitstreams-modal/themed-item-access-control-select-bitstreams-modal.component.ts b/src/app/shared/access-control-form-container/item-access-control-select-bitstreams-modal/themed-item-access-control-select-bitstreams-modal.component.ts new file mode 100644 index 00000000000..cea9a0c9171 --- /dev/null +++ b/src/app/shared/access-control-form-container/item-access-control-select-bitstreams-modal/themed-item-access-control-select-bitstreams-modal.component.ts @@ -0,0 +1,35 @@ +import { Component, Input } from '@angular/core'; +import { ThemedComponent } from '../../theme-support/themed.component'; +import { ItemAccessControlSelectBitstreamsModalComponent } from './item-access-control-select-bitstreams-modal.component'; +import { Item } from '../../../core/shared/item.model'; + +/** + * Themed wrapper for {@link ItemAccessControlSelectBitstreamsModalComponent} + */ +@Component({ + selector: 'ds-themed-item-access-control-select-bitstreams-modal', + templateUrl: '../../theme-support/themed.component.html', +}) +export class ThemedItemAccessControlSelectBitstreamsModalComponent extends ThemedComponent { + + @Input() item: Item; + + @Input() selectedBitstreams: string[]; + + protected inAndOutputNames: (keyof ItemAccessControlSelectBitstreamsModalComponent & keyof this)[] = [ + 'item', + 'selectedBitstreams' + ]; + + protected getComponentName(): string { + return 'ItemAccessControlSelectBitstreamsModalComponent'; + } + + protected importThemedComponent(themeName: string): Promise { + return import(`../../../../themes/${themeName}/app/shared/access-control-form-container/item-access-control-select-bitstreams-modal/item-access-control-select-bitstreams-modal.component`); + } + + protected importUnthemedComponent(): Promise { + return import('./item-access-control-select-bitstreams-modal.component'); + } +} diff --git a/src/themes/custom/app/shared/access-control-form-container/item-access-control-select-bitstreams-modal/item-access-control-select-bitstreams-modal.component.html b/src/themes/custom/app/shared/access-control-form-container/item-access-control-select-bitstreams-modal/item-access-control-select-bitstreams-modal.component.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/themes/custom/app/shared/access-control-form-container/item-access-control-select-bitstreams-modal/item-access-control-select-bitstreams-modal.component.ts b/src/themes/custom/app/shared/access-control-form-container/item-access-control-select-bitstreams-modal/item-access-control-select-bitstreams-modal.component.ts new file mode 100644 index 00000000000..62e1f304fb9 --- /dev/null +++ b/src/themes/custom/app/shared/access-control-form-container/item-access-control-select-bitstreams-modal/item-access-control-select-bitstreams-modal.component.ts @@ -0,0 +1,10 @@ +import { Component } from '@angular/core'; +import { ItemAccessControlSelectBitstreamsModalComponent as BaseComponent } from '../../../../../../app/shared/access-control-form-container/item-access-control-select-bitstreams-modal/item-access-control-select-bitstreams-modal.component'; + +@Component({ + selector: 'ds-item-access-control-select-bitstreams-modal', + // templateUrl: './item-access-control-select-bitstreams-modal.component.html', + templateUrl: '../../../../app/shared/access-control-form-container/item-access-control-select-bitstreams-modal/item-access-control-select-bitstreams-modal.component.html', +}) +export class ItemAccessControlSelectBitstreamsModalComponent extends BaseComponent { +} diff --git a/src/themes/custom/lazy-theme.module.ts b/src/themes/custom/lazy-theme.module.ts index edb3f5478c9..69e6a0b290c 100644 --- a/src/themes/custom/lazy-theme.module.ts +++ b/src/themes/custom/lazy-theme.module.ts @@ -156,6 +156,7 @@ 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 { ItemAccessControlSelectBitstreamsModalComponent } from './app/shared/access-control-form-container/item-access-control-select-bitstreams-modal/item-access-control-select-bitstreams-modal.component'; const DECLARATIONS = [ FileSectionComponent, @@ -239,6 +240,7 @@ const DECLARATIONS = [ SubmissionSectionUploadFileComponent, ItemStatusComponent, EditBitstreamPageComponent, + ItemAccessControlSelectBitstreamsModalComponent, ]; @NgModule({