Prevents breaking form hooks when theme is not updated. Bulk edition second select now automatically selects when only one option is available.
This commit is contained in:
parent
94144763ed
commit
f6ad2f3275
|
@ -25,11 +25,13 @@
|
|||
<template
|
||||
v-for="(metadatum, index) in metadata">
|
||||
<option
|
||||
:key="index"
|
||||
v-if="metadatum.id"
|
||||
:value="metadatum.id">
|
||||
{{ metadatum.name }}
|
||||
</option>
|
||||
<option
|
||||
:key="index"
|
||||
v-if="index === Object.keys(metadata).length-1"
|
||||
value="status">
|
||||
{{ $i18n.get('label_status') }}
|
||||
|
@ -42,6 +44,7 @@
|
|||
v-if="bulkEditionProcedures[criterion] &&
|
||||
bulkEditionProcedures[criterion].metadatumID"
|
||||
:disabled="!!bulkEditionProcedures[criterion].action"
|
||||
:value="bulkEditionProcedures[criterion].action ? bulkEditionProcedures[criterion].action : undefined"
|
||||
class="tainacan-bulk-edition-field tainacan-bulk-edition-field-not-last"
|
||||
:placeholder="$i18n.get('instruction_select_a_action')"
|
||||
@input="addToBulkEditionProcedures($event, 'action', criterion)">
|
||||
|
@ -57,7 +60,6 @@
|
|||
<option
|
||||
v-for="(edtAct, key) in editionActionsForNotMultiple"
|
||||
:value="edtAct"
|
||||
:selected="Object.keys(editionActionsForNotMultiple).length === 1"
|
||||
:key="key">
|
||||
{{ edtAct }}
|
||||
</option>
|
||||
|
@ -533,11 +535,19 @@
|
|||
return found ? found : {};
|
||||
},
|
||||
addToBulkEditionProcedures(value, key, criterion){
|
||||
|
||||
if(Array.isArray(value)){
|
||||
value = value[0];
|
||||
}
|
||||
|
||||
this.$set(this.bulkEditionProcedures[criterion], `${key}`, value);
|
||||
|
||||
if (key == 'metadatumID') {
|
||||
if (this.getMetadataByID(this.bulkEditionProcedures[criterion].metadatumID).multiple != 'yes') {
|
||||
let value = Object.values(this.editionActionsForNotMultiple)[0];
|
||||
this.addToBulkEditionProcedures(value, 'action', criterion);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
|
|
|
@ -65,7 +65,7 @@ export const formHooks = {
|
|||
];
|
||||
// Gets data from existing extra form hooks
|
||||
for (let position of positions) {
|
||||
if (this.formHooks[entity][position] && this.formHooks[entity][position] != undefined) {
|
||||
if (this.formHooks[entity] && this.formHooks[entity][position] && this.formHooks[entity][position] != undefined) {
|
||||
let formElement = document.getElementById('form-' + entity + '-' + position);
|
||||
if (formElement) {
|
||||
for (let element of formElement.elements) {
|
||||
|
@ -95,7 +95,7 @@ export const formHooks = {
|
|||
];
|
||||
// Gets data from existing extra form hooks
|
||||
for (let position of positions) {
|
||||
if (this.formHooks[entity][position] && this.formHooks[entity][position] != undefined) {
|
||||
if (this.formHooks[entity] && this.formHooks[entity][position] && this.formHooks[entity][position] != undefined) {
|
||||
let formElement = document.getElementById('form-' + entity + '-' + position);
|
||||
|
||||
if (formElement) {
|
||||
|
|
|
@ -110,9 +110,8 @@ export const ThemeItemsListing = new Vue({
|
|||
},
|
||||
render: h => h(ThemeItemsList),
|
||||
beforeMount () {
|
||||
console.log("oie")
|
||||
//if (this.$el.attributes['collection-id'] != undefined)
|
||||
this.collectionId = this.$el.attributes['collection-id'].value;
|
||||
if (this.$el.attributes['collection-id'] != undefined)
|
||||
this.collectionId = this.$el.attributes['collection-id'].value;
|
||||
if (this.$el.attributes['default-view-mode'] != undefined)
|
||||
this.defaultViewMode = this.$el.attributes['default-view-mode'].value;
|
||||
if (this.$el.attributes['enabled-view-modes'] != undefined)
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
export default {
|
||||
name: "ThemeItemsList",
|
||||
created() {
|
||||
console.log("oi")
|
||||
this.$userPrefs.init();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue