From a98610913a77d36ea2895291f0202c8869b808d6 Mon Sep 17 00:00:00 2001 From: Kelani Tolulope Date: Mon, 20 Mar 2023 22:34:01 +0100 Subject: [PATCH] Add preselect fields when exporting a record list --- .../web/compose/src/components/PageBlocks/RecordListBase.vue | 1 + .../src/components/Public/Record/Exporter/Configurator.vue | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/client/web/compose/src/components/PageBlocks/RecordListBase.vue b/client/web/compose/src/components/PageBlocks/RecordListBase.vue index d8b0e89dc..e42689edf 100644 --- a/client/web/compose/src/components/PageBlocks/RecordListBase.vue +++ b/client/web/compose/src/components/PageBlocks/RecordListBase.vue @@ -73,6 +73,7 @@ :prefilter="prefilter" :selection="selected" :processing="processing" + :preselected-fields="fields.map(({ moduleField }) => moduleField)" class="mr-1 float-left" @export="onExport" /> diff --git a/client/web/compose/src/components/Public/Record/Exporter/Configurator.vue b/client/web/compose/src/components/Public/Record/Exporter/Configurator.vue index 37c1972e0..d351e0e7f 100644 --- a/client/web/compose/src/components/Public/Record/Exporter/Configurator.vue +++ b/client/web/compose/src/components/Public/Record/Exporter/Configurator.vue @@ -487,7 +487,9 @@ export default { preselectedFields: { handler (value) { - this.fields = value.filter(f => this.disabledTypes.indexOf(f.kind) < 0) + if (!this.fields.length) { + this.fields = value.filter(f => this.disabledTypes.indexOf(f.kind) < 0) + } }, immediate: true, },