This commit is contained in:
2020-06-21 18:48:25 +00:00
parent a13c28e5bd
commit 975302d98a
2 changed files with 60 additions and 4 deletions

View File

@@ -17,7 +17,9 @@ todo: USERS - Administration - Users
Or at least potential to do that d.t.r. (down the road / TTM)
SINGLE EDIT FORM
Set all user props relevant to the admin
todo: customer id, headoffice id, etc for those usertypes that require additional stuff set
only show optionally on that usertype
todo: need a role collection control of some kind for things like case 3417.
Control present all or subset of roles for selection, user can select from them like a checkbox dropdown or something.
@@ -30,9 +32,13 @@ todo: user options form put color picker last it's pushing down the entire last
todo: grid enum roles not always working
maybe put a role control in there or replicate that code
todo: need to test a license downgrade of techs once have User creation stuff done
todo: if a post or put from the client receives the full record back then make sure not fetching it again redundantly see user form and widget form that seem to do this on submit
todo: Administration - translation
translation page with translation settings
- Translation feedback link in translation page https://rockfish.ayanova.com/default.htm#!/rfcaseEdit/3722

View File

@@ -101,6 +101,41 @@
></v-select>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<v-text-field
name="username"
id="username"
v-model="login"
:readonly="formState.readOnly"
prepend-icon="fa-user"
autocomplete="off"
autocorrect="off"
autocapitalize="off"
spellcheck="false"
:label="$ay.t('NewLogin')"
:error-messages="form().serverErrors(this, 'login')"
ref="login"
@input="fieldValueChanged('login')"
></v-text-field>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<v-text-field
name="password"
id="password"
v-model="password"
:readonly="formState.readOnly"
:append-outer-icon="reveal ? 'fa-eye' : 'fa-eye-slash'"
prepend-icon="fa-key"
:label="$ay.t('NewPassword')"
:type="reveal ? 'text' : 'password'"
:error-messages="form().serverErrors(this, 'password')"
ref="password"
@input="fieldValueChanged('password')"
@click:append-outer="reveal = !reveal"
></v-text-field>
</v-col>
<v-col v-if="form().showMe(this, 'Notes')" cols="12">
<v-textarea
v-model="obj.notes"
@@ -267,6 +302,9 @@ export default {
tags: [],
lastLogin: null
},
login: null,
password: null,
reveal: true,
formState: {
ready: false,
dirty: false,
@@ -389,12 +427,22 @@ export default {
let vm = this;
if (vm.canSave) {
vm.formState.loading = true;
let url = API_BASE_URL; // + vm.$route.params.recordid;
let url = API_BASE_URL;
try {
//clear any errors vm might be around from previous submit
window.$gz.form.deleteAllErrorBoxErrors(vm);
let res = await window.$gz.api.upsert(url, vm.obj);
//add in password and login if changed
let submitObject = vm.obj;
if (vm.password != null && vm.password != "") {
submitObject.password = vm.password;
}
if (vm.login != null && vm.login != "") {
submitObject.login = vm.login;
}
let res = await window.$gz.api.upsert(url, submitObject);
vm.formState.loading = false;
if (res.error) {
vm.formState.serverError = res.error;
@@ -654,6 +702,8 @@ async function fetchTranslatedText(vm) {
"User",
"Name",
"UserEmployeeNumber",
"NewLogin",
"NewPassword",
"AuthorizationRoles",
"UserNotes",
"UserType",