This commit is contained in:
@@ -9,6 +9,10 @@ todo: Case 3595 Mass delete extension
|
||||
Rights!!!!!
|
||||
Do this early as it will be copied over and over again
|
||||
|
||||
todo: extension needs ability to force closed the Extension control and refresh the underlying grid
|
||||
for example when deleting and user loses their selections
|
||||
|
||||
todo: on grid refresh it should confirm selected still relevant
|
||||
|
||||
todo: csv version of export is not exporting all records but a subset only for no apparent reason
|
||||
json does all but csv only does some and seems to skip many
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -7,7 +7,10 @@
|
||||
<v-expansion-panels focusable>
|
||||
<ExtensionTags :dataListSelection="dataListSelection" />
|
||||
<ExtensionExport :dataListSelection="dataListSelection" />
|
||||
<ExtensionDelete :dataListSelection="dataListSelection" />
|
||||
<ExtensionDelete
|
||||
v-on:ext-close-refresh="close({ refresh: true })"
|
||||
:dataListSelection="dataListSelection"
|
||||
/>
|
||||
</v-expansion-panels>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
@@ -49,6 +52,8 @@ export default {
|
||||
}`;
|
||||
},
|
||||
open(dls) {
|
||||
// console.log("OPEN", dls);
|
||||
// this.$on("ext-close-refresh", this.close({ refresh: true }));
|
||||
this.dataListSelection = dls;
|
||||
this.isVisible = true;
|
||||
return new Promise((resolve, reject) => {
|
||||
@@ -56,9 +61,10 @@ export default {
|
||||
this.reject = reject;
|
||||
});
|
||||
},
|
||||
close() {
|
||||
close(ret) {
|
||||
//this.$off("ext-close-refresh");
|
||||
this.isVisible = false;
|
||||
this.resolve(null);
|
||||
this.resolve(ret);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -67,9 +67,14 @@ async function clickHandler(menuItem) {
|
||||
});
|
||||
break;
|
||||
case "extensions":
|
||||
// console.log(
|
||||
// "widgets:extensions dls: ",
|
||||
// m.vm.$refs.gzdatatable.getDataListSelection(window.$gz.type.Widget)
|
||||
// );
|
||||
let res = await m.vm.$refs.extensions.open(
|
||||
m.vm.$refs.gzdatatable.getDataListSelection(window.$gz.type.Widget)
|
||||
);
|
||||
console.log("widgets::extensions res=", res);
|
||||
break;
|
||||
case "report":
|
||||
if (m.id != null) {
|
||||
|
||||
Reference in New Issue
Block a user