forked from hazza/dspace-angular
Merge pull request #2093 from 4Science/CST-8914-export-button
Add flag to show/hide csv export button
This commit is contained in:
@@ -1 +1 @@
|
||||
<ds-themed-search [trackStatistics]="true"></ds-themed-search>
|
||||
<ds-themed-search [showCsvExport]="true" [trackStatistics]="true"></ds-themed-search>
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<div class="d-flex justify-content-between">
|
||||
<h2 *ngIf="!disableHeader">{{ (configuration ? configuration + '.search.results.head' : 'search.results.head') | translate }}</h2>
|
||||
<ds-search-export-csv [searchConfig]="searchConfig"></ds-search-export-csv>
|
||||
<ds-search-export-csv *ngIf="showCsvExport" [searchConfig]="searchConfig"></ds-search-export-csv>
|
||||
</div>
|
||||
<div *ngIf="searchResults && searchResults?.hasSucceeded && !searchResults?.isLoading && searchResults?.payload?.page.length > 0" @fadeIn>
|
||||
<ds-viewable-collection
|
||||
|
@@ -47,6 +47,11 @@ export class SearchResultsComponent {
|
||||
*/
|
||||
@Input() searchConfig: PaginatedSearchOptions;
|
||||
|
||||
/**
|
||||
* A boolean representing if show csv export button
|
||||
*/
|
||||
@Input() showCsvExport = false;
|
||||
|
||||
/**
|
||||
* The current sorting configuration of the search
|
||||
*/
|
||||
|
@@ -21,7 +21,7 @@ import { ListableObject } from '../../object-collection/shared/listable-object.m
|
||||
templateUrl: '../../theme-support/themed.component.html',
|
||||
})
|
||||
export class ThemedSearchResultsComponent extends ThemedComponent<SearchResultsComponent> {
|
||||
protected inAndOutputNames: (keyof SearchResultsComponent & keyof this)[] = ['linkType', 'searchResults', 'searchConfig', 'sortConfig', 'viewMode', 'configuration', 'disableHeader', 'selectable', 'context', 'hidePaginationDetail', 'selectionConfig', 'contentChange', 'deselectObject', 'selectObject'];
|
||||
protected inAndOutputNames: (keyof SearchResultsComponent & keyof this)[] = ['linkType', 'searchResults', 'searchConfig', 'showCsvExport', 'sortConfig', 'viewMode', 'configuration', 'disableHeader', 'selectable', 'context', 'hidePaginationDetail', 'selectionConfig', 'contentChange', 'deselectObject', 'selectObject'];
|
||||
|
||||
@Input() linkType: CollectionElementLinkType;
|
||||
|
||||
@@ -29,6 +29,8 @@ export class ThemedSearchResultsComponent extends ThemedComponent<SearchResultsC
|
||||
|
||||
@Input() searchConfig: PaginatedSearchOptions;
|
||||
|
||||
@Input() showCsvExport = false;
|
||||
|
||||
@Input() sortConfig: SortOptions;
|
||||
|
||||
@Input() viewMode: ViewMode;
|
||||
|
@@ -30,16 +30,17 @@
|
||||
</button>
|
||||
</div>
|
||||
<ds-themed-search-results [searchResults]="resultsRD$ | async"
|
||||
[searchConfig]="searchOptions$ | async"
|
||||
[configuration]="(currentConfiguration$ | async)"
|
||||
[disableHeader]="!searchEnabled"
|
||||
[linkType]="linkType"
|
||||
[context]="(currentContext$ | async)"
|
||||
[selectable]="selectable"
|
||||
[selectionConfig]="selectionConfig"
|
||||
(contentChange)="onContentChange($event)"
|
||||
(deselectObject)="deselectObject.emit($event)"
|
||||
(selectObject)="selectObject.emit($event)"></ds-themed-search-results>
|
||||
[searchConfig]="searchOptions$ | async"
|
||||
[configuration]="(currentConfiguration$ | async)"
|
||||
[disableHeader]="!searchEnabled"
|
||||
[linkType]="linkType"
|
||||
[context]="(currentContext$ | async)"
|
||||
[selectable]="selectable"
|
||||
[selectionConfig]="selectionConfig"
|
||||
[showCsvExport]="showCsvExport"
|
||||
(contentChange)="onContentChange($event)"
|
||||
(deselectObject)="deselectObject.emit($event)"
|
||||
(selectObject)="selectObject.emit($event)"></ds-themed-search-results>
|
||||
</div>
|
||||
</div>
|
||||
</ng-template>
|
||||
|
@@ -118,6 +118,11 @@ export class SearchComponent implements OnInit {
|
||||
*/
|
||||
@Input() selectionConfig: SelectionConfig;
|
||||
|
||||
/**
|
||||
* A boolean representing if show csv export button
|
||||
*/
|
||||
@Input() showCsvExport = false;
|
||||
|
||||
/**
|
||||
* A boolean representing if show search sidebar button
|
||||
*/
|
||||
|
@@ -19,7 +19,7 @@ import { ListableObject } from '../object-collection/shared/listable-object.mode
|
||||
templateUrl: '../theme-support/themed.component.html',
|
||||
})
|
||||
export class ThemedSearchComponent extends ThemedComponent<SearchComponent> {
|
||||
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'];
|
||||
protected inAndOutputNames: (keyof SearchComponent & keyof this)[] = ['configurationList', 'context', 'configuration', 'fixedFilterQuery', 'useCachedVersionIfAvailable', 'inPlaceSearch', 'linkType', 'paginationId', 'searchEnabled', 'sideBarWidth', 'searchFormPlaceholder', 'selectable', 'selectionConfig', 'showCsvExport', 'showSidebar', 'showViewModes', 'useUniquePageId', 'viewModeList', 'showScopeSelector', 'resultFound', 'deselectObject', 'selectObject', 'trackStatistics'];
|
||||
|
||||
@Input() configurationList: SearchConfigurationOption[] = [];
|
||||
|
||||
@@ -47,6 +47,8 @@ export class ThemedSearchComponent extends ThemedComponent<SearchComponent> {
|
||||
|
||||
@Input() selectionConfig: SelectionConfig;
|
||||
|
||||
@Input() showCsvExport = false;
|
||||
|
||||
@Input() showSidebar = true;
|
||||
|
||||
@Input() showViewModes = true;
|
||||
|
Reference in New Issue
Block a user