This commit is contained in:
2019-04-04 20:02:32 +00:00
parent 108338dbeb
commit 85466f6acb
2 changed files with 16 additions and 18 deletions

View File

@@ -240,6 +240,7 @@ Localized input and parsing and validation
----------------- -----------------
TODO AFTER CLIENT block ABOVE: TODO AFTER CLIENT block ABOVE:
ON UPDATE: have an url that opens automatically or a notification and link to one after a new version has been detected just like visual studio does in order to show what is new in this version
ABOUT form - add the user settings such as timezone offset, locale formatting patterns etc, will be useful for troubleshooting ABOUT form - add the user settings such as timezone offset, locale formatting patterns etc, will be useful for troubleshooting

View File

@@ -178,8 +178,8 @@ export default {
}; };
}, },
methods: { methods: {
Change(ref) { Change(ref) {
this.$gzv.Change(this, ref); this.$gzv.Change(this, ref);
}, },
getDataFromApi() { getDataFromApi() {
var url = "Widget/" + this.$route.params.id; var url = "Widget/" + this.$route.params.id;
@@ -188,21 +188,17 @@ export default {
}); });
}, },
submit() { submit() {
// debugger; //check if form is valid, as far as I know this is the way you're supposed to do it and in testing it does not force all fields to revalidate individually
if (this.$refs.form.validate()) {
var that = this;
var url = "Widget/" + this.$route.params.id;
//TODO: CHECK FOR BROKEN RULES AND DON'T SUBMIT IF THERE ARE ANY HERE //clear any errors that might be around from previous submit
this.$gzutil.RemoveAllPropertiesFromObject(this.serverError);
var that = this; this.$gzapi.upsert(url, this.obj).then(res => {
var url = "Widget/" + this.$route.params.id; if (res.error) {
that.serverError = res.error;
//clear any errors that might be around from previous submit
this.$gzutil.RemoveAllPropertiesFromObject(this.serverError);
this.$gzapi
.upsert(url, this.obj)
.then(res => {
if (res.error) {
that.serverError = res.error;
} else { } else {
//Logic for detecting if a post or put: if id then it was a post, if no id then it was a put //Logic for detecting if a post or put: if id then it was a post, if no id then it was a put
if (res.id) { if (res.id) {
@@ -214,10 +210,11 @@ export default {
} }
} }
}); });
//In theory all exceptions should be handled by the gzapi methods, so we should not need to deal with this in the form very often if at all //In theory all exceptions should be handled by the gzapi methods, so we should not need to deal with this in the form very often if at all
// .catch(function(error) { // .catch(function(error) {
// }); // });
} else {
}
} //end of submit() } //end of submit()
} }
}; };