Skip to content

Commit 80b9052

Browse files
100479: Removed the default input values to make it possible to override them in themes
1 parent 38df774 commit 80b9052

5 files changed

Lines changed: 50 additions & 73 deletions

File tree

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

src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/themed-item-list-preview.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export class ThemedItemListPreviewComponent extends ThemedComponent<ItemListPrev
2222

2323
@Input() status: MyDspaceItemStatusType;
2424

25-
@Input() showSubmitter = false;
25+
@Input() showSubmitter: boolean;
2626

2727

2828
protected getComponentName(): string {

src/app/shared/object-list/themed-object-list.component.ts

Lines changed: 22 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ import {ListableObject} from '../object-collection/shared/listable-object.model'
1919
templateUrl: '../theme-support/themed.component.html',
2020
})
2121
export class ThemedObjectListComponent extends ThemedComponent<ObjectListComponent> {
22-
/**
23-
* The view mode of the this component
24-
*/
25-
viewMode = ViewMode.ListElement;
2622

2723
/**
2824
* The current pagination configuration
@@ -37,18 +33,20 @@ export class ThemedObjectListComponent extends ThemedComponent<ObjectListCompone
3733
/**
3834
* Whether or not the list elements have a border
3935
*/
40-
@Input() hasBorder = false;
36+
@Input() hasBorder: boolean;
4137

4238
/**
4339
* The whether or not the gear is hidden
4440
*/
45-
@Input() hideGear = false;
41+
@Input() hideGear: boolean;
4642

4743
/**
4844
* Whether or not the pager is visible when there is only a single page of results
4945
*/
50-
@Input() hidePagerWhenSinglePage = true;
51-
@Input() selectable = false;
46+
@Input() hidePagerWhenSinglePage: boolean;
47+
48+
@Input() selectable: boolean;
49+
5250
@Input() selectionConfig: { repeatable: boolean, listId: string };
5351

5452
/**
@@ -64,12 +62,12 @@ export class ThemedObjectListComponent extends ThemedComponent<ObjectListCompone
6462
/**
6563
* Option for hiding the pagination detail
6664
*/
67-
@Input() hidePaginationDetail = false;
65+
@Input() hidePaginationDetail: boolean;
6866

6967
/**
7068
* Whether or not to add an import button to the object
7169
*/
72-
@Input() importable = false;
70+
@Input() importable: boolean;
7371

7472
/**
7573
* Config used for the import button
@@ -79,42 +77,24 @@ export class ThemedObjectListComponent extends ThemedComponent<ObjectListCompone
7977
/**
8078
* Whether or not the pagination should be rendered as simple previous and next buttons instead of the normal pagination
8179
*/
82-
@Input() showPaginator = true;
80+
@Input() showPaginator: boolean;
8381

8482
/**
8583
* Emit when one of the listed object has changed.
8684
*/
87-
@Output() contentChange = new EventEmitter<any>();
85+
@Output() contentChange: EventEmitter<any> = new EventEmitter();
8886

8987
/**
9088
* If showPaginator is set to true, emit when the previous button is clicked
9189
*/
92-
@Output() prev = new EventEmitter<boolean>();
90+
@Output() prev: EventEmitter<boolean> = new EventEmitter();
9391

9492
/**
9593
* If showPaginator is set to true, emit when the next button is clicked
9694
*/
97-
@Output() next = new EventEmitter<boolean>();
98-
99-
/**
100-
* The current listable objects
101-
*/
102-
private _objects: RemoteData<PaginatedList<ListableObject>>;
103-
104-
/**
105-
* Setter for the objects
106-
* @param objects The new objects
107-
*/
108-
@Input() set objects(objects: RemoteData<PaginatedList<ListableObject>>) {
109-
this._objects = objects;
110-
}
95+
@Output() next: EventEmitter<boolean> = new EventEmitter();
11196

112-
/**
113-
* Getter to return the current objects
114-
*/
115-
get objects() {
116-
return this._objects;
117-
}
97+
@Input() objects: RemoteData<PaginatedList<ListableObject>>;
11898

11999
/**
120100
* An event fired when the page is changed.
@@ -123,48 +103,45 @@ export class ThemedObjectListComponent extends ThemedComponent<ObjectListCompone
123103
@Output() change: EventEmitter<{
124104
pagination: PaginationComponentOptions,
125105
sort: SortOptions
126-
}> = new EventEmitter<{
127-
pagination: PaginationComponentOptions,
128-
sort: SortOptions
129-
}>();
106+
}> = new EventEmitter();
130107

131108
/**
132109
* An event fired when the page is changed.
133110
* Event's payload equals to the newly selected page.
134111
*/
135-
@Output() pageChange: EventEmitter<number> = new EventEmitter<number>();
112+
@Output() pageChange: EventEmitter<number> = new EventEmitter();
136113

137114
/**
138115
* An event fired when the page wsize is changed.
139116
* Event's payload equals to the newly selected page size.
140117
*/
141-
@Output() pageSizeChange: EventEmitter<number> = new EventEmitter<number>();
118+
@Output() pageSizeChange: EventEmitter<number> = new EventEmitter();
142119

143120
/**
144121
* An event fired when the sort direction is changed.
145122
* Event's payload equals to the newly selected sort direction.
146123
*/
147-
@Output() sortDirectionChange: EventEmitter<SortDirection> = new EventEmitter<SortDirection>();
124+
@Output() sortDirectionChange: EventEmitter<SortDirection> = new EventEmitter();
148125

149126
/**
150127
* An event fired when on of the pagination parameters changes
151128
*/
152-
@Output() paginationChange: EventEmitter<any> = new EventEmitter<any>();
129+
@Output() paginationChange: EventEmitter<any> = new EventEmitter();
153130

154-
@Output() deselectObject: EventEmitter<ListableObject> = new EventEmitter<ListableObject>();
131+
@Output() deselectObject: EventEmitter<ListableObject> = new EventEmitter();
155132

156-
@Output() selectObject: EventEmitter<ListableObject> = new EventEmitter<ListableObject>();
133+
@Output() selectObject: EventEmitter<ListableObject> = new EventEmitter();
157134

158135
/**
159136
* Send an import event to the parent component
160137
*/
161-
@Output() importObject: EventEmitter<ListableObject> = new EventEmitter<ListableObject>();
138+
@Output() importObject: EventEmitter<ListableObject> = new EventEmitter();
162139

163140
/**
164141
* An event fired when the sort field is changed.
165142
* Event's payload equals to the newly selected sort field.
166143
*/
167-
@Output() sortFieldChange: EventEmitter<string> = new EventEmitter<string>();
144+
@Output() sortFieldChange: EventEmitter<string> = new EventEmitter();
168145

169146
inAndOutputNames: (keyof ObjectListComponent & keyof this)[] = [
170147
'config',

src/app/shared/search/search-results/themed-search-results.component.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,21 +35,21 @@ export class ThemedSearchResultsComponent extends ThemedComponent<SearchResultsC
3535

3636
@Input() configuration: string;
3737

38-
@Input() disableHeader = false;
38+
@Input() disableHeader: boolean;
3939

40-
@Input() selectable = false;
40+
@Input() selectable: boolean;
4141

4242
@Input() context: Context;
4343

44-
@Input() hidePaginationDetail = false;
44+
@Input() hidePaginationDetail: boolean;
4545

46-
@Input() selectionConfig: SelectionConfig = null;
46+
@Input() selectionConfig: SelectionConfig;
4747

48-
@Output() contentChange: EventEmitter<ListableObject> = new EventEmitter<ListableObject>();
48+
@Output() contentChange: EventEmitter<ListableObject> = new EventEmitter();
4949

50-
@Output() deselectObject: EventEmitter<ListableObject> = new EventEmitter<ListableObject>();
50+
@Output() deselectObject: EventEmitter<ListableObject> = new EventEmitter();
5151

52-
@Output() selectObject: EventEmitter<ListableObject> = new EventEmitter<ListableObject>();
52+
@Output() selectObject: EventEmitter<ListableObject> = new EventEmitter();
5353

5454
protected getComponentName(): string {
5555
return 'SearchResultsComponent';

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

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,49 +21,49 @@ import { ListableObject } from '../object-collection/shared/listable-object.mode
2121
export class ThemedSearchComponent extends ThemedComponent<SearchComponent> {
2222
protected inAndOutputNames: (keyof SearchComponent & keyof this)[] = ['configurationList', 'context', 'configuration', 'fixedFilterQuery', 'useCachedVersionIfAvailable', 'inPlaceSearch', 'linkType', 'paginationId', 'searchEnabled', 'sideBarWidth', 'searchFormPlaceholder', 'selectable', 'selectionConfig', 'showSidebar', 'showViewModes', 'useUniquePageId', 'viewModeList', 'showScopeSelector', 'resultFound', 'deselectObject', 'selectObject', 'trackStatistics'];
2323

24-
@Input() configurationList: SearchConfigurationOption[] = [];
24+
@Input() configurationList: SearchConfigurationOption[];
2525

26-
@Input() context: Context = Context.Search;
26+
@Input() context: Context;
2727

28-
@Input() configuration = 'default';
28+
@Input() configuration: string;
2929

3030
@Input() fixedFilterQuery: string;
3131

32-
@Input() useCachedVersionIfAvailable = true;
32+
@Input() useCachedVersionIfAvailable: boolean;
3333

34-
@Input() inPlaceSearch = true;
34+
@Input() inPlaceSearch: boolean;
3535

3636
@Input() linkType: CollectionElementLinkType;
3737

38-
@Input() paginationId = 'spc';
38+
@Input() paginationId: string;
3939

40-
@Input() searchEnabled = true;
40+
@Input() searchEnabled: boolean;
4141

42-
@Input() sideBarWidth = 3;
42+
@Input() sideBarWidth: number;
4343

44-
@Input() searchFormPlaceholder = 'search.search-form.placeholder';
44+
@Input() searchFormPlaceholder: string;
4545

46-
@Input() selectable = false;
46+
@Input() selectable: boolean;
4747

4848
@Input() selectionConfig: SelectionConfig;
4949

50-
@Input() showSidebar = true;
50+
@Input() showSidebar: boolean;
5151

52-
@Input() showViewModes = true;
52+
@Input() showViewModes: boolean;
5353

54-
@Input() useUniquePageId: false;
54+
@Input() useUniquePageId: boolean;
5555

5656
@Input() viewModeList: ViewMode[];
5757

58-
@Input() showScopeSelector = true;
58+
@Input() showScopeSelector: boolean;
5959

60-
@Input() trackStatistics = false;
60+
@Input() trackStatistics: boolean;
6161

62-
@Output() resultFound: EventEmitter<SearchObjects<DSpaceObject>> = new EventEmitter<SearchObjects<DSpaceObject>>();
62+
@Output() resultFound: EventEmitter<SearchObjects<DSpaceObject>> = new EventEmitter();
6363

64-
@Output() deselectObject: EventEmitter<ListableObject> = new EventEmitter<ListableObject>();
64+
@Output() deselectObject: EventEmitter<ListableObject> = new EventEmitter();
6565

66-
@Output() selectObject: EventEmitter<ListableObject> = new EventEmitter<ListableObject>();
66+
@Output() selectObject: EventEmitter<ListableObject> = new EventEmitter();
6767

6868
protected getComponentName(): string {
6969
return 'SearchComponent';

0 commit comments

Comments
 (0)