moved t function to global and misc cleanup
This commit is contained in:
@@ -47,9 +47,6 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
translation() {
|
||||
return window.$gz.translation;
|
||||
},
|
||||
handleInput(value) {
|
||||
let ret = parseCurrency(value, {
|
||||
currency: this.currencyName,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div v-if="templateHasVisibleCustomFields()">
|
||||
<span class="v-label v-label--active theme--light">
|
||||
{{ t("ObjectCustomFieldCustomGrid") }}
|
||||
{{ $ay.t("ObjectCustomFieldCustomGrid") }}
|
||||
</span>
|
||||
<div>
|
||||
<v-row align-center justify-left row wrap>
|
||||
@@ -20,12 +20,17 @@
|
||||
<gz-date-time-picker
|
||||
v-model="_self[item.dataKey]"
|
||||
:readonly="readOnly"
|
||||
:label="t(item.fld)"
|
||||
:label="$ay.t(item.fld)"
|
||||
:ref="item.fld"
|
||||
:data-cy="item.fld"
|
||||
:error-messages="form().serverErrors(parentVM, item.fld)"
|
||||
:rules="[
|
||||
form().customFieldsCheck(parentVM, item, _self, t(item.fld))
|
||||
form().customFieldsCheck(
|
||||
parentVM,
|
||||
item,
|
||||
_self,
|
||||
$ay.t(item.fld)
|
||||
)
|
||||
]"
|
||||
></gz-date-time-picker>
|
||||
</div>
|
||||
@@ -35,12 +40,17 @@
|
||||
<gz-date-picker
|
||||
v-model="_self[item.dataKey]"
|
||||
:readonly="readOnly"
|
||||
:label="t(item.fld)"
|
||||
:label="$ay.t(item.fld)"
|
||||
:ref="item.fld"
|
||||
:data-cy="item.fld"
|
||||
:error-messages="form().serverErrors(parentVM, item.fld)"
|
||||
:rules="[
|
||||
form().customFieldsCheck(parentVM, item, _self, t(item.fld))
|
||||
form().customFieldsCheck(
|
||||
parentVM,
|
||||
item,
|
||||
_self,
|
||||
$ay.t(item.fld)
|
||||
)
|
||||
]"
|
||||
></gz-date-picker>
|
||||
</div>
|
||||
@@ -49,12 +59,17 @@
|
||||
<gz-time-picker
|
||||
v-model="_self[item.dataKey]"
|
||||
:readonly="readOnly"
|
||||
:label="t(item.fld)"
|
||||
:label="$ay.t(item.fld)"
|
||||
:ref="item.fld"
|
||||
:data-cy="item.fld"
|
||||
:error-messages="form().serverErrors(parentVM, item.fld)"
|
||||
:rules="[
|
||||
form().customFieldsCheck(parentVM, item, _self, t(item.fld))
|
||||
form().customFieldsCheck(
|
||||
parentVM,
|
||||
item,
|
||||
_self,
|
||||
$ay.t(item.fld)
|
||||
)
|
||||
]"
|
||||
></gz-time-picker>
|
||||
</div>
|
||||
@@ -63,12 +78,17 @@
|
||||
<v-textarea
|
||||
v-model="_self[item.dataKey]"
|
||||
:readonly="readOnly"
|
||||
:label="t(item.fld)"
|
||||
:label="$ay.t(item.fld)"
|
||||
:ref="item.fld"
|
||||
:data-cy="item.fld"
|
||||
:error-messages="form().serverErrors(parentVM, item.fld)"
|
||||
:rules="[
|
||||
form().customFieldsCheck(parentVM, item, _self, t(item.fld))
|
||||
form().customFieldsCheck(
|
||||
parentVM,
|
||||
item,
|
||||
_self,
|
||||
$ay.t(item.fld)
|
||||
)
|
||||
]"
|
||||
auto-grow
|
||||
clearable
|
||||
@@ -79,12 +99,17 @@
|
||||
<v-text-field
|
||||
v-model="_self[item.dataKey]"
|
||||
:readonly="readOnly"
|
||||
:label="t(item.fld)"
|
||||
:label="$ay.t(item.fld)"
|
||||
:ref="item.fld"
|
||||
:data-cy="item.fld"
|
||||
:error-messages="form().serverErrors(parentVM, item.fld)"
|
||||
:rules="[
|
||||
form().customFieldsCheck(parentVM, item, _self, t(item.fld))
|
||||
form().customFieldsCheck(
|
||||
parentVM,
|
||||
item,
|
||||
_self,
|
||||
$ay.t(item.fld)
|
||||
)
|
||||
]"
|
||||
clearable
|
||||
:counter="10"
|
||||
@@ -97,12 +122,17 @@
|
||||
<v-checkbox
|
||||
v-model="_self[item.dataKey]"
|
||||
:readonly="readOnly"
|
||||
:label="t(item.fld)"
|
||||
:label="$ay.t(item.fld)"
|
||||
:ref="item.fld"
|
||||
:data-cy="item.fld"
|
||||
:error-messages="form().serverErrors(parentVM, item.fld)"
|
||||
:rules="[
|
||||
form().customFieldsCheck(parentVM, item, _self, t(item.fld))
|
||||
form().customFieldsCheck(
|
||||
parentVM,
|
||||
item,
|
||||
_self,
|
||||
$ay.t(item.fld)
|
||||
)
|
||||
]"
|
||||
></v-checkbox>
|
||||
</div>
|
||||
@@ -111,12 +141,17 @@
|
||||
<gz-decimal
|
||||
v-model="_self[item.dataKey]"
|
||||
:readonly="readOnly"
|
||||
:label="t(item.fld)"
|
||||
:label="$ay.t(item.fld)"
|
||||
:ref="item.fld"
|
||||
:data-cy="item.fld"
|
||||
:error-messages="form().serverErrors(parentVM, item.fld)"
|
||||
:rules="[
|
||||
form().customFieldsCheck(parentVM, item, _self, t(item.fld))
|
||||
form().customFieldsCheck(
|
||||
parentVM,
|
||||
item,
|
||||
_self,
|
||||
$ay.t(item.fld)
|
||||
)
|
||||
]"
|
||||
></gz-decimal>
|
||||
</div>
|
||||
@@ -125,12 +160,17 @@
|
||||
<gz-currency
|
||||
v-model="_self[item.dataKey]"
|
||||
:readonly="readOnly"
|
||||
:label="t(item.fld)"
|
||||
:label="$ay.t(item.fld)"
|
||||
:ref="item.fld"
|
||||
:data-cy="item.fld"
|
||||
:error-messages="form().serverErrors(parentVM, item.fld)"
|
||||
:rules="[
|
||||
form().customFieldsCheck(parentVM, item, _self, t(item.fld))
|
||||
form().customFieldsCheck(
|
||||
parentVM,
|
||||
item,
|
||||
_self,
|
||||
$ay.t(item.fld)
|
||||
)
|
||||
]"
|
||||
></gz-currency>
|
||||
</div>
|
||||
@@ -166,9 +206,6 @@ export default {
|
||||
},
|
||||
|
||||
methods: {
|
||||
t: function(tKey) {
|
||||
return window.$gz.translation.get(tKey);
|
||||
},
|
||||
form() {
|
||||
//nothing
|
||||
return window.$gz.form;
|
||||
@@ -433,9 +470,6 @@ export default {
|
||||
if (!window.$gz._) {
|
||||
throw "custom-fields-control: $gz._ (lodash) is required and missing";
|
||||
}
|
||||
if (!window.$gz.translation) {
|
||||
throw "custom-fields-control: $gz.translation is required and missing";
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<v-date-picker :locale="defaultLocale" v-model="dateOnly">
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn text color="primary" @click="dlgdate = false">{{
|
||||
t("OK")
|
||||
$ay.t("OK")
|
||||
}}</v-btn>
|
||||
</v-date-picker>
|
||||
</v-dialog>
|
||||
@@ -59,11 +59,6 @@ export default {
|
||||
required: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
t(tKey) {
|
||||
return window.$gz.translation.get(tKey);
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
date() {
|
||||
//this tortuous fuckery is required so that the input and change events only fire on a real change, not initial page load
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn text color="primary" @click="dlgdate = false">{{
|
||||
t("OK")
|
||||
$ay.t("OK")
|
||||
}}</v-btn>
|
||||
</v-date-picker>
|
||||
</v-dialog>
|
||||
@@ -62,7 +62,7 @@
|
||||
>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn text color="primary" @click="dlgtime = false">{{
|
||||
t("OK")
|
||||
$ay.t("OK")
|
||||
}}</v-btn>
|
||||
</v-time-picker>
|
||||
</v-dialog>
|
||||
@@ -105,11 +105,6 @@ export default {
|
||||
},
|
||||
testId: String
|
||||
},
|
||||
methods: {
|
||||
t(tKey) {
|
||||
return window.$gz.translation.get(tKey);
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
date() {
|
||||
//this tortuous fuckery is required so that the input and change events only fire on a real change, not initial page load
|
||||
|
||||
@@ -47,9 +47,6 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
translation() {
|
||||
return window.$gz.translation;
|
||||
},
|
||||
handleInput(value) {
|
||||
this.$emit(
|
||||
"input",
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
:items="selectLists.listViews"
|
||||
item-text="name"
|
||||
item-value="id"
|
||||
:label="t('DataListView')"
|
||||
:label="$ay.t('DataListView')"
|
||||
@input="listViewChanged"
|
||||
data-cy="selectlistview"
|
||||
>
|
||||
@@ -37,7 +37,7 @@
|
||||
class="headline ml-3 accent--text"
|
||||
v-if="!loading && records.length < 1"
|
||||
>
|
||||
{{ t("NoData") }}
|
||||
{{ $ay.t("NoData") }}
|
||||
</div>
|
||||
<!-- WIDE TABLE VIEW -->
|
||||
<template v-if="$vuetify.breakpoint.smAndUp">
|
||||
@@ -55,11 +55,11 @@
|
||||
showCurrentPage: true,
|
||||
showFirstLastPage: true,
|
||||
itemsPerPageOptions: rowsPerPageItems,
|
||||
itemsPerPageText: t('RowsPerPage'),
|
||||
pageText: t('PageOfPageText')
|
||||
itemsPerPageText: $ay.t('RowsPerPage'),
|
||||
pageText: $ay.t('PageOfPageText')
|
||||
}"
|
||||
:loading-text="t('Loading')"
|
||||
:no-data-text="t('NoData')"
|
||||
:loading-text="$ay.t('Loading')"
|
||||
:no-data-text="$ay.t('NoData')"
|
||||
class="elevation-1"
|
||||
data-cy="datatable-wide"
|
||||
>
|
||||
@@ -173,15 +173,15 @@
|
||||
showCurrentPage: true,
|
||||
showFirstLastPage: true,
|
||||
itemsPerPageOptions: rowsPerPageItems,
|
||||
itemsPerPageText: t('RowsPerPage'),
|
||||
pageText: t('PageOfPageText')
|
||||
itemsPerPageText: $ay.t('RowsPerPage'),
|
||||
pageText: $ay.t('PageOfPageText')
|
||||
}"
|
||||
:loading-text="t('Loading')"
|
||||
:loading-text="$ay.t('Loading')"
|
||||
class="elevation-1"
|
||||
data-cy="datatable-mobile"
|
||||
>
|
||||
<template v-slot:header="props">
|
||||
<!-- Mimic the full width data table select all toggle :no-data-text="t('NoData')"-->
|
||||
<!-- Mimic the full width data table select all toggle :no-data-text="$ay.t('NoData')"-->
|
||||
<div
|
||||
id="divSelectAll"
|
||||
@click="props.toggleSelectAll(!props.everyItem)"
|
||||
@@ -492,9 +492,6 @@ export default {
|
||||
//i is the actual AyaNova index of vm record so we have all we need to open vm object
|
||||
window.$gz.eventBus.$emit("openobject", { type: typeToOpen, id: i });
|
||||
},
|
||||
t(tKey) {
|
||||
return window.$gz.translation.get(tKey);
|
||||
},
|
||||
getDataFromApi() {
|
||||
let vm = this;
|
||||
if (vm.loading) {
|
||||
@@ -867,7 +864,7 @@ function loadFormSettings(vm) {
|
||||
//add UNSAVED FILTER if -1
|
||||
|
||||
vm.selectLists.listViews.unshift({
|
||||
name: vm.t("FilterUnsaved"),
|
||||
name: vm.$ay.t("FilterUnsaved"),
|
||||
id: -1
|
||||
});
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
item-disabled="!active"
|
||||
:error-messages="errors"
|
||||
:loading="fetching"
|
||||
:placeholder="t('Search')"
|
||||
:placeholder="$ay.t('Search')"
|
||||
:search-input.sync="searchEntry"
|
||||
:filter="customFilter"
|
||||
hide-no-data
|
||||
@@ -107,9 +107,6 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
t: function(tKey) {
|
||||
return window.$gz.translation.get(tKey);
|
||||
},
|
||||
hasError: function() {
|
||||
return this.errors.length > 0;
|
||||
},
|
||||
@@ -283,7 +280,7 @@ export default {
|
||||
if (val.includes(" ")) {
|
||||
queryTerms = val.split(" ");
|
||||
if (queryTerms.length > 2) {
|
||||
vm.errors.push(vm.t("ErrorPickListQueryInvalid"));
|
||||
vm.errors.push(vm.$ay.t("ErrorPickListQueryInvalid"));
|
||||
return;
|
||||
}
|
||||
isATwoTermQuery = true;
|
||||
@@ -318,7 +315,7 @@ export default {
|
||||
window.$gz._.startsWith(queryTerms[0], "..") &&
|
||||
window.$gz._.startsWith(queryTerms[1], "..")
|
||||
) {
|
||||
vm.errors.push(vm.t("ErrorPickListQueryInvalid"));
|
||||
vm.errors.push(vm.$ay.t("ErrorPickListQueryInvalid"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -327,7 +324,7 @@ export default {
|
||||
!window.$gz._.startsWith(queryTerms[0], "..") &&
|
||||
!window.$gz._.startsWith(queryTerms[1], "..")
|
||||
) {
|
||||
vm.errors.push(vm.t("ErrorPickListQueryInvalid"));
|
||||
vm.errors.push(vm.$ay.t("ErrorPickListQueryInvalid"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -349,17 +346,6 @@ export default {
|
||||
this.getList(urlParams);
|
||||
//------------
|
||||
}, 300) //did some checking, 200-300ms seems to be the most common debounce time for ajax search queries
|
||||
},
|
||||
beforeCreate() {
|
||||
//check pre-requisites exist just in case
|
||||
if (window.$gz.errorHandler.devMode()) {
|
||||
// if (!window.$gz._) {
|
||||
// throw "tag-picker: $gz._ (lodash) is required and missing";
|
||||
// }
|
||||
if (!window.$gz.translation) {
|
||||
throw "tag-picker: $gz.translation is required and missing";
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
<template>
|
||||
<div>
|
||||
<span class="v-label v-label--active theme--light">
|
||||
{{ t("Tags") }}
|
||||
{{ $ay.t("Tags") }}
|
||||
</span>
|
||||
<v-autocomplete
|
||||
v-bind:value="value"
|
||||
v-on:input="$emit('input', $event)"
|
||||
:items="sourcetags"
|
||||
:loading="tagSearchUnderway"
|
||||
:placeholder="t('TypeToSearchOrAdd')"
|
||||
:no-data-text="t('NoData')"
|
||||
:placeholder="$ay.t('TypeToSearchOrAdd')"
|
||||
:no-data-text="$ay.t('NoData')"
|
||||
:search-input.sync="tagSearchEntry"
|
||||
hide-selected
|
||||
multiple
|
||||
@@ -95,9 +95,6 @@ export default {
|
||||
},
|
||||
|
||||
methods: {
|
||||
t: function(tKey) {
|
||||
return window.$gz.translation.get(tKey);
|
||||
},
|
||||
addTag() {
|
||||
let theTag = this.tagSearchEntry;
|
||||
theTag = this.normalizeTag(theTag);
|
||||
@@ -113,17 +110,6 @@ export default {
|
||||
tagName = tagName.length > 255 ? tagName.substr(0, 255 - 1) : tagName;
|
||||
return tagName;
|
||||
}
|
||||
},
|
||||
beforeCreate() {
|
||||
//check pre-requisites exist just in case
|
||||
if (window.$gz.errorHandler.devMode()) {
|
||||
if (!window.$gz._) {
|
||||
throw "tag-picker: $gz._ (lodash) is required and missing";
|
||||
}
|
||||
if (!window.$gz.translation) {
|
||||
throw "tag-picker: $gz.translation is required and missing";
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn text color="primary" @click="dlgtime = false">{{
|
||||
t("OK")
|
||||
$ay.t("OK")
|
||||
}}</v-btn>
|
||||
</v-time-picker>
|
||||
</v-dialog>
|
||||
@@ -64,11 +64,6 @@ export default {
|
||||
required: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
t(tKey) {
|
||||
return window.$gz.translation.get(tKey);
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
date() {
|
||||
//this tortuous fuckery is required so that the input and change events only fire on a real change, not initial page load
|
||||
|
||||
Reference in New Issue
Block a user