diff --git a/app/frontend/src/components/forms/ExportSubmissions.vue b/app/frontend/src/components/forms/ExportSubmissions.vue index addae30ad..1efd97dfc 100644 --- a/app/frontend/src/components/forms/ExportSubmissions.vue +++ b/app/frontend/src/components/forms/ExportSubmissions.vue @@ -62,7 +62,7 @@ - + {{ $t('trans.exportSubmissions.formVersion') }} @@ -408,6 +408,8 @@ export default { 'submissionList', 'isRTL', 'lang', + 'selectedSubmissions', + 'selectedVersion', ]), ...mapGetters('auth', ['email']), @@ -426,7 +428,12 @@ export default { }, methods: { ...mapActions('notifications', ['addNotification']), - ...mapActions('form', ['fetchForm', 'fetchFormCSVExportFields']), + ...mapActions('form', [ + 'fetchForm', + 'fetchFormCSVExportFields', + 'selectSubmissions', + 'selectVersion', + ]), async changeVersions(value) { this.versionRequired = false; value !== '' @@ -503,7 +510,8 @@ export default { // drafts: true }, fieldToExport, - emailExport + emailExport, + this.selectedSubmissions ); if (response && response.data && !emailExport) { @@ -531,6 +539,9 @@ export default { `${this.form.id}: ${error}`, }); } + // empty selected submissions for export if there are so + this.selectSubmissions(''); + this.selectVersion(null); }, async updateVersions() { @@ -553,7 +564,11 @@ export default { this.versions.push( ...this.form.versions.map((version) => version.version) ); - this.versionSelected = this.versions[0]; + if (this.selectedVersion) { + this.versionSelected = this.selectedVersion; + } else { + this.versionSelected = this.versions[0]; + } await this.refreshFormFields(this.versionSelected); } }, diff --git a/app/frontend/src/components/forms/SubmissionsTable.vue b/app/frontend/src/components/forms/SubmissionsTable.vue index 7bb089c1c..3c8bf8b12 100644 --- a/app/frontend/src/components/forms/SubmissionsTable.vue +++ b/app/frontend/src/components/forms/SubmissionsTable.vue @@ -101,6 +101,17 @@ +
+ + {{ $t('trans.exportSubmissions.formVersion') }} + + +