Skip to content

Commit

Permalink
118639: Theme ItemAccessControlSelectBitstreamsModalComponent
Browse files Browse the repository at this point in the history
  • Loading branch information
nona-luypaert committed Sep 25, 2024
1 parent 404ccd9 commit b2e3cf7
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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',
Expand Down Expand Up @@ -139,7 +139,7 @@ export class AccessControlFormContainerComponent<T extends DSpaceObject> 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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand All @@ -25,7 +26,8 @@ import {ToDatePipe} from './access-control-array-form/to-date.pipe';
AccessControlFormContainerComponent,
AccessControlArrayFormComponent,
ItemAccessControlSelectBitstreamsModalComponent,
ToDatePipe
ThemedItemAccessControlSelectBitstreamsModalComponent,
ToDatePipe,
],
exports: [ AccessControlFormContainerComponent, AccessControlArrayFormComponent ],
})
Expand Down
Original file line number Diff line number Diff line change
@@ -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<ItemAccessControlSelectBitstreamsModalComponent> {

@Input() item: Item;

@Input() selectedBitstreams: string[];

protected inAndOutputNames: (keyof ItemAccessControlSelectBitstreamsModalComponent & keyof this)[] = [
'item',
'selectedBitstreams'
];

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

protected importThemedComponent(themeName: string): Promise<any> {
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<any> {
return import('./item-access-control-select-bitstreams-modal.component');
}
}
Original file line number Diff line number Diff line change
@@ -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 {
}
2 changes: 2 additions & 0 deletions src/themes/custom/lazy-theme.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -239,6 +240,7 @@ const DECLARATIONS = [
SubmissionSectionUploadFileComponent,
ItemStatusComponent,
EditBitstreamPageComponent,
ItemAccessControlSelectBitstreamsModalComponent,
];

@NgModule({
Expand Down

0 comments on commit b2e3cf7

Please sign in to comment.