This commit is contained in:
2020-06-14 23:26:21 +00:00
parent 3858fe5c7f
commit 124511e117
3 changed files with 41 additions and 30 deletions

View File

@@ -337,37 +337,39 @@ export default {
},
remove() {
let vm = this;
window.$gz.dialog.confirmGeneric("ResetToDefault").then(dialogResult => {
if (dialogResult == true) {
//do the delete
vm.formState.loading = true;
//No need to delete a new record, just abandon it...
if (vm.templateId && vm.templateId != 0) {
let url = API_BASE_URL + vm.templateId;
window.$gz.dialog
.confirmGeneric("ResetToDefault", "warning")
.then(dialogResult => {
if (dialogResult == true) {
//do the delete
vm.formState.loading = true;
//No need to delete a new record, just abandon it...
if (vm.templateId && vm.templateId != 0) {
let url = API_BASE_URL + vm.templateId;
window.$gz.form.deleteAllErrorBoxErrors(vm);
window.$gz.api
.remove(url)
.then(res => {
if (res.error) {
vm.formState.serverError = res.error;
window.$gz.form.setErrorBoxErrors(vm);
} else {
//trigger reload of form
this.getDataFromApi();
}
})
.catch(function handleGetDataFromAPIError(error) {
//Update the form status
window.$gz.form.setFormState({
vm: vm,
loading: false
window.$gz.form.deleteAllErrorBoxErrors(vm);
window.$gz.api
.remove(url)
.then(res => {
if (res.error) {
vm.formState.serverError = res.error;
window.$gz.form.setErrorBoxErrors(vm);
} else {
//trigger reload of form
this.getDataFromApi();
}
})
.catch(function handleGetDataFromAPIError(error) {
//Update the form status
window.$gz.form.setFormState({
vm: vm,
loading: false
});
window.$gz.errorHandler.handleFormError(error, vm);
});
window.$gz.errorHandler.handleFormError(error, vm);
});
}
}
}
});
});
}
}
};

View File

@@ -349,7 +349,16 @@ export default {
//Only no key or expired trial are here, not expired purchase
//so safe to erase
let dialogResult = await window.$gz.dialog.confirmGeneric(
"AdminEraseDatabaseWarning"
"AdminEraseDatabaseWarning",
"warning"
);
if (dialogResult == false) {
return;
}
dialogResult = await window.$gz.dialog.confirmGeneric(
"AdminEraseDatabaseLastWarning",
"error"
);
if (dialogResult == false) {
return;

View File

@@ -355,7 +355,7 @@ function clickHandler(menuItem) {
break;
case "backupnow":
window.$gz.dialog
.confirmGeneric("AreYouSureBackupNow")
.confirmGeneric("AreYouSureBackupNow", "warning")
.then(dialogResult => {
if (dialogResult == true) {
m.vm.backupNow();