This commit is contained in:
2020-04-19 20:34:18 +00:00
parent d7a68faaf3
commit 26aecf60f3
3 changed files with 31 additions and 13 deletions

View File

@@ -679,21 +679,25 @@ export default {
setFormState(newState) {
//this returns a promise so any function that needs to wait for this can utilize that
return Vue.nextTick(function() {
if (newState.valid != undefined) {
if (newState.valid != null) {
newState.vm.formState.valid = newState.valid;
}
if (newState.dirty != undefined) {
if (newState.dirty != null) {
newState.vm.formState.dirty = newState.dirty;
}
if (newState.loading != undefined) {
if (newState.loading != null) {
newState.vm.formState.loading = newState.loading;
}
if (newState.readOnly != undefined) {
if (newState.readOnly != null) {
newState.vm.formState.readOnly = newState.readOnly;
}
if (newState.ready != null) {
newState.vm.formState.ready = newState.ready;
}
});
},
////////////////////////////////////

View File

@@ -800,12 +800,6 @@ export default {
todo: Undo / redo (ctrl-z / ctrl-y) ability?
- may need a library for this one if it's tricky to support levels of undo
todo: wiki controls showing before widget form has loaded causing annoying ability to click but then doesn't work right away
- wiki controls (and indeed nothing at all) should show on form until the object is finished loading

View File

@@ -218,6 +218,20 @@
</v-form>
</v-col>
</v-row>
<!-- <v-overlay :value="!formState.ready">
<v-progress-circular
color="secondary"
indeterminate
size="70"
></v-progress-circular>
</v-overlay> -->
<template v-if="!formState.ready">
<v-progress-circular
indeterminate
color="primary"
:size="60"
></v-progress-circular>
</template>
</v-container>
</template>
@@ -237,7 +251,7 @@ export default {
initForm(vm)
.then(() => {
vm.rights = window.$gz.role.getRights(window.$gz.type.Widget);
vm.formState.ready = true;
window.$gz.eventBus.$on("menu-click", clickHandler);
//id 0 means create a new record don't load one
if (vm.$route.params.recordid != 0) {
@@ -251,18 +265,23 @@ export default {
dirty: false,
valid: true,
loading: false,
readOnly: readOnly
readOnly: readOnly,
ready: true
});
// //bugbug WTF? This doesn't make sense, if it's an attempt to hide delete button then that's wrong
// //it's a new record so it can't be deleted so...
// vm.rights.delete = false;
generateMenu(vm);
vm.formState.ready = true;
}
})
.catch(err => {
vm.formState.ready = true;
window.$gz.errorHandler.handleFormError(err, vm);
vm.formState.ready = true;
})
.finally(function() {
// vm.formState.ready = true;
});
},
beforeRouteUpdate(to, from, next) {
@@ -398,6 +417,7 @@ export default {
window.$gz.api
.get(url)
.then(res => {
vm.formState.ready = true;
if (res.error) {
//Not found?
if (res.error.code == "2010") {