This commit is contained in:
2020-12-09 17:41:30 +00:00
parent 3ed6dfa264
commit 91ddef7a29
4 changed files with 21 additions and 45 deletions

View File

@@ -9,6 +9,10 @@ todo: Case 3595 Mass delete extension
Rights!!!!! Rights!!!!!
Do this early as it will be copied over and over again 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 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 json does all but csv only does some and seems to skip many

View File

@@ -46,7 +46,7 @@ export default {
return true; return true;
}, },
async doAction() { async doAction() {
dialogResult = await window.$gz.dialog.confirmGeneric( let dialogResult = await window.$gz.dialog.confirmGeneric(
"EraseMultipleObjectsWarning", "EraseMultipleObjectsWarning",
"error" "error"
); );
@@ -55,19 +55,8 @@ export default {
} }
//do the bulk action //do the bulk action
let vm = this; let vm = this;
let url = "tag-list/"; let url = "job-operations/bulk-delete";
let body = this.dataListSelection; 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 { try {
//call api route //call api route
@@ -116,40 +105,12 @@ export default {
} }
//Here if it's completed successfully //Here if it's completed successfully
window.$gz.eventBus.$emit("notify-success", vm.$ay.t("JobCompleted")); window.$gz.eventBus.$emit("notify-success", vm.$ay.t("JobCompleted"));
vm.$emit("ext-close-refresh");
} catch (error) { } catch (error) {
vm.jobActive = false; vm.jobActive = false;
window.$gz.errorHandler.handleFormError(error, vm); window.$gz.errorHandler.handleFormError(error, vm);
window.$gz.eventBus.$emit("notify-error", vm.$ay.t("JobFailed")); 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: { props: {

View File

@@ -7,7 +7,10 @@
<v-expansion-panels focusable> <v-expansion-panels focusable>
<ExtensionTags :dataListSelection="dataListSelection" /> <ExtensionTags :dataListSelection="dataListSelection" />
<ExtensionExport :dataListSelection="dataListSelection" /> <ExtensionExport :dataListSelection="dataListSelection" />
<ExtensionDelete :dataListSelection="dataListSelection" /> <ExtensionDelete
v-on:ext-close-refresh="close({ refresh: true })"
:dataListSelection="dataListSelection"
/>
</v-expansion-panels> </v-expansion-panels>
</v-card-text> </v-card-text>
<v-card-actions> <v-card-actions>
@@ -49,6 +52,8 @@ export default {
}`; }`;
}, },
open(dls) { open(dls) {
// console.log("OPEN", dls);
// this.$on("ext-close-refresh", this.close({ refresh: true }));
this.dataListSelection = dls; this.dataListSelection = dls;
this.isVisible = true; this.isVisible = true;
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
@@ -56,9 +61,10 @@ export default {
this.reject = reject; this.reject = reject;
}); });
}, },
close() { close(ret) {
//this.$off("ext-close-refresh");
this.isVisible = false; this.isVisible = false;
this.resolve(null); this.resolve(ret);
} }
} }
}; };

View File

@@ -67,9 +67,14 @@ async function clickHandler(menuItem) {
}); });
break; break;
case "extensions": case "extensions":
// console.log(
// "widgets:extensions dls: ",
// m.vm.$refs.gzdatatable.getDataListSelection(window.$gz.type.Widget)
// );
let res = await m.vm.$refs.extensions.open( let res = await m.vm.$refs.extensions.open(
m.vm.$refs.gzdatatable.getDataListSelection(window.$gz.type.Widget) m.vm.$refs.gzdatatable.getDataListSelection(window.$gz.type.Widget)
); );
console.log("widgets::extensions res=", res);
break; break;
case "report": case "report":
if (m.id != null) { if (m.id != null) {