Skip to content

Commit

Permalink
Themed ItemVersionsNoticeComponent
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandrevryghem committed Nov 14, 2023
1 parent 404ccd9 commit bb16b44
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/app/item-page/full/full-item-page.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="item-page" *ngIf="itemRD?.hasSucceeded" @fadeInOut>
<div *ngIf="itemRD?.payload as item">
<ds-themed-item-alerts [item]="item"></ds-themed-item-alerts>
<ds-item-versions-notice [item]="item"></ds-item-versions-notice>
<ds-themed-item-versions-notice [item]="item"></ds-themed-item-versions-notice>
<ds-view-tracker [object]="item"></ds-view-tracker>
<div *ngIf="!item.isWithdrawn || (isAdmin$|async)" class="full-item-info">
<div class="d-flex flex-row">
Expand Down
2 changes: 1 addition & 1 deletion src/app/item-page/simple/item-page.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="item-page" *ngIf="itemRD?.hasSucceeded" @fadeInOut>
<div *ngIf="itemRD?.payload as item">
<ds-themed-item-alerts [item]="item"></ds-themed-item-alerts>
<ds-item-versions-notice [item]="item"></ds-item-versions-notice>
<ds-themed-item-versions-notice [item]="item"></ds-themed-item-versions-notice>
<ds-view-tracker [object]="item"></ds-view-tracker>
<ds-listable-object-component-loader *ngIf="!item.isWithdrawn || (isAdmin$|async)" [object]="item" [viewMode]="viewMode"></ds-listable-object-component-loader>
<ds-item-versions class="mt-2" [item]="item" [displayActions]="false"></ds-item-versions>
Expand Down
2 changes: 2 additions & 0 deletions src/app/item-page/versions/item-versions.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ import { NgModule } from '@angular/core';
import { SharedModule } from '../../shared/shared.module';
import { ItemVersionsComponent } from './item-versions.component';
import { ItemVersionsNoticeComponent } from './notice/item-versions-notice.component';
import { ThemedItemVersionsNoticeComponent } from './notice/themed-item-versions-notice.component';

const DECLARATIONS = [
ItemVersionsComponent,
ItemVersionsNoticeComponent,
ThemedItemVersionsNoticeComponent,
];

@NgModule({
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { Component, Input } from '@angular/core';
import { Item } from '../../../core/shared/item.model';
import { ThemedComponent } from '../../../shared/theme-support/themed.component';
import { ItemVersionsNoticeComponent } from './item-versions-notice.component';

/**
* Themed wrapper for {@link ItemVersionsNoticeComponent}
*/
@Component({
selector: 'ds-themed-item-versions-notice',
styleUrls: [],
templateUrl: '../../../shared/theme-support/themed.component.html',
})
export class ThemedItemVersionsNoticeComponent extends ThemedComponent<ItemVersionsNoticeComponent> {

@Input() item: Item;

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

protected importThemedComponent(themeName: string): Promise<any> {
return import(`../../../../themes/${themeName}/app/item-page/versions/notice/item-versions-notice.component`);
}

protected importUnthemedComponent(): Promise<any> {
return import('./item-versions-notice.component');
}

}
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Component } from '@angular/core';
import { ItemVersionsNoticeComponent as BaseComponent } from '../../../../../../app/item-page/versions/notice/item-versions-notice.component';

@Component({
selector: 'ds-item-versions-notice',
// templateUrl: './item-versions-notice.component.html',
templateUrl: '../../../../../../app/item-page/versions/notice/item-versions-notice.component.html',
})
export class ItemVersionsNoticeComponent 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 { ItemVersionsNoticeComponent } from './app/item-page/versions/notice/item-versions-notice.component';

const DECLARATIONS = [
FileSectionComponent,
Expand Down Expand Up @@ -239,6 +240,7 @@ const DECLARATIONS = [
SubmissionSectionUploadFileComponent,
ItemStatusComponent,
EditBitstreamPageComponent,
ItemVersionsNoticeComponent,
];

@NgModule({
Expand Down

0 comments on commit bb16b44

Please sign in to comment.