Skip to content

Commit 6d42535

Browse files
author
abhinav
committed
Merge remote-tracking branch 'contributions/w2p-124198_add-themeable-ItemBitstreamsComponent_contribute-7.6' into w2p-124198_add-themeable-ItemBitstreamsComponent_contribute-main
2 parents 7e69b44 + ebdd7c5 commit 6d42535

File tree

7 files changed

+83
-3
lines changed

7 files changed

+83
-3
lines changed

src/app/item-page/edit-item-page/edit-item-page-routes.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import {
1919
} from './edit-item-page.routing-paths';
2020
import { ItemAccessControlComponent } from './item-access-control/item-access-control.component';
2121
import { ItemAuthorizationsComponent } from './item-authorizations/item-authorizations.component';
22-
import { ItemBitstreamsComponent } from './item-bitstreams/item-bitstreams.component';
22+
import { ThemedItemBitstreamsComponent } from './item-bitstreams/themed-item-bitstreams.component';
2323
import { ItemCollectionMapperComponent } from './item-collection-mapper/item-collection-mapper.component';
2424
import { ItemCurateComponent } from './item-curate/item-curate.component';
2525
import { ItemDeleteComponent } from './item-delete/item-delete.component';
@@ -77,7 +77,7 @@ export const ROUTES: Route[] = [
7777
},
7878
{
7979
path: 'bitstreams',
80-
component: ItemBitstreamsComponent,
80+
component: ThemedItemBitstreamsComponent,
8181
data: { title: 'item.edit.tabs.bitstreams.title', showBreadcrumbs: true },
8282
canActivate: [itemPageBitstreamsGuard],
8383
},

src/app/item-page/edit-item-page/item-bitstreams/item-bitstreams.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ import { ItemBitstreamsService } from './item-bitstreams.service';
6868
import { ItemEditBitstreamBundleComponent } from './item-edit-bitstream-bundle/item-edit-bitstream-bundle.component';
6969

7070
@Component({
71-
selector: 'ds-item-bitstreams',
71+
selector: 'ds-base-item-bitstreams',
7272
styleUrls: ['./item-bitstreams.component.scss'],
7373
templateUrl: './item-bitstreams.component.html',
7474
imports: [
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import {
2+
Component,
3+
Input,
4+
} from '@angular/core';
5+
6+
import { Item } from '../../../core/shared/item.model';
7+
import { ThemedComponent } from '../../../shared/theme-support/themed.component';
8+
import { ItemBitstreamsComponent } from './item-bitstreams.component';
9+
10+
/**
11+
* Themed wrapper for {@link ItemBitstreamsComponent}
12+
*/
13+
@Component({
14+
selector: 'ds-item-bitstreams',
15+
styleUrls: ['./item-bitstreams.component.scss'],
16+
templateUrl: '../../../shared/theme-support/themed.component.html',
17+
standalone: true,
18+
imports: [ItemBitstreamsComponent],
19+
})
20+
export class ThemedItemBitstreamsComponent extends ThemedComponent<ItemBitstreamsComponent> {
21+
@Input() item: Item;
22+
23+
protected inAndOutputNames: (keyof ItemBitstreamsComponent & keyof this)[] = [
24+
'item',
25+
];
26+
27+
protected getComponentName(): string {
28+
return 'ItemBitstreamsComponent';
29+
}
30+
31+
protected importThemedComponent(themeName: string): Promise<any> {
32+
return import(`../../../../themes/${themeName}/app/item-page/edit-item-page/item-bitstreams/item-bitstreams.component`);
33+
}
34+
35+
protected importUnthemedComponent(): Promise<any> {
36+
return import(`./item-bitstreams.component`);
37+
}
38+
}

src/themes/custom/app/item-page/edit-item-page/item-bitstreams/item-bitstream.component.scss

Whitespace-only changes.

src/themes/custom/app/item-page/edit-item-page/item-bitstreams/item-bitstreams.component.html

Whitespace-only changes.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import {
2+
AsyncPipe,
3+
CommonModule,
4+
NgForOf,
5+
NgIf,
6+
} from '@angular/common';
7+
import { Component } from '@angular/core';
8+
import { RouterLink } from '@angular/router';
9+
import { TranslateModule } from '@ngx-translate/core';
10+
11+
import { ItemBitstreamsComponent as BaseComponent } from '../../../../../../app/item-page/edit-item-page/item-bitstreams/item-bitstreams.component';
12+
import { ItemEditBitstreamBundleComponent } from '../../../../../../app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/item-edit-bitstream-bundle.component';
13+
import { AlertComponent } from '../../../../../../app/shared/alert/alert.component';
14+
import { BtnDisabledDirective } from '../../../../../../app/shared/btn-disabled.directive';
15+
import { ThemedLoadingComponent } from '../../../../../../app/shared/loading/themed-loading.component';
16+
import { VarDirective } from '../../../../../../app/shared/utils/var.directive';
17+
18+
@Component({
19+
selector: 'ds-themed-item-bitstreams',
20+
styleUrls: ['../../../../../../app/item-page/edit-item-page/item-bitstreams/item-bitstreams.component.scss'],
21+
templateUrl: '../../../../../../app/item-page/edit-item-page/item-bitstreams/item-bitstreams.component.html',
22+
imports: [
23+
CommonModule,
24+
AsyncPipe,
25+
TranslateModule,
26+
ItemEditBitstreamBundleComponent,
27+
RouterLink,
28+
NgIf,
29+
VarDirective,
30+
NgForOf,
31+
ThemedLoadingComponent,
32+
AlertComponent,
33+
BtnDisabledDirective,
34+
],
35+
standalone: true,
36+
})
37+
export class ItemBitstreamsComponent extends BaseComponent {
38+
39+
}

src/themes/custom/eager-theme.module.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { HeaderComponent } from './app/header/header.component';
1111
import { HeaderNavbarWrapperComponent } from './app/header-nav-wrapper/header-navbar-wrapper.component';
1212
import { HomeNewsComponent } from './app/home-page/home-news/home-news.component';
1313
import { TopLevelCommunityListComponent } from './app/home-page/top-level-community-list/top-level-community-list.component';
14+
import { ItemBitstreamsComponent } from './app/item-page/edit-item-page/item-bitstreams/item-bitstreams.component';
1415
import { PublicationComponent } from './app/item-page/simple/item-types/publication/publication.component';
1516
import { UntypedItemComponent } from './app/item-page/simple/item-types/untyped-item/untyped-item.component';
1617
import { NavbarComponent } from './app/navbar/navbar.component';
@@ -33,6 +34,7 @@ import { PublicationSidebarSearchListElementComponent } from './app/shared/objec
3334
import { StartsWithDateComponent } from './app/shared/starts-with/date/starts-with-date.component';
3435
import { StartsWithTextComponent } from './app/shared/starts-with/text/starts-with-text.component';
3536

37+
3638
/**
3739
* Add components that use a custom decorator to ENTRY_COMPONENTS as well as DECLARATIONS.
3840
* This will ensure that decorator gets picked up when the app loads
@@ -54,6 +56,7 @@ const ENTRY_COMPONENTS = [
5456
ItemSearchResultListElementComponent,
5557
TopLevelCommunityListComponent,
5658
BrowseEntryListElementComponent,
59+
ItemBitstreamsComponent,
5760
];
5861

5962
const DECLARATIONS = [

0 commit comments

Comments
 (0)