From c5a1b0ddb969e19cc4ede2f7be6d5dfa47baa705 Mon Sep 17 00:00:00 2001 From: Lauren-D Date: Thu, 16 Jul 2020 17:16:28 +0200 Subject: [PATCH] search: add button to export results This part add a button or dropdown list on search page to export results. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Adapts record search component and template. * Adds `export as ...` on ng-core-tester home page. Co-Authored-by: Johnny MarieĢthoz Co-Authored-by: Lauren-D --- .../src/app/home/home.component.ts | 19 ++++++++++- .../search/record-search.component.html | 25 ++++++++++++++ .../record/search/record-search.component.ts | 34 ++++++++++++++++++- 3 files changed, 76 insertions(+), 2 deletions(-) diff --git a/projects/ng-core-tester/src/app/home/home.component.ts b/projects/ng-core-tester/src/app/home/home.component.ts index c3907220..832929d6 100644 --- a/projects/ng-core-tester/src/app/home/home.component.ts +++ b/projects/ng-core-tester/src/app/home/home.component.ts @@ -37,10 +37,27 @@ export class HomeComponent { key: 'documents', label: 'Documents', component: DocumentComponent + , + exportFormats: [ + { + label: 'JSON', + format: 'json' + } + ], }, { key: 'organisations', - label: 'Organisations' + label: 'Organisations', + exportFormats: [ + { + label: 'JSON', + format: 'json' + }, + { + label: 'CSV', + format: 'csv' + } + ], } ]; diff --git a/projects/rero/ng-core/src/lib/record/search/record-search.component.html b/projects/rero/ng-core/src/lib/record/search/record-search.component.html index 3c23f508..51648bc2 100644 --- a/projects/rero/ng-core/src/lib/record/search/record-search.component.html +++ b/projects/rero/ng-core/src/lib/record/search/record-search.component.html @@ -54,6 +54,31 @@
{{ 'Add' | translate }} + + {{ 'Export as' | translate }} {{ exportFormats[0].label }} + +
+ + +