Skip to content

Commit d9f6386

Browse files
authored
Merge pull request DSpace#2164 from alexandrevryghem/fixed-default-input-values-not-working_contribute-main
Fixed some themeable component default values not being overridable
2 parents ade9533 + fc7997d commit d9f6386

15 files changed

Lines changed: 72 additions & 134 deletions

File tree

src/app/footer/themed-footer.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { FooterComponent } from './footer.component';
77
*/
88
@Component({
99
selector: 'ds-themed-footer',
10-
styleUrls: ['footer.component.scss'],
10+
styleUrls: [],
1111
templateUrl: '../shared/theme-support/themed.component.html',
1212
})
1313
export class ThemedFooterComponent extends ThemedComponent<FooterComponent> {
@@ -20,6 +20,6 @@ export class ThemedFooterComponent extends ThemedComponent<FooterComponent> {
2020
}
2121

2222
protected importUnthemedComponent(): Promise<any> {
23-
return import(`./footer.component`);
23+
return import('./footer.component');
2424
}
2525
}

src/app/header-nav-wrapper/themed-header-navbar-wrapper.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import { ThemedComponent } from '../shared/theme-support/themed.component';
33
import { HeaderNavbarWrapperComponent } from './header-navbar-wrapper.component';
44

55
/**
6-
* Themed wrapper for BreadcrumbsComponent
6+
* Themed wrapper for {@link HeaderNavbarWrapperComponent}
77
*/
88
@Component({
99
selector: 'ds-themed-header-navbar-wrapper',
10-
styleUrls: ['./themed-header-navbar-wrapper.component.scss'],
10+
styleUrls: [],
1111
templateUrl: '../shared/theme-support/themed.component.html',
1212
})
1313
export class ThemedHeaderNavbarWrapperComponent extends ThemedComponent<HeaderNavbarWrapperComponent> {
@@ -20,6 +20,6 @@ export class ThemedHeaderNavbarWrapperComponent extends ThemedComponent<HeaderNa
2020
}
2121

2222
protected importUnthemedComponent(): Promise<any> {
23-
return import(`./header-navbar-wrapper.component`);
23+
return import('./header-navbar-wrapper.component');
2424
}
2525
}

src/app/home-page/themed-home-page.component.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ import { Component } from '@angular/core';
88
templateUrl: '../shared/theme-support/themed.component.html',
99
})
1010
export class ThemedHomePageComponent extends ThemedComponent<HomePageComponent> {
11-
protected inAndOutputNames: (keyof HomePageComponent & keyof this)[];
12-
1311

1412
protected getComponentName(): string {
1513
return 'HomePageComponent';

src/app/item-page/simple/metadata-representation-list/themed-metadata-representation-list.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export class ThemedMetadataRepresentationListComponent extends ThemedComponent<M
1919

2020
@Input() label: string;
2121

22-
@Input() incrementBy = 10;
22+
@Input() incrementBy: number;
2323

2424
protected getComponentName(): string {
2525
return 'MetadataRepresentationListComponent';

src/app/my-dspace-page/themed-my-dspace-page.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import { MyDSpacePageComponent } from './my-dspace-page.component';
1111
templateUrl: './../shared/theme-support/themed.component.html'
1212
})
1313
export class ThemedMyDSpacePageComponent extends ThemedComponent<MyDSpacePageComponent> {
14-
protected inAndOutputNames: (keyof MyDSpacePageComponent & keyof this)[];
1514

1615
protected getComponentName(): string {
1716
return 'MyDSpacePageComponent';

src/app/search-page/themed-configuration-search-page.component.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,18 @@ export class ThemedConfigurationSearchPageComponent extends ThemedComponent<Conf
2828
/**
2929
* True when the search component should show results on the current page
3030
*/
31-
@Input() inPlaceSearch = true;
31+
@Input() inPlaceSearch: boolean;
3232

3333
/**
3434
* Whether or not the search bar should be visible
3535
*/
36-
@Input()
37-
searchEnabled = true;
36+
@Input() searchEnabled: boolean;
3837

3938
/**
4039
* The width of the sidebar (bootstrap columns)
4140
*/
4241
@Input()
43-
sideBarWidth = 3;
42+
sideBarWidth: number;
4443

4544
/**
4645
* The currently applied configuration (determines title of search)
@@ -66,7 +65,7 @@ export class ThemedConfigurationSearchPageComponent extends ThemedComponent<Conf
6665
}
6766

6867
protected importUnthemedComponent(): Promise<any> {
69-
return import(`./configuration-search-page.component`);
68+
return import('./configuration-search-page.component');
7069
}
7170

7271
}

src/app/shared/collection-dropdown/themed-collection-dropdown.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ export class ThemedCollectionDropdownComponent extends ThemedComponent<Collectio
1111

1212
@Input() entityType: string;
1313

14-
@Output() searchComplete = new EventEmitter<any>();
14+
@Output() searchComplete: EventEmitter<any> = new EventEmitter();
1515

16-
@Output() theOnlySelectable = new EventEmitter<CollectionListEntry>();
16+
@Output() theOnlySelectable: EventEmitter<CollectionListEntry> = new EventEmitter();
1717

18-
@Output() selectionChange = new EventEmitter<CollectionListEntry>();
18+
@Output() selectionChange = new EventEmitter();
1919

2020
protected inAndOutputNames: (keyof CollectionDropdownComponent & keyof this)[] = ['entityType', 'searchComplete', 'theOnlySelectable', 'selectionChange'];
2121

src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/themed-dynamic-lookup-relation-external-source-tab.component.ts

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,14 @@ import { RelationshipOptions } from '../../../models/relationship-options.model'
44
import { ListableObject } from '../../../../../object-collection/shared/listable-object.model';
55
import { Context } from '../../../../../../core/shared/context.model';
66
import { Item } from '../../../../../../core/shared/item.model';
7-
import { SEARCH_CONFIG_SERVICE } from '../../../../../../my-dspace-page/my-dspace-page.component';
8-
import { SearchConfigurationService } from '../../../../../../core/shared/search/search-configuration.service';
97
import { Collection } from '../../../../../../core/shared/collection.model';
108
import { ExternalSource } from '../../../../../../core/shared/external-source.model';
119
import { DsDynamicLookupRelationExternalSourceTabComponent } from './dynamic-lookup-relation-external-source-tab.component';
12-
import { fadeIn, fadeInOut } from '../../../../../animations/fade';
1310

1411
@Component({
1512
selector: 'ds-themed-dynamic-lookup-relation-external-source-tab',
1613
styleUrls: [],
1714
templateUrl: '../../../../../theme-support/themed.component.html',
18-
providers: [
19-
{
20-
provide: SEARCH_CONFIG_SERVICE,
21-
useClass: SearchConfigurationService
22-
}
23-
],
24-
animations: [
25-
fadeIn,
26-
fadeInOut
27-
]
2815
})
2916
export class ThemedDynamicLookupRelationExternalSourceTabComponent extends ThemedComponent<DsDynamicLookupRelationExternalSourceTabComponent> {
3017
protected inAndOutputNames: (keyof DsDynamicLookupRelationExternalSourceTabComponent & keyof this)[] = ['label', 'listId',
@@ -44,7 +31,7 @@ export class ThemedDynamicLookupRelationExternalSourceTabComponent extends Theme
4431

4532
@Input() repeatable: boolean;
4633

47-
@Output() importedObject: EventEmitter<ListableObject> = new EventEmitter<ListableObject>();
34+
@Output() importedObject: EventEmitter<ListableObject> = new EventEmitter();
4835

4936
@Input() externalSource: ExternalSource;
5037

src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/themed-dynamic-lookup-relation-search-tab.component.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,11 @@ import { Item } from '../../../../../../core/shared/item.model';
1010
import { SearchResult } from '../../../../../search/models/search-result.model';
1111
import { SearchObjects } from '../../../../../search/models/search-objects.model';
1212
import { DSpaceObject } from '../../../../../../core/shared/dspace-object.model';
13-
import { SEARCH_CONFIG_SERVICE } from '../../../../../../my-dspace-page/my-dspace-page.component';
14-
import { SearchConfigurationService } from '../../../../../../core/shared/search/search-configuration.service';
1513

1614
@Component({
1715
selector: 'ds-themed-dynamic-lookup-relation-search-tab',
1816
styleUrls: [],
1917
templateUrl: '../../../../../theme-support/themed.component.html',
20-
providers: [
21-
{
22-
provide: SEARCH_CONFIG_SERVICE,
23-
useClass: SearchConfigurationService
24-
}
25-
]
2618
})
2719
export class ThemedDynamicLookupRelationSearchTabComponent extends ThemedComponent<DsDynamicLookupRelationSearchTabComponent> {
2820
protected inAndOutputNames: (keyof DsDynamicLookupRelationSearchTabComponent & keyof this)[] = ['relationship', 'listId',
@@ -51,11 +43,11 @@ export class ThemedDynamicLookupRelationSearchTabComponent extends ThemedCompone
5143

5244
@Input() isEditRelationship: boolean;
5345

54-
@Output() deselectObject: EventEmitter<ListableObject> = new EventEmitter<ListableObject>();
46+
@Output() deselectObject: EventEmitter<ListableObject> = new EventEmitter();
5547

56-
@Output() selectObject: EventEmitter<ListableObject> = new EventEmitter<ListableObject>();
48+
@Output() selectObject: EventEmitter<ListableObject> = new EventEmitter();
5749

58-
@Output() resultFound: EventEmitter<SearchObjects<DSpaceObject>> = new EventEmitter<SearchObjects<DSpaceObject>>();
50+
@Output() resultFound: EventEmitter<SearchObjects<DSpaceObject>> = new EventEmitter();
5951

6052
protected getComponentName(): string {
6153
return 'DsDynamicLookupRelationSearchTabComponent';

src/app/shared/loading/themed-loading.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ import { ThemeService } from '../theme-support/theme.service';
1414
export class ThemedLoadingComponent extends ThemedComponent<LoadingComponent> {
1515

1616
@Input() message: string;
17-
@Input() showMessage = true;
18-
@Input() spinner = false;
17+
@Input() showMessage: boolean;
18+
@Input() spinner: boolean;
1919

2020
protected inAndOutputNames: (keyof LoadingComponent & keyof this)[] = ['message', 'showMessage', 'spinner'];
2121

0 commit comments

Comments
 (0)