Batch is the new Bulk

This commit is contained in:
2020-12-10 19:29:00 +00:00
parent 417fbac239
commit 7ee490102a
7 changed files with 17 additions and 16 deletions

View File

@@ -6,7 +6,10 @@
MISC ITEMS THAT CAME UP
todo: Jobs translation at server
Look for all string "LogJobAsync(" and ensure uses LT keys and NO english
Exceptions and server log are NOT to use translation keys, plain english as writ only required
Look for string var JobName = and insert username if it's the start of a batch job
See JobOperationsController job for mass delete for example
Look for all uses of the word "Bulk" in relation to "Bulk jobs" and switch to "Batch"
todo: make sure all objects have updated jobs translation for batch jobs

View File

@@ -244,7 +244,7 @@ export default {
Accept: "application/json",
"Content-Type": "application/json",
Authorization: "Bearer " + window.$gz.store.state.apiToken
//this maybe useful in future like bulk ops etc so keeping as a reminder
//this maybe useful in future like batch ops etc so keeping as a reminder
//,"X-AY-Import-Mode": true
};
},

View File

@@ -57,8 +57,8 @@ export default {
//Clear any possible prior errors
vm.$emit("ext-show-job-log", "clear");
//do the bulk action
let url = "job-operations/bulk-delete";
//do the batch action
let url = "job-operations/batch-delete";
let body = this.dataListSelection;
try {

View File

@@ -73,19 +73,19 @@ export default {
return false;
},
async doAction() {
//do the bulk action
//do the batch action
let vm = this;
let url = "tag-list/";
let body = this.dataListSelection;
switch (vm.action) {
case "Add":
url += `bulk-add/${vm.tag}`;
url += `batch-add/${vm.tag}`;
break;
case "Remove":
url += `bulk-remove/${vm.tag}`;
url += `batch-remove/${vm.tag}`;
break;
case "Replace":
url += `bulk-replace/${vm.tag}?toTag=${vm.replace}`;
url += `batch-replace/${vm.tag}?toTag=${vm.replace}`;
break;
}

View File

@@ -90,8 +90,6 @@ export default {
}
let res = await window.$gz.api.get(`job-operations/logs/${jobId}`);
//{"data":[{"created":"2020-12-09T19:20:41.915635Z","statusText":"Processing job \"Bulk operation: DELETE on HeadOffice (2 specified) - BulkCoreBizObjectOperation:Delete\"","jobId":"9817e970-c746-443c-8f11-fc0588f2acff"},{"created":"2020-12-09T19:20:41.922711Z","statusText":"Bulk job Delete started...","jobId":"9817e970-c746-443c-8f11-fc0588f2acff"},{"created":"2020-12-09T19:20:41.938821Z","statusText":"Error processing item 11: Validation errors:\r\nTarget: errorbox error: LT:Customer\r\n","jobId":"9817e970-c746-443c-8f11-fc0588f2acff"},{"created":"2020-12-09T19:20:41.951148Z","statusText":"Error processing item 2: Validation errors:\r\nTarget: errorbox error: LT:Customer\r\n","jobId":"9817e970-c746-443c-8f11-fc0588f2acff"},{"created":"2020-12-09T19:20:41.954891Z","statusText":"Bulk job Delete processed 2 of 2 with 2 failures","jobId":"9817e970-c746-443c-8f11-fc0588f2acff"}]}
//NOPE-----------
if (res.data) {
let ret = [];
for (let i = 0; i < res.data.length; i++) {

View File

@@ -471,11 +471,11 @@ export default {
getDataListSelection(ayaType) {
let vm = this;
//called when parent form needs the selected id's or the list view options needed to rehydrate the entire list of id's in the same order and filter
//i.e. for reporting, bulk operations etc
//i.e. for reporting, batch operations etc
let selectedRowIds = [];
//get selected row id's if there are selections else get all row id's
//called into from parent for things like reporting or bulk ops
//called into from parent for things like reporting or batch ops
//selected or records both are arrays with an id property that contains the row id conveniently for this method
if (vm.selected.length > 0) {
//return row id's of selected items only

View File

@@ -81,7 +81,7 @@ export default {
await fetchTranslatedText(this);
await populateSelectionLists(this);
generateMenu(this);
this.handleSelected([]); //start out read only no selection state for bulk ops options
this.handleSelected([]); //start out read only no selection state for batch ops options
},
beforeDestroy() {
window.$gz.eventBus.$off("menu-click", clickHandler);
@@ -115,7 +115,7 @@ export default {
};
},
methods: {
canBulkOp() {
canBatchOp() {
return (
this.rights.change &&
this.selectedItems &&
@@ -125,7 +125,7 @@ export default {
handleSelected(selected) {
this.selectedItems = selected;
if (this.canBulkOp()) {
if (this.canBatchOp()) {
window.$gz.eventBus.$emit(
"menu-enable-item",
FORM_KEY + ":DELETE_SELECTED"
@@ -152,7 +152,7 @@ export default {
vm.moveDialog = false;
window.$gz.form.deleteAllErrorBoxErrors(vm);
let res = await window.$gz.api.upsert("attachment/bulk-move", {
let res = await window.$gz.api.upsert("attachment/batch-move", {
idList: this.selectedItems,
toType: this.moveType,
toId: this.moveId
@@ -176,7 +176,7 @@ export default {
window.$gz.form.deleteAllErrorBoxErrors(vm);
let res = await window.$gz.api.upsert(
"attachment/bulk-delete",
"attachment/batch-delete",
this.selectedItems
);
if (res.error) {