This commit is contained in:
@@ -340,7 +340,7 @@ export default {
|
||||
}
|
||||
|
||||
let isReset = toPath && toPath.includes("home-reset");
|
||||
|
||||
debugger;
|
||||
//redirect to login if not authenticated
|
||||
if (!vm.$store.state.authenticated && !isReset) {
|
||||
//If a direct open path was being used but user is not logged in this will catch it
|
||||
|
||||
@@ -79,7 +79,7 @@ export default {
|
||||
}
|
||||
return window.$gz.store.state.translationText[key];
|
||||
},
|
||||
async cacheTranslations(keys) {
|
||||
async cacheTranslations(keys, forceTranslationId = 0) {
|
||||
return new Promise(async function fetchTranslationKeysFromServer(resolve) {
|
||||
//
|
||||
//step 1: build an array of keys that we don't have already
|
||||
@@ -99,7 +99,17 @@ export default {
|
||||
}
|
||||
|
||||
//step 2: get it
|
||||
let transData = await window.$gz.api.upsert("translation/subset", needIt);
|
||||
let transData = null;
|
||||
if (forceTranslationId != 0) {
|
||||
debugger;
|
||||
transData = await window.$gz.api.upsert(
|
||||
`translation/subset/${forceTranslationId}`,
|
||||
needIt
|
||||
);
|
||||
} else {
|
||||
transData = await window.$gz.api.upsert("translation/subset", needIt);
|
||||
}
|
||||
|
||||
transData.data.forEach(function commitFetchedTranslationItemToStore(
|
||||
item
|
||||
) {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<template>
|
||||
<v-form ref="form">
|
||||
{{ obj }}
|
||||
|
||||
<v-row>
|
||||
<v-col cols="12">
|
||||
<v-text-field
|
||||
@@ -47,14 +49,25 @@
|
||||
<script>
|
||||
/* Xeslint-disable */
|
||||
export default {
|
||||
async created() {},
|
||||
async created() {
|
||||
debugger;
|
||||
let searchParams = new URLSearchParams(window.location.search);
|
||||
//home-reset?rc={ResetCode}&tr={EffectiveTranslationId}&lg={loginName}
|
||||
this.obj.passwordResetCode = searchParams.get("rc");
|
||||
this.obj.loginName = searchParams.get("lg");
|
||||
this.obj.translationId = parseInt(searchParams.get("tr"));
|
||||
await initForm(this);
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
obj: {
|
||||
newPassword: null,
|
||||
confirmPassword: null,
|
||||
passwordResetCode: null
|
||||
passwordResetCode: null,
|
||||
loginName: null,
|
||||
translationId: 0 //1 //safety valve default to english
|
||||
},
|
||||
|
||||
reveal: true,
|
||||
formState: {
|
||||
ready: true,
|
||||
@@ -110,4 +123,29 @@ export default {
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/////////////////////////////////
|
||||
//
|
||||
//
|
||||
async function initForm(vm) {
|
||||
await fetchTranslatedText(vm);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////
|
||||
//
|
||||
// Ensures UI translated text is available
|
||||
//
|
||||
async function fetchTranslatedText(vm) {
|
||||
debugger;
|
||||
await window.$gz.translation.cacheTranslations(
|
||||
[
|
||||
"NewPassword",
|
||||
"ConfirmPassword",
|
||||
"UserLogin",
|
||||
"ErrorRequiredFieldEmpty",
|
||||
"ErrorNoMatch"
|
||||
],
|
||||
vm.translationId
|
||||
);
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user