This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
:loading="jobActive"
|
||||
>{{ $ay.t("StartJob") }}</v-btn
|
||||
>
|
||||
|
||||
</v-expansion-panel-content>
|
||||
</v-expansion-panel>
|
||||
</template>
|
||||
@@ -36,7 +37,8 @@ export default {
|
||||
data: () => ({
|
||||
jobActive: false,
|
||||
rights: window.$gz.role.defaultRightsObject(),
|
||||
available: false
|
||||
available: false,
|
||||
notes: null
|
||||
}),
|
||||
methods: {
|
||||
goHelp() {
|
||||
@@ -46,6 +48,7 @@ export default {
|
||||
return true;
|
||||
},
|
||||
async doAction() {
|
||||
let vm = this;
|
||||
let dialogResult = await window.$gz.dialog.confirmGeneric(
|
||||
"EraseMultipleObjectsWarning",
|
||||
"error"
|
||||
@@ -53,8 +56,9 @@ export default {
|
||||
if (dialogResult == false) {
|
||||
return;
|
||||
}
|
||||
vm.notes = null;
|
||||
//do the bulk action
|
||||
let vm = this;
|
||||
|
||||
let url = "job-operations/bulk-delete";
|
||||
let body = this.dataListSelection;
|
||||
|
||||
@@ -90,14 +94,18 @@ export default {
|
||||
`job-operations/status/${jobId}`
|
||||
);
|
||||
if (jobStatus.error) {
|
||||
//throw new Error(jobStatus.error);
|
||||
throw new Error(
|
||||
window.$gz.errorHandler.errorToString(jobStatus, vm)
|
||||
);
|
||||
}
|
||||
jobStatus = jobStatus.data;
|
||||
if (jobStatus == 4 || jobStatus == 0) {
|
||||
throw new Error("Seeding job failed");
|
||||
if (jobStatus == 4) {
|
||||
|
||||
vm.notes = res.data;
|
||||
}
|
||||
}
|
||||
throw new Error("Job failed");
|
||||
}
|
||||
if (jobStatus == 3) {
|
||||
vm.jobActive = false;
|
||||
@@ -108,7 +116,9 @@ export default {
|
||||
vm.$emit("ext-close-refresh");
|
||||
} catch (error) {
|
||||
vm.jobActive = false;
|
||||
window.$gz.errorHandler.handleFormError(error, vm);
|
||||
|
||||
// vm.notes = window.$gz.errorHandler.errorToString(error);
|
||||
//window.$gz.errorHandler.handleFormError(error, vm);
|
||||
window.$gz.eventBus.$emit("notify-error", vm.$ay.t("JobFailed"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ export default {
|
||||
}
|
||||
jobStatus = jobStatus.data;
|
||||
if (jobStatus == 4 || jobStatus == 0) {
|
||||
throw new Error("Seeding job failed");
|
||||
throw new Error("Job failed");
|
||||
}
|
||||
if (jobStatus == 3) {
|
||||
vm.jobActive = false;
|
||||
|
||||
@@ -4,11 +4,26 @@
|
||||
<v-card-title>{{ $ay.t("Extensions") }}</v-card-title>
|
||||
<v-card-subtitle class="mt-1">{{ titleText() }}</v-card-subtitle>
|
||||
<v-card-text>
|
||||
<template v-if="errorObj">
|
||||
<v-data-table
|
||||
:headers="headers"
|
||||
:items="errorObj"
|
||||
class="elevation-1"
|
||||
:disable-pagination="true"
|
||||
:disable-filtering="true"
|
||||
hide-default-footer
|
||||
:sort-by="['created']"
|
||||
:sort-desc="[true]"
|
||||
:header-props="{ sortByText: $ay.t('Sort') }"
|
||||
>
|
||||
</v-data-table>
|
||||
</template>
|
||||
<v-expansion-panels focusable>
|
||||
<ExtensionTags :dataListSelection="dataListSelection" />
|
||||
<ExtensionExport :dataListSelection="dataListSelection" />
|
||||
<ExtensionDelete
|
||||
v-on:ext-close-refresh="close({ refresh: true })"
|
||||
v-on:ext-show-job-log="handleError(e)"
|
||||
:dataListSelection="dataListSelection"
|
||||
/>
|
||||
</v-expansion-panels>
|
||||
@@ -40,7 +55,13 @@ export default {
|
||||
selectedRowIds: [],
|
||||
dataListKey: null,
|
||||
listView: null
|
||||
}
|
||||
},
|
||||
headers: [],
|
||||
errorObj: null,
|
||||
//cache display format stuff
|
||||
timeZoneName: window.$gz.locale.getBrowserTimeZoneName(),
|
||||
languageName: window.$gz.locale.getBrowserLanguages(),
|
||||
hour12: window.$gz.locale.getHour12()
|
||||
}),
|
||||
methods: {
|
||||
titleText() {
|
||||
@@ -51,6 +72,45 @@ export default {
|
||||
this.dataListSelection.selectedRowIds.length
|
||||
}`;
|
||||
},
|
||||
async handleError(jobId) {
|
||||
console.log("handleError", jobId);
|
||||
return;
|
||||
let res = await window.$gz.api.get(`job-operations/logs/${jobId}`);
|
||||
if (res.data || res.data.length() > 0) {
|
||||
/*{"data":[
|
||||
{"created":"2020-12-09T18:41:58.129408Z","statusText":"Processing job \"Bulk operation: DELETE on HeadOffice (2 specified) - BulkCoreBizObjectOperation:Delete\"","jobId":"00000000-0000-0000-0000-000000000000"},
|
||||
{"created":"2020-12-09T18:41:58.149926Z","statusText":"Bulk job Delete started...","jobId":"00000000-0000-0000-0000-000000000000"},
|
||||
{"created":"2020-12-09T18:41:58.185514Z","statusText":"Error processing item 9: Validation errors:\r\nTarget: errorbox error: LT:Customer\r\n","jobId":"00000000-0000-0000-0000-000000000000"},
|
||||
{"created":"2020-12-09T18:41:58.194434Z","statusText":"Error processing item 7: Validation errors:\r\nTarget: errorbox error: LT:Customer\r\n","jobId":"00000000-0000-0000-0000-000000000000"},
|
||||
{"created":"2020-12-09T18:41:58.196858Z","statusText":"Bulk job Delete processed 2 of 2 with 2 failures","jobId":"00000000-0000-0000-0000-000000000000"}
|
||||
]}
|
||||
*/
|
||||
}
|
||||
//NOPE-----------
|
||||
if (res.data) {
|
||||
vm.rawObj = res.data;
|
||||
let ret = [];
|
||||
for (let i = 0; i < res.data.length; i++) {
|
||||
let o = res.data[i];
|
||||
ret.push({
|
||||
id: i,
|
||||
created: window.$gz.locale.utcDateToShortDateAndTimeLocalized(
|
||||
o.created,
|
||||
this.timeZoneName,
|
||||
this.languageName,
|
||||
this.hour12
|
||||
),
|
||||
status: o.statusText,
|
||||
jobId:
|
||||
o.jobId == "00000000-0000-0000-0000-000000000000" ? "" : o.jobId
|
||||
});
|
||||
}
|
||||
vm.obj = ret;
|
||||
} else {
|
||||
vm.rawObj = [];
|
||||
vm.obj = [];
|
||||
}
|
||||
},
|
||||
open(dls) {
|
||||
this.dataListSelection = dls;
|
||||
this.isVisible = true;
|
||||
@@ -65,4 +125,30 @@ export default {
|
||||
}
|
||||
}
|
||||
};
|
||||
/////////////////////////////////
|
||||
//
|
||||
//
|
||||
async function initForm(vm) {
|
||||
await fetchTranslatedText(vm);
|
||||
await createTableHeaders(vm);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////
|
||||
//
|
||||
// Ensures UI translated text is available
|
||||
//
|
||||
async function fetchTranslatedText(vm) {
|
||||
await window.$gz.translation.cacheTranslations(["TimeStamp", "ID", "Status"]);
|
||||
}
|
||||
|
||||
//////////////////////
|
||||
//
|
||||
//
|
||||
async function createTableHeaders(vm) {
|
||||
vm.headers = [
|
||||
{ text: vm.$ay.t("TimeStamp"), value: "created" },
|
||||
{ text: vm.$ay.t("Status"), value: "status" },
|
||||
{ text: vm.$ay.t("ID"), value: "jobId" }
|
||||
];
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -238,7 +238,7 @@ export default {
|
||||
}
|
||||
jobStatus = jobStatus.data;
|
||||
if (jobStatus == 4 || jobStatus == 0) {
|
||||
throw new Error("Seeding job failed");
|
||||
throw new Error("Job failed");
|
||||
}
|
||||
if (jobStatus == 3) {
|
||||
vm.jobActive = false;
|
||||
|
||||
Reference in New Issue
Block a user