This commit is contained in:
2020-02-07 23:32:22 +00:00
parent 82f2defc7e
commit 9a15ae5cec
11 changed files with 61 additions and 103 deletions

View File

@@ -50,16 +50,14 @@ SHELL / NAV / MENUS / LAYOUT
TODO: LOCALIZATION TODO: LOCALIZATION
- TODO ACTIONS - TODO ACTIONS
- Currency / decimal INPUT handle commas test to see if working fully
- needs to parse the currency, maybe I can cobble that together since the number portion stays the same?? (arabic?)
- INPUT currency / decimal can a german user input a currency as 1.234,56 ? (comma is the decimal separator and decimal is the thousands separator)
- https://dm4t2.github.io/vue-currency-input/guide/#installation
- PARSERS
- Update / test own parser for currency and decimal for validation purposes
- already something in there for currency I think
- Get rid of timezone numeric override and any other deprecated stuff (currency symbol, decimal symbol etc) and associated code at client and server - Get rid of timezone numeric override and any other deprecated stuff (currency symbol, decimal symbol etc) and associated code at client and server
- Add the new overrides for language and timezone and currency code and 12hour at client and server - Add the new overrides for language and timezone and currency code and 12hour at client and server
- CurrencyName (only one can't be inferred)
- Time zone name
- language name
- 12hr time
- Make functional user settings form with all overrides so can test shit out - Make functional user settings form with all overrides so can test shit out
- Need a browser check on opening the login page that will check to ensure the browser can do the date conversions properly etc and tell user browser is unsuitable if it isn't - Need a browser check on opening the login page that will check to ensure the browser can do the date conversions properly etc and tell user browser is unsuitable if it isn't

View File

@@ -1,11 +1,12 @@
export default { export default {
version: "8.0.0-alpha.2020.Jan.31", version: "8.0.0-alpha.2020.Feb-07",
copyright: copyright:
"Copyright © 1999-2020, Ground Zero Tech-Works Inc. All Rights Reserved", "Copyright © 1999-2020, Ground Zero Tech-Works Inc. All Rights Reserved",
browser: { browser: {
platform: window.navigator.platform, platform: window.navigator.platform,
userAgent: window.navigator.userAgent, userAgent: window.navigator.userAgent,
language: window.navigator.language, languages: window.navigator.languages,
tz: Intl.DateTimeFormat().resolvedOptions().timeZone,
oscpu: window.navigator.oscpu, oscpu: window.navigator.oscpu,
maxTouchPoints: window.navigator.maxTouchPoints, maxTouchPoints: window.navigator.maxTouchPoints,
webdriver: window.navigator.webdriver, webdriver: window.navigator.webdriver,

View File

@@ -158,24 +158,7 @@ export default {
"AM", "AM",
"PM" "PM"
], ],
decimalValidate(required) {
return { required: required, decimal: [2, this.format().decimalSeparator] };
},
decimalParse(v) {
if (v) {
if (
this.decimalSeparator != "." &&
v.includes(this.format().decimalSeparator)
) {
v = v.replace(this.format().decimalSeparator, ".");
}
v = parseFloat(v);
}
return v;
},
format() {
return window.$gz.store.state.locale;
},
//////////////////////////////////////////////////////// ////////////////////////////////////////////////////////
// Take in a string that contains one or more // Take in a string that contains one or more
//locale keys between square brackets //locale keys between square brackets
@@ -224,6 +207,12 @@ export default {
getCurrencyName() { getCurrencyName() {
return window.$gz.store.state.locale.currencyName; return window.$gz.store.state.locale.currencyName;
}, },
//////////////////////////////////////////////////
// Get the user's chosen 12hr clock
//
getHour12() {
return window.$gz.store.state.locale.hour12;
},
/////////////////////////////////////////// ///////////////////////////////////////////
// Turn a utc date into a displayable // Turn a utc date into a displayable
// short date and time // short date and time
@@ -246,7 +235,7 @@ export default {
} }
if (!hour12) { if (!hour12) {
hour12 = window.$gz.store.state.locale.hour12; hour12 = this.getHour12();
} }
//parse the date which is identified as utc ("2020-02-06T18:18:49.148011Z") //parse the date which is identified as utc ("2020-02-06T18:18:49.148011Z")
@@ -306,7 +295,7 @@ export default {
} }
if (!hour12) { if (!hour12) {
hour12 = window.$gz.store.state.locale.hour12; hour12 = this.getHour12();
} }
//parse the date which is identified as utc ("2020-02-06T18:18:49.148011Z") //parse the date which is identified as utc ("2020-02-06T18:18:49.148011Z")

View File

@@ -17,7 +17,8 @@
> >
<!-- CURRENCY --> <!-- CURRENCY -->
<div v-if="item.type === 8"> <div v-if="item.type === 8">
<v-text-field TODO: CURRENCY CONTROL HERE
<!-- <v-text-field
v-model="_self[item.dataKey]" v-model="_self[item.dataKey]"
:readonly="readOnly" :readonly="readOnly"
:prefix="ltFormat().currencySymbol" :prefix="ltFormat().currencySymbol"
@@ -29,7 +30,7 @@
]" ]"
type="number" type="number"
step="any" step="any"
></v-text-field> ></v-text-field> -->
</div> </div>
<!-- DATE --> <!-- DATE -->
<div v-else-if="item.type === 2"> <div v-else-if="item.type === 2">
@@ -104,7 +105,8 @@
</div> </div>
<!-- DECIMAL --> <!-- DECIMAL -->
<div v-else-if="item.type === 7"> <div v-else-if="item.type === 7">
<v-text-field TODO: DECIMAL CONTROL HERE
<!-- <v-text-field
v-model="_self[item.dataKey]" v-model="_self[item.dataKey]"
:readonly="readOnly" :readonly="readOnly"
:label="lt(item.fld)" :label="lt(item.fld)"
@@ -117,7 +119,7 @@
:counter="10" :counter="10"
type="number" type="number"
step="any" step="any"
></v-text-field> ></v-text-field> -->
</div> </div>
<!-- BOOL --> <!-- BOOL -->
<div v-else-if="item.type === 6"> <div v-else-if="item.type === 6">
@@ -167,9 +169,6 @@ export default {
lt: function(ltkey) { lt: function(ltkey) {
return window.$gz.locale.get(ltkey); return window.$gz.locale.get(ltkey);
}, },
ltFormat() {
return window.$gz.locale.format();
},
form() { form() {
//nothing //nothing
return window.$gz.form; return window.$gz.form;

View File

@@ -53,7 +53,7 @@
<v-time-picker <v-time-picker
scrollable scrollable
ampm-in-title ampm-in-title
:format="ampmFormat" :format="hour12 ? 'ampm' : '24hr'"
v-model="timeOnly" v-model="timeOnly"
> >
<v-spacer></v-spacer> <v-spacer></v-spacer>
@@ -87,9 +87,10 @@ export default {
//cache display format stuff //cache display format stuff
timeZoneName: window.$gz.locale.getTimeZoneName(), timeZoneName: window.$gz.locale.getTimeZoneName(),
languageName: window.$gz.locale.getBrowserLanguages(), languageName: window.$gz.locale.getBrowserLanguages(),
hour12: window.$gz.store.state.locale.hour12, hour12: window.$gz.locale.getHour12(),
defaultLocale: window.$gz.locale.getBrowserFirstLanguage().split("-", 1)[0], defaultLocale: window.$gz.locale.getBrowserFirstLanguage().split("-", 1)[0]
ampmFormat: window.$gz.locale.format().hour12 ? "ampm" : "24hr" // ampmFormat: window.$gz.locale.getHour12() ? "ampm" : "24hr"
//:format="ampmFormat"
}), }),
props: { props: {
label: String, label: String,

View File

@@ -331,9 +331,6 @@ export default {
lt(ltKey) { lt(ltKey) {
return window.$gz.locale.get(ltKey); return window.$gz.locale.get(ltKey);
}, },
ltFormat() {
return window.$gz.locale.format();
},
getDataFromApi() { getDataFromApi() {
var that = this; var that = this;

View File

@@ -212,9 +212,6 @@ Actual in inspector browser code:
lt(ltKey) { lt(ltKey) {
return window.$gz.locale.get(ltKey); return window.$gz.locale.get(ltKey);
}, },
ltFormat() {
return window.$gz.locale.format();
},
newItem() { newItem() {
this.$router.push({ this.$router.push({
name: "inventory-widget-edit", name: "inventory-widget-edit",

View File

@@ -17,7 +17,7 @@
<v-time-picker <v-time-picker
scrollable scrollable
ampm-in-title ampm-in-title
:format="ampmFormat" :format="hour12 ? 'ampm' : '24hr'"
v-model="timeOnly" v-model="timeOnly"
> >
<v-spacer></v-spacer> <v-spacer></v-spacer>
@@ -51,9 +51,8 @@ export default {
//cache display format stuff //cache display format stuff
timeZoneName: window.$gz.locale.getTimeZoneName(), timeZoneName: window.$gz.locale.getTimeZoneName(),
languageName: window.$gz.locale.getBrowserLanguages(), languageName: window.$gz.locale.getBrowserLanguages(),
hour12: window.$gz.store.state.locale.hour12, hour12: window.$gz.locale.getHour12(),
defaultLocale: window.$gz.locale.getBrowserFirstLanguage().split("-", 1)[0], defaultLocale: window.$gz.locale.getBrowserFirstLanguage().split("-", 1)[0]
ampmFormat: window.$gz.locale.format().hour12 ? "ampm" : "24hr"
}), }),
props: { props: {
label: String, label: String,

View File

@@ -154,7 +154,6 @@ Vue.filter("currency", function vueFilterCurrency(value) {
style: "currency", style: "currency",
currency: "EUR" currency: "EUR"
}); });
// return locale.format().currencySymbol + value.toFixed(2);
}); });
Vue.filter("decimal", function vueFilterDecimal(value) { Vue.filter("decimal", function vueFilterDecimal(value) {

View File

@@ -21,14 +21,10 @@ export default new Vuex.Store({
homePage: undefined, homePage: undefined,
localeText: {}, localeText: {},
locale: { locale: {
tag: "en-US", languageOverride: "en-US",
decimalSeparator: ".", timeZoneOverride: ".",
currencyName: "USD", currencyName: "USD",
hour12: true, hour12: true
// shortDate: "YYYY-MM-DD",
// shortTime: "hh:mm:ss A",
// shortDateAndTime: "YYYY-MM-DD hh:mm:ss A",
timeZoneOffset: -7 //timeZoneOffset is in decimal hours
}, },
navItems: [], navItems: [],
logArray: [], logArray: [],

View File

@@ -16,107 +16,92 @@
<v-card id="ayaNovaVersioncard"> <v-card id="ayaNovaVersioncard">
<v-subheader>{{ lt("ClientApp") }}</v-subheader> <v-subheader>{{ lt("ClientApp") }}</v-subheader>
<div> <div>
<span class="ml-6 body-1">{{ lt("Version") }}:</span> <span class="ml-6 body-1">{{ lt("Version") }}: </span>
<span class="body-2">{{ clientInfo.version }}</span> <span class="body-2">{{ clientInfo.version }}</span>
</div> </div>
<div> <div>
<span class="ml-6 body-1">{{ lt("User") }}:</span> <span class="ml-6 body-1">{{ lt("User") }}: </span>
<span class="body-2">{{ this.$store.state.userName }}</span> <span class="body-2">{{ this.$store.state.userName }}</span>
</div> </div>
<div> <div>
<span class="ml-6 body-1">12h:</span> <span class="ml-6 body-1">12h: </span>
<span class="body-2"> <span class="body-2">
{{ ltFormat().hour12 }} {{ locale().getHour12() }}
</span> </span>
</div> </div>
<div> <div>
<span class="ml-6 body-1">{{ lt("UserTimeZoneOffset") }}:</span> <span class="ml-6 body-1">{{ lt("TimeZone") }}: </span>
<span class="body-2"> <span class="body-2">
{{ ltFormat().timeZoneOffset }} {{ locale().getTimeZoneName() }}
</span> </span>
</div> </div>
<div> <div>
<span class="ml-6 body-1">{{ lt("DecimalSeparator") }}:</span> <span class="ml-6 body-1">{{ lt("LanguageCode") }}: </span>
<span class="body-2">{{ ltFormat().decimalSeparator }}</span> <span class="body-2">{{ locale().getBrowserFirstLanguage() }}</span>
</div> </div>
<div> <div>
<span class="ml-6 body-1">{{ lt("CurrencySymbol") }}:</span> <span class="ml-6 body-1">{{ lt("CurrencyCode") }}: </span>
<span class="body-2">{{ ltFormat().currencySymbol }}</span> <span class="body-2">{{ locale().getCurrencyName() }}</span>
</div> </div>
<!-- <div>
<span class="ml-6 body-1">{{ lt("ShortDateFormat") }}:</span>
<span class="body-2">{{ ltFormat().shortDate }}</span>
</div>
<div>
<span class="ml-6 body-1">{{ lt("ShortTimeFormat") }}:</span>
<span class="body-2">{{ ltFormat().shortTime }}</span>
</div>
<div>
<span class="ml-6 body-1">{{ lt("ShortDateAndTimeFormat") }}: </span>
<span class="body-2">{{ ltFormat().shortDateAndTime }}</span>
</div> -->
<v-divider class="mt-6"></v-divider> <v-divider class="mt-6"></v-divider>
<v-subheader>{{ lt("Browser") }}</v-subheader> <v-subheader>{{ lt("Browser") }}</v-subheader>
<div v-for="(value, name) in clientInfo.browser" :key="name"> <div v-for="(value, name) in clientInfo.browser" :key="name">
<span class="ml-6 body-1">{{ name }}:</span> <span class="ml-6 body-1">{{ name }}: </span>
<span class="body-2">{{ value }}</span> <span class="body-2">{{ value }}</span>
</div> </div>
<v-divider class="mt-6"></v-divider> <v-divider class="mt-6"></v-divider>
<v-subheader>{{ lt("Server") }}</v-subheader> <v-subheader>{{ lt("Server") }}</v-subheader>
<div> <div>
<span class="ml-6 body-1">{{ lt("ServerAddress") }}:</span> <span class="ml-6 body-1">{{ lt("ServerAddress") }}: </span>
<span class="body-2">{{ this.$store.state.apiUrl }}</span> <span class="body-2">{{ this.$store.state.apiUrl }}</span>
</div> </div>
<div> <div>
<span class="ml-6 body-1">{{ lt("Version") }}:</span> <span class="ml-6 body-1">{{ lt("Version") }}: </span>
<span class="body-2">{{ serverInfo.serverVersion }}</span> <span class="body-2">{{ serverInfo.serverVersion }}</span>
</div> </div>
<div> <div>
<span class="ml-6 body-1">{{ lt("SchemaVersion") }}:</span> <span class="ml-6 body-1">{{ lt("SchemaVersion") }}: </span>
<span class="body-2">{{ serverInfo.dbSchemaVersion }}</span> <span class="body-2">{{ serverInfo.dbSchemaVersion }}</span>
</div> </div>
<div> <div>
<span class="ml-6 body-1">{{ lt("ServerTime") }}:</span> <span class="ml-6 body-1">{{ lt("ServerTime") }}: </span>
<span class="body-2">{{ serverInfo.serverLocalTime }}</span> <span class="body-2">{{ serverInfo.serverLocalTime }}</span>
</div> </div>
<div> <div>
<span class="ml-6 body-1">{{ lt("TimeZone") }}:</span> <span class="ml-6 body-1">{{ lt("TimeZone") }}: </span>
<span class="body-2">{{ serverInfo.serverTimeZone }}</span> <span class="body-2">{{ serverInfo.serverTimeZone }}</span>
</div> </div>
<v-divider class="mt-6"></v-divider> <v-divider class="mt-6"></v-divider>
<v-subheader>{{ lt("HelpLicense") }}</v-subheader> <v-subheader>{{ lt("HelpLicense") }}</v-subheader>
<div> <div>
<span class="ml-6 body-1">{{ lt("RegisteredUser") }}:</span> <span class="ml-6 body-1">{{ lt("RegisteredUser") }}: </span>
<span class="body-2">{{ <span class="body-2">{{
serverInfo.license.license.licensedTo serverInfo.license.license.licensedTo
}}</span> }}</span>
</div> </div>
<div> <div>
<span class="ml-6 body-1">{{ lt("DatabaseID") }}:</span> <span class="ml-6 body-1">{{ lt("DatabaseID") }}: </span>
<span class="body-2">{{ serverInfo.license.license.dbId }}</span> <span class="body-2">{{ serverInfo.license.license.dbId }}</span>
</div> </div>
<div> <div>
<span class="ml-6 body-1">{{ lt("LicenseSerial") }}:</span> <span class="ml-6 body-1">{{ lt("LicenseSerial") }}: </span>
<span class="body-2">{{ serverInfo.license.license.keySerial }}</span> <span class="body-2">{{ serverInfo.license.license.keySerial }}</span>
</div> </div>
<div> <div>
<span class="ml-6 body-1">{{ lt("LicenseExpiration") }}:</span> <span class="ml-6 body-1">{{ lt("LicenseExpiration") }}: </span>
<span class="body-2">{{ <span class="body-2">{{
serverInfo.license.license.licenseExpiration serverInfo.license.license.licenseExpiration
}}</span> }}</span>
</div> </div>
<div> <div>
<span class="ml-6 body-1">{{ lt("SupportedUntil") }}:</span> <span class="ml-6 body-1">{{ lt("SupportedUntil") }}: </span>
<span class="body-2">{{ <span class="body-2">{{
serverInfo.license.license.maintenanceExpiration serverInfo.license.license.maintenanceExpiration
}}</span> }}</span>
@@ -198,12 +183,9 @@ export default {
"Log", "Log",
"User", "User",
"Browser", "Browser",
"UserTimeZoneOffset", "LanguageCode",
"DecimalSeparator", "TimeZone",
"CurrencySymbol", "CurrencyCode"
"ShortDateFormat",
"ShortTimeFormat",
"ShortDateAndTimeFormat"
]) ])
.then(function() { .then(function() {
vm.formState.ready = true; vm.formState.ready = true;
@@ -269,8 +251,8 @@ export default {
lt(ltKey) { lt(ltKey) {
return window.$gz.locale.get(ltKey); return window.$gz.locale.get(ltKey);
}, },
ltFormat() { locale() {
return window.$gz.locale.format(); return window.$gz.locale;
} }
} }
}; };