This commit is contained in:
@@ -48,6 +48,8 @@ User / Contact self password administration and onboarding
|
|||||||
|
|
||||||
todo: User update / save password and login, if try to change login but don't give password it bombs with server error
|
todo: User update / save password and login, if try to change login but don't give password it bombs with server error
|
||||||
todo: if authenticated and click reset link sb logged out before reset form opens
|
todo: if authenticated and click reset link sb logged out before reset form opens
|
||||||
|
todo: Test alt languages in reset ui
|
||||||
|
todo: suggest loginname be email address
|
||||||
todo: SEEDER
|
todo: SEEDER
|
||||||
Sample customer contacts need random contact info also entered so it's visible as example
|
Sample customer contacts need random contact info also entered so it's visible as example
|
||||||
|
|
||||||
|
|||||||
@@ -101,10 +101,6 @@ export default {
|
|||||||
//step 2: get it
|
//step 2: get it
|
||||||
let transData = null;
|
let transData = null;
|
||||||
|
|
||||||
console.log(
|
|
||||||
"translation.js::cachetranslationkeys forcetranslationid=",
|
|
||||||
forceTranslationId
|
|
||||||
);
|
|
||||||
if (forceTranslationId) {
|
if (forceTranslationId) {
|
||||||
transData = await window.$gz.api.upsert(
|
transData = await window.$gz.api.upsert(
|
||||||
`translation/subset/${forceTranslationId}`,
|
`translation/subset/${forceTranslationId}`,
|
||||||
|
|||||||
@@ -1033,11 +1033,13 @@ async function fetchTranslatedText(vm) {
|
|||||||
await window.$gz.translation.cacheTranslations([
|
await window.$gz.translation.cacheTranslations([
|
||||||
"Vendor",
|
"Vendor",
|
||||||
"User",
|
"User",
|
||||||
|
"UserSettings",
|
||||||
"Name",
|
"Name",
|
||||||
"UserEmployeeNumber",
|
"UserEmployeeNumber",
|
||||||
"NewLogin",
|
"NewLogin",
|
||||||
"NewPassword",
|
"NewPassword",
|
||||||
"AuthorizationRoles",
|
"AuthorizationRoles",
|
||||||
|
"LastLogin",
|
||||||
"UserNotes",
|
"UserNotes",
|
||||||
"UserType",
|
"UserType",
|
||||||
"Active",
|
"Active",
|
||||||
@@ -1056,7 +1058,18 @@ async function fetchTranslatedText(vm) {
|
|||||||
"UserCustom13",
|
"UserCustom13",
|
||||||
"UserCustom14",
|
"UserCustom14",
|
||||||
"UserCustom15",
|
"UserCustom15",
|
||||||
"UserCustom16"
|
"UserCustom16",
|
||||||
|
"CurrencyCode",
|
||||||
|
"LanguageCode",
|
||||||
|
"TimeZone",
|
||||||
|
"UserEmailAddress",
|
||||||
|
"UserColor",
|
||||||
|
"Translation",
|
||||||
|
"DarkMode",
|
||||||
|
"MapUrlTemplate",
|
||||||
|
"UserPhone1",
|
||||||
|
"UserPhone2",
|
||||||
|
"UserPageAddress"
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1066,6 +1066,8 @@ async function initForm(vm) {
|
|||||||
//
|
//
|
||||||
async function fetchTranslatedText(vm) {
|
async function fetchTranslatedText(vm) {
|
||||||
await window.$gz.translation.cacheTranslations([
|
await window.$gz.translation.cacheTranslations([
|
||||||
|
"User",
|
||||||
|
"UserSettings",
|
||||||
"Contact",
|
"Contact",
|
||||||
"Name",
|
"Name",
|
||||||
"Customer",
|
"Customer",
|
||||||
@@ -1073,6 +1075,7 @@ async function fetchTranslatedText(vm) {
|
|||||||
"NewLogin",
|
"NewLogin",
|
||||||
"NewPassword",
|
"NewPassword",
|
||||||
"AuthorizationRoles",
|
"AuthorizationRoles",
|
||||||
|
"LastLogin",
|
||||||
"UserNotes",
|
"UserNotes",
|
||||||
"UserType",
|
"UserType",
|
||||||
"Active",
|
"Active",
|
||||||
|
|||||||
@@ -1,8 +1,18 @@
|
|||||||
<template>
|
<template>
|
||||||
<v-form ref="form">
|
<v-form ref="form">
|
||||||
{{ obj }}
|
{{ formState }}
|
||||||
|
<v-row v-if="formState.ready">
|
||||||
<v-row>
|
<v-col cols="12">
|
||||||
|
<v-text-field
|
||||||
|
name="username"
|
||||||
|
id="username"
|
||||||
|
v-model="obj.loginName"
|
||||||
|
:readonly="true"
|
||||||
|
prepend-icon="$ayiUser"
|
||||||
|
:label="$ay.t('UserLogin')"
|
||||||
|
data-cy="loginName"
|
||||||
|
></v-text-field>
|
||||||
|
</v-col>
|
||||||
<v-col cols="12">
|
<v-col cols="12">
|
||||||
<v-text-field
|
<v-text-field
|
||||||
v-model="obj.newPassword"
|
v-model="obj.newPassword"
|
||||||
@@ -37,10 +47,15 @@
|
|||||||
@click:append-outer="reveal = !reveal"
|
@click:append-outer="reveal = !reveal"
|
||||||
></v-text-field>
|
></v-text-field>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col cols="12" md="7" mt-1 mb-5>
|
<v-col cols="12" mt-1 mb-5>
|
||||||
<v-btn color="primary" v-on:click="login()" value="LOGIN">
|
<v-btn
|
||||||
<v-icon>$ayiSignIn</v-icon>
|
:disabled="!canSave"
|
||||||
</v-btn>
|
color="primary"
|
||||||
|
value="SUBMIT"
|
||||||
|
@click="submit()"
|
||||||
|
data-cy="submit"
|
||||||
|
>{{ $ay.t("Save") }}</v-btn
|
||||||
|
>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
</v-form>
|
</v-form>
|
||||||
@@ -56,6 +71,7 @@ export default {
|
|||||||
this.obj.loginName = searchParams.get("lg");
|
this.obj.loginName = searchParams.get("lg");
|
||||||
this.obj.translationId = parseInt(searchParams.get("tr"));
|
this.obj.translationId = parseInt(searchParams.get("tr"));
|
||||||
await initForm(this);
|
await initForm(this);
|
||||||
|
this.formState.ready = true;
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -69,9 +85,9 @@ export default {
|
|||||||
|
|
||||||
reveal: true,
|
reveal: true,
|
||||||
formState: {
|
formState: {
|
||||||
ready: true,
|
ready: false,
|
||||||
dirty: false,
|
dirty: false,
|
||||||
valid: true,
|
valid: false,
|
||||||
readOnly: false,
|
readOnly: false,
|
||||||
loading: false,
|
loading: false,
|
||||||
errorBoxMessage: null,
|
errorBoxMessage: null,
|
||||||
@@ -80,6 +96,11 @@ export default {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
canSave: function() {
|
||||||
|
return this.formState.valid && this.formState.dirty;
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
translation() {
|
translation() {
|
||||||
return window.$gz.translation;
|
return window.$gz.translation;
|
||||||
@@ -101,8 +122,8 @@ export default {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
let res = await window.$gz.api.upsert(url, {
|
let res = await window.$gz.api.upsert(url, {
|
||||||
PasswordResetCode: obj.passwordResetCode,
|
PasswordResetCode: vm.obj.passwordResetCode,
|
||||||
Password: obj.confirmPassword
|
Password: vm.obj.confirmPassword
|
||||||
});
|
});
|
||||||
|
|
||||||
if (res.error) {
|
if (res.error) {
|
||||||
@@ -110,7 +131,11 @@ export default {
|
|||||||
window.$gz.form.setErrorBoxErrors(vm);
|
window.$gz.form.setErrorBoxErrors(vm);
|
||||||
} else {
|
} else {
|
||||||
vm.$router.push({
|
vm.$router.push({
|
||||||
name: "login"
|
name: "login",
|
||||||
|
params: {
|
||||||
|
presetLogin: vm.obj.loginName,
|
||||||
|
presetPassword: vm.obj.confirmPassword
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -141,7 +166,8 @@ async function fetchTranslatedText(vm) {
|
|||||||
"ConfirmPassword",
|
"ConfirmPassword",
|
||||||
"UserLogin",
|
"UserLogin",
|
||||||
"ErrorRequiredFieldEmpty",
|
"ErrorRequiredFieldEmpty",
|
||||||
"ErrorNoMatch"
|
"ErrorNoMatch",
|
||||||
|
"Save"
|
||||||
],
|
],
|
||||||
vm.obj.translationId
|
vm.obj.translationId
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -295,6 +295,14 @@ export default {
|
|||||||
async created() {
|
async created() {
|
||||||
let vm = this;
|
let vm = this;
|
||||||
//debugger;
|
//debugger;
|
||||||
|
|
||||||
|
//reset password redirects here with preset creds
|
||||||
|
//this will help the user identify it and hopefully remember it
|
||||||
|
if (vm.$route.params.presetLogin) {
|
||||||
|
vm.input.username = vm.$route.params.presetLogin;
|
||||||
|
vm.input.password = vm.$route.params.presetPassword;
|
||||||
|
}
|
||||||
|
|
||||||
vm.smallLogoUrl = window.$gz.api.logoUrl("small");
|
vm.smallLogoUrl = window.$gz.api.logoUrl("small");
|
||||||
vm.mediumLogoUrl = window.$gz.api.logoUrl("medium");
|
vm.mediumLogoUrl = window.$gz.api.logoUrl("medium");
|
||||||
vm.largeLogoUrl = window.$gz.api.logoUrl("large");
|
vm.largeLogoUrl = window.$gz.api.logoUrl("large");
|
||||||
|
|||||||
Reference in New Issue
Block a user