Upgrade Babel e others dependencies, Improve bulk edit items and advanced search style
This commit is contained in:
parent
e327992dca
commit
ef516bcc84
7
.babelrc
7
.babelrc
|
@ -1,6 +1,9 @@
|
|||
{
|
||||
"presets": [
|
||||
["env", { "modules": false }],
|
||||
["stage-3"]
|
||||
["@babel/preset-env",
|
||||
{
|
||||
"modules": false
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
File diff suppressed because it is too large
Load Diff
21
package.json
21
package.json
|
@ -25,27 +25,26 @@
|
|||
"vuex": "^3.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"autoprefixer": "^9.1.2",
|
||||
"babel-core": "^6.26.3",
|
||||
"babel-loader": "^7.1.5",
|
||||
"babel-preset-env": "^1.7.0",
|
||||
"babel-preset-stage-3": "^6.24.1",
|
||||
"@babel/core": "^7.0.0",
|
||||
"@babel/preset-env": "^7.0.0",
|
||||
"autoprefixer": "^9.1.5",
|
||||
"babel-loader": "^8.0.2",
|
||||
"cross-env": "^5.2.0",
|
||||
"css-loader": "^1.0.0",
|
||||
"element-theme-chalk": "^2.4.6",
|
||||
"eslint": "^5.4.0",
|
||||
"eslint": "^5.5.0",
|
||||
"eslint-loader": "^2.1.0",
|
||||
"eslint-plugin-vue": "^4.7.1",
|
||||
"file-loader": "^1.1.11",
|
||||
"file-loader": "^2.0.0",
|
||||
"postcss-loader": "^3.0.0",
|
||||
"sass-loader": "^7.1.0",
|
||||
"style-loader": "^0.22.1",
|
||||
"style-loader": "^0.23.0",
|
||||
"uglifyjs-webpack-plugin": "^1.3.0",
|
||||
"vue-custom-element": "^3.2.5",
|
||||
"vue-loader": "^15.4.0",
|
||||
"vue-loader": "^15.4.1",
|
||||
"vue-template-compiler": "^2.5.17",
|
||||
"webpack": "^4.16.5",
|
||||
"webpack": "^4.17.2",
|
||||
"webpack-cli": "^3.1.0",
|
||||
"webpack-dev-server": "^3.1.5"
|
||||
"webpack-dev-server": "^3.1.7"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -77,10 +77,11 @@
|
|||
<b-taginput
|
||||
v-else-if="advancedSearchQuery.taxquery[searchCriterion]"
|
||||
:data="terms"
|
||||
:value="advancedSearchQuery.taxquery[searchCriterion].btags.length > 0 ?
|
||||
:value="advancedSearchQuery.taxquery[searchCriterion] &&
|
||||
advancedSearchQuery.taxquery[searchCriterion].btags.length > 0 ?
|
||||
Array.from(new Set(advancedSearchQuery.taxquery[searchCriterion].btags)) : []"
|
||||
autocomplete
|
||||
:loading="isFetching"
|
||||
:loading="advancedSearchQuery.taxquery[searchCriterion].isFetching"
|
||||
attached
|
||||
ellipsis
|
||||
@remove="removeValueOf($event, searchCriterion)"
|
||||
|
@ -315,11 +316,12 @@
|
|||
advancedSearchQuery: {
|
||||
advancedSearch: true,
|
||||
metaquery: {},
|
||||
taxquery: {},
|
||||
taxquery: {
|
||||
isFetching: false,
|
||||
},
|
||||
},
|
||||
termList: [],
|
||||
terms: [],
|
||||
isFetching: false,
|
||||
dateMask: this.getDateLocaleMask(),
|
||||
dateFormat: '',
|
||||
}
|
||||
|
@ -334,7 +336,7 @@
|
|||
autoCompleteTerm: _.debounce( function(value, searchCriterion){
|
||||
this.termList = [];
|
||||
this.terms = [];
|
||||
this.isFetching = true;
|
||||
this.$set(this.advancedSearchQuery.taxquery[searchCriterion], 'isFetching', true);
|
||||
|
||||
this.fetchTerms({
|
||||
taxonomyId: this.advancedSearchQuery.taxquery[searchCriterion].taxonomy_id,
|
||||
|
@ -357,9 +359,9 @@
|
|||
this.termList[term].i = i;
|
||||
}
|
||||
|
||||
this.isFetching = false;
|
||||
this.$set(this.advancedSearchQuery.taxquery[searchCriterion], 'isFetching', false);
|
||||
}).catch((error) => {
|
||||
this.isFetching = false;
|
||||
this.$set(this.advancedSearchQuery.taxquery[searchCriterion], 'isFetching', false);
|
||||
throw error;
|
||||
});
|
||||
}, 300),
|
||||
|
@ -435,7 +437,9 @@
|
|||
this.advancedSearchQuery = {
|
||||
advancedSearch: true,
|
||||
metaquery: {},
|
||||
taxquery: {}
|
||||
taxquery: {
|
||||
isFetching: false,
|
||||
}
|
||||
};
|
||||
},
|
||||
convertDateToMatchInDB(dateValue){
|
||||
|
@ -651,6 +655,17 @@
|
|||
width: 800px !important;
|
||||
}
|
||||
|
||||
.autocomplete {
|
||||
.dropdown-menu {
|
||||
top: auto !important;
|
||||
min-width: 100% !important;
|
||||
|
||||
.dropdown-content {
|
||||
width: auto !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.dropdown-item:hover {
|
||||
background-color: unset !important;
|
||||
}
|
||||
|
|
|
@ -178,8 +178,11 @@
|
|||
</button>
|
||||
<div
|
||||
v-if="bulkEditionProcedures[criterion].isDone"
|
||||
@mouseover="$set(bulkEditionProcedures[criterion], 'tooltipShow', !bulkEditionProcedures[criterion].tooltipShow)"
|
||||
class="is-pulled-right">
|
||||
<b-tooltip
|
||||
:active="bulkEditionProcedures[criterion].tooltipShow"
|
||||
always
|
||||
class="is-success"
|
||||
size="is-small"
|
||||
position="is-left"
|
||||
|
@ -193,8 +196,11 @@
|
|||
</div>
|
||||
<div
|
||||
v-if="bulkEditionProcedures[criterion].isDoneWithError && !bulkEditionProcedures[criterion].isExecuting"
|
||||
@mouseover="$set(bulkEditionProcedures[criterion], 'tooltipShow', !bulkEditionProcedures[criterion].tooltipShow)"
|
||||
class="is-pulled-right">
|
||||
<b-tooltip
|
||||
:active="bulkEditionProcedures[criterion].tooltipShow"
|
||||
always
|
||||
class="is-danger"
|
||||
size="is-small"
|
||||
position="is-left"
|
||||
|
@ -230,7 +236,7 @@
|
|||
<!--<pre>{{ bulkEditionProcedures }}</pre>-->
|
||||
|
||||
<footer class="field is-grouped form-submit">
|
||||
<div class="control">
|
||||
<p class="control">
|
||||
<button
|
||||
@click="$eventBusSearch.loadItems(); $parent.close()"
|
||||
:disabled="(Object.keys(bulkEditionProcedures).length &&
|
||||
|
@ -239,25 +245,22 @@
|
|||
class="button is-outlined">
|
||||
{{ $i18n.get('close') }}
|
||||
</button>
|
||||
</div>
|
||||
<div class="control">
|
||||
</p>
|
||||
<p class="control">
|
||||
<button
|
||||
class="button is-turquoise5"
|
||||
:disabled="dones.every((item) => item === true) === false"
|
||||
@click="addEditionCriterion()">
|
||||
{{ editionCriteria.length <= 0 ?
|
||||
$i18n.get('add_one_edition_criterion') :
|
||||
$i18n.get('add_another_edition_criterion')
|
||||
}}
|
||||
{{ $i18n.get('new_action') }}
|
||||
</button>
|
||||
<button
|
||||
:disabled="dones.every((item) => item === true) === false"
|
||||
class="button is-success"
|
||||
type="button"
|
||||
@click="$eventBusSearch.loadItems(); $parent.close();">
|
||||
{{ $i18n.get('done') }}
|
||||
{{ $i18n.get('finish') }}
|
||||
</button>
|
||||
</div>
|
||||
</p>
|
||||
</footer>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -328,6 +331,7 @@
|
|||
isExecuting: false,
|
||||
actionResult: '',
|
||||
totalItemsEditedWithSuccess: 0,
|
||||
tooltipShow: true,
|
||||
}
|
||||
},
|
||||
groupID: null,
|
||||
|
@ -355,7 +359,21 @@
|
|||
...mapGetters('metadata', [
|
||||
'getMetadata'
|
||||
]),
|
||||
finalizeProcedure(criterion, withError){
|
||||
finalizeProcedure(criterion){
|
||||
this.$set(this.bulkEditionProcedures[criterion], 'actionResult', this.getActionResult());
|
||||
|
||||
let withError = false;
|
||||
|
||||
if(this.bulkEditionProcedures[criterion].actionResult.constructor.name === 'Object' &&
|
||||
(this.bulkEditionProcedures[criterion].actionResult.data &&
|
||||
this.bulkEditionProcedures[criterion].actionResult.data.status.toString().split('')[0] != 2) ||
|
||||
this.bulkEditionProcedures[criterion].actionResult.error_message) {
|
||||
|
||||
withError = true;
|
||||
} else {
|
||||
this.$set(this.bulkEditionProcedures[criterion], 'totalItemsEditedWithSuccess', this.actionResult);
|
||||
}
|
||||
|
||||
this.$set(this.bulkEditionProcedures[criterion], 'isDone', !withError);
|
||||
this.$set(this.bulkEditionProcedures[criterion], 'isDoneWithError', withError);
|
||||
|
||||
|
@ -377,18 +395,7 @@
|
|||
groupID: this.groupID,
|
||||
bodyParams: { value: procedure.newValue }
|
||||
}).then(() => {
|
||||
this.$set(this.bulkEditionProcedures[criterion], 'actionResult', this.getActionResult());
|
||||
|
||||
if(this.bulkEditionProcedures[criterion].actionResult.constructor.name === 'Object' &&
|
||||
(this.bulkEditionProcedures[criterion].actionResult.data &&
|
||||
this.bulkEditionProcedures[criterion].actionResult.data.status.toString().split('')[0] != 2) ||
|
||||
this.bulkEditionProcedures[criterion].actionResult.error_message) {
|
||||
|
||||
this.finalizeProcedure(criterion, true);
|
||||
} else {
|
||||
this.$set(this.bulkEditionProcedures[criterion], 'totalItemsEditedWithSuccess', this.actionResult);
|
||||
this.finalizeProcedure(criterion);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.setValueInBulk({
|
||||
|
@ -399,18 +406,7 @@
|
|||
value: procedure.newValue
|
||||
}
|
||||
}).then(() => {
|
||||
this.$set(this.bulkEditionProcedures[criterion], 'actionResult', this.getActionResult());
|
||||
|
||||
if(this.bulkEditionProcedures[criterion].actionResult.constructor.name === 'Object' &&
|
||||
(this.bulkEditionProcedures[criterion].actionResult.data &&
|
||||
this.bulkEditionProcedures[criterion].actionResult.data.status.toString().split('')[0] != 2) ||
|
||||
this.bulkEditionProcedures[criterion].actionResult.error_message) {
|
||||
|
||||
this.finalizeProcedure(criterion, true);
|
||||
} else {
|
||||
this.$set(this.bulkEditionProcedures[criterion], 'totalItemsEditedWithSuccess', this.actionResult);
|
||||
this.finalizeProcedure(criterion);
|
||||
}
|
||||
});
|
||||
}
|
||||
} else if(procedure.action === this.editionActionsForMultiple.add){
|
||||
|
@ -424,18 +420,7 @@
|
|||
value: procedure.newValue,
|
||||
}
|
||||
}).then(() => {
|
||||
this.$set(this.bulkEditionProcedures[criterion], 'actionResult', this.getActionResult());
|
||||
|
||||
if(this.bulkEditionProcedures[criterion].actionResult.constructor.name === 'Object' &&
|
||||
(this.bulkEditionProcedures[criterion].actionResult.data &&
|
||||
this.bulkEditionProcedures[criterion].actionResult.data.status.toString().split('')[0] != 2) ||
|
||||
this.bulkEditionProcedures[criterion].actionResult.error_message) {
|
||||
|
||||
this.finalizeProcedure(criterion, true);
|
||||
} else {
|
||||
this.$set(this.bulkEditionProcedures[criterion], 'totalItemsEditedWithSuccess', this.actionResult);
|
||||
this.finalizeProcedure(criterion);
|
||||
}
|
||||
});
|
||||
} else if(procedure.action === this.editionActionsForMultiple.replace){
|
||||
this.$set(this.bulkEditionProcedures[criterion], 'isExecuting', true);
|
||||
|
@ -449,18 +434,7 @@
|
|||
new_value: procedure.newValue,
|
||||
}
|
||||
}).then(() => {
|
||||
this.$set(this.bulkEditionProcedures[criterion], 'actionResult', this.getActionResult());
|
||||
|
||||
if(this.bulkEditionProcedures[criterion].actionResult.constructor.name === 'Object' &&
|
||||
(this.bulkEditionProcedures[criterion].actionResult.data &&
|
||||
this.bulkEditionProcedures[criterion].actionResult.data.status.toString().split('')[0] != 2) ||
|
||||
this.bulkEditionProcedures[criterion].actionResult.error_message) {
|
||||
|
||||
this.finalizeProcedure(criterion, true);
|
||||
} else {
|
||||
this.$set(this.bulkEditionProcedures[criterion], 'totalItemsEditedWithSuccess', this.actionResult);
|
||||
this.finalizeProcedure(criterion);
|
||||
}
|
||||
});
|
||||
} else if(procedure.action === this.editionActionsForMultiple.remove){
|
||||
this.$set(this.bulkEditionProcedures[criterion], 'isExecuting', true);
|
||||
|
@ -473,18 +447,7 @@
|
|||
value: procedure.newValue,
|
||||
}
|
||||
}).then(() => {
|
||||
this.$set(this.bulkEditionProcedures[criterion], 'actionResult', this.getActionResult());
|
||||
|
||||
if(this.bulkEditionProcedures[criterion].actionResult.constructor.name === 'Object' &&
|
||||
(this.bulkEditionProcedures[criterion].actionResult.data &&
|
||||
this.bulkEditionProcedures[criterion].actionResult.data.status.toString().split('')[0] != 2) ||
|
||||
this.bulkEditionProcedures[criterion].actionResult.error_message) {
|
||||
|
||||
this.finalizeProcedure(criterion, true);
|
||||
} else {
|
||||
this.$set(this.bulkEditionProcedures[criterion], 'totalItemsEditedWithSuccess', this.actionResult);
|
||||
this.finalizeProcedure(criterion);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
@ -504,7 +467,8 @@
|
|||
isDoneWithError: false,
|
||||
isExecuting: false,
|
||||
actionResult: '',
|
||||
totalItemsEditedWithSuccess: 0
|
||||
totalItemsEditedWithSuccess: 0,
|
||||
tooltipShow: true,
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -575,7 +539,7 @@
|
|||
}
|
||||
|
||||
.tainacan-modal-content .form-submit {
|
||||
padding: 120px 0 0.4em 0 !important;
|
||||
padding: 160px 0 0.4em 0 !important;
|
||||
}
|
||||
|
||||
.no-overflow-modal-card-body {
|
||||
|
|
|
@ -69,8 +69,9 @@ return apply_filters( 'tainacan-admin-i18n', [
|
|||
'add_one_edition_criterion' => __( 'Add one edition criterion', 'tainacan' ),
|
||||
'set_new_value' => __( 'Set new value', 'tainacan' ),
|
||||
'replace_value' => __( 'Replace value', 'tainacan' ),
|
||||
'done' => __( 'Done', 'tainacan' ),
|
||||
'finish' => __( 'Finish', 'tainacan' ),
|
||||
'select_to_create' => __( 'select to create', 'tainacan' ),
|
||||
'new_action' => __( 'New action', 'tainacan' ),
|
||||
|
||||
// Wordpress Status
|
||||
'publish' => __( 'Publish', 'tainacan' ),
|
||||
|
|
Loading…
Reference in New Issue