-
Notifications
You must be signed in to change notification settings - Fork 566
Expand file tree
/
Copy paththemed-configuration-search-page.component.ts
More file actions
185 lines (155 loc) · 4.64 KB
/
Copy paththemed-configuration-search-page.component.ts
File metadata and controls
185 lines (155 loc) · 4.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
import {
Component,
Input,
} from '@angular/core';
import { Context } from '@dspace/core/shared/context.model';
import { ViewMode } from '@dspace/core/shared/view-mode.model';
import { CollectionElementLinkType } from '../shared/object-collection/collection-element-link.type';
import { SelectionConfig } from '../shared/search/search-results/search-results.component';
import { SearchConfigurationOption } from '../shared/search/search-switch-configuration/search-configuration-option.model';
import { ThemedComponent } from '../shared/theme-support/themed.component';
import { ConfigurationSearchPageComponent } from './configuration-search-page.component';
/**
* Themed wrapper for ConfigurationSearchPageComponent
*/
@Component({
selector: 'ds-configuration-search-page',
templateUrl: '../shared/theme-support/themed.component.html',
})
export class ThemedConfigurationSearchPageComponent extends ThemedComponent<ConfigurationSearchPageComponent> {
/**
* The list of available configuration options
*/
@Input() configurationList: SearchConfigurationOption[];
/**
* The current context
* If empty, 'search' is used
*/
@Input() context: Context;
/**
* The configuration to use for the search options
* If empty, 'default' is used
*/
@Input() configuration: string;
/**
* The actual query for the fixed filter.
* If empty, the query will be determined by the route parameter called 'filter'
*/
@Input() fixedFilterQuery: string;
/**
* If this is true, the request will only be sent if there's
* no valid cached version. Defaults to true
*/
@Input() useCachedVersionIfAvailable: boolean;
/**
* True when the search component should show results on the current page
*/
@Input() inPlaceSearch: boolean;
/**
* The link type of the listed search results
*/
@Input() linkType: CollectionElementLinkType;
/**
* The search instance id used in the search
*/
@Input() searchInstanceId: string;
/**
* Whether or not the search bar should be visible
*/
@Input() searchEnabled: boolean;
/**
* The width of the sidebar (bootstrap columns)
*/
@Input() sideBarWidth: number;
/**
* The placeholder of the search form input
*/
@Input() searchFormPlaceholder: string;
/**
* A boolean representing if result entries are selectable
*/
@Input() selectable: boolean;
/**
* The config option used for selection functionality
*/
@Input() selectionConfig: SelectionConfig;
/**
* A boolean representing if show csv export button
*/
@Input() showCsvExport: boolean;
/**
* A boolean representing if show search sidebar button
*/
@Input() showSidebar: boolean;
/**
* Whether to show the thumbnail preview
*/
@Input() showThumbnails: boolean;
/**
* Whether to show the view mode switch
*/
@Input() showViewModes: boolean;
/**
* List of available view mode
*/
@Input() useUniquePageId: boolean;
/**
* List of available view mode
*/
@Input() viewModeList: ViewMode[];
/**
* Defines whether or not to show the scope selector
*/
@Input() showScopeSelector: boolean;
/**
* Whether or not to track search statistics by sending updates to the rest api
*/
@Input() trackStatistics: boolean;
/**
* The default value for the search query when none is already defined in the {@link SearchConfigurationService}
*/
@Input() query: string;
/**
* The fallback scope when no scope is defined in the url, if this is also undefined no scope will be set
*/
@Input() scope: string;
/**
* Hides the scope in the url, this can be useful when you hardcode the scope in another way
*/
@Input() hideScopeInUrl: boolean;
protected inAndOutputNames: (keyof ConfigurationSearchPageComponent & keyof this)[] = [
'configurationList',
'context',
'configuration',
'fixedFilterQuery',
'useCachedVersionIfAvailable',
'inPlaceSearch',
'linkType',
'searchInstanceId',
'searchEnabled',
'sideBarWidth',
'searchFormPlaceholder',
'selectable',
'selectionConfig',
'showCsvExport',
'showSidebar',
'showThumbnails',
'showViewModes',
'useUniquePageId',
'viewModeList',
'showScopeSelector',
'trackStatistics',
'query',
'scope',
'hideScopeInUrl',
];
protected getComponentName(): string {
return 'ConfigurationSearchPageComponent';
}
protected importThemedComponent(themeName: string): Promise<any> {
return import(`../../themes/${themeName}/app/search-page/configuration-search-page.component`);
}
protected importUnthemedComponent(): Promise<any> {
return import('./configuration-search-page.component');
}
}