Skip to content

Commit e523583

Browse files
authored
Merge pull request DSpace#1779 from mwoodiupui/themeable-dialogs
Make create, edit community/collection/item dialogs theme-able.
2 parents e5165c1 + ba2f173 commit e523583

27 files changed

Lines changed: 399 additions & 18 deletions

File tree

src/app/menu.resolver.ts

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,24 @@ import { filter, find, map, take } from 'rxjs/operators';
1616
import { hasValue } from './shared/empty.util';
1717
import { FeatureID } from './core/data/feature-authorization/feature-id';
1818
import {
19-
CreateCommunityParentSelectorComponent
20-
} from './shared/dso-selector/modal-wrappers/create-community-parent-selector/create-community-parent-selector.component';
19+
ThemedCreateCommunityParentSelectorComponent
20+
} from './shared/dso-selector/modal-wrappers/create-community-parent-selector/themed-create-community-parent-selector.component';
2121
import { OnClickMenuItemModel } from './shared/menu/menu-item/models/onclick.model';
2222
import {
23-
CreateCollectionParentSelectorComponent
24-
} from './shared/dso-selector/modal-wrappers/create-collection-parent-selector/create-collection-parent-selector.component';
23+
ThemedCreateCollectionParentSelectorComponent
24+
} from './shared/dso-selector/modal-wrappers/create-collection-parent-selector/themed-create-collection-parent-selector.component';
2525
import {
26-
CreateItemParentSelectorComponent
27-
} from './shared/dso-selector/modal-wrappers/create-item-parent-selector/create-item-parent-selector.component';
26+
ThemedCreateItemParentSelectorComponent
27+
} from './shared/dso-selector/modal-wrappers/create-item-parent-selector/themed-create-item-parent-selector.component';
2828
import {
29-
EditCommunitySelectorComponent
30-
} from './shared/dso-selector/modal-wrappers/edit-community-selector/edit-community-selector.component';
29+
ThemedEditCommunitySelectorComponent
30+
} from './shared/dso-selector/modal-wrappers/edit-community-selector/themed-edit-community-selector.component';
3131
import {
32-
EditCollectionSelectorComponent
33-
} from './shared/dso-selector/modal-wrappers/edit-collection-selector/edit-collection-selector.component';
32+
ThemedEditCollectionSelectorComponent
33+
} from './shared/dso-selector/modal-wrappers/edit-collection-selector/themed-edit-collection-selector.component';
3434
import {
35-
EditItemSelectorComponent
36-
} from './shared/dso-selector/modal-wrappers/edit-item-selector/edit-item-selector.component';
35+
ThemedEditItemSelectorComponent
36+
} from './shared/dso-selector/modal-wrappers/edit-item-selector/themed-edit-item-selector.component';
3737
import {
3838
ExportMetadataSelectorComponent
3939
} from './shared/dso-selector/modal-wrappers/export-metadata-selector/export-metadata-selector.component';
@@ -188,7 +188,7 @@ export class MenuResolver implements Resolve<boolean> {
188188
type: MenuItemType.ONCLICK,
189189
text: 'menu.section.new_community',
190190
function: () => {
191-
this.modalService.open(CreateCommunityParentSelectorComponent);
191+
this.modalService.open(ThemedCreateCommunityParentSelectorComponent);
192192
}
193193
} as OnClickMenuItemModel,
194194
},
@@ -201,7 +201,7 @@ export class MenuResolver implements Resolve<boolean> {
201201
type: MenuItemType.ONCLICK,
202202
text: 'menu.section.new_collection',
203203
function: () => {
204-
this.modalService.open(CreateCollectionParentSelectorComponent);
204+
this.modalService.open(ThemedCreateCollectionParentSelectorComponent);
205205
}
206206
} as OnClickMenuItemModel,
207207
},
@@ -214,7 +214,7 @@ export class MenuResolver implements Resolve<boolean> {
214214
type: MenuItemType.ONCLICK,
215215
text: 'menu.section.new_item',
216216
function: () => {
217-
this.modalService.open(CreateItemParentSelectorComponent);
217+
this.modalService.open(ThemedCreateItemParentSelectorComponent);
218218
}
219219
} as OnClickMenuItemModel,
220220
},
@@ -263,7 +263,7 @@ export class MenuResolver implements Resolve<boolean> {
263263
type: MenuItemType.ONCLICK,
264264
text: 'menu.section.edit_community',
265265
function: () => {
266-
this.modalService.open(EditCommunitySelectorComponent);
266+
this.modalService.open(ThemedEditCommunitySelectorComponent);
267267
}
268268
} as OnClickMenuItemModel,
269269
},
@@ -276,7 +276,7 @@ export class MenuResolver implements Resolve<boolean> {
276276
type: MenuItemType.ONCLICK,
277277
text: 'menu.section.edit_collection',
278278
function: () => {
279-
this.modalService.open(EditCollectionSelectorComponent);
279+
this.modalService.open(ThemedEditCollectionSelectorComponent);
280280
}
281281
} as OnClickMenuItemModel,
282282
},
@@ -289,7 +289,7 @@ export class MenuResolver implements Resolve<boolean> {
289289
type: MenuItemType.ONCLICK,
290290
text: 'menu.section.edit_item',
291291
function: () => {
292-
this.modalService.open(EditItemSelectorComponent);
292+
this.modalService.open(ThemedEditItemSelectorComponent);
293293
}
294294
} as OnClickMenuItemModel,
295295
},
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import {Component} from '@angular/core';
2+
import {CreateCollectionParentSelectorComponent} from './create-collection-parent-selector.component';
3+
import {ThemedComponent} from 'src/app/shared/theme-support/themed.component';
4+
5+
/**
6+
* Themed wrapper for CreateCollectionParentSelectorComponent
7+
*/
8+
@Component({
9+
selector: 'ds-themed-create-collection-parent-selector',
10+
styleUrls: [],
11+
templateUrl: '../../../theme-support/themed.component.html'
12+
})
13+
export class ThemedCreateCollectionParentSelectorComponent
14+
extends ThemedComponent<CreateCollectionParentSelectorComponent> {
15+
16+
protected getComponentName(): string {
17+
return 'CreateCollectionParentSelectorComponent';
18+
}
19+
20+
protected importThemedComponent(themeName: string): Promise<any> {
21+
return import(`../../../../../themes/${themeName}/app/shared/dso-selector/modal-wrappers/create-collection-parent-selector/create-collection-parent-selector.component`);
22+
}
23+
24+
protected importUnthemedComponent(): Promise<any> {
25+
return import('./create-collection-parent-selector.component');
26+
}
27+
28+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import {Component} from '@angular/core';
2+
import {CreateCommunityParentSelectorComponent} from './create-community-parent-selector.component';
3+
import {ThemedComponent} from 'src/app/shared/theme-support/themed.component';
4+
5+
/**
6+
* Themed wrapper for CreateCommunityParentSelectorComponent
7+
*/
8+
@Component({
9+
selector: 'ds-themed-create-community-parent-selector',
10+
styleUrls: [],
11+
templateUrl: '../../../theme-support/themed.component.html'
12+
})
13+
export class ThemedCreateCommunityParentSelectorComponent
14+
extends ThemedComponent<CreateCommunityParentSelectorComponent> {
15+
protected getComponentName(): string {
16+
return 'CreateCommunityParentSelectorComponent';
17+
}
18+
19+
protected importThemedComponent(themeName: string): Promise<any> {
20+
return import(`../../../../../themes/${themeName}/app/shared/dso-selector/modal-wrappers/create-community-parent-selector/create-community-parent-selector.component`);
21+
}
22+
23+
protected importUnthemedComponent(): Promise<any> {
24+
return import('./create-community-parent-selector.component');
25+
}
26+
27+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import {Component, Input} from '@angular/core';
2+
import {CreateItemParentSelectorComponent} from './create-item-parent-selector.component';
3+
import {ThemedComponent} from 'src/app/shared/theme-support/themed.component';
4+
5+
/**
6+
* Themed wrapper for CreateItemParentSelectorComponent
7+
*/
8+
@Component({
9+
selector: 'ds-themed-create-item-parent-selector',
10+
styleUrls: [],
11+
templateUrl: '../../../theme-support/themed.component.html'
12+
})
13+
export class ThemedCreateItemParentSelectorComponent
14+
extends ThemedComponent<CreateItemParentSelectorComponent> {
15+
@Input() entityType: string;
16+
17+
protected inAndOutputNames: (keyof CreateItemParentSelectorComponent & keyof this)[] = ['entityType'];
18+
19+
protected getComponentName(): string {
20+
return 'CreateItemParentSelectorComponent';
21+
}
22+
23+
protected importThemedComponent(themeName: string): Promise<any> {
24+
return import(`../../../../../themes/${themeName}/app/shared/dso-selector/modal-wrappers/create-item-parent-selector/create-item-parent-selector.component`);
25+
}
26+
27+
protected importUnthemedComponent(): Promise<any> {
28+
return import('./create-item-parent-selector.component');
29+
}
30+
31+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import {Component} from '@angular/core';
2+
import {EditCollectionSelectorComponent} from './edit-collection-selector.component';
3+
import {ThemedComponent} from 'src/app/shared/theme-support/themed.component';
4+
5+
/**
6+
* Themed wrapper for EditCollectionSelectorComponent
7+
*/
8+
@Component({
9+
selector: 'ds-themed-edit-collection-selector',
10+
styleUrls: [],
11+
templateUrl: '../../../theme-support/themed.component.html'
12+
})
13+
export class ThemedEditCollectionSelectorComponent
14+
extends ThemedComponent<EditCollectionSelectorComponent> {
15+
protected getComponentName(): string {
16+
return 'EditCollectionSelectorComponent';
17+
}
18+
19+
protected importThemedComponent(themeName: string): Promise<any> {
20+
return import(`../../../../../themes/${themeName}/app/shared/dso-selector/modal-wrappers/edit-collection-selector/edit-collection-selector.component`);
21+
}
22+
23+
protected importUnthemedComponent(): Promise<any> {
24+
return import('./edit-collection-selector.component');
25+
}
26+
27+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import {Component} from '@angular/core';
2+
import {EditCommunitySelectorComponent} from './edit-community-selector.component';
3+
import {ThemedComponent} from 'src/app/shared/theme-support/themed.component';
4+
5+
/**
6+
* Themed wrapper for EditCommunitySelectorComponent
7+
*/
8+
@Component({
9+
selector: 'ds-themed-edit-community-selector',
10+
styleUrls: [],
11+
templateUrl: '../../../theme-support/themed.component.html'
12+
})
13+
export class ThemedEditCommunitySelectorComponent
14+
extends ThemedComponent<EditCommunitySelectorComponent> {
15+
protected getComponentName(): string {
16+
return 'EditCommunitySelectorComponent';
17+
}
18+
19+
protected importThemedComponent(themeName: string): Promise<any> {
20+
return import(`../../../../../themes/${themeName}/app/shared/dso-selector/modal-wrappers/edit-community-selector/edit-community-selector.component`);
21+
}
22+
23+
protected importUnthemedComponent(): Promise<any> {
24+
return import('./edit-community-selector.component');
25+
}
26+
27+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import {Component} from '@angular/core';
2+
import {EditItemSelectorComponent} from './edit-item-selector.component';
3+
import {ThemedComponent} from 'src/app/shared/theme-support/themed.component';
4+
5+
/**
6+
* Themed wrapper for EditItemSelectorComponent
7+
*/
8+
@Component({
9+
selector: 'ds-themed-edit-item-selector',
10+
styleUrls: [],
11+
templateUrl: '../../../theme-support/themed.component.html'
12+
})
13+
export class ThemedEditItemSelectorComponent
14+
extends ThemedComponent<EditItemSelectorComponent> {
15+
protected getComponentName(): string {
16+
return 'EditItemSelectorComponent';
17+
}
18+
19+
protected importThemedComponent(themeName: string): Promise<any> {
20+
return import(`../../../../../themes/${themeName}/app/shared/dso-selector/modal-wrappers/edit-item-selector/edit-item-selector.component`);
21+
}
22+
23+
protected importUnthemedComponent(): Promise<any> {
24+
return import('./edit-item-selector.component');
25+
}
26+
27+
}

src/app/shared/shared.module.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,21 @@ import { DSOSelectorComponent } from './dso-selector/dso-selector/dso-selector.c
124124
import {
125125
CreateCommunityParentSelectorComponent
126126
} from './dso-selector/modal-wrappers/create-community-parent-selector/create-community-parent-selector.component';
127+
import {
128+
ThemedCreateCommunityParentSelectorComponent
129+
} from './dso-selector/modal-wrappers/create-community-parent-selector/themed-create-community-parent-selector.component';
127130
import {
128131
CreateItemParentSelectorComponent
129132
} from './dso-selector/modal-wrappers/create-item-parent-selector/create-item-parent-selector.component';
133+
import {
134+
ThemedCreateItemParentSelectorComponent
135+
} from './dso-selector/modal-wrappers/create-item-parent-selector/themed-create-item-parent-selector.component';
130136
import {
131137
CreateCollectionParentSelectorComponent
132138
} from './dso-selector/modal-wrappers/create-collection-parent-selector/create-collection-parent-selector.component';
139+
import {
140+
ThemedCreateCollectionParentSelectorComponent
141+
} from './dso-selector/modal-wrappers/create-collection-parent-selector/themed-create-collection-parent-selector.component';
133142
import {
134143
CommunitySearchResultListElementComponent
135144
} from './object-list/search-result-list-element/community-search-result/community-search-result-list-element.component';
@@ -139,12 +148,21 @@ import {
139148
import {
140149
EditItemSelectorComponent
141150
} from './dso-selector/modal-wrappers/edit-item-selector/edit-item-selector.component';
151+
import {
152+
ThemedEditItemSelectorComponent
153+
} from './dso-selector/modal-wrappers/edit-item-selector/themed-edit-item-selector.component';
142154
import {
143155
EditCommunitySelectorComponent
144156
} from './dso-selector/modal-wrappers/edit-community-selector/edit-community-selector.component';
157+
import {
158+
ThemedEditCommunitySelectorComponent
159+
} from './dso-selector/modal-wrappers/edit-community-selector/themed-edit-community-selector.component';
145160
import {
146161
EditCollectionSelectorComponent
147162
} from './dso-selector/modal-wrappers/edit-collection-selector/edit-collection-selector.component';
163+
import {
164+
ThemedEditCollectionSelectorComponent
165+
} from './dso-selector/modal-wrappers/edit-collection-selector/themed-edit-collection-selector.component';
148166
import {
149167
ItemListPreviewComponent
150168
} from './object-list/my-dspace-result-list-element/item-list-preview/item-list-preview.component';
@@ -395,11 +413,17 @@ const COMPONENTS = [
395413
DsoInputSuggestionsComponent,
396414
DSOSelectorComponent,
397415
CreateCommunityParentSelectorComponent,
416+
ThemedCreateCommunityParentSelectorComponent,
398417
CreateCollectionParentSelectorComponent,
418+
ThemedCreateCollectionParentSelectorComponent,
399419
CreateItemParentSelectorComponent,
420+
ThemedCreateItemParentSelectorComponent,
400421
EditCommunitySelectorComponent,
422+
ThemedEditCommunitySelectorComponent,
401423
EditCollectionSelectorComponent,
424+
ThemedEditCollectionSelectorComponent,
402425
EditItemSelectorComponent,
426+
ThemedEditItemSelectorComponent,
403427
CommunitySearchResultListElementComponent,
404428
CollectionSearchResultListElementComponent,
405429
BrowseByComponent,
@@ -491,11 +515,17 @@ const ENTRY_COMPONENTS = [
491515
StartsWithDateComponent,
492516
StartsWithTextComponent,
493517
CreateCommunityParentSelectorComponent,
518+
ThemedCreateCommunityParentSelectorComponent,
494519
CreateCollectionParentSelectorComponent,
520+
ThemedCreateCollectionParentSelectorComponent,
495521
CreateItemParentSelectorComponent,
522+
ThemedCreateItemParentSelectorComponent,
496523
EditCommunitySelectorComponent,
524+
ThemedEditCommunitySelectorComponent,
497525
EditCollectionSelectorComponent,
526+
ThemedEditCollectionSelectorComponent,
498527
EditItemSelectorComponent,
528+
ThemedEditItemSelectorComponent,
499529
PlainTextMetadataListElementComponent,
500530
ItemMetadataListElementComponent,
501531
MetadataRepresentationListElementComponent,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<div>
2+
<div class="modal-header">{{'dso-selector.'+ action + '.' + objectType.toString().toLowerCase() + '.head' | translate}}
3+
<button type="button" class="close" (click)="close()" aria-label="Close">
4+
<span aria-hidden="true">×</span>
5+
</button>
6+
</div>
7+
<div class="modal-body">
8+
<h5 *ngIf="header" class="px-2">{{header | translate}}</h5>
9+
<ds-dso-selector [currentDSOId]="dsoRD?.payload.uuid" [types]="selectorTypes" (onSelect)="selectObject($event)"></ds-dso-selector>
10+
</div>
11+
</div>

src/themes/custom/app/shared/dso-selector/modal-wrappers/create-collection-parent-selector/create-collection-parent-selector.component.scss

Whitespace-only changes.

0 commit comments

Comments
 (0)