refactoring, renaming capitalized functions to proper case, etc
This commit is contained in:
@@ -21,10 +21,10 @@
|
||||
clearable
|
||||
:counter="255"
|
||||
:label="this.$gzlocale.get('WidgetName')"
|
||||
:rules="[this.$gzv.Max255(this,'name'),this.$gzv.Required(this,'name')]"
|
||||
:error-messages="this.$gzv.ServerErrors(this,'name')"
|
||||
:rules="[this.$gzv.max255(this,'name'),this.$gzv.required(this,'name')]"
|
||||
:error-messages="this.$gzv.serverErrors(this,'name')"
|
||||
ref="name"
|
||||
@change="Change('name')"
|
||||
@change="onChange('name')"
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs12 sm6 lg4 xl3 px-2>
|
||||
@@ -33,10 +33,10 @@
|
||||
clearable
|
||||
:counter="10"
|
||||
:label="this.$gzlocale.get('WidgetSerial')"
|
||||
:rules="[this.$gzv.MaxLength(this,'serial',10)]"
|
||||
:error-messages="this.$gzv.ServerErrors(this,'serial')"
|
||||
:rules="[this.$gzv.maxLength(this,'serial',10)]"
|
||||
:error-messages="this.$gzv.serverErrors(this,'serial')"
|
||||
ref="serial"
|
||||
@change="Change('serial')"
|
||||
@change="onChange('serial')"
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs12 sm6 lg4 xl3 px-2>
|
||||
@@ -46,10 +46,10 @@
|
||||
:counter="10"
|
||||
:label="this.$gzlocale.get('WidgetCount')"
|
||||
ref="count"
|
||||
:rules="[this.$gzv.Integer(this,'count'),this.$gzv.Required(this,'count')]"
|
||||
:error-messages="this.$gzv.ServerErrors(this,'count')"
|
||||
:rules="[this.$gzv.integerValid(this,'count'),this.$gzv.required(this,'count')]"
|
||||
:error-messages="this.$gzv.serverErrors(this,'count')"
|
||||
required
|
||||
@change="Change('count')"
|
||||
@change="onChange('count')"
|
||||
type="number"
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
@@ -61,9 +61,9 @@
|
||||
:label="this.$gzlocale.get('WidgetDollarAmount')"
|
||||
ref="dollarAmount"
|
||||
required
|
||||
:rules="[this.$gzv.Decimal(this,'dollarAmount'),this.$gzv.Required(this,'dollarAmount')]"
|
||||
:error-messages="this.$gzv.ServerErrors(this,'dollarAmount')"
|
||||
@change="Change('dollarAmount')"
|
||||
:rules="[this.$gzv.decimalValid(this,'dollarAmount'),this.$gzv.required(this,'dollarAmount')]"
|
||||
:error-messages="this.$gzv.serverErrors(this,'dollarAmount')"
|
||||
@change="onChange('dollarAmount')"
|
||||
type="number"
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
@@ -73,19 +73,19 @@
|
||||
:label="this.$gzlocale.get('WidgetStartDate')"
|
||||
v-model="obj.startDate"
|
||||
ref="startDate"
|
||||
:error-messages="this.$gzv.ServerErrors(this,'startDate')"
|
||||
@change="Change('startDate')"
|
||||
:error-messages="this.$gzv.serverErrors(this,'startDate')"
|
||||
@change="onChange('startDate')"
|
||||
></gz-date-time-picker>
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs12 sm6 lg4 xl3 px-2>
|
||||
<gz-date-time-picker
|
||||
:label="this.$gzlocale.get('WidgetEndDate')"
|
||||
:rules="[this.$gzv.After(this,'startDate','endDate')]"
|
||||
:error-messages="this.$gzv.ServerErrors(this,'endDate')"
|
||||
:rules="[this.$gzv.datePrecedence(this,'startDate','endDate')]"
|
||||
:error-messages="this.$gzv.serverErrors(this,'endDate')"
|
||||
v-model="obj.endDate"
|
||||
ref="endDate"
|
||||
@change="Change('endDate')"
|
||||
@change="onChange('endDate')"
|
||||
></gz-date-time-picker>
|
||||
</v-flex>
|
||||
<v-flex xs12 sm6 lg4 xl3 px-2>
|
||||
@@ -93,9 +93,9 @@
|
||||
v-model="obj.active"
|
||||
:label="this.$gzlocale.get('Active')"
|
||||
ref="active"
|
||||
:error-messages="this.$gzv.ServerErrors(this,'active')"
|
||||
:error-messages="this.$gzv.serverErrors(this,'active')"
|
||||
required
|
||||
@change="Change('active')"
|
||||
@change="onChange('active')"
|
||||
></v-checkbox>
|
||||
</v-flex>
|
||||
<v-flex xs12 sm6 lg4 xl3 px-2>
|
||||
@@ -103,10 +103,10 @@
|
||||
v-model="obj.roles"
|
||||
:label="this.$gzlocale.get('WidgetRoles')"
|
||||
ref="roles"
|
||||
:rules="[this.$gzv.Integer(this,'roles'),this.$gzv.Required(this,'roles')]"
|
||||
:error-messages="this.$gzv.ServerErrors(this,'roles')"
|
||||
:rules="[this.$gzv.integerValid(this,'roles'),this.$gzv.required(this,'roles')]"
|
||||
:error-messages="this.$gzv.serverErrors(this,'roles')"
|
||||
required
|
||||
@change="Change('roles')"
|
||||
@change="onChange('roles')"
|
||||
type="number"
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
@@ -218,19 +218,19 @@ export default {
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
Change(ref) {
|
||||
this.$gzv.Change(this, ref);
|
||||
onChange(ref) {
|
||||
this.$gzv.onChange(this, ref);
|
||||
},
|
||||
getDataFromApi() {
|
||||
var url = "Widget/" + this.$route.params.id;
|
||||
var that = this;
|
||||
this.$gzv.DeleteAllErrorBoxErrors(this);
|
||||
this.$gzv.deleteAllErrorBoxErrors(this);
|
||||
this.$gzapi
|
||||
.get(url)
|
||||
.then(res => {
|
||||
if (res.error) {
|
||||
that.serverError = res.error;
|
||||
that.$gzv.SetErrorBoxErrors(that);
|
||||
that.$gzv.setErrorBoxErrors(that);
|
||||
} else {
|
||||
that.obj = res.data;
|
||||
}
|
||||
@@ -246,14 +246,14 @@ export default {
|
||||
var url = "Widget/" + this.$route.params.id;
|
||||
|
||||
//clear any errors that might be around from previous submit
|
||||
this.$gzv.DeleteAllErrorBoxErrors(this);
|
||||
this.$gzv.deleteAllErrorBoxErrors(this);
|
||||
|
||||
this.$gzapi
|
||||
.upsert(url, this.obj)
|
||||
.then(res => {
|
||||
if (res.error) {
|
||||
that.serverError = res.error;
|
||||
that.$gzv.SetErrorBoxErrors(that);
|
||||
that.$gzv.setErrorBoxErrors(that);
|
||||
} else {
|
||||
//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) {
|
||||
|
||||
Reference in New Issue
Block a user