This commit is contained in:
@@ -46,7 +46,7 @@ export default {
|
||||
return true;
|
||||
},
|
||||
async doAction() {
|
||||
dialogResult = await window.$gz.dialog.confirmGeneric(
|
||||
let dialogResult = await window.$gz.dialog.confirmGeneric(
|
||||
"EraseMultipleObjectsWarning",
|
||||
"error"
|
||||
);
|
||||
@@ -55,19 +55,8 @@ export default {
|
||||
}
|
||||
//do the bulk action
|
||||
let vm = this;
|
||||
let url = "tag-list/";
|
||||
let url = "job-operations/bulk-delete";
|
||||
let body = this.dataListSelection;
|
||||
switch (vm.action) {
|
||||
case "Add":
|
||||
url += `bulk-add/${vm.tag}`;
|
||||
break;
|
||||
case "Remove":
|
||||
url += `bulk-remove/${vm.tag}`;
|
||||
break;
|
||||
case "Replace":
|
||||
url += `bulk-replace/${vm.tag}?toTag=${vm.replace}`;
|
||||
break;
|
||||
}
|
||||
|
||||
try {
|
||||
//call api route
|
||||
@@ -116,40 +105,12 @@ export default {
|
||||
}
|
||||
//Here if it's completed successfully
|
||||
window.$gz.eventBus.$emit("notify-success", vm.$ay.t("JobCompleted"));
|
||||
vm.$emit("ext-close-refresh");
|
||||
} catch (error) {
|
||||
vm.jobActive = false;
|
||||
window.$gz.errorHandler.handleFormError(error, vm);
|
||||
window.$gz.eventBus.$emit("notify-error", vm.$ay.t("JobFailed"));
|
||||
}
|
||||
},
|
||||
normalize(value) {
|
||||
if (!value) {
|
||||
return null;
|
||||
}
|
||||
|
||||
//Must be lowercase per rules
|
||||
//This may be naive when we get international cust omers but for now supporting utf-8 and it appears it's safe to do this with unicode
|
||||
value = value.toLowerCase();
|
||||
//No spaces in tags, replace with dashes
|
||||
|
||||
value = value.split(" ").join("-");
|
||||
//Remove multiple dash sequences
|
||||
value = value.replace(/-+/g, "-");
|
||||
|
||||
//Ensure doesn't start or end with a dash
|
||||
value = value.replace(/^\-+-\-+$/g, "");
|
||||
// inObj = inObj.Trim("-");
|
||||
//No longer than 255 characters
|
||||
// inObj = StringUtil.MaxLength(inObj, 255);
|
||||
return value;
|
||||
},
|
||||
normalizeTag(value) {
|
||||
value = this.normalize(value);
|
||||
this.tag = value;
|
||||
},
|
||||
normalizeReplace(value) {
|
||||
value = this.normalize(value);
|
||||
this.replace = value;
|
||||
}
|
||||
},
|
||||
props: {
|
||||
|
||||
Reference in New Issue
Block a user