Merge branch 'develop' of https://github.com/tainacan/tainacan into develop

This commit is contained in:
weryques 2018-04-04 14:42:29 -03:00
commit b0bd770edb
5 changed files with 18 additions and 12 deletions

View File

@ -3,12 +3,12 @@
<b-field
grouped
group-multiline>
<button
v-if="selectedItems.length > 0"
class="button field is-danger"
@click="deleteSelectedItems()">
<span>{{ $i18n.get('instruction_delete_selected_items') }} </span><b-icon icon="delete"/>
</button>
<button
v-if="selectedItems.length > 0"
class="button field is-danger"
@click="deleteSelectedItems()">
<span>{{ $i18n.get('instruction_delete_selected_items') }} </span><b-icon icon="delete"/>
</button>
</b-field>
<b-table
ref="itemsTable"
@ -25,6 +25,7 @@
<b-table-column
v-for="(column, index) in tableFields"
:key="index"
:custom-key="column.slug"
:label="column.label"
:visible="column.visible"
:width="column.field == 'row_actions' ? 78 : column.field == 'featured_image' ? 55 : undefined ">
@ -180,7 +181,8 @@ export default {
this.$router.push(this.$routerHelper.getItemEditPath(this.collectionId, itemId));
},
showValue( metadata ){
if( ! metadata || metadata.value === false )
if( ! metadata || metadata.value === false || metadata.value == undefined || metadata.value == '' )
return '';
if( Array.isArray( metadata.value ) ){

View File

@ -163,7 +163,7 @@ export default {
);
}
this.tableFields.push({ label: this.$i18n.get('label_actions'), field: 'row_actions', slug: 'actions', visible: true });
this.$console.log(this.tableFields);
this.prefTableFields = this.tableFields;
// this.$userPrefs.get('table_columns_' + this.collectionId)
// .then((value) => {

View File

@ -2,6 +2,7 @@
<b-datepicker
:id="id"
v-model="dateValue"
@blur="onBlur"
@input="onInput($event)"/>
</template>
@ -14,7 +15,7 @@
},
data() {
return {
dateValue: new Date()
dateValue: ''
}
},
props: {
@ -25,6 +26,9 @@
value: [String, Number, Array],
},
methods: {
onBlur() {
this.$emit('blur');
},
onInput($event) {
this.dateValue = $event;
let date_init = this.dateValue.getUTCFullYear() + '-' +

View File

@ -77,6 +77,7 @@
} else {
this.setFieldTypeMessage('');
}
return msg;
}
},

View File

@ -61,7 +61,6 @@ export const updateField = ( { commit }, { collectionId, fieldId, isRepositoryLe
resolve( field );
})
.catch(error => {
console.log(error);
reject({ error_message: error['response']['data'].error_message, errors: error['response']['data'].errors });
});
});
@ -88,12 +87,12 @@ export const deleteField = ({ commit }, { collectionId, fieldId, isRepositoryLev
});
};
export const updateCollectionFieldsOrder = ({ commit }, { collectionId, fieldsOrder }) => {
export const updateCollectionFieldsOrder = ({ commit, dispatch }, { collectionId, fieldsOrder }) => {
return new Promise((resolve, reject) => {
axios.tainacan.patch('/collections/' + collectionId, {
fields_order: fieldsOrder
}).then( res => {
commit('setCollection', res.data);
// dispatch('collection/setCollection', res.data, {root: true});
resolve( res.data );
}).catch( error => {
reject( error.response );