diff --git a/components/forms/PybossaForm.vue b/components/forms/PybossaForm.vue index 233d3a56..29dadde3 100644 --- a/components/forms/PybossaForm.vue +++ b/components/forms/PybossaForm.vue @@ -168,10 +168,11 @@ export default { process () { this.processing = true this.alert = '' + return this.$axios({ method: this.form.method, url: this.form.endpoint, - data: this.form.model, + data: this.getModel(), params: this.form.params || {}, headers: { 'X-CSRFToken': this.form.model.csrf @@ -235,6 +236,26 @@ export default { }) }, + /** + * Return the form model after converting any multiselect fields. + */ + getModel () { + const modelCopy = JSON.parse(JSON.stringify(this.form.model)) + const multiselectFields = this.form.schema.fields.filter(field => { + return field.type === 'vueMultiSelect' + }) + + for (let field of multiselectFields) { + let value = modelCopy[field.model] + if (Array.isArray(value)) { + modelCopy[field.model] = value.map(item => (item.id)) + } else if (value) { + modelCopy[field.model] = value.id + } + } + return modelCopy + }, + /** * Emit success and go to next, if present. * @param {Object} data diff --git a/components/modals/AddExportField.vue b/components/modals/AddExportField.vue deleted file mode 100644 index 12e956cf..00000000 --- a/components/modals/AddExportField.vue +++ /dev/null @@ -1,75 +0,0 @@ - - - diff --git a/components/modals/AddFormField.vue b/components/modals/AddFormField.vue index 9c89015c..c3ba7f30 100644 --- a/components/modals/AddFormField.vue +++ b/components/modals/AddFormField.vue @@ -64,7 +64,7 @@ export default { ] }, selectOptions: { - hideNoneSelected: true + hideNoneSelectedText: true }, validator: (value) => { if (!value || !value.length) { @@ -89,7 +89,7 @@ export default { return model.type !== 'input' }, selectOptions: { - hideNoneSelected: true + hideNoneSelectedText: true }, validator: (value, field, model) => { if ((!value || !value.length) && model.type === 'input') { diff --git a/layouts/admin-collection-dashboard.vue b/layouts/admin-collection-dashboard.vue index f0f8cad3..efbcb246 100644 --- a/layouts/admin-collection-dashboard.vue +++ b/layouts/admin-collection-dashboard.vue @@ -69,15 +69,6 @@ export default { } } }, - { - label: 'Exports', - link: { - name: 'admin-collection-short_name-exports', - params: { - short_name: this.currentCollection.short_name - } - } - }, { label: 'Featured Projects', link: { diff --git a/layouts/bases/Tabs.vue b/layouts/bases/Tabs.vue index ff095824..b3851de7 100644 --- a/layouts/bases/Tabs.vue +++ b/layouts/bases/Tabs.vue @@ -47,11 +47,11 @@ export default { }, backgroundImageUrl: { type: String, - required: true + default: '' }, navbarBrand: { type: String, - required: true + default: '' } }, diff --git a/layouts/collection-default.vue b/layouts/collection-default.vue index 58ae0c8a..8bfc261e 100644 --- a/layouts/collection-default.vue +++ b/layouts/collection-default.vue @@ -22,7 +22,10 @@ export default { }, backgroundImageUrl () { - if (this.currentCollection.info.background) { + if ( + typeof this.currentCollection.info !== 'undefined' && + this.currentCollection.info.background + ) { return this.currentCollection.info.background } return '~/assets/img/app-background.jpg' diff --git a/layouts/collection-tabs.vue b/layouts/collection-tabs.vue index caa0e50c..b731184e 100644 --- a/layouts/collection-tabs.vue +++ b/layouts/collection-tabs.vue @@ -25,7 +25,10 @@ export default { }, backgroundImageUrl () { - if (this.currentCollection.info.background) { + if ( + typeof this.currentCollection.info !== 'undefined' && + this.currentCollection.info.background + ) { return this.currentCollection.info.background } return '~/assets/img/app-background.jpg' diff --git a/package.json b/package.json index 55390118..a9f40f07 100644 --- a/package.json +++ b/package.json @@ -21,11 +21,11 @@ "@nuxtjs/proxy": "^1.1.4", "@nuxtjs/pwa": "^2.0.2", "@nuxtjs/sentry": "^1.0.3", - "bootstrap": "4.0.0", + "bootstrap": "4.1.1", "bootstrap-vue": "^2.0.0-rc.6", "capitalize": "^1.0.0", "chartist-plugin-tooltips": "0.0.17", - "clipboard": "^1.7.1", + "clipboard": "^2.0.1", "cookie": "^0.3.1", "cookieconsent": "^3.0.4", "croppie": "^2.5.0", diff --git a/pages/admin/collection/_short_name/exports/_id/index.vue b/pages/admin/collection/_short_name/exports/_id/index.vue deleted file mode 100644 index daa3eb6a..00000000 --- a/pages/admin/collection/_short_name/exports/_id/index.vue +++ /dev/null @@ -1,177 +0,0 @@ - - - diff --git a/pages/admin/collection/_short_name/exports/index.vue b/pages/admin/collection/_short_name/exports/index.vue deleted file mode 100644 index fc054b15..00000000 --- a/pages/admin/collection/_short_name/exports/index.vue +++ /dev/null @@ -1,144 +0,0 @@ - - - diff --git a/pages/admin/collection/_short_name/exports/new.vue b/pages/admin/collection/_short_name/exports/new.vue deleted file mode 100644 index e0802149..00000000 --- a/pages/admin/collection/_short_name/exports/new.vue +++ /dev/null @@ -1,188 +0,0 @@ - - - diff --git a/pages/admin/collection/_short_name/volumes/_id/index.vue b/pages/admin/collection/_short_name/volumes/_id/index.vue index 8f1fd546..14974436 100644 --- a/pages/admin/collection/_short_name/volumes/_id/index.vue +++ b/pages/admin/collection/_short_name/volumes/_id/index.vue @@ -151,7 +151,7 @@ export default { return { id: importer, name: importer } }), selectOptions: { - hideNoneSelected: true + hideNoneSelectedText: true }, hint: 'The importer type', disabled: this.hasProjects diff --git a/pages/admin/collection/_short_name/volumes/new.vue b/pages/admin/collection/_short_name/volumes/new.vue index e3c77934..4a4734b5 100644 --- a/pages/admin/collection/_short_name/volumes/new.vue +++ b/pages/admin/collection/_short_name/volumes/new.vue @@ -106,7 +106,7 @@ export default { return { id: importer, name: importer } }), selectOptions: { - hideNoneSelected: true + hideNoneSelectedText: true }, hint: 'The importer type' } diff --git a/pages/admin/site/results.vue b/pages/admin/site/results.vue index f10cd377..3edf3be0 100644 --- a/pages/admin/site/results.vue +++ b/pages/admin/site/results.vue @@ -11,21 +11,21 @@ show-empty responsive :dark="darkMode" - :items="unanalysedCategories" + :items="unanalysedResultsSummary" :fields="tableFields"> -