Skip to content

Commit a64aefe

Browse files
committed
[DSC-1841] Add environment setting to disable item badge from browse and search results list
1 parent 5b16196 commit a64aefe

5 files changed

Lines changed: 12 additions & 0 deletions

File tree

config/config.example.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,8 @@ browseBy:
275275
fiveYearLimit: 30
276276
# The absolute lowest year to display in the dropdown (only used when no lowest date can be found for all items)
277277
defaultLowerLimit: 1900
278+
# Whether to add item badges to BOTH browse and search result lists.
279+
showLabels: true
278280
# If true, thumbnail images for items will be added to BOTH search and browse result lists.
279281
showThumbnails: true
280282
# The number of entries in a paginated browse results list.

src/app/shared/object-list/search-result-list-element/search-result-list-element.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export class SearchResultListElementComponent<T extends SearchResult<K>, K exten
3333
* Retrieve the dso from the search result
3434
*/
3535
ngOnInit(): void {
36+
this.showLabel = this.showLabel ?? this.appConfig.browseBy.showLabels;
3637
this.showThumbnails = this.showThumbnails ?? this.appConfig.browseBy.showThumbnails;
3738
if (hasValue(this.object)) {
3839
this.dso = this.object.indexableObject;

src/config/browse-by-config.interface.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ export interface BrowseByConfig extends Config {
2323
*/
2424
defaultLowerLimit: number;
2525

26+
/**
27+
* If true, badges for items will be added to BOTH search and browse result lists.
28+
*/
29+
showLabels: boolean;
30+
2631
/**
2732
* If true, thumbnail images for items will be added to BOTH search and browse result lists.
2833
*/

src/config/default-app-config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,8 @@ export class DefaultAppConfig implements AppConfig {
337337
fiveYearLimit: 30,
338338
// The absolute lowest year to display in the dropdown (only used when no lowest date can be found for all items)
339339
defaultLowerLimit: 1900,
340+
// Whether to add item badges to BOTH browse and search result lists.
341+
showLabels: true,
340342
// Whether to add item thumbnail images to BOTH browse and search result lists.
341343
showThumbnails: true,
342344
// The number of entries in a paginated browse results list.

src/environments/environment.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,8 @@ export const environment: BuildConfig = {
245245
fiveYearLimit: 30,
246246
// The absolute lowest year to display in the dropdown (only used when no lowest date can be found for all items)
247247
defaultLowerLimit: 1900,
248+
// Whether to add item badges to BOTH browse and search result lists.
249+
showLabels: true,
248250
// Whether to add item thumbnail images to BOTH browse and search result lists.
249251
showThumbnails: true,
250252
// The number of entries in a paginated browse results list.

0 commit comments

Comments
 (0)