diff --git a/ayanova/devdocs/todo.txt b/ayanova/devdocs/todo.txt index 1321c380..dad6f41c 100644 --- a/ayanova/devdocs/todo.txt +++ b/ayanova/devdocs/todo.txt @@ -9,12 +9,16 @@ todo: Joyce issue report: ISSUE NOTICED if delete (the 2 or 0.5 etc) and attempt to leave blank when click on Save get error "Validation error Object did not pass validation" (nothing is logged to the Server Log) +BUGBUG: decimal control displays blank even when value comes from server. It's ok when you manually enter but reverts to blank even though the value is there on open + +todo: bizrule constrain 'scale' value on pdf options report designer to 1-0 range, currently can type anything in there ### SMALL QUICK ITEMS ##### todo: now as a desktop app it's trying to automatically go to index.html all of a sudden https://stackoverflow.com/questions/45412014/how-do-i-set-the-start-url-of-a-manifest-json-to-be-the-root-of-the-site todo: is notifynewcount request double sending? It seems like it appears twice at the same moment in the log -todo: new small log, old small to medium, old medium to large + +todo: login button can be obscured by footer, this should not happen todo: Joyce issue report: can't delete second report template diff --git a/ayanova/src/api/gzform.js b/ayanova/src/api/gzform.js index d662953e..d6d64fd1 100644 --- a/ayanova/src/api/gzform.js +++ b/ayanova/src/api/gzform.js @@ -375,6 +375,89 @@ export default { return err; }, /////////////////////////////// + // MAX VALUE + // Maximum numeric value + // maxValue is lt or eq + // empty is considered valid for this rule + // + maxValueValid(vm, ref, maxValue) { + if (vm.formState.loading) { + return true; + } + + let ctrl = getControl(vm, ref); + if (typeof ctrl == "undefined") { + return true; + } + + let value = getControlValue(ctrl); + if (isEmpty(value)) { + return true; + } + + if (!isNumber(value)) { + return true; + } + + //Ok, were here with a non empty number of some kind + if (value <= maxValue) { + return true; + } + + // "ErrorFieldValueNumberGreaterThanMax": "Value must be less than XX" + let err = `${vm.$ay + .t("ErrorFieldValueNumberGreaterThanMax") + .replace("{0}", maxValue)} ${maxValue}`; + //Update the form status + this.setFormState({ + vm: vm, + valid: false + }); + return err; + }, + /////////////////////////////// + // MIN VALUE + // Minimum numeric value + // minValue is gt or eq + // empty is considered valid for this rule + // + minValueValid(vm, ref, minValue) { + if (vm.formState.loading) { + return true; + } + + let ctrl = getControl(vm, ref); + if (typeof ctrl == "undefined") { + return true; + } + + let value = getControlValue(ctrl); + if (isEmpty(value)) { + return true; + } + + if (!isNumber(value)) { + return true; + } + + //Ok, were here with a non empty number of some kind + //actual check + if (value >= minValue) { + return true; + } + + // "ErrorFieldValueNumberLessThanMin": "Value must be more than XX" + let err = `${vm.$ay + .t("ErrorFieldValueNumberLessThanMin") + .replace("{0}", minValue)} ${minValue}`; + //Update the form status + this.setFormState({ + vm: vm, + valid: false + }); + return err; + }, + /////////////////////////////// // EMAIL IS VALID-ish //https://tylermcginnis.com/validate-email-address-javascript/ emailValid(vm, ref) { diff --git a/ayanova/src/views/ay-report-edit.vue b/ayanova/src/views/ay-report-edit.vue index 5cf2ab30..665c8bec 100644 --- a/ayanova/src/views/ay-report-edit.vue +++ b/ayanova/src/views/ay-report-edit.vue @@ -287,6 +287,7 @@ + {{ obj.scale }}