This commit is contained in:
@@ -68,11 +68,22 @@ todo: TESTING After customer form is made
|
|||||||
Test setting coords from phone
|
Test setting coords from phone
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
OUTSTANDING WITH CUSTOMER
|
OUTSTANDING WITH CUSTOMER
|
||||||
contacts
|
|
||||||
USER object needs the full contact fields added first
|
Contact user should default to customer limited role by default
|
||||||
Phone1, Phone2, Phone3 (formerly pager address)
|
PW / Login generator automatically and sends creds
|
||||||
shows all contact info directly in grid
|
need code that generates easily enterable urls
|
||||||
|
if pw starts with "TEMP" or some key token then maybe they need to go to the change password automatically upon login
|
||||||
|
this way can issue a pw and email it and when user first logs in they must set it to something?
|
||||||
|
New user useroptions should default to the server default translation automatically
|
||||||
|
New User should always have useroptions automatically created with sensible defaults
|
||||||
|
useroptions should not need a POST route at all, only a PUT to update
|
||||||
|
What happens if new user created, nothing set for langauge etc and then just login??
|
||||||
|
Centralize MAP URLS
|
||||||
|
contacts
|
||||||
|
Maybe convert generic customer contacts list to proper data grid source from server
|
||||||
|
shows all contact info directly in grid
|
||||||
Change cust-user edit form (and other user edit form) and add tabs and user options section so that it can all be set there as well
|
Change cust-user edit form (and other user edit form) and add tabs and user options section so that it can all be set there as well
|
||||||
Add button to email the user their creds and login and invite them to change the password once they login
|
Add button to email the user their creds and login and invite them to change the password once they login
|
||||||
Customer User (contacts) UI for this client (generate, view)
|
Customer User (contacts) UI for this client (generate, view)
|
||||||
|
|||||||
@@ -2,231 +2,405 @@
|
|||||||
<v-container fluid>
|
<v-container fluid>
|
||||||
<gz-report-selector ref="reportSelector"></gz-report-selector>
|
<gz-report-selector ref="reportSelector"></gz-report-selector>
|
||||||
<h2 class="red--text" v-if="$ay.dev">
|
<h2 class="red--text" v-if="$ay.dev">
|
||||||
todo: revisit after add vendor to support usertype contractor TEST SAVE
|
todo: revisit after add vendor to support usertype contractor
|
||||||
when have vendor and make sure wont' allow without vendor chosen and make
|
|
||||||
sure if not error is clear
|
|
||||||
</h2>
|
</h2>
|
||||||
<v-row v-if="formState.ready">
|
{{ formState }}
|
||||||
<v-col>
|
<div v-if="formState.ready">
|
||||||
<v-form ref="form">
|
<gz-error :errorBoxMessage="formState.errorBoxMessage"></gz-error>
|
||||||
<v-row>
|
|
||||||
<gz-error :errorBoxMessage="formState.errorBoxMessage"></gz-error>
|
|
||||||
|
|
||||||
<v-col cols="12" sm="6" lg="4" xl="3">
|
<v-form ref="form">
|
||||||
<v-text-field
|
<v-tabs mobile-breakpoint="100" v-model="tab">
|
||||||
v-model="obj.name"
|
<v-tab>{{ $ay.t("User") }}</v-tab>
|
||||||
:readonly="formState.readOnly"
|
<v-tab v-if="obj.id != 0">{{ $ay.t("UserSettings") }}</v-tab>
|
||||||
:disabled="formState.readOnly"
|
|
||||||
:label="$ay.t('Name')"
|
|
||||||
:rules="[form().required(this, 'name')]"
|
|
||||||
:error-messages="form().serverErrors(this, 'name')"
|
|
||||||
ref="name"
|
|
||||||
data-cy="name"
|
|
||||||
@input="fieldValueChanged('name')"
|
|
||||||
></v-text-field>
|
|
||||||
</v-col>
|
|
||||||
|
|
||||||
<v-col
|
<v-tabs-items v-model="tab">
|
||||||
v-if="form().showMe(this, 'subVendorId') && obj.userType == 5"
|
<v-tab-item class="mt-4">
|
||||||
cols="12"
|
<v-row>
|
||||||
sm="6"
|
<v-col cols="12" sm="6" lg="4" xl="3">
|
||||||
lg="4"
|
<v-text-field
|
||||||
xl="3"
|
v-model="obj.name"
|
||||||
>
|
:readonly="formState.readOnly"
|
||||||
<gz-pick-list
|
:disabled="formState.readOnly"
|
||||||
:ayaType="ayaTypes().Vendor"
|
:label="$ay.t('Name')"
|
||||||
:showEditIcon="true"
|
:rules="[form().required(this, 'name')]"
|
||||||
v-model="obj.subVendorId"
|
:error-messages="form().serverErrors(this, 'name')"
|
||||||
:readonly="formState.readOnly"
|
ref="name"
|
||||||
:disabled="formState.readOnly"
|
data-cy="name"
|
||||||
:label="$ay.t('Vendor')"
|
@input="fieldValueChanged('name')"
|
||||||
ref="subVendorId"
|
></v-text-field>
|
||||||
data-cy="subVendorId"
|
</v-col>
|
||||||
:error-messages="form().serverErrors(this, 'subVendorId')"
|
|
||||||
@input="fieldValueChanged('subVendorId')"
|
|
||||||
></gz-pick-list>
|
|
||||||
</v-col>
|
|
||||||
|
|
||||||
<v-col cols="12" sm="6" lg="4" xl="3">
|
<v-col
|
||||||
<v-text-field
|
v-if="form().showMe(this, 'subVendorId') && obj.userType == 5"
|
||||||
v-model="obj.employeeNumber"
|
cols="12"
|
||||||
:readonly="formState.readOnly"
|
sm="6"
|
||||||
:disabled="formState.readOnly"
|
lg="4"
|
||||||
:label="$ay.t('UserEmployeeNumber')"
|
xl="3"
|
||||||
:error-messages="form().serverErrors(this, 'employeeNumber')"
|
>
|
||||||
ref="employeeNumber"
|
<gz-pick-list
|
||||||
data-cy="employeeNumber"
|
:ayaType="ayaTypes().Vendor"
|
||||||
@input="fieldValueChanged('employeeNumber')"
|
:showEditIcon="true"
|
||||||
></v-text-field>
|
v-model="obj.subVendorId"
|
||||||
</v-col>
|
:readonly="formState.readOnly"
|
||||||
|
:disabled="formState.readOnly"
|
||||||
|
:label="$ay.t('Vendor')"
|
||||||
|
ref="subVendorId"
|
||||||
|
data-cy="subVendorId"
|
||||||
|
:error-messages="form().serverErrors(this, 'subVendorId')"
|
||||||
|
@input="fieldValueChanged('subVendorId')"
|
||||||
|
></gz-pick-list>
|
||||||
|
</v-col>
|
||||||
|
|
||||||
<v-col cols="12" sm="6" lg="4" xl="3">
|
<v-col cols="12" sm="6" lg="4" xl="3">
|
||||||
<gz-role-picker
|
<v-text-field
|
||||||
:label="$ay.t('AuthorizationRoles')"
|
v-model="obj.employeeNumber"
|
||||||
v-model="obj.roles"
|
:readonly="formState.readOnly"
|
||||||
:readonly="formState.readOnly"
|
:disabled="formState.readOnly"
|
||||||
:disabled="formState.readOnly"
|
:label="$ay.t('UserEmployeeNumber')"
|
||||||
ref="roles"
|
:error-messages="
|
||||||
testId="roles"
|
form().serverErrors(this, 'employeeNumber')
|
||||||
:error-messages="form().serverErrors(this, 'roles')"
|
"
|
||||||
@input="fieldValueChanged('roles')"
|
ref="employeeNumber"
|
||||||
limitSelectionTo="inside"
|
data-cy="employeeNumber"
|
||||||
></gz-role-picker>
|
@input="fieldValueChanged('employeeNumber')"
|
||||||
</v-col>
|
></v-text-field>
|
||||||
|
</v-col>
|
||||||
|
|
||||||
<v-col
|
<v-col cols="12" sm="6" lg="4" xl="3">
|
||||||
v-if="form().showMe(this, 'Active')"
|
<gz-role-picker
|
||||||
cols="12"
|
:label="$ay.t('AuthorizationRoles')"
|
||||||
sm="6"
|
v-model="obj.roles"
|
||||||
lg="4"
|
:readonly="formState.readOnly"
|
||||||
xl="3"
|
:disabled="formState.readOnly"
|
||||||
>
|
ref="roles"
|
||||||
<v-checkbox
|
testId="roles"
|
||||||
v-model="obj.active"
|
:error-messages="form().serverErrors(this, 'roles')"
|
||||||
:readonly="formState.readOnly"
|
@input="fieldValueChanged('roles')"
|
||||||
:disabled="formState.readOnly"
|
limitSelectionTo="inside"
|
||||||
:label="$ay.t('Active')"
|
></gz-role-picker>
|
||||||
ref="active"
|
</v-col>
|
||||||
data-cy="active"
|
|
||||||
:error-messages="form().serverErrors(this, 'active')"
|
|
||||||
@change="fieldValueChanged('active')"
|
|
||||||
></v-checkbox>
|
|
||||||
</v-col>
|
|
||||||
|
|
||||||
<v-col
|
<v-col
|
||||||
v-if="form().showMe(this, 'UserType')"
|
v-if="form().showMe(this, 'Active')"
|
||||||
cols="12"
|
cols="12"
|
||||||
sm="6"
|
sm="6"
|
||||||
lg="4"
|
lg="4"
|
||||||
xl="3"
|
xl="3"
|
||||||
>
|
>
|
||||||
<v-select
|
<v-checkbox
|
||||||
v-model="obj.userType"
|
v-model="obj.active"
|
||||||
:items="selectLists.usertypes"
|
:readonly="formState.readOnly"
|
||||||
item-text="name"
|
:disabled="formState.readOnly"
|
||||||
item-value="id"
|
:label="$ay.t('Active')"
|
||||||
:readonly="formState.readOnly"
|
ref="active"
|
||||||
:disabled="formState.readOnly"
|
data-cy="active"
|
||||||
:label="$ay.t('UserType')"
|
:error-messages="form().serverErrors(this, 'active')"
|
||||||
ref="usertype"
|
@change="fieldValueChanged('active')"
|
||||||
data-cy="usertype"
|
></v-checkbox>
|
||||||
:rules="[form().integerValid(this, 'usertype')]"
|
</v-col>
|
||||||
:error-messages="form().serverErrors(this, 'usertype')"
|
|
||||||
@input="fieldValueChanged('usertype')"
|
|
||||||
></v-select>
|
|
||||||
</v-col>
|
|
||||||
|
|
||||||
<v-col cols="12" sm="6" lg="4" xl="3">
|
<v-col
|
||||||
<v-text-field
|
v-if="form().showMe(this, 'UserType')"
|
||||||
name="username"
|
cols="12"
|
||||||
id="username"
|
sm="6"
|
||||||
v-model="login"
|
lg="4"
|
||||||
:readonly="formState.readOnly"
|
xl="3"
|
||||||
prepend-icon="$ayiUser"
|
>
|
||||||
autocomplete="off"
|
<v-select
|
||||||
autocorrect="off"
|
v-model="obj.userType"
|
||||||
autocapitalize="off"
|
:items="selectLists.usertypes"
|
||||||
spellcheck="false"
|
item-text="name"
|
||||||
:label="$ay.t('NewLogin')"
|
item-value="id"
|
||||||
:error-messages="form().serverErrors(this, 'login')"
|
:readonly="formState.readOnly"
|
||||||
ref="login"
|
:disabled="formState.readOnly"
|
||||||
@input="fieldValueChanged('login')"
|
:label="$ay.t('UserType')"
|
||||||
></v-text-field>
|
ref="usertype"
|
||||||
</v-col>
|
data-cy="usertype"
|
||||||
|
:rules="[form().integerValid(this, 'usertype')]"
|
||||||
|
:error-messages="form().serverErrors(this, 'usertype')"
|
||||||
|
@input="fieldValueChanged('usertype')"
|
||||||
|
></v-select>
|
||||||
|
</v-col>
|
||||||
|
|
||||||
<v-col cols="12" sm="6" lg="4" xl="3">
|
<v-col cols="12" sm="6" lg="4" xl="3">
|
||||||
<v-text-field
|
<v-text-field
|
||||||
name="password"
|
name="username"
|
||||||
id="password"
|
id="username"
|
||||||
v-model="password"
|
v-model="login"
|
||||||
:readonly="formState.readOnly"
|
:readonly="formState.readOnly"
|
||||||
:append-outer-icon="reveal ? '$ayiEye' : '$ayiEyeSlash'"
|
prepend-icon="$ayiUser"
|
||||||
prepend-icon="$ayiKey"
|
autocomplete="off"
|
||||||
:label="$ay.t('NewPassword')"
|
autocorrect="off"
|
||||||
:type="reveal ? 'text' : 'password'"
|
autocapitalize="off"
|
||||||
:error-messages="form().serverErrors(this, 'password')"
|
spellcheck="false"
|
||||||
ref="password"
|
:label="$ay.t('NewLogin')"
|
||||||
@input="fieldValueChanged('password')"
|
:error-messages="form().serverErrors(this, 'login')"
|
||||||
@click:append-outer="reveal = !reveal"
|
ref="login"
|
||||||
></v-text-field>
|
@input="fieldValueChanged('login')"
|
||||||
</v-col>
|
></v-text-field>
|
||||||
<v-col cols="12" sm="6" lg="4" xl="3">
|
</v-col>
|
||||||
<gz-date-time-picker
|
|
||||||
:label="$ay.t('LastLogin')"
|
|
||||||
v-model="obj.lastLogin"
|
|
||||||
readonly
|
|
||||||
disabled
|
|
||||||
ref="lastLogin"
|
|
||||||
testId="lastLogin"
|
|
||||||
></gz-date-time-picker>
|
|
||||||
</v-col>
|
|
||||||
<v-col v-if="form().showMe(this, 'Notes')" cols="12">
|
|
||||||
<v-textarea
|
|
||||||
v-model="obj.notes"
|
|
||||||
:readonly="formState.readOnly"
|
|
||||||
:disabled="formState.readOnly"
|
|
||||||
:label="$ay.t('UserNotes')"
|
|
||||||
:error-messages="form().serverErrors(this, 'notes')"
|
|
||||||
ref="notes"
|
|
||||||
data-cy="notes"
|
|
||||||
@input="fieldValueChanged('notes')"
|
|
||||||
auto-grow
|
|
||||||
></v-textarea>
|
|
||||||
</v-col>
|
|
||||||
|
|
||||||
<v-col v-if="form().showMe(this, 'Tags')" cols="12">
|
<v-col cols="12" sm="6" lg="4" xl="3">
|
||||||
<gz-tag-picker
|
<v-text-field
|
||||||
v-model="obj.tags"
|
name="password"
|
||||||
:readonly="formState.readOnly"
|
id="password"
|
||||||
:disabled="formState.readOnly"
|
v-model="password"
|
||||||
ref="tags"
|
:readonly="formState.readOnly"
|
||||||
data-cy="tags"
|
:append-outer-icon="reveal ? '$ayiEye' : '$ayiEyeSlash'"
|
||||||
:error-messages="form().serverErrors(this, 'tags')"
|
prepend-icon="$ayiKey"
|
||||||
@input="fieldValueChanged('tags')"
|
:label="$ay.t('NewPassword')"
|
||||||
></gz-tag-picker>
|
:type="reveal ? 'text' : 'password'"
|
||||||
</v-col>
|
:error-messages="form().serverErrors(this, 'password')"
|
||||||
|
ref="password"
|
||||||
|
@input="fieldValueChanged('password')"
|
||||||
|
@click:append-outer="reveal = !reveal"
|
||||||
|
></v-text-field>
|
||||||
|
</v-col>
|
||||||
|
<v-col cols="12" sm="6" lg="4" xl="3">
|
||||||
|
<gz-date-time-picker
|
||||||
|
:label="$ay.t('LastLogin')"
|
||||||
|
v-model="obj.lastLogin"
|
||||||
|
readonly
|
||||||
|
disabled
|
||||||
|
ref="lastLogin"
|
||||||
|
testId="lastLogin"
|
||||||
|
></gz-date-time-picker>
|
||||||
|
</v-col>
|
||||||
|
<v-col v-if="form().showMe(this, 'Notes')" cols="12">
|
||||||
|
<v-textarea
|
||||||
|
v-model="obj.notes"
|
||||||
|
:readonly="formState.readOnly"
|
||||||
|
:disabled="formState.readOnly"
|
||||||
|
:label="$ay.t('UserNotes')"
|
||||||
|
:error-messages="form().serverErrors(this, 'notes')"
|
||||||
|
ref="notes"
|
||||||
|
data-cy="notes"
|
||||||
|
@input="fieldValueChanged('notes')"
|
||||||
|
auto-grow
|
||||||
|
></v-textarea>
|
||||||
|
</v-col>
|
||||||
|
|
||||||
<v-col cols="12">
|
<v-col v-if="form().showMe(this, 'Tags')" cols="12">
|
||||||
<gz-custom-fields
|
<gz-tag-picker
|
||||||
v-model="obj.customFields"
|
v-model="obj.tags"
|
||||||
:formKey="formCustomTemplateKey"
|
:readonly="formState.readOnly"
|
||||||
:readonly="formState.readOnly"
|
:disabled="formState.readOnly"
|
||||||
:disabled="formState.readOnly"
|
ref="tags"
|
||||||
:parentVM="this"
|
data-cy="tags"
|
||||||
ref="customFields"
|
:error-messages="form().serverErrors(this, 'tags')"
|
||||||
data-cy="customFields"
|
@input="fieldValueChanged('tags')"
|
||||||
:error-messages="form().serverErrors(this, 'customFields')"
|
></gz-tag-picker>
|
||||||
@input="fieldValueChanged('customFields')"
|
</v-col>
|
||||||
></gz-custom-fields>
|
|
||||||
</v-col>
|
|
||||||
|
|
||||||
<v-col v-if="form().showMe(this, 'Wiki')" cols="12">
|
<v-col cols="12">
|
||||||
<gz-wiki
|
<gz-custom-fields
|
||||||
:ayaType="ayaType"
|
v-model="obj.customFields"
|
||||||
:ayaId="obj.id"
|
:formKey="formCustomTemplateKey"
|
||||||
ref="wiki"
|
:readonly="formState.readOnly"
|
||||||
v-model="obj.wiki"
|
:disabled="formState.readOnly"
|
||||||
:readonly="formState.readOnly"
|
:parentVM="this"
|
||||||
:disabled="formState.readOnly"
|
ref="customFields"
|
||||||
@input="fieldValueChanged('wiki')"
|
data-cy="customFields"
|
||||||
></gz-wiki
|
:error-messages="form().serverErrors(this, 'customFields')"
|
||||||
></v-col>
|
@input="fieldValueChanged('customFields')"
|
||||||
|
></gz-custom-fields>
|
||||||
|
</v-col>
|
||||||
|
|
||||||
<v-col
|
<v-col v-if="form().showMe(this, 'Wiki')" cols="12">
|
||||||
v-if="form().showMe(this, 'Attachments') && obj.id"
|
<gz-wiki
|
||||||
cols="12"
|
:ayaType="ayaType"
|
||||||
>
|
:ayaId="obj.id"
|
||||||
<gz-attachments
|
ref="wiki"
|
||||||
:readonly="formState.readOnly"
|
v-model="obj.wiki"
|
||||||
:disabled="formState.readOnly"
|
:readonly="formState.readOnly"
|
||||||
:ayaType="ayaType"
|
:disabled="formState.readOnly"
|
||||||
:ayaId="obj.id"
|
@input="fieldValueChanged('wiki')"
|
||||||
></gz-attachments
|
></gz-wiki
|
||||||
></v-col>
|
></v-col>
|
||||||
</v-row>
|
|
||||||
</v-form>
|
<v-col
|
||||||
</v-col>
|
v-if="form().showMe(this, 'Attachments') && obj.id"
|
||||||
</v-row>
|
cols="12"
|
||||||
|
>
|
||||||
|
<gz-attachments
|
||||||
|
:readonly="formState.readOnly"
|
||||||
|
:disabled="formState.readOnly"
|
||||||
|
:ayaType="ayaType"
|
||||||
|
:ayaId="obj.id"
|
||||||
|
></gz-attachments
|
||||||
|
></v-col>
|
||||||
|
</v-row>
|
||||||
|
</v-tab-item>
|
||||||
|
<v-tab-item v-if="obj.id != 0" class="mt-4">
|
||||||
|
<v-row>
|
||||||
|
<v-col cols="12" sm="6" lg="4" xl="3">
|
||||||
|
<v-select
|
||||||
|
v-model="optionsObj.translationId"
|
||||||
|
:items="selectLists.translations"
|
||||||
|
item-text="name"
|
||||||
|
item-value="id"
|
||||||
|
:readonly="formState.readOnly"
|
||||||
|
:label="$ay.t('Translation')"
|
||||||
|
ref="translationId"
|
||||||
|
:error-messages="form().serverErrors(this, 'translationId')"
|
||||||
|
@input="fieldValueChanged('translationId')"
|
||||||
|
></v-select>
|
||||||
|
</v-col>
|
||||||
|
|
||||||
|
<v-col cols="12" sm="6" lg="4" xl="3">
|
||||||
|
<v-text-field
|
||||||
|
v-model="optionsObj.emailAddress"
|
||||||
|
:readonly="formState.readOnly"
|
||||||
|
:label="$ay.t('UserEmailAddress')"
|
||||||
|
:error-messages="form().serverErrors(this, 'emailAddress')"
|
||||||
|
ref="emailAddress"
|
||||||
|
@input="fieldValueChanged('emailAddress')"
|
||||||
|
data-cy="emailAddress"
|
||||||
|
type="email"
|
||||||
|
></v-text-field>
|
||||||
|
</v-col>
|
||||||
|
<v-col
|
||||||
|
v-if="form().showMe(this, 'Phone1')"
|
||||||
|
cols="12"
|
||||||
|
sm="6"
|
||||||
|
lg="4"
|
||||||
|
xl="3"
|
||||||
|
>
|
||||||
|
<v-text-field
|
||||||
|
v-model="optionsObj.phone1"
|
||||||
|
:readonly="formState.readOnly"
|
||||||
|
:disabled="formState.readOnly"
|
||||||
|
:label="$ay.t('UserPhone1')"
|
||||||
|
ref="phone1"
|
||||||
|
data-cy="phone1"
|
||||||
|
type="tel"
|
||||||
|
:error-messages="form().serverErrors(this, 'phone1')"
|
||||||
|
@input="fieldValueChanged('phone1')"
|
||||||
|
></v-text-field>
|
||||||
|
</v-col>
|
||||||
|
|
||||||
|
<v-col
|
||||||
|
v-if="form().showMe(this, 'Phone2')"
|
||||||
|
cols="12"
|
||||||
|
sm="6"
|
||||||
|
lg="4"
|
||||||
|
xl="3"
|
||||||
|
>
|
||||||
|
<v-text-field
|
||||||
|
v-model="optionsObj.phone2"
|
||||||
|
:readonly="formState.readOnly"
|
||||||
|
:disabled="formState.readOnly"
|
||||||
|
:label="$ay.t('UserPhone2')"
|
||||||
|
ref="phone2"
|
||||||
|
data-cy="phone2"
|
||||||
|
type="tel"
|
||||||
|
:error-messages="form().serverErrors(this, 'phone2')"
|
||||||
|
@input="fieldValueChanged('phone2')"
|
||||||
|
></v-text-field>
|
||||||
|
</v-col>
|
||||||
|
|
||||||
|
<v-col
|
||||||
|
v-if="form().showMe(this, 'Phone3')"
|
||||||
|
cols="12"
|
||||||
|
sm="6"
|
||||||
|
lg="4"
|
||||||
|
xl="3"
|
||||||
|
>
|
||||||
|
<v-text-field
|
||||||
|
v-model="optionsObj.phone3"
|
||||||
|
:readonly="formState.readOnly"
|
||||||
|
:disabled="formState.readOnly"
|
||||||
|
:label="$ay.t('UserPageAddress')"
|
||||||
|
ref="phone3"
|
||||||
|
data-cy="phone3"
|
||||||
|
type="tel"
|
||||||
|
:error-messages="form().serverErrors(this, 'phone3')"
|
||||||
|
@input="fieldValueChanged('phone3')"
|
||||||
|
></v-text-field>
|
||||||
|
</v-col>
|
||||||
|
|
||||||
|
<v-col cols="12" sm="6" lg="4" xl="3">
|
||||||
|
<v-text-field
|
||||||
|
v-model="optionsObj.mapUrlTemplate"
|
||||||
|
:readonly="formState.readOnly"
|
||||||
|
:label="$ay.t('MapUrlTemplate')"
|
||||||
|
:error-messages="
|
||||||
|
form().serverErrors(this, 'mapUrlTemplate')
|
||||||
|
"
|
||||||
|
ref="mapUrlTemplate"
|
||||||
|
@input="fieldValueChanged('mapUrlTemplate')"
|
||||||
|
data-cy="mapUrlTemplate"
|
||||||
|
></v-text-field>
|
||||||
|
<v-select
|
||||||
|
:items="selectLists.mapUrls"
|
||||||
|
item-text="name"
|
||||||
|
item-value="value"
|
||||||
|
@input="mapUrlSelectionChanged"
|
||||||
|
></v-select>
|
||||||
|
</v-col>
|
||||||
|
|
||||||
|
<v-col cols="12" sm="6" lg="4" xl="3">
|
||||||
|
<v-text-field
|
||||||
|
v-model="optionsObj.currencyName"
|
||||||
|
hint="e.g. USD, EUR, GBP, AUD, CAD etc"
|
||||||
|
:readonly="formState.readOnly"
|
||||||
|
:label="$ay.t('CurrencyCode')"
|
||||||
|
:rules="[form().required(this, 'currencyName')]"
|
||||||
|
:error-messages="form().serverErrors(this, 'currencyName')"
|
||||||
|
ref="currencyName"
|
||||||
|
@input="fieldValueChanged('currencyName')"
|
||||||
|
></v-text-field>
|
||||||
|
</v-col>
|
||||||
|
|
||||||
|
<v-col cols="12" sm="6" lg="4" xl="3">
|
||||||
|
<v-text-field
|
||||||
|
v-model="optionsObj.languageOverride"
|
||||||
|
:placeholder="locale().getBrowserFirstLanguage()"
|
||||||
|
:readonly="formState.readOnly"
|
||||||
|
:label="$ay.t('LanguageCode')"
|
||||||
|
:error-messages="
|
||||||
|
form().serverErrors(this, 'languageOverride')
|
||||||
|
"
|
||||||
|
ref="languageOverride"
|
||||||
|
@input="fieldValueChanged('languageOverride')"
|
||||||
|
></v-text-field>
|
||||||
|
</v-col>
|
||||||
|
|
||||||
|
<v-col cols="12" sm="6" lg="4" xl="3">
|
||||||
|
<v-text-field
|
||||||
|
v-model="optionsObj.timeZoneOverride"
|
||||||
|
:placeholder="locale().getBrowserTimeZoneName()"
|
||||||
|
:readonly="formState.readOnly"
|
||||||
|
:label="$ay.t('TimeZone')"
|
||||||
|
:error-messages="
|
||||||
|
form().serverErrors(this, 'timeZoneOverride')
|
||||||
|
"
|
||||||
|
ref="timeZoneOverride"
|
||||||
|
@input="fieldValueChanged('timeZoneOverride')"
|
||||||
|
></v-text-field>
|
||||||
|
</v-col>
|
||||||
|
|
||||||
|
<v-col cols="12" sm="6" lg="4" xl="3">
|
||||||
|
<!-- https://vuetifyjs.com/en/components/color-pickers -->
|
||||||
|
<span class="v-label v-label--active theme--light">
|
||||||
|
{{ $ay.t("UserColor") }}
|
||||||
|
</span>
|
||||||
|
<v-color-picker
|
||||||
|
v-model="optionsObj.uiColor"
|
||||||
|
:readonly="formState.readOnly"
|
||||||
|
hide-mode-switch
|
||||||
|
mode="hexa"
|
||||||
|
:error-messages="form().serverErrors(this, 'uiColor')"
|
||||||
|
ref="uiColor"
|
||||||
|
@input="fieldValueChanged('uiColor')"
|
||||||
|
></v-color-picker>
|
||||||
|
</v-col>
|
||||||
|
</v-row>
|
||||||
|
</v-tab-item>
|
||||||
|
</v-tabs-items>
|
||||||
|
</v-tabs>
|
||||||
|
</v-form>
|
||||||
|
</div>
|
||||||
<template v-if="!formState.ready">
|
<template v-if="!formState.ready">
|
||||||
<v-progress-circular
|
<v-progress-circular
|
||||||
indeterminate
|
indeterminate
|
||||||
@@ -303,7 +477,49 @@ export default {
|
|||||||
return {
|
return {
|
||||||
formCustomTemplateKey: FORM_CUSTOM_TEMPLATE_KEY,
|
formCustomTemplateKey: FORM_CUSTOM_TEMPLATE_KEY,
|
||||||
selectLists: {
|
selectLists: {
|
||||||
usertypes: []
|
usertypes: [],
|
||||||
|
translations: [],
|
||||||
|
mapUrls: [
|
||||||
|
{
|
||||||
|
name: "Apple",
|
||||||
|
value:
|
||||||
|
"http://maps.apple.com/?q={ayaddress}<|>http://maps.apple.com/?ll={aylatitude},{aylongitude}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Bing",
|
||||||
|
value:
|
||||||
|
"https://bing.com/maps/default.aspx?where1={ayaddress}<|>https://bing.com/maps/default.aspx?cp={aylatitude}~{aylongitude}&lvl=17&style=r&sp=point.{aylatitude}_{aylongitude}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Google",
|
||||||
|
value:
|
||||||
|
"https://www.google.com/maps/search/?api=1&query={ayaddress}<|>https://www.google.com/maps/search/?api=1&query={aylatitude},{aylongitude}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "MapQuest",
|
||||||
|
value:
|
||||||
|
"https://mapquest.com/?center={ayaddress}&zoom=17<|>https://mapquest.com/?center={aylatitude},{aylongitude}&zoom=17"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Open Street Map",
|
||||||
|
value:
|
||||||
|
"https://www.openstreetmap.org/search?query={ayaddress}<|>https://www.openstreetmap.org/?mlat={aylatitude}&mlon={aylongitude}#map=17/{aylatitude}/{aylongitude}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "geo URI",
|
||||||
|
value: "geo:{aylatitude},{aylongitude}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Waze",
|
||||||
|
value:
|
||||||
|
"https://waze.com/ul?q={ayaddress}<|>https://www.waze.com/ul?ll={aylatitude},{aylongitude}&navigate=yes&zoom=17"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Yandex",
|
||||||
|
value:
|
||||||
|
"https://yandex.ru/maps/?mode=search&text={ayaddress}&z=17<|>https://yandex.ru/maps/?ll={aylatitude},{aylongitude}&z=12&l=map"
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
obj: {
|
obj: {
|
||||||
id: 0,
|
id: 0,
|
||||||
@@ -322,9 +538,36 @@ export default {
|
|||||||
tags: [],
|
tags: [],
|
||||||
lastLogin: null
|
lastLogin: null
|
||||||
},
|
},
|
||||||
|
|
||||||
|
optionsObj: {
|
||||||
|
/*concurrency": 7490431,
|
||||||
|
"translationId": 1,
|
||||||
|
"emailAddress": null,
|
||||||
|
"uiColor": "#000000",
|
||||||
|
"languageOverride": null,
|
||||||
|
"timeZoneOverride": null,
|
||||||
|
"currencyName": "USD",
|
||||||
|
"hour12": true,
|
||||||
|
"userId": 1 */
|
||||||
|
id: 0,
|
||||||
|
concurrency: 0,
|
||||||
|
emailAddress: null,
|
||||||
|
phone1: null,
|
||||||
|
phone2: null,
|
||||||
|
phone3: null,
|
||||||
|
mapUrlTemplate: null,
|
||||||
|
uiColor: null,
|
||||||
|
languageOverride: null,
|
||||||
|
timeZoneOverride: null,
|
||||||
|
currencyName: null,
|
||||||
|
hour12: null,
|
||||||
|
translationId: null
|
||||||
|
},
|
||||||
|
|
||||||
login: null,
|
login: null,
|
||||||
password: null,
|
password: null,
|
||||||
reveal: true,
|
reveal: true,
|
||||||
|
tab: 0,
|
||||||
formState: {
|
formState: {
|
||||||
ready: false,
|
ready: false,
|
||||||
dirty: false,
|
dirty: false,
|
||||||
@@ -383,6 +626,16 @@ export default {
|
|||||||
ayaTypes: function() {
|
ayaTypes: function() {
|
||||||
return window.$gz.type;
|
return window.$gz.type;
|
||||||
},
|
},
|
||||||
|
translation() {
|
||||||
|
return window.$gz.translation;
|
||||||
|
},
|
||||||
|
locale() {
|
||||||
|
return window.$gz.locale;
|
||||||
|
},
|
||||||
|
mapUrlSelectionChanged(val) {
|
||||||
|
this.optionsObj.mapUrlTemplate = val;
|
||||||
|
this.fieldValueChanged("mapUrlTemplate");
|
||||||
|
},
|
||||||
form() {
|
form() {
|
||||||
return window.$gz.form;
|
return window.$gz.form;
|
||||||
},
|
},
|
||||||
@@ -392,6 +645,7 @@ export default {
|
|||||||
!this.formState.loading &&
|
!this.formState.loading &&
|
||||||
!this.formState.readOnly
|
!this.formState.readOnly
|
||||||
) {
|
) {
|
||||||
|
console.log("FieldValueChanged for ", ref);
|
||||||
window.$gz.form.fieldValueChanged(this, ref);
|
window.$gz.form.fieldValueChanged(this, ref);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -427,6 +681,8 @@ export default {
|
|||||||
valid: true,
|
valid: true,
|
||||||
loading: false
|
loading: false
|
||||||
});
|
});
|
||||||
|
|
||||||
|
await vm.getUserOptionsDataFromApi();
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
window.$gz.errorHandler.handleFormError(error, vm);
|
window.$gz.errorHandler.handleFormError(error, vm);
|
||||||
@@ -479,6 +735,7 @@ export default {
|
|||||||
//PUT - only concurrency token is returned (**warning, if server changes object other fields then this needs to act more like POST above but is more efficient this way**)
|
//PUT - only concurrency token is returned (**warning, if server changes object other fields then this needs to act more like POST above but is more efficient this way**)
|
||||||
//Handle "put" of an existing record (UPDATE)
|
//Handle "put" of an existing record (UPDATE)
|
||||||
vm.obj.concurrency = res.data.concurrency;
|
vm.obj.concurrency = res.data.concurrency;
|
||||||
|
await vm.submitOptions();
|
||||||
}
|
}
|
||||||
|
|
||||||
//Update the form status
|
//Update the form status
|
||||||
@@ -561,6 +818,77 @@ export default {
|
|||||||
} finally {
|
} finally {
|
||||||
vm.formState.loading = false;
|
vm.formState.loading = false;
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
async getUserOptionsDataFromApi() {
|
||||||
|
let vm = this;
|
||||||
|
vm.formState.loading = true;
|
||||||
|
|
||||||
|
let url = `user-option/${vm.obj.id}`;
|
||||||
|
window.$gz.form.deleteAllErrorBoxErrors(vm);
|
||||||
|
try {
|
||||||
|
let res = await window.$gz.api.get(url);
|
||||||
|
|
||||||
|
if (res.error) {
|
||||||
|
//Not found?
|
||||||
|
if (res.error.code == "2010") {
|
||||||
|
window.$gz.form.handleObjectNotFound(vm);
|
||||||
|
}
|
||||||
|
vm.formState.serverError = res.error;
|
||||||
|
window.$gz.form.setErrorBoxErrors(vm);
|
||||||
|
} else {
|
||||||
|
vm.optionsObj = res.data;
|
||||||
|
// vm.activeTranslationId = res.data.translationId;
|
||||||
|
|
||||||
|
//Update the form status
|
||||||
|
window.$gz.form.setFormState({
|
||||||
|
vm: vm,
|
||||||
|
dirty: false,
|
||||||
|
valid: true,
|
||||||
|
loading: false
|
||||||
|
});
|
||||||
|
//modify the menu as necessary
|
||||||
|
generateMenu(vm);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
//Update the form status
|
||||||
|
window.$gz.form.setFormState({
|
||||||
|
vm: vm,
|
||||||
|
loading: false
|
||||||
|
});
|
||||||
|
window.$gz.errorHandler.handleFormError(error, vm);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async submitOptions() {
|
||||||
|
let vm = this;
|
||||||
|
if (vm.canSave) {
|
||||||
|
vm.formState.loading = true;
|
||||||
|
|
||||||
|
let url = `user-option/${vm.obj.id}`;
|
||||||
|
|
||||||
|
//clear any errors vm might be around from previous submit
|
||||||
|
window.$gz.form.deleteAllErrorBoxErrors(vm);
|
||||||
|
try {
|
||||||
|
let res = await window.$gz.api.upsert(url, vm.optionsObj);
|
||||||
|
|
||||||
|
vm.formState.loading = false;
|
||||||
|
if (res.error) {
|
||||||
|
vm.formState.serverError = res.error;
|
||||||
|
window.$gz.form.setErrorBoxErrors(vm);
|
||||||
|
} else {
|
||||||
|
//UserOptions is never a POST as it always exists and can't be deleted so always a PUT
|
||||||
|
|
||||||
|
//Handle "put" of an existing record (UPDATE)
|
||||||
|
vm.optionsObj.concurrency = res.data.concurrency;
|
||||||
|
window.$gz.form.setFormState({
|
||||||
|
vm: vm,
|
||||||
|
dirty: false
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
vm.formState.loading = false;
|
||||||
|
window.$gz.errorHandler.handleFormError(error, vm);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -778,5 +1106,16 @@ async function populateSelectionLists(vm) {
|
|||||||
vm.selectLists.usertypes = window.$gz.enums.getSelectionList(
|
vm.selectLists.usertypes = window.$gz.enums.getSelectionList(
|
||||||
"insideusertype"
|
"insideusertype"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//------------
|
||||||
|
//http://localhost:7575/api/v8/translation/list
|
||||||
|
let res = await window.$gz.api.get("translation/list");
|
||||||
|
if (res.error) {
|
||||||
|
vm.formState.serverError = res.error;
|
||||||
|
window.$gz.form.setErrorBoxErrors(vm);
|
||||||
|
//window.$gz.errorHandler.handleFormError(res.error, vm);
|
||||||
|
} else {
|
||||||
|
vm.selectLists.translations = res.data;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -641,7 +641,7 @@
|
|||||||
hide-default-footer
|
hide-default-footer
|
||||||
@click:row="contactsRowClick"
|
@click:row="contactsRowClick"
|
||||||
:sort-by="['name']"
|
:sort-by="['name']"
|
||||||
show-select
|
:show-select="false"
|
||||||
:header-props="{ sortByText: $ay.t('Sort') }"
|
:header-props="{ sortByText: $ay.t('Sort') }"
|
||||||
data-cy="custUsersTable"
|
data-cy="custUsersTable"
|
||||||
>
|
>
|
||||||
@@ -653,7 +653,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-slot:top>
|
<template v-slot:top>
|
||||||
<div>
|
<div class="text-right mb-6">
|
||||||
<v-btn
|
<v-btn
|
||||||
@click="contactsGetDataFromApi"
|
@click="contactsGetDataFromApi"
|
||||||
:disabled="obj.id == 0"
|
:disabled="obj.id == 0"
|
||||||
@@ -1129,15 +1129,17 @@ export default {
|
|||||||
ret.push({
|
ret.push({
|
||||||
id: o.id,
|
id: o.id,
|
||||||
name: o.name,
|
name: o.name,
|
||||||
|
emailAddress: o.emailAddress,
|
||||||
|
phone1: o.phone1,
|
||||||
|
phone2: o.phone2,
|
||||||
|
phone3: o.phone3,
|
||||||
active: o.active,
|
active: o.active,
|
||||||
userType: window.$gz.enums.get("outsideusertype", o.userType),
|
|
||||||
lastLogin: window.$gz.locale.utcDateToShortDateAndTimeLocalized(
|
lastLogin: window.$gz.locale.utcDateToShortDateAndTimeLocalized(
|
||||||
o.lastLogin,
|
o.lastLogin,
|
||||||
this.timeZoneName,
|
this.timeZoneName,
|
||||||
this.languageName,
|
this.languageName,
|
||||||
this.hour12
|
this.hour12
|
||||||
),
|
)
|
||||||
roles: this.rolesDisplayFromRoles(o.roles)
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1432,6 +1434,10 @@ async function fetchTranslatedText(vm) {
|
|||||||
async function createTableHeaders(vm) {
|
async function createTableHeaders(vm) {
|
||||||
vm.headers = [
|
vm.headers = [
|
||||||
{ text: vm.$ay.t("User"), value: "name" },
|
{ text: vm.$ay.t("User"), value: "name" },
|
||||||
|
{ text: vm.$ay.t("UserEmailAddress"), value: "emailAddress" },
|
||||||
|
{ text: vm.$ay.t("UserPhone1"), value: "phone1" },
|
||||||
|
{ text: vm.$ay.t("UserPhone2"), value: "phone2" },
|
||||||
|
{ text: vm.$ay.t("UserPageAddress"), value: "phone3" },
|
||||||
{ text: vm.$ay.t("Active"), value: "active" },
|
{ text: vm.$ay.t("Active"), value: "active" },
|
||||||
{ text: vm.$ay.t("LastLogin"), value: "lastLogin" }
|
{ text: vm.$ay.t("LastLogin"), value: "lastLogin" }
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -2,214 +2,389 @@
|
|||||||
<v-container fluid>
|
<v-container fluid>
|
||||||
<gz-report-selector ref="reportSelector"></gz-report-selector>
|
<gz-report-selector ref="reportSelector"></gz-report-selector>
|
||||||
|
|
||||||
<v-row v-if="formState.ready">
|
<div v-if="formState.ready">
|
||||||
<v-col>
|
<gz-error :errorBoxMessage="formState.errorBoxMessage"></gz-error>
|
||||||
<v-form ref="form">
|
|
||||||
<v-row>
|
|
||||||
<gz-error :errorBoxMessage="formState.errorBoxMessage"></gz-error>
|
|
||||||
|
|
||||||
<v-col
|
<v-form ref="form">
|
||||||
v-if="form().showMe(this, 'customerId') && obj.userType == 3"
|
<v-tabs mobile-breakpoint="100" v-model="tab">
|
||||||
cols="12"
|
<v-tab>{{ $ay.t("User") }}</v-tab>
|
||||||
sm="6"
|
<v-tab v-if="obj.id != 0">{{ $ay.t("UserSettings") }}</v-tab>
|
||||||
lg="4"
|
|
||||||
xl="3"
|
|
||||||
>
|
|
||||||
<gz-pick-list
|
|
||||||
:ayaType="ayaTypes().Customer"
|
|
||||||
:showEditIcon="true"
|
|
||||||
:includeInactive="true"
|
|
||||||
v-model="obj.customerId"
|
|
||||||
:readonly="true"
|
|
||||||
:disabled="true"
|
|
||||||
:label="$ay.t('Customer')"
|
|
||||||
ref="customerId"
|
|
||||||
data-cy="customerId"
|
|
||||||
:error-messages="form().serverErrors(this, 'customerId')"
|
|
||||||
@input="fieldValueChanged('customerId')"
|
|
||||||
></gz-pick-list>
|
|
||||||
</v-col>
|
|
||||||
|
|
||||||
<v-col
|
<v-tabs-items v-model="tab">
|
||||||
v-if="form().showMe(this, 'headOfficeId') && obj.userType == 4"
|
<v-tab-item class="mt-4">
|
||||||
cols="12"
|
<v-row>
|
||||||
sm="6"
|
<v-col
|
||||||
lg="4"
|
v-if="form().showMe(this, 'customerId') && obj.userType == 3"
|
||||||
xl="3"
|
cols="12"
|
||||||
>
|
sm="6"
|
||||||
<gz-pick-list
|
lg="4"
|
||||||
:ayaType="ayaTypes().HeadOffice"
|
xl="3"
|
||||||
:showEditIcon="true"
|
>
|
||||||
:includeInactive="true"
|
<gz-pick-list
|
||||||
v-model="obj.headOfficeId"
|
:ayaType="ayaTypes().Customer"
|
||||||
:readonly="true"
|
:showEditIcon="true"
|
||||||
:disabled="true"
|
:includeInactive="true"
|
||||||
:label="$ay.t('HeadOffice')"
|
v-model="obj.customerId"
|
||||||
ref="headOfficeId"
|
:readonly="true"
|
||||||
data-cy="headOfficeId"
|
:disabled="true"
|
||||||
:error-messages="form().serverErrors(this, 'headOfficeId')"
|
:label="$ay.t('Customer')"
|
||||||
@input="fieldValueChanged('headOfficeId')"
|
ref="customerId"
|
||||||
></gz-pick-list>
|
data-cy="customerId"
|
||||||
</v-col>
|
:error-messages="form().serverErrors(this, 'customerId')"
|
||||||
|
@input="fieldValueChanged('customerId')"
|
||||||
|
></gz-pick-list>
|
||||||
|
</v-col>
|
||||||
|
|
||||||
<v-col cols="12" sm="6" lg="4" xl="3">
|
<v-col
|
||||||
<v-text-field
|
v-if="
|
||||||
v-model="obj.name"
|
form().showMe(this, 'headOfficeId') && obj.userType == 4
|
||||||
:readonly="formState.readOnly"
|
"
|
||||||
:disabled="formState.readOnly"
|
cols="12"
|
||||||
:label="$ay.t('Name')"
|
sm="6"
|
||||||
:rules="[form().required(this, 'name')]"
|
lg="4"
|
||||||
:error-messages="form().serverErrors(this, 'name')"
|
xl="3"
|
||||||
ref="name"
|
>
|
||||||
data-cy="name"
|
<gz-pick-list
|
||||||
@input="fieldValueChanged('name')"
|
:ayaType="ayaTypes().HeadOffice"
|
||||||
></v-text-field>
|
:showEditIcon="true"
|
||||||
</v-col>
|
:includeInactive="true"
|
||||||
|
v-model="obj.headOfficeId"
|
||||||
|
:readonly="true"
|
||||||
|
:disabled="true"
|
||||||
|
:label="$ay.t('HeadOffice')"
|
||||||
|
ref="headOfficeId"
|
||||||
|
data-cy="headOfficeId"
|
||||||
|
:error-messages="form().serverErrors(this, 'headOfficeId')"
|
||||||
|
@input="fieldValueChanged('headOfficeId')"
|
||||||
|
></gz-pick-list>
|
||||||
|
</v-col>
|
||||||
|
|
||||||
<v-col cols="12" sm="6" lg="4" xl="3">
|
<v-col cols="12" sm="6" lg="4" xl="3">
|
||||||
<gz-role-picker
|
<v-text-field
|
||||||
:label="$ay.t('AuthorizationRoles')"
|
v-model="obj.name"
|
||||||
v-model="obj.roles"
|
:readonly="formState.readOnly"
|
||||||
:readonly="formState.readOnly"
|
:disabled="formState.readOnly"
|
||||||
:disabled="formState.readOnly"
|
:label="$ay.t('Name')"
|
||||||
ref="roles"
|
:rules="[form().required(this, 'name')]"
|
||||||
testId="roles"
|
:error-messages="form().serverErrors(this, 'name')"
|
||||||
:error-messages="form().serverErrors(this, 'roles')"
|
ref="name"
|
||||||
@input="fieldValueChanged('roles')"
|
data-cy="name"
|
||||||
limitSelectionTo="outside"
|
@input="fieldValueChanged('name')"
|
||||||
></gz-role-picker>
|
></v-text-field>
|
||||||
</v-col>
|
</v-col>
|
||||||
|
|
||||||
<v-col
|
<v-col cols="12" sm="6" lg="4" xl="3">
|
||||||
v-if="form().showMe(this, 'Active')"
|
<gz-role-picker
|
||||||
cols="12"
|
:label="$ay.t('AuthorizationRoles')"
|
||||||
sm="6"
|
v-model="obj.roles"
|
||||||
lg="4"
|
:readonly="formState.readOnly"
|
||||||
xl="3"
|
:disabled="formState.readOnly"
|
||||||
>
|
ref="roles"
|
||||||
<v-checkbox
|
testId="roles"
|
||||||
v-model="obj.active"
|
:error-messages="form().serverErrors(this, 'roles')"
|
||||||
:readonly="formState.readOnly"
|
@input="fieldValueChanged('roles')"
|
||||||
:disabled="formState.readOnly"
|
limitSelectionTo="outside"
|
||||||
:label="$ay.t('Active')"
|
></gz-role-picker>
|
||||||
ref="active"
|
</v-col>
|
||||||
data-cy="active"
|
|
||||||
:error-messages="form().serverErrors(this, 'active')"
|
|
||||||
@change="fieldValueChanged('active')"
|
|
||||||
></v-checkbox>
|
|
||||||
</v-col>
|
|
||||||
|
|
||||||
<v-col cols="12" sm="6" lg="4" xl="3">
|
<v-col
|
||||||
<v-text-field
|
v-if="form().showMe(this, 'Active')"
|
||||||
name="username"
|
cols="12"
|
||||||
id="username"
|
sm="6"
|
||||||
v-model="login"
|
lg="4"
|
||||||
:readonly="formState.readOnly"
|
xl="3"
|
||||||
prepend-icon="$ayiUser"
|
>
|
||||||
autocomplete="off"
|
<v-checkbox
|
||||||
autocorrect="off"
|
v-model="obj.active"
|
||||||
autocapitalize="off"
|
:readonly="formState.readOnly"
|
||||||
spellcheck="false"
|
:disabled="formState.readOnly"
|
||||||
:label="$ay.t('NewLogin')"
|
:label="$ay.t('Active')"
|
||||||
:error-messages="form().serverErrors(this, 'login')"
|
ref="active"
|
||||||
ref="login"
|
data-cy="active"
|
||||||
@input="fieldValueChanged('login')"
|
:error-messages="form().serverErrors(this, 'active')"
|
||||||
></v-text-field>
|
@change="fieldValueChanged('active')"
|
||||||
</v-col>
|
></v-checkbox>
|
||||||
|
</v-col>
|
||||||
|
|
||||||
<v-col cols="12" sm="6" lg="4" xl="3">
|
<v-col cols="12" sm="6" lg="4" xl="3">
|
||||||
<v-text-field
|
<v-text-field
|
||||||
name="password"
|
name="username"
|
||||||
id="password"
|
id="username"
|
||||||
v-model="password"
|
v-model="login"
|
||||||
:readonly="formState.readOnly"
|
:readonly="formState.readOnly"
|
||||||
:append-outer-icon="reveal ? '$ayiEye' : '$ayiEyeSlash'"
|
prepend-icon="$ayiUser"
|
||||||
prepend-icon="$ayiKey"
|
autocomplete="off"
|
||||||
:label="$ay.t('NewPassword')"
|
autocorrect="off"
|
||||||
:type="reveal ? 'text' : 'password'"
|
autocapitalize="off"
|
||||||
:error-messages="form().serverErrors(this, 'password')"
|
spellcheck="false"
|
||||||
ref="password"
|
:label="$ay.t('NewLogin')"
|
||||||
@input="fieldValueChanged('password')"
|
:error-messages="form().serverErrors(this, 'login')"
|
||||||
@click:append-outer="reveal = !reveal"
|
ref="login"
|
||||||
></v-text-field>
|
@input="fieldValueChanged('login')"
|
||||||
</v-col>
|
></v-text-field>
|
||||||
<v-col cols="12" sm="6" lg="4" xl="3">
|
</v-col>
|
||||||
<gz-date-time-picker
|
|
||||||
:label="$ay.t('LastLogin')"
|
|
||||||
v-model="obj.lastLogin"
|
|
||||||
readonly
|
|
||||||
disabled
|
|
||||||
ref="lastLogin"
|
|
||||||
testId="lastLogin"
|
|
||||||
></gz-date-time-picker>
|
|
||||||
</v-col>
|
|
||||||
<v-col v-if="form().showMe(this, 'Notes')" cols="12">
|
|
||||||
<v-textarea
|
|
||||||
v-model="obj.notes"
|
|
||||||
:readonly="formState.readOnly"
|
|
||||||
:disabled="formState.readOnly"
|
|
||||||
:label="$ay.t('UserNotes')"
|
|
||||||
:error-messages="form().serverErrors(this, 'notes')"
|
|
||||||
ref="notes"
|
|
||||||
data-cy="notes"
|
|
||||||
@input="fieldValueChanged('notes')"
|
|
||||||
auto-grow
|
|
||||||
></v-textarea>
|
|
||||||
</v-col>
|
|
||||||
|
|
||||||
<v-col v-if="form().showMe(this, 'Tags')" cols="12">
|
<v-col cols="12" sm="6" lg="4" xl="3">
|
||||||
<gz-tag-picker
|
<v-text-field
|
||||||
v-model="obj.tags"
|
name="password"
|
||||||
:readonly="formState.readOnly"
|
id="password"
|
||||||
:disabled="formState.readOnly"
|
v-model="password"
|
||||||
ref="tags"
|
:readonly="formState.readOnly"
|
||||||
data-cy="tags"
|
:append-outer-icon="reveal ? '$ayiEye' : '$ayiEyeSlash'"
|
||||||
:error-messages="form().serverErrors(this, 'tags')"
|
prepend-icon="$ayiKey"
|
||||||
@input="fieldValueChanged('tags')"
|
:label="$ay.t('NewPassword')"
|
||||||
></gz-tag-picker>
|
:type="reveal ? 'text' : 'password'"
|
||||||
</v-col>
|
:error-messages="form().serverErrors(this, 'password')"
|
||||||
|
ref="password"
|
||||||
|
@input="fieldValueChanged('password')"
|
||||||
|
@click:append-outer="reveal = !reveal"
|
||||||
|
></v-text-field>
|
||||||
|
</v-col>
|
||||||
|
<v-col cols="12" sm="6" lg="4" xl="3">
|
||||||
|
<gz-date-time-picker
|
||||||
|
:label="$ay.t('LastLogin')"
|
||||||
|
v-model="obj.lastLogin"
|
||||||
|
readonly
|
||||||
|
disabled
|
||||||
|
ref="lastLogin"
|
||||||
|
testId="lastLogin"
|
||||||
|
></gz-date-time-picker>
|
||||||
|
</v-col>
|
||||||
|
<v-col v-if="form().showMe(this, 'Notes')" cols="12">
|
||||||
|
<v-textarea
|
||||||
|
v-model="obj.notes"
|
||||||
|
:readonly="formState.readOnly"
|
||||||
|
:disabled="formState.readOnly"
|
||||||
|
:label="$ay.t('UserNotes')"
|
||||||
|
:error-messages="form().serverErrors(this, 'notes')"
|
||||||
|
ref="notes"
|
||||||
|
data-cy="notes"
|
||||||
|
@input="fieldValueChanged('notes')"
|
||||||
|
auto-grow
|
||||||
|
></v-textarea>
|
||||||
|
</v-col>
|
||||||
|
|
||||||
<v-col cols="12">
|
<v-col v-if="form().showMe(this, 'Tags')" cols="12">
|
||||||
<gz-custom-fields
|
<gz-tag-picker
|
||||||
v-model="obj.customFields"
|
v-model="obj.tags"
|
||||||
:formKey="formCustomTemplateKey"
|
:readonly="formState.readOnly"
|
||||||
:readonly="formState.readOnly"
|
:disabled="formState.readOnly"
|
||||||
:disabled="formState.readOnly"
|
ref="tags"
|
||||||
:parentVM="this"
|
data-cy="tags"
|
||||||
ref="customFields"
|
:error-messages="form().serverErrors(this, 'tags')"
|
||||||
data-cy="customFields"
|
@input="fieldValueChanged('tags')"
|
||||||
:error-messages="form().serverErrors(this, 'customFields')"
|
></gz-tag-picker>
|
||||||
@input="fieldValueChanged('customFields')"
|
</v-col>
|
||||||
></gz-custom-fields>
|
|
||||||
</v-col>
|
|
||||||
|
|
||||||
<v-col v-if="form().showMe(this, 'Wiki')" cols="12">
|
<v-col cols="12">
|
||||||
<gz-wiki
|
<gz-custom-fields
|
||||||
:ayaType="ayaType"
|
v-model="obj.customFields"
|
||||||
:ayaId="obj.id"
|
:formKey="formCustomTemplateKey"
|
||||||
ref="wiki"
|
:readonly="formState.readOnly"
|
||||||
v-model="obj.wiki"
|
:disabled="formState.readOnly"
|
||||||
:readonly="formState.readOnly"
|
:parentVM="this"
|
||||||
:disabled="formState.readOnly"
|
ref="customFields"
|
||||||
@input="fieldValueChanged('wiki')"
|
data-cy="customFields"
|
||||||
></gz-wiki
|
:error-messages="form().serverErrors(this, 'customFields')"
|
||||||
></v-col>
|
@input="fieldValueChanged('customFields')"
|
||||||
|
></gz-custom-fields>
|
||||||
|
</v-col>
|
||||||
|
|
||||||
<v-col
|
<v-col v-if="form().showMe(this, 'Wiki')" cols="12">
|
||||||
v-if="form().showMe(this, 'Attachments') && obj.id"
|
<gz-wiki
|
||||||
cols="12"
|
:ayaType="ayaType"
|
||||||
>
|
:ayaId="obj.id"
|
||||||
<gz-attachments
|
ref="wiki"
|
||||||
:readonly="formState.readOnly"
|
v-model="obj.wiki"
|
||||||
:disabled="formState.readOnly"
|
:readonly="formState.readOnly"
|
||||||
:ayaType="ayaType"
|
:disabled="formState.readOnly"
|
||||||
:ayaId="obj.id"
|
@input="fieldValueChanged('wiki')"
|
||||||
></gz-attachments
|
></gz-wiki
|
||||||
></v-col>
|
></v-col>
|
||||||
</v-row>
|
|
||||||
</v-form>
|
<v-col
|
||||||
</v-col>
|
v-if="form().showMe(this, 'Attachments') && obj.id"
|
||||||
</v-row>
|
cols="12"
|
||||||
|
>
|
||||||
|
<gz-attachments
|
||||||
|
:readonly="formState.readOnly"
|
||||||
|
:disabled="formState.readOnly"
|
||||||
|
:ayaType="ayaType"
|
||||||
|
:ayaId="obj.id"
|
||||||
|
></gz-attachments
|
||||||
|
></v-col>
|
||||||
|
</v-row>
|
||||||
|
</v-tab-item>
|
||||||
|
<v-tab-item v-if="obj.id != 0" class="mt-4">
|
||||||
|
<v-row>
|
||||||
|
<v-col cols="12" sm="6" lg="4" xl="3">
|
||||||
|
<v-select
|
||||||
|
v-model="optionsObj.translationId"
|
||||||
|
:items="selectLists.translations"
|
||||||
|
item-text="name"
|
||||||
|
item-value="id"
|
||||||
|
:readonly="formState.readOnly"
|
||||||
|
:label="$ay.t('Translation')"
|
||||||
|
ref="translationId"
|
||||||
|
:error-messages="form().serverErrors(this, 'translationId')"
|
||||||
|
@input="fieldValueChanged('translationId')"
|
||||||
|
></v-select>
|
||||||
|
</v-col>
|
||||||
|
|
||||||
|
<v-col cols="12" sm="6" lg="4" xl="3">
|
||||||
|
<v-text-field
|
||||||
|
v-model="optionsObj.emailAddress"
|
||||||
|
:readonly="formState.readOnly"
|
||||||
|
:label="$ay.t('UserEmailAddress')"
|
||||||
|
:error-messages="form().serverErrors(this, 'emailAddress')"
|
||||||
|
ref="emailAddress"
|
||||||
|
@input="fieldValueChanged('emailAddress')"
|
||||||
|
data-cy="emailAddress"
|
||||||
|
type="email"
|
||||||
|
></v-text-field>
|
||||||
|
</v-col>
|
||||||
|
<v-col
|
||||||
|
v-if="form().showMe(this, 'Phone1')"
|
||||||
|
cols="12"
|
||||||
|
sm="6"
|
||||||
|
lg="4"
|
||||||
|
xl="3"
|
||||||
|
>
|
||||||
|
<v-text-field
|
||||||
|
v-model="optionsObj.phone1"
|
||||||
|
:readonly="formState.readOnly"
|
||||||
|
:disabled="formState.readOnly"
|
||||||
|
:label="$ay.t('UserPhone1')"
|
||||||
|
ref="phone1"
|
||||||
|
data-cy="phone1"
|
||||||
|
type="tel"
|
||||||
|
:error-messages="form().serverErrors(this, 'phone1')"
|
||||||
|
@input="fieldValueChanged('phone1')"
|
||||||
|
></v-text-field>
|
||||||
|
</v-col>
|
||||||
|
|
||||||
|
<v-col
|
||||||
|
v-if="form().showMe(this, 'Phone2')"
|
||||||
|
cols="12"
|
||||||
|
sm="6"
|
||||||
|
lg="4"
|
||||||
|
xl="3"
|
||||||
|
>
|
||||||
|
<v-text-field
|
||||||
|
v-model="optionsObj.phone2"
|
||||||
|
:readonly="formState.readOnly"
|
||||||
|
:disabled="formState.readOnly"
|
||||||
|
:label="$ay.t('UserPhone2')"
|
||||||
|
ref="phone2"
|
||||||
|
data-cy="phone2"
|
||||||
|
type="tel"
|
||||||
|
:error-messages="form().serverErrors(this, 'phone2')"
|
||||||
|
@input="fieldValueChanged('phone2')"
|
||||||
|
></v-text-field>
|
||||||
|
</v-col>
|
||||||
|
|
||||||
|
<v-col
|
||||||
|
v-if="form().showMe(this, 'Phone3')"
|
||||||
|
cols="12"
|
||||||
|
sm="6"
|
||||||
|
lg="4"
|
||||||
|
xl="3"
|
||||||
|
>
|
||||||
|
<v-text-field
|
||||||
|
v-model="optionsObj.phone3"
|
||||||
|
:readonly="formState.readOnly"
|
||||||
|
:disabled="formState.readOnly"
|
||||||
|
:label="$ay.t('UserPageAddress')"
|
||||||
|
ref="phone3"
|
||||||
|
data-cy="phone3"
|
||||||
|
type="tel"
|
||||||
|
:error-messages="form().serverErrors(this, 'phone3')"
|
||||||
|
@input="fieldValueChanged('phone3')"
|
||||||
|
></v-text-field>
|
||||||
|
</v-col>
|
||||||
|
|
||||||
|
<v-col cols="12" sm="6" lg="4" xl="3">
|
||||||
|
<v-text-field
|
||||||
|
v-model="optionsObj.mapUrlTemplate"
|
||||||
|
:readonly="formState.readOnly"
|
||||||
|
:label="$ay.t('MapUrlTemplate')"
|
||||||
|
:error-messages="
|
||||||
|
form().serverErrors(this, 'mapUrlTemplate')
|
||||||
|
"
|
||||||
|
ref="mapUrlTemplate"
|
||||||
|
@input="fieldValueChanged('mapUrlTemplate')"
|
||||||
|
data-cy="mapUrlTemplate"
|
||||||
|
></v-text-field>
|
||||||
|
<v-select
|
||||||
|
:items="selectLists.mapUrls"
|
||||||
|
item-text="name"
|
||||||
|
item-value="value"
|
||||||
|
@input="mapUrlSelectionChanged"
|
||||||
|
></v-select>
|
||||||
|
</v-col>
|
||||||
|
|
||||||
|
<v-col cols="12" sm="6" lg="4" xl="3">
|
||||||
|
<v-text-field
|
||||||
|
v-model="optionsObj.currencyName"
|
||||||
|
hint="e.g. USD, EUR, GBP, AUD, CAD etc"
|
||||||
|
:readonly="formState.readOnly"
|
||||||
|
:label="$ay.t('CurrencyCode')"
|
||||||
|
:rules="[form().required(this, 'currencyName')]"
|
||||||
|
:error-messages="form().serverErrors(this, 'currencyName')"
|
||||||
|
ref="currencyName"
|
||||||
|
@input="fieldValueChanged('currencyName')"
|
||||||
|
></v-text-field>
|
||||||
|
</v-col>
|
||||||
|
|
||||||
|
<v-col cols="12" sm="6" lg="4" xl="3">
|
||||||
|
<v-text-field
|
||||||
|
v-model="optionsObj.languageOverride"
|
||||||
|
:placeholder="locale().getBrowserFirstLanguage()"
|
||||||
|
:readonly="formState.readOnly"
|
||||||
|
:label="$ay.t('LanguageCode')"
|
||||||
|
:error-messages="
|
||||||
|
form().serverErrors(this, 'languageOverride')
|
||||||
|
"
|
||||||
|
ref="languageOverride"
|
||||||
|
@input="fieldValueChanged('languageOverride')"
|
||||||
|
></v-text-field>
|
||||||
|
</v-col>
|
||||||
|
|
||||||
|
<v-col cols="12" sm="6" lg="4" xl="3">
|
||||||
|
<v-text-field
|
||||||
|
v-model="optionsObj.timeZoneOverride"
|
||||||
|
:placeholder="locale().getBrowserTimeZoneName()"
|
||||||
|
:readonly="formState.readOnly"
|
||||||
|
:label="$ay.t('TimeZone')"
|
||||||
|
:error-messages="
|
||||||
|
form().serverErrors(this, 'timeZoneOverride')
|
||||||
|
"
|
||||||
|
ref="timeZoneOverride"
|
||||||
|
@input="fieldValueChanged('timeZoneOverride')"
|
||||||
|
></v-text-field>
|
||||||
|
</v-col>
|
||||||
|
|
||||||
|
<v-col cols="12" sm="6" lg="4" xl="3">
|
||||||
|
<!-- https://vuetifyjs.com/en/components/color-pickers -->
|
||||||
|
<span class="v-label v-label--active theme--light">
|
||||||
|
{{ $ay.t("UserColor") }}
|
||||||
|
</span>
|
||||||
|
<v-color-picker
|
||||||
|
v-model="optionsObj.uiColor"
|
||||||
|
:readonly="formState.readOnly"
|
||||||
|
hide-mode-switch
|
||||||
|
mode="hexa"
|
||||||
|
:error-messages="form().serverErrors(this, 'uiColor')"
|
||||||
|
ref="uiColor"
|
||||||
|
@input="fieldValueChanged('uiColor')"
|
||||||
|
></v-color-picker>
|
||||||
|
</v-col>
|
||||||
|
</v-row>
|
||||||
|
</v-tab-item>
|
||||||
|
</v-tabs-items>
|
||||||
|
</v-tabs>
|
||||||
|
</v-form>
|
||||||
|
</div>
|
||||||
<template v-if="!formState.ready">
|
<template v-if="!formState.ready">
|
||||||
<v-progress-circular
|
<v-progress-circular
|
||||||
indeterminate
|
indeterminate
|
||||||
@@ -254,12 +429,23 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
/* Customer = 3,
|
/* Customer = 3,
|
||||||
HeadOffice = 4, */
|
HeadOffice = 4, */
|
||||||
if (vm.$route.params.customerid != 0) {
|
if (vm.$route.params.customerid && vm.$route.params.customerid != 0) {
|
||||||
vm.obj.customerId = vm.$route.params.customerid;
|
vm.obj.customerId = vm.$route.params.customerid;
|
||||||
vm.obj.userType = 3;
|
vm.obj.userType = 3;
|
||||||
} else if (vm.$route.params.headofficeid != 0) {
|
} else if (
|
||||||
|
vm.$route.params.headofficeid &&
|
||||||
|
vm.$route.params.headofficeid != 0
|
||||||
|
) {
|
||||||
vm.obj.headOfficeId = vm.$route.params.headofficeid;
|
vm.obj.headOfficeId = vm.$route.params.headofficeid;
|
||||||
vm.obj.userType = 4;
|
vm.obj.userType = 4;
|
||||||
|
} else {
|
||||||
|
//no customer or headoffice id, can't proceed
|
||||||
|
// navigate backwards
|
||||||
|
vm.$router.go(-1);
|
||||||
|
//if above turns out to be problematic just go to customers list instead
|
||||||
|
// vm.$router.push({
|
||||||
|
// name: "cust-customers"
|
||||||
|
// });
|
||||||
}
|
}
|
||||||
vm.formState.loading = false; //here we handle it immediately
|
vm.formState.loading = false; //here we handle it immediately
|
||||||
}
|
}
|
||||||
@@ -295,7 +481,49 @@ export default {
|
|||||||
return {
|
return {
|
||||||
formCustomTemplateKey: FORM_CUSTOM_TEMPLATE_KEY,
|
formCustomTemplateKey: FORM_CUSTOM_TEMPLATE_KEY,
|
||||||
selectLists: {
|
selectLists: {
|
||||||
usertypes: []
|
usertypes: [],
|
||||||
|
translations: [],
|
||||||
|
mapUrls: [
|
||||||
|
{
|
||||||
|
name: "Apple",
|
||||||
|
value:
|
||||||
|
"http://maps.apple.com/?q={ayaddress}<|>http://maps.apple.com/?ll={aylatitude},{aylongitude}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Bing",
|
||||||
|
value:
|
||||||
|
"https://bing.com/maps/default.aspx?where1={ayaddress}<|>https://bing.com/maps/default.aspx?cp={aylatitude}~{aylongitude}&lvl=17&style=r&sp=point.{aylatitude}_{aylongitude}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Google",
|
||||||
|
value:
|
||||||
|
"https://www.google.com/maps/search/?api=1&query={ayaddress}<|>https://www.google.com/maps/search/?api=1&query={aylatitude},{aylongitude}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "MapQuest",
|
||||||
|
value:
|
||||||
|
"https://mapquest.com/?center={ayaddress}&zoom=17<|>https://mapquest.com/?center={aylatitude},{aylongitude}&zoom=17"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Open Street Map",
|
||||||
|
value:
|
||||||
|
"https://www.openstreetmap.org/search?query={ayaddress}<|>https://www.openstreetmap.org/?mlat={aylatitude}&mlon={aylongitude}#map=17/{aylatitude}/{aylongitude}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "geo URI",
|
||||||
|
value: "geo:{aylatitude},{aylongitude}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Waze",
|
||||||
|
value:
|
||||||
|
"https://waze.com/ul?q={ayaddress}<|>https://www.waze.com/ul?ll={aylatitude},{aylongitude}&navigate=yes&zoom=17"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Yandex",
|
||||||
|
value:
|
||||||
|
"https://yandex.ru/maps/?mode=search&text={ayaddress}&z=17<|>https://yandex.ru/maps/?ll={aylatitude},{aylongitude}&z=12&l=map"
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
obj: {
|
obj: {
|
||||||
id: 0,
|
id: 0,
|
||||||
@@ -314,9 +542,34 @@ export default {
|
|||||||
tags: [],
|
tags: [],
|
||||||
lastLogin: null
|
lastLogin: null
|
||||||
},
|
},
|
||||||
|
optionsObj: {
|
||||||
|
/*concurrency": 7490431,
|
||||||
|
"translationId": 1,
|
||||||
|
"emailAddress": null,
|
||||||
|
"uiColor": "#000000",
|
||||||
|
"languageOverride": null,
|
||||||
|
"timeZoneOverride": null,
|
||||||
|
"currencyName": "USD",
|
||||||
|
"hour12": true,
|
||||||
|
"userId": 1 */
|
||||||
|
id: 0,
|
||||||
|
concurrency: 0,
|
||||||
|
emailAddress: null,
|
||||||
|
phone1: null,
|
||||||
|
phone2: null,
|
||||||
|
phone3: null,
|
||||||
|
mapUrlTemplate: null,
|
||||||
|
uiColor: null,
|
||||||
|
languageOverride: null,
|
||||||
|
timeZoneOverride: null,
|
||||||
|
currencyName: null,
|
||||||
|
hour12: null,
|
||||||
|
translationId: null
|
||||||
|
},
|
||||||
login: null,
|
login: null,
|
||||||
password: null,
|
password: null,
|
||||||
reveal: true,
|
reveal: true,
|
||||||
|
tab: 0,
|
||||||
formState: {
|
formState: {
|
||||||
ready: false,
|
ready: false,
|
||||||
dirty: false,
|
dirty: false,
|
||||||
@@ -375,6 +628,16 @@ export default {
|
|||||||
ayaTypes: function() {
|
ayaTypes: function() {
|
||||||
return window.$gz.type;
|
return window.$gz.type;
|
||||||
},
|
},
|
||||||
|
translation() {
|
||||||
|
return window.$gz.translation;
|
||||||
|
},
|
||||||
|
locale() {
|
||||||
|
return window.$gz.locale;
|
||||||
|
},
|
||||||
|
mapUrlSelectionChanged(val) {
|
||||||
|
this.optionsObj.mapUrlTemplate = val;
|
||||||
|
this.fieldValueChanged("mapUrlTemplate");
|
||||||
|
},
|
||||||
form() {
|
form() {
|
||||||
return window.$gz.form;
|
return window.$gz.form;
|
||||||
},
|
},
|
||||||
@@ -419,6 +682,8 @@ export default {
|
|||||||
valid: true,
|
valid: true,
|
||||||
loading: false
|
loading: false
|
||||||
});
|
});
|
||||||
|
|
||||||
|
await vm.getUserOptionsDataFromApi();
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
window.$gz.errorHandler.handleFormError(error, vm);
|
window.$gz.errorHandler.handleFormError(error, vm);
|
||||||
@@ -457,11 +722,12 @@ export default {
|
|||||||
if (res.data.id) {
|
if (res.data.id) {
|
||||||
//POST - whole new object returned
|
//POST - whole new object returned
|
||||||
vm.obj = res.data;
|
vm.obj = res.data;
|
||||||
|
|
||||||
//Change URL to new record
|
//Change URL to new record
|
||||||
//NOTE: will not cause a page re-render, almost nothing does unless forced with a KEY property or using router.GO()
|
//NOTE: will not cause a page re-render, almost nothing does unless forced with a KEY property or using router.GO()
|
||||||
|
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
name: "adm-user",
|
name: "cust-user",
|
||||||
params: {
|
params: {
|
||||||
recordid: res.data.id,
|
recordid: res.data.id,
|
||||||
obj: res.data //Pass data object to new form
|
obj: res.data //Pass data object to new form
|
||||||
@@ -471,6 +737,7 @@ export default {
|
|||||||
//PUT - only concurrency token is returned (**warning, if server changes object other fields then this needs to act more like POST above but is more efficient this way**)
|
//PUT - only concurrency token is returned (**warning, if server changes object other fields then this needs to act more like POST above but is more efficient this way**)
|
||||||
//Handle "put" of an existing record (UPDATE)
|
//Handle "put" of an existing record (UPDATE)
|
||||||
vm.obj.concurrency = res.data.concurrency;
|
vm.obj.concurrency = res.data.concurrency;
|
||||||
|
await vm.submitOptions();
|
||||||
}
|
}
|
||||||
|
|
||||||
//Update the form status
|
//Update the form status
|
||||||
@@ -553,6 +820,77 @@ export default {
|
|||||||
} finally {
|
} finally {
|
||||||
vm.formState.loading = false;
|
vm.formState.loading = false;
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
async getUserOptionsDataFromApi() {
|
||||||
|
let vm = this;
|
||||||
|
vm.formState.loading = true;
|
||||||
|
|
||||||
|
let url = `user-option/${vm.obj.id}`;
|
||||||
|
window.$gz.form.deleteAllErrorBoxErrors(vm);
|
||||||
|
try {
|
||||||
|
let res = await window.$gz.api.get(url);
|
||||||
|
|
||||||
|
if (res.error) {
|
||||||
|
//Not found?
|
||||||
|
if (res.error.code == "2010") {
|
||||||
|
window.$gz.form.handleObjectNotFound(vm);
|
||||||
|
}
|
||||||
|
vm.formState.serverError = res.error;
|
||||||
|
window.$gz.form.setErrorBoxErrors(vm);
|
||||||
|
} else {
|
||||||
|
vm.optionsObj = res.data;
|
||||||
|
// vm.activeTranslationId = res.data.translationId;
|
||||||
|
|
||||||
|
//Update the form status
|
||||||
|
window.$gz.form.setFormState({
|
||||||
|
vm: vm,
|
||||||
|
dirty: false,
|
||||||
|
valid: true,
|
||||||
|
loading: false
|
||||||
|
});
|
||||||
|
//modify the menu as necessary
|
||||||
|
generateMenu(vm);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
//Update the form status
|
||||||
|
window.$gz.form.setFormState({
|
||||||
|
vm: vm,
|
||||||
|
loading: false
|
||||||
|
});
|
||||||
|
window.$gz.errorHandler.handleFormError(error, vm);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async submitOptions() {
|
||||||
|
let vm = this;
|
||||||
|
if (vm.canSave) {
|
||||||
|
vm.formState.loading = true;
|
||||||
|
|
||||||
|
let url = `user-option/${vm.obj.id}`;
|
||||||
|
|
||||||
|
//clear any errors vm might be around from previous submit
|
||||||
|
window.$gz.form.deleteAllErrorBoxErrors(vm);
|
||||||
|
try {
|
||||||
|
let res = await window.$gz.api.upsert(url, vm.optionsObj);
|
||||||
|
|
||||||
|
vm.formState.loading = false;
|
||||||
|
if (res.error) {
|
||||||
|
vm.formState.serverError = res.error;
|
||||||
|
window.$gz.form.setErrorBoxErrors(vm);
|
||||||
|
} else {
|
||||||
|
//UserOptions is never a POST as it always exists and can't be deleted so always a PUT
|
||||||
|
|
||||||
|
//Handle "put" of an existing record (UPDATE)
|
||||||
|
vm.optionsObj.concurrency = res.data.concurrency;
|
||||||
|
window.$gz.form.setFormState({
|
||||||
|
vm: vm,
|
||||||
|
dirty: false
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
vm.formState.loading = false;
|
||||||
|
window.$gz.errorHandler.handleFormError(error, vm);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -723,7 +1061,7 @@ let JUST_DELETED = false;
|
|||||||
async function initForm(vm) {
|
async function initForm(vm) {
|
||||||
await fetchTranslatedText(vm);
|
await fetchTranslatedText(vm);
|
||||||
await window.$gz.formCustomTemplate.get(FORM_CUSTOM_TEMPLATE_KEY);
|
await window.$gz.formCustomTemplate.get(FORM_CUSTOM_TEMPLATE_KEY);
|
||||||
//await populateSelectionLists(vm);
|
await populateSelectionLists(vm);
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////
|
||||||
@@ -757,18 +1095,33 @@ async function fetchTranslatedText(vm) {
|
|||||||
"UserCustom13",
|
"UserCustom13",
|
||||||
"UserCustom14",
|
"UserCustom14",
|
||||||
"UserCustom15",
|
"UserCustom15",
|
||||||
"UserCustom16"
|
"UserCustom16",
|
||||||
|
"CurrencyCode",
|
||||||
|
"LanguageCode",
|
||||||
|
"TimeZone",
|
||||||
|
"UserEmailAddress",
|
||||||
|
"UserColor",
|
||||||
|
"Translation",
|
||||||
|
"DarkMode",
|
||||||
|
"MapUrlTemplate",
|
||||||
|
"UserPhone1",
|
||||||
|
"UserPhone2",
|
||||||
|
"UserPageAddress"
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// //////////////////////
|
//////////////////////
|
||||||
// //
|
//
|
||||||
// //
|
//
|
||||||
// async function populateSelectionLists(vm) {
|
async function populateSelectionLists(vm) {
|
||||||
// //ensure the pick lists required are pre-fetched
|
//http://localhost:7575/api/v8/translation/list
|
||||||
// await window.$gz.enums.fetchEnumList("outsideusertype");
|
let res = await window.$gz.api.get("translation/list");
|
||||||
// vm.selectLists.usertypes = window.$gz.enums.getSelectionList(
|
if (res.error) {
|
||||||
// "outsideusertype"
|
vm.formState.serverError = res.error;
|
||||||
// );
|
window.$gz.form.setErrorBoxErrors(vm);
|
||||||
// }
|
//window.$gz.errorHandler.handleFormError(res.error, vm);
|
||||||
|
} else {
|
||||||
|
vm.selectLists.translations = res.data;
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -111,6 +111,10 @@ export default {
|
|||||||
ret.push({
|
ret.push({
|
||||||
id: o.id,
|
id: o.id,
|
||||||
name: o.name,
|
name: o.name,
|
||||||
|
emailAddress: o.emailAddress,
|
||||||
|
phone1: o.phone1,
|
||||||
|
phone2: o.phone2,
|
||||||
|
phone3: o.phone3,
|
||||||
active: o.active,
|
active: o.active,
|
||||||
userType: window.$gz.enums.get("outsideusertype", o.userType),
|
userType: window.$gz.enums.get("outsideusertype", o.userType),
|
||||||
lastLogin: window.$gz.locale.utcDateToShortDateAndTimeLocalized(
|
lastLogin: window.$gz.locale.utcDateToShortDateAndTimeLocalized(
|
||||||
@@ -262,7 +266,11 @@ async function fetchTranslatedText(vm) {
|
|||||||
"User",
|
"User",
|
||||||
"Active",
|
"Active",
|
||||||
"UserType",
|
"UserType",
|
||||||
"LastLogin"
|
"LastLogin",
|
||||||
|
"UserEmailAddress",
|
||||||
|
"UserPhone1",
|
||||||
|
"UserPhone2",
|
||||||
|
"UserPageAddress"
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -282,6 +290,10 @@ async function cacheEnums(vm) {
|
|||||||
async function createTableHeaders(vm) {
|
async function createTableHeaders(vm) {
|
||||||
vm.headers = [
|
vm.headers = [
|
||||||
{ text: vm.$ay.t("User"), value: "name" },
|
{ text: vm.$ay.t("User"), value: "name" },
|
||||||
|
{ text: vm.$ay.t("UserEmailAddress"), value: "emailAddress" },
|
||||||
|
{ text: vm.$ay.t("UserPhone1"), value: "phone1" },
|
||||||
|
{ text: vm.$ay.t("UserPhone2"), value: "phone2" },
|
||||||
|
{ text: vm.$ay.t("UserPageAddress"), value: "phone3" },
|
||||||
{ text: vm.$ay.t("Active"), value: "active" },
|
{ text: vm.$ay.t("Active"), value: "active" },
|
||||||
{ text: vm.$ay.t("UserType"), value: "userType" },
|
{ text: vm.$ay.t("UserType"), value: "userType" },
|
||||||
{ text: vm.$ay.t("LastLogin"), value: "lastLogin" }
|
{ text: vm.$ay.t("LastLogin"), value: "lastLogin" }
|
||||||
|
|||||||
@@ -120,17 +120,6 @@
|
|||||||
@input="fieldValueChanged('currencyName')"
|
@input="fieldValueChanged('currencyName')"
|
||||||
></v-text-field>
|
></v-text-field>
|
||||||
</v-col>
|
</v-col>
|
||||||
<!-- Keeping in case decide to implement non-native time pickers again, but this won't work with native ones
|
|
||||||
<v-col cols="12" sm="6" lg="4" xl="3">
|
|
||||||
<v-checkbox
|
|
||||||
v-model="obj.hour12"
|
|
||||||
:readonly="formState.readOnly"
|
|
||||||
:label="$ay.t('Hour12')"
|
|
||||||
ref="hour12"
|
|
||||||
:error-messages="form().serverErrors(this, 'hour12')"
|
|
||||||
@change="fieldValueChanged('hour12')"
|
|
||||||
></v-checkbox>
|
|
||||||
</v-col> -->
|
|
||||||
|
|
||||||
<v-col cols="12" sm="6" lg="4" xl="3">
|
<v-col cols="12" sm="6" lg="4" xl="3">
|
||||||
<v-text-field
|
<v-text-field
|
||||||
@@ -192,7 +181,7 @@ export default {
|
|||||||
try {
|
try {
|
||||||
await initForm(vm);
|
await initForm(vm);
|
||||||
|
|
||||||
vm.rights = window.$gz.role.getRights(window.$gz.type.UserOptions);
|
vm.rights = window.$gz.role.fullRightsObject(); //getRights(window.$gz.type.UserOptions);
|
||||||
vm.formState.ready = true;
|
vm.formState.ready = true;
|
||||||
window.$gz.eventBus.$on("menu-click", clickHandler);
|
window.$gz.eventBus.$on("menu-click", clickHandler);
|
||||||
//UserOptions never creates a new one so this code is a little different than other forms
|
//UserOptions never creates a new one so this code is a little different than other forms
|
||||||
@@ -565,7 +554,6 @@ async function fetchTranslatedText(vm) {
|
|||||||
"LanguageCode",
|
"LanguageCode",
|
||||||
"TimeZone",
|
"TimeZone",
|
||||||
"UserEmailAddress",
|
"UserEmailAddress",
|
||||||
//"Hour12",
|
|
||||||
"UserColor",
|
"UserColor",
|
||||||
"Translation",
|
"Translation",
|
||||||
"DarkMode",
|
"DarkMode",
|
||||||
|
|||||||
Reference in New Issue
Block a user