LINTER FOLKS. LINTER.

This commit is contained in:
mateuswetah 2018-03-23 10:20:37 -03:00
parent f98553f1f3
commit 0b5dfa8b30
37 changed files with 949 additions and 114 deletions

16
.eslintrc.js Normal file
View File

@ -0,0 +1,16 @@
module.exports = {
extends: [
// add more generic rulesets here, such as:
'eslint:recommended',
'plugin:vue/essential'
],
rules: {
// override/add rules settings here, such as:
'vue/no-unused-vars': 'error',
"no-console": "warn",
"no-unused-vars": "warn",
"no-undef": "warn",
"vue/no-side-effects-in-computed-properties": "warn",
"vue/return-in-computed-property": "warn"
}
}

822
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -31,6 +31,9 @@
"css-loader": "^0.25.0", "css-loader": "^0.25.0",
"cypress": "^2.1.0", "cypress": "^2.1.0",
"element-theme-chalk": "^2.1.0", "element-theme-chalk": "^2.1.0",
"eslint": "^4.19.1",
"eslint-loader": "^2.0.0",
"eslint-plugin-vue": "^4.4.0",
"file-loader": "^0.9.0", "file-loader": "^0.9.0",
"postcss-loader": "^2.1.0", "postcss-loader": "^2.1.0",
"sass-resources-loader": "^1.3.2", "sass-resources-loader": "^1.3.2",

View File

@ -118,7 +118,9 @@
<p class="help is-danger">{{formErrorMessage}}</p> <p class="help is-danger">{{formErrorMessage}}</p>
</form> </form>
<b-loading :active.sync="isLoading" :canCancel="false"></b-loading> <b-loading
:active.sync="isLoading"
:canCancel="false"></b-loading>
</div> </div>
</div> </div>
</template> </template>
@ -224,7 +226,6 @@
status: 'private', status: 'private',
allowInsert: this.form.allowInsert allowInsert: this.form.allowInsert
}; };
console.log(data); console.log(data);
this.updateCategory(data) this.updateCategory(data)

View File

@ -280,7 +280,7 @@ export default {
deleteThumbnail() { deleteThumbnail() {
this.updateThumbnail({collectionId: this.collectionId, thumbnailId: 0}) this.updateThumbnail({collectionId: this.collectionId, thumbnailId: 0})
.then((res) => { .then(() => {
this.collection.featured_image = false; this.collection.featured_image = false;
}) })
.catch((error) => { .catch((error) => {

View File

@ -188,7 +188,7 @@ export default {
if ((field.field_type_object && field.field_type_object.form_component) || field.edit_form == '') { if ((field.field_type_object && field.field_type_object.form_component) || field.edit_form == '') {
this.updateField({collectionId: this.collectionId, fieldId: field.id, isRepositoryLevel: this.isRepositoryLevel, index: this.index, options: this.editForm}) this.updateField({collectionId: this.collectionId, fieldId: field.id, isRepositoryLevel: this.isRepositoryLevel, index: this.index, options: this.editForm})
.then((field) => { .then(() => {
this.editForm = {}; this.editForm = {};
this.formErrors = {}; this.formErrors = {};
this.formErrorMessage = ''; this.formErrorMessage = '';
@ -215,7 +215,7 @@ export default {
formObj[key] = value; formObj[key] = value;
this.updateField({collectionId: this.collectionId, fieldId: field.id, isRepositoryLevel: this.isRepositoryLevel, index: this.index, options: formObj}) this.updateField({collectionId: this.collectionId, fieldId: field.id, isRepositoryLevel: this.isRepositoryLevel, index: this.index, options: formObj})
.then((field) => { .then(() => {
this.editForm = {}; this.editForm = {};
this.formErrors = {}; this.formErrors = {};
this.formErrorMessage = ''; this.formErrorMessage = '';

View File

@ -130,7 +130,7 @@ export default {
if ((filter.filter_type_object && filter.filter_type_object.form_component) || filter.edit_form == '') { if ((filter.filter_type_object && filter.filter_type_object.form_component) || filter.edit_form == '') {
this.updateFilter({ filterId: filter.id, index: this.index, options: this.editForm}) this.updateFilter({ filterId: filter.id, index: this.index, options: this.editForm})
.then((filter) => { .then(() => {
this.editForm = {}; this.editForm = {};
this.formErrors = {}; this.formErrors = {};
this.formErrorMessage = ''; this.formErrorMessage = '';
@ -157,7 +157,7 @@ export default {
formObj[key] = value; formObj[key] = value;
this.updateFilter({ filterId: filter.id, index: this.index, options: formObj}) this.updateFilter({ filterId: filter.id, index: this.index, options: formObj})
.then((filter) => { .then(() => {
this.editForm = {}; this.editForm = {};
this.formErrors = {}; this.formErrors = {};
this.formErrorMessage = ''; this.formErrorMessage = '';

View File

@ -195,7 +195,7 @@ export default {
this.$router.push(this.$routerHelper.getItemPath(this.form.collectionId, this.itemId)); this.$router.push(this.$routerHelper.getItemPath(this.form.collectionId, this.itemId));
}).catch(error => { }).catch(error => {
console.log(error);
this.isLoading = false; this.isLoading = false;
}); });
}, },
@ -234,7 +234,7 @@ export default {
}, },
loadMetadata() { loadMetadata() {
// Obtains Item Field // Obtains Item Field
this.fetchFields(this.itemId).then(res => { this.fetchFields(this.itemId).then(() => {
this.isLoading = false; this.isLoading = false;
}); });
}, },
@ -245,7 +245,7 @@ export default {
for (let file of $event) { for (let file of $event) {
this.sendAttachment({ item_id: this.itemId, file: file }) this.sendAttachment({ item_id: this.itemId, file: file })
.then((res) => { .then(() => {
}) })
.catch((error) => { .catch((error) => {
@ -273,7 +273,7 @@ export default {
}, },
deleteThumbnail() { deleteThumbnail() {
this.updateThumbnail({itemId: this.itemId, thumbnailId: 0}) this.updateThumbnail({itemId: this.itemId, thumbnailId: 0})
.then((res) => { .then(() => {
this.item.featured_image = false; this.item.featured_image = false;
}) })
.catch((error) => { .catch((error) => {
@ -281,7 +281,7 @@ export default {
}); });
}, },
deleteFile(index) { deleteFile(index) {
console.log("Delete:" + index);
} }
}, },
computed: { computed: {

View File

@ -14,7 +14,6 @@
v-if="totalCategories > 0" v-if="totalCategories > 0"
ref="categoryTable" ref="categoryTable"
:data="categories" :data="categories"
@selection-change="handleSelectionChange"
:checked-rows.sync="selectedCategories" :checked-rows.sync="selectedCategories"
checkable checkable
:loading="isLoading" :loading="isLoading"
@ -150,7 +149,7 @@
for (let category of this.selectedCategories) { for (let category of this.selectedCategories) {
this.deleteCategory(category.id) this.deleteCategory(category.id)
.then((res) => { .then(() => {
this.loadCategories(); this.loadCategories();
this.$toast.open({ this.$toast.open({
duration: 3000, duration: 3000,
@ -159,7 +158,7 @@
type: 'is-secondary', type: 'is-secondary',
queue: false queue: false
}) })
}).catch((err) => { }).catch(() => {
this.$toast.open({ this.$toast.open({
duration: 3000, duration: 3000,
message: this.$i18n.get('info_error_deleting_category'), message: this.$i18n.get('info_error_deleting_category'),
@ -173,8 +172,6 @@
} }
}); });
}, },
handleSelectionChange(value) {
},
goToCategoryPage(categoryId) { goToCategoryPage(categoryId) {
this.$router.push(this.$routerHelper.getCategoryPath(categoryId)); this.$router.push(this.$routerHelper.getCategoryPath(categoryId));
}, },

View File

@ -6,7 +6,6 @@
<b-table <b-table
ref="collectionTable" ref="collectionTable"
:data="collections" :data="collections"
@selection-change="handleSelectionChange"
:checked-rows.sync="selectedCollections" :checked-rows.sync="selectedCollections"
checkable checkable
:loading="isLoading" :loading="isLoading"
@ -70,7 +69,7 @@
</template> </template>
<script> <script>
import { mapActions, mapGetters } from 'vuex' import { mapActions } from 'vuex'
export default { export default {
name: 'CollectionsList', name: 'CollectionsList',
@ -126,7 +125,7 @@ export default {
for (let collection of this.selectedCollections) { for (let collection of this.selectedCollections) {
this.deleteCollection(collection.id) this.deleteCollection(collection.id)
.then((res) => { .then(() => {
this.loadCollections(); this.loadCollections();
this.$toast.open({ this.$toast.open({
duration: 3000, duration: 3000,
@ -135,7 +134,7 @@ export default {
type: 'is-secondary', type: 'is-secondary',
queue: false queue: false
}) })
}).catch((err) => { }).catch(() => {
this.$toast.open({ this.$toast.open({
duration: 3000, duration: 3000,
message: this.$i18n.get('info_error_deleting_collection'), message: this.$i18n.get('info_error_deleting_collection'),
@ -149,8 +148,6 @@ export default {
} }
}); });
}, },
handleSelectionChange(value) {
},
goToCollectionPage(collectionId) { goToCollectionPage(collectionId) {
this.$router.push(this.$routerHelper.getCollectionPath(collectionId)); this.$router.push(this.$routerHelper.getCollectionPath(collectionId));
}, },

View File

@ -220,7 +220,7 @@ export default {
if (!this.isRepositoryLevel) if (!this.isRepositoryLevel)
this.updateFieldsOrder(); this.updateFieldsOrder();
}) })
.catch((error) => { .catch(() => {
}); });
}, },
editField(field) { editField(field) {
@ -270,10 +270,10 @@ export default {
this.isLoadingFields = true; this.isLoadingFields = true;
this.fetchFieldTypes() this.fetchFieldTypes()
.then((res) => { .then(() => {
this.isLoadingFieldTypes = false; this.isLoadingFieldTypes = false;
}) })
.catch((error) => { .catch(() => {
this.isLoadingFieldTypes = false; this.isLoadingFieldTypes = false;
}); });
@ -285,10 +285,10 @@ export default {
this.fetchFields({collectionId: this.collectionId, isRepositoryLevel: this.isRepositoryLevel}) this.fetchFields({collectionId: this.collectionId, isRepositoryLevel: this.isRepositoryLevel})
.then((res) => { .then(() => {
this.isLoadingFields = false; this.isLoadingFields = false;
}) })
.catch((error) => { .catch(() => {
this.isLoadingFields = false; this.isLoadingFields = false;
}); });
} }

View File

@ -9,7 +9,6 @@
</template> </template>
<script> <script>
import { mapActions, mapGetters } from 'vuex'; import { mapActions, mapGetters } from 'vuex';
import { eventFilterBus } from '../../../js/event-bus-filters'
export default { export default {
data(){ data(){

View File

@ -280,17 +280,15 @@ export default {
this.activeFilterList.splice(index, 1); this.activeFilterList.splice(index, 1);
this.isLoadingFieldTypes = true; this.isLoadingFieldTypes = true;
this.fetchFields({collectionId: this.collectionId, isRepositoryLevel: this.isRepositoryLevel}) this.fetchFields({collectionId: this.collectionId, isRepositoryLevel: this.isRepositoryLevel})
.then((res) => { .then(() => {
this.isLoadingFieldTypes = false; this.isLoadingFieldTypes = false;
}) })
.catch((error) => { .catch(() => {
this.isLoadingFieldTypes = false; this.isLoadingFieldTypes = false;
}); });
if (!this.isRepositoryLevel) if (!this.isRepositoryLevel)
this.updateFiltersOrder(); this.updateFiltersOrder();
})
.catch((error) => {
}); });
}, },
confirmSelectedFilterType() { confirmSelectedFilterType() {
@ -379,26 +377,26 @@ export default {
this.isLoadingFilterTypes = true; this.isLoadingFilterTypes = true;
this.fetchFilterTypes() this.fetchFilterTypes()
.then((res) => { .then(() => {
this.isLoadingFilterTypes = false; this.isLoadingFilterTypes = false;
}) })
.catch((error) => { .catch(() => {
this.isLoadingFilterTypes = false; this.isLoadingFilterTypes = false;
}); });
this.fetchFilters({collectionId: this.collectionId, isRepositoryLevel: this.isRepositoryLevel}) this.fetchFilters({collectionId: this.collectionId, isRepositoryLevel: this.isRepositoryLevel})
.then((res) => { .then(() => {
this.isLoadingFilters = false; this.isLoadingFilters = false;
// Needs to be done after activeFilterList exists to compare and remove chosen fields. // Needs to be done after activeFilterList exists to compare and remove chosen fields.
this.fetchFields({collectionId: this.collectionId, isRepositoryLevel: this.isRepositoryLevel}) this.fetchFields({collectionId: this.collectionId, isRepositoryLevel: this.isRepositoryLevel})
.then((res) => { .then(() => {
this.isLoadingFieldTypes = false; this.isLoadingFieldTypes = false;
}) })
.catch((error) => { .catch(() => {
this.isLoadingFieldTypes = false; this.isLoadingFieldTypes = false;
}); });
}) })
.catch((error) => { .catch(() => {
this.isLoadingFilters = false; this.isLoadingFilters = false;
}); });
} }

View File

@ -65,7 +65,7 @@
</template> </template>
<script> <script>
import { mapActions, mapGetters } from 'vuex'; import { mapActions } from 'vuex';
export default { export default {
name: 'ItemsList', name: 'ItemsList',
@ -92,7 +92,7 @@ export default {
this.$dialog.confirm({ this.$dialog.confirm({
message: this.$i18n.get('info_warning_item_delete'), message: this.$i18n.get('info_warning_item_delete'),
onConfirm: () => { onConfirm: () => {
this.deleteItem(itemId).then((res) => { this.deleteItem(itemId).then(() => {
this.loadItems(); this.loadItems();
this.$toast.open({ this.$toast.open({
duration: 3000, duration: 3000,
@ -105,7 +105,7 @@ export default {
if (this.selectedItems[i].id == this.itemId) if (this.selectedItems[i].id == this.itemId)
this.selectedItems.splice(i, 1); this.selectedItems.splice(i, 1);
} }
}).catch(( error ) => { }).catch(() => {
this.$toast.open({ this.$toast.open({
duration: 3000, duration: 3000,
@ -125,7 +125,7 @@ export default {
for (let item of this.selectedItems) { for (let item of this.selectedItems) {
this.deleteItem(item.id) this.deleteItem(item.id)
.then((res) => { .then(() => {
this.loadItems(); this.loadItems();
this.$toast.open({ this.$toast.open({
duration: 3000, duration: 3000,
@ -135,7 +135,7 @@ export default {
queue: false queue: false
}); });
}).catch((err) => { }).catch(() => {
this.$toast.open({ this.$toast.open({
duration: 3000, duration: 3000,
message: this.$i18n.get('info_error_deleting_item'), message: this.$i18n.get('info_error_deleting_item'),

View File

@ -58,7 +58,7 @@ export default {
} }
}, },
watch: { watch: {
'$route' (to, from) { '$route' (to) {
this.isCompressed = (to.params.collectionId != undefined); this.isCompressed = (to.params.collectionId != undefined);
this.activeRoute = to.name; this.activeRoute = to.name;
} }

View File

@ -69,7 +69,7 @@ export default {
id: Number id: Number
}, },
watch: { watch: {
'$route' (to, from) { '$route' (to) {
this.activeRoute = to.name; this.activeRoute = to.name;
} }
}, },

View File

@ -93,7 +93,7 @@ export default {
} }
}, },
watch: { watch: {
'$route' (to, from) { '$route' (to) {
this.onSecondaryPage = (to.params.collectionId != undefined); this.onSecondaryPage = (to.params.collectionId != undefined);
this.pageTitle = this.$route.meta.title; this.pageTitle = this.$route.meta.title;
this.currentIcon = this.$route.meta.icon; this.currentIcon = this.$route.meta.icon;

View File

@ -56,7 +56,7 @@ export default {
border-radius: 10px; border-radius: 10px;
margin: 0px 0px 0px -37px; margin: 0px 0px 0px -37px;
position: absolute; position: absolute;
z-index: 99999999999999; z-index: 999999999999999;
bottom: 100%; bottom: 100%;
left: 0%; left: 0%;
min-width: 250px; min-width: 250px;

View File

@ -103,7 +103,7 @@
this.isLoading = false; this.isLoading = false;
this.totalCategories = res.total; this.totalCategories = res.total;
}) })
.catch((error) => { .catch(() => {
this.isLoading = false; this.isLoading = false;
}); });
}, },
@ -126,7 +126,7 @@
.then((value) => { .then((value) => {
this.categoriesPerPage = value; this.categoriesPerPage = value;
}) })
.catch((error) => { .catch(() => {
this.$userPrefs.set('categories_per_page', 12, null); this.$userPrefs.set('categories_per_page', 12, null);
}); });
}, },

View File

@ -103,7 +103,7 @@ export default {
this.isLoading = false; this.isLoading = false;
this.totalCollections = res.total; this.totalCollections = res.total;
}) })
.catch((error) => { .catch(() => {
this.isLoading = false; this.isLoading = false;
}); });
}, },
@ -126,7 +126,7 @@ export default {
.then((value) => { .then((value) => {
this.collectionsPerPage = value; this.collectionsPerPage = value;
}) })
.catch((error) => { .catch(() => {
this.$userPrefs.set('collections_per_page', 12, null); this.$userPrefs.set('collections_per_page', 12, null);
}); });
}, },

View File

@ -135,7 +135,7 @@ export default {
'search_by_collection' 'search_by_collection'
]), ]),
onChangeTableFields(field) { onChangeTableFields(field) {
let prevValue = this.prefTableFields; // let prevValue = this.prefTableFields;
let index = this.prefTableFields.findIndex(alteredField => alteredField.slug === field.slug); let index = this.prefTableFields.findIndex(alteredField => alteredField.slug === field.slug);
if (index >= 0) { if (index >= 0) {
//prevValue[index].visible = this.prefTableFields[index].visible ? false : true; //prevValue[index].visible = this.prefTableFields[index].visible ? false : true;
@ -187,11 +187,10 @@ export default {
this.alterQueryString(); this.alterQueryString();
} }
promisse.then(() => {
promisse.then((res) => {
this.isLoading = false; this.isLoading = false;
}) })
.catch((error) => { .catch(() => {
this.isLoading = false; this.isLoading = false;
}); });
}, },
@ -233,7 +232,7 @@ export default {
.then((value) => { .then((value) => {
this.itemsPerPage = value; this.itemsPerPage = value;
}) })
.catch((error) => { .catch(() => {
this.$userPrefs.set('items_per_page', 12, null); this.$userPrefs.set('items_per_page', 12, null);
}); });
}, },
@ -309,9 +308,10 @@ export default {
padding: $page-small-side-padding; padding: $page-small-side-padding;
.label { .label {
font-size: 12px;
font-weight: normal; font-weight: normal;
font-size: 0.85em;
} }
} }
.table-container { .table-container {

View File

@ -70,7 +70,7 @@ export default {
let loadingInstance = this; let loadingInstance = this;
// Obtains Item // Obtains Item
this.fetchItem(this.itemId).then(res => { this.fetchItem(this.itemId).then(() => {
loadingInstance.isLoading = false; loadingInstance.isLoading = false;
}); });
} }

View File

@ -22,7 +22,7 @@
v-model="parent"> v-model="parent">
<option :value="0" selected> ---{{ $i18n.get('label_parent_term') }}--- </option> <option :value="0" selected> ---{{ $i18n.get('label_parent_term') }}--- </option>
<option <option
v-for="option,index in options" v-for="(option,index) in options"
:key="index" :key="index"
:value="option.term_id" :value="option.term_id"
v-html="setSpaces( option.level ) + option.name"></option> v-html="setSpaces( option.level ) + option.name"></option>
@ -97,7 +97,7 @@
if( !Array.isArray( val ) && this.field.field.multiple === 'no' ){ if( !Array.isArray( val ) && this.field.field.multiple === 'no' ){
axios.patch(`/item/${this.item_id}/metadata/${this.field_id}`, { axios.patch(`/item/${this.item_id}/metadata/${this.field_id}`, {
values: term_id, values: term_id,
}).then( res => { }).then(() => {
instance.$emit('newTerm', term_id); instance.$emit('newTerm', term_id);
}) })
} else { } else {

View File

@ -1,6 +1,8 @@
<template> <template>
<div> <div>
<div v-for="option,index in options"> <div
v-for="(option, index) in options"
:key="index">
<b-checkbox <b-checkbox
:id="id" :id="id"
:style="{ paddingLeft: (option.level * 30) + 'px' }" :style="{ paddingLeft: (option.level * 30) + 'px' }"

View File

@ -1,6 +1,8 @@
<template> <template>
<div> <div>
<div v-for="option,index in options"> <div
v-for="(option, index) in options"
:key="index">
<b-radio <b-radio
:id="id" :id="id"
:style="{ paddingLeft: (option.level * 30) + 'px' }" :style="{ paddingLeft: (option.level * 30) + 'px' }"

View File

@ -7,7 +7,7 @@
@input="emitChange()" @input="emitChange()"
:placeholder="$i18n.get('label_select_category')" expanded> :placeholder="$i18n.get('label_select_category')" expanded>
<option <option
v-for="option,index in options" v-for="(option, index) in options"
:key="index" :key="index"
:value="option.term_id" :value="option.term_id"
v-html="setSpaces( option.level ) + option.name"></option> v-html="setSpaces( option.level ) + option.name"></option>

View File

@ -45,7 +45,7 @@
@input="emitValues()" @input="emitValues()"
v-model="input_type"> v-model="input_type">
<option <option
v-for="option,index in single_types" v-for="(option, index) in single_types"
:value="index" :value="index"
:key="index"> :key="index">
{{ option }} {{ option }}
@ -60,7 +60,7 @@
v-else> v-else>
<option <option
v-for="option,index in multiple_types" v-for="(option, index) in multiple_types"
:value="index" :value="index"
:key="index"> :key="index">
{{ option }} {{ option }}
@ -102,7 +102,7 @@
errors: [ String, Object, Array ] errors: [ String, Object, Array ]
}, },
created(){ created(){
this.fetchTaxonomies().then( res => { this.fetchTaxonomies().then(() => {
if ( this.value ) { if ( this.value ) {
this.taxonomy_id = this.value.taxonomy_id; this.taxonomy_id = this.value.taxonomy_id;
} }

View File

@ -45,7 +45,8 @@
</label> </label>
<div class="block"> <div class="block">
<div <div
v-for="option in fields" v-for="(option, index) in fields"
:key="index"
class="field"> class="field">
<b-checkbox <b-checkbox
name="field_type_relationship[search][]" name="field_type_relationship[search][]"
@ -82,7 +83,6 @@
<script> <script>
import { tainacan as axios } from '../../../js/axios/axios'; import { tainacan as axios } from '../../../js/axios/axios';
import Vue from 'vue';
export default { export default {
props: { props: {
@ -125,7 +125,7 @@
} }
}, },
created(){ created(){
this.fetchCollections().then( data => { this.fetchCollections().then(() => {
if( this.collection_id && this.collection_id !== '' ){ if( this.collection_id && this.collection_id !== '' ){
this.collection = this.collection_id; this.collection = this.collection_id;
} else if ( this.value ) { } else if ( this.value ) {
@ -165,7 +165,6 @@
}) })
.catch(error => { .catch(error => {
console.log(error); console.log(error);
reject(error);
}); });
}, },
fetchFieldsFromCollection( value ){ fetchFieldsFromCollection( value ){
@ -198,7 +197,7 @@
}) })
} }
}) })
.catch((error) => { .catch(() => {
this.hasFields = false; this.hasFields = false;
}); });

View File

@ -5,7 +5,7 @@
v-model="selected" v-model="selected"
@input="onChecked()"> @input="onChecked()">
<option <option
v-for="option,index in getOptions" v-for="(option, index) in getOptions"
:key="index" :key="index"
:label="option" :label="option"
:value="option" :value="option"

View File

@ -33,9 +33,6 @@
this.inputValue = $event; this.inputValue = $event;
this.$emit('input', this.inputValue); this.$emit('input', this.inputValue);
} }
},
created(){
this.inputValue = this.value;
} }
} }
</script> </script>

View File

@ -34,9 +34,6 @@
this.inputValue = $event; this.inputValue = $event;
this.$emit('input', this.inputValue); this.$emit('input', this.inputValue);
} }
},
created(){
this.inputValue = this.value;
} }
} }
</script> </script>

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="block"> <div class="block">
<div <div
v-for="option,index in options" v-for="(option, index) in options"
:key="index" :key="index"
class="field"> class="field">
<b-checkbox <b-checkbox
@ -53,11 +53,11 @@
} }
}, },
methods: { methods: {
loadOptions(){ loadOptions(){deleteFile
let promise = null; let promise = null;
this.isLoading = true; this.isLoading = true;
if ( this.type === 'Tainacan\Field_types\Relationship' ) { if ( this.type === 'Tainacan\\Field_types\\Relationship' ) {
let collectionTarget = ( this.filter && this.filter.field.field_type_options.collection_id ) ? let collectionTarget = ( this.filter && this.filter.field.field_type_options.collection_id ) ?
this.filter.field.field_type_options.collection_id : this.collection_id; this.filter.field.field_type_options.collection_id : this.collection_id;
@ -67,7 +67,7 @@
promise = this.getValuesPlainText( this.field ); promise = this.getValuesPlainText( this.field );
} }
promise.then( data => { promise.then(() => {
this.isLoading = false; this.isLoading = false;
this.selectedValues() this.selectedValues()
}) })

View File

@ -8,7 +8,7 @@
expanded> expanded>
<option value="">{{ $i18n.get('label_selectbox_init') }}...</option> <option value="">{{ $i18n.get('label_selectbox_init') }}...</option>
<option <option
v-for="option,index in options" v-for="(option, index) in options"
:key="index" :key="index"
:label="option.label" :label="option.label"
:value="option.value" :value="option.value"
@ -66,7 +66,7 @@
promise = this.getValuesPlainText( this.field ); promise = this.getValuesPlainText( this.field );
} }
promise.then( data => { promise.then(() => {
this.isLoading = false; this.isLoading = false;
instance.selectedValues(); instance.selectedValues();
}) })

View File

@ -81,7 +81,7 @@
promise = this.getValuesPlainText( this.field, query ); promise = this.getValuesPlainText( this.field, query );
} }
promise.then( data => { promise.then(() => {
this.isLoading = false; this.isLoading = false;
}).catch( error => { }).catch( error => {
console.log('error select', error ); console.log('error select', error );

View File

@ -15,7 +15,6 @@
<script> <script>
import { eventFilterBus } from '../../js/event-bus-filters' import { eventFilterBus } from '../../js/event-bus-filters'
import qs from 'qs';
import { mapActions, mapGetters } from 'vuex'; import { mapActions, mapGetters } from 'vuex';
import router from '../../admin/js/router' import router from '../../admin/js/router'

View File

@ -14,6 +14,12 @@ module.exports = {
devtool: 'eval-source-map', devtool: 'eval-source-map',
module: { module: {
rules: [ rules: [
{
enforce: "pre",
test: /\.vue$/,
exclude: /node_modules/,
loader: "eslint-loader"
},
{ {
test: /\.vue$/, test: /\.vue$/,
loader: 'vue-loader', loader: 'vue-loader',