This commit is contained in:
@@ -49,7 +49,7 @@ export default {
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
vm.$router.push({
|
vm.$router.push({
|
||||||
name: "customer-user",
|
name: "cust-user",
|
||||||
params: { recordid: tid.id }
|
params: { recordid: tid.id }
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,9 +21,21 @@
|
|||||||
export default {
|
export default {
|
||||||
async created() {
|
async created() {
|
||||||
await window.$gz.enums.fetchEnumList("AuthorizationRoles");
|
await window.$gz.enums.fetchEnumList("AuthorizationRoles");
|
||||||
this.availableRoles = window.$gz.enums.getSelectionList(
|
let rawRoles = window.$gz.enums.getSelectionList("AuthorizationRoles");
|
||||||
"AuthorizationRoles"
|
if (this.limitSelectionTo == null) {
|
||||||
);
|
this.availableRoles = rawRoles;
|
||||||
|
} else {
|
||||||
|
if (this.limitSelectionTo == "inside") {
|
||||||
|
//CustomerLimited=2048, CustomerFull=4096
|
||||||
|
this.availableRoles = rawRoles.filter(
|
||||||
|
z => z.id != 2048 && z.id != 4096
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
this.availableRoles = rawRoles.filter(
|
||||||
|
z => z.id == 2048 || z.id == 4096
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -42,6 +54,7 @@ export default {
|
|||||||
type: String,
|
type: String,
|
||||||
required: false
|
required: false
|
||||||
},
|
},
|
||||||
|
limitSelectionTo: { type: String, default: null }, //"inside" - no customer roles, "outside" - no non-customer roles
|
||||||
testId: String
|
testId: String
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|||||||
@@ -56,6 +56,7 @@
|
|||||||
testId="roles"
|
testId="roles"
|
||||||
:error-messages="form().serverErrors(this, 'roles')"
|
:error-messages="form().serverErrors(this, 'roles')"
|
||||||
@input="fieldValueChanged('roles')"
|
@input="fieldValueChanged('roles')"
|
||||||
|
limitSelectionTo="inside"
|
||||||
></gz-role-picker>
|
></gz-role-picker>
|
||||||
</v-col>
|
</v-col>
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,27 @@
|
|||||||
<v-row>
|
<v-row>
|
||||||
<gz-error :errorBoxMessage="formState.errorBoxMessage"></gz-error>
|
<gz-error :errorBoxMessage="formState.errorBoxMessage"></gz-error>
|
||||||
|
|
||||||
|
<v-col
|
||||||
|
v-if="form().showMe(this, 'UserId')"
|
||||||
|
cols="12"
|
||||||
|
sm="6"
|
||||||
|
lg="4"
|
||||||
|
xl="3"
|
||||||
|
>
|
||||||
|
<gz-pick-list
|
||||||
|
:ayaType="ayaTypes().Customer"
|
||||||
|
:showEditIcon="true"
|
||||||
|
v-model="obj.customerId"
|
||||||
|
:readonly="formState.readOnly"
|
||||||
|
:disabled="formState.readOnly"
|
||||||
|
:label="$ay.t('Customer')"
|
||||||
|
ref="customerId"
|
||||||
|
:data-cy="!!$ay.dev ? 'customerId' : false"
|
||||||
|
: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 cols="12" sm="6" lg="4" xl="3">
|
||||||
<v-text-field
|
<v-text-field
|
||||||
v-model="obj.name"
|
v-model="obj.name"
|
||||||
@@ -30,22 +51,6 @@
|
|||||||
@input="fieldValueChanged('name')"
|
@input="fieldValueChanged('name')"
|
||||||
></v-text-field>
|
></v-text-field>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col cols="12" sm="6" lg="4" xl="3">
|
|
||||||
<v-text-field
|
|
||||||
v-model="obj.employeeNumber"
|
|
||||||
:readonly="formState.readOnly"
|
|
||||||
:disabled="formState.readOnly"
|
|
||||||
:clearable="!formState.readOnly"
|
|
||||||
@click:clear="fieldValueChanged('employeeNumber')"
|
|
||||||
:counter="255"
|
|
||||||
:label="$ay.t('UserEmployeeNumber')"
|
|
||||||
:rules="[form().max255(this, 'employeeNumber')]"
|
|
||||||
:error-messages="form().serverErrors(this, 'employeeNumber')"
|
|
||||||
ref="employeeNumber"
|
|
||||||
:data-cy="!!$ay.dev ? 'employeeNumber' : false"
|
|
||||||
@input="fieldValueChanged('employeeNumber')"
|
|
||||||
></v-text-field>
|
|
||||||
</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
|
<gz-role-picker
|
||||||
@@ -57,6 +62,7 @@
|
|||||||
testId="roles"
|
testId="roles"
|
||||||
:error-messages="form().serverErrors(this, 'roles')"
|
:error-messages="form().serverErrors(this, 'roles')"
|
||||||
@input="fieldValueChanged('roles')"
|
@input="fieldValueChanged('roles')"
|
||||||
|
limitSelectionTo="outside"
|
||||||
></gz-role-picker>
|
></gz-role-picker>
|
||||||
</v-col>
|
</v-col>
|
||||||
|
|
||||||
@@ -734,7 +740,7 @@ async function fetchTranslatedText(vm) {
|
|||||||
await window.$gz.translation.cacheTranslations([
|
await window.$gz.translation.cacheTranslations([
|
||||||
"User",
|
"User",
|
||||||
"Name",
|
"Name",
|
||||||
"UserEmployeeNumber",
|
"Customer",
|
||||||
"NewLogin",
|
"NewLogin",
|
||||||
"NewPassword",
|
"NewPassword",
|
||||||
"AuthorizationRoles",
|
"AuthorizationRoles",
|
||||||
@@ -765,9 +771,9 @@ async function fetchTranslatedText(vm) {
|
|||||||
//
|
//
|
||||||
async function populateSelectionLists(vm) {
|
async function populateSelectionLists(vm) {
|
||||||
//ensure the pick lists required are pre-fetched
|
//ensure the pick lists required are pre-fetched
|
||||||
await window.$gz.enums.fetchEnumList("insideusertype");
|
await window.$gz.enums.fetchEnumList("outsideusertype");
|
||||||
vm.selectLists.usertypes = window.$gz.enums.getSelectionList(
|
vm.selectLists.usertypes = window.$gz.enums.getSelectionList(
|
||||||
"insideusertype"
|
"outsideusertype"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ export default {
|
|||||||
window.$gz.eventBus.$emit("openobject", {
|
window.$gz.eventBus.$emit("openobject", {
|
||||||
type: window.$gz.type.User,
|
type: window.$gz.type.User,
|
||||||
id: item.id,
|
id: item.id,
|
||||||
inside: true
|
inside: false
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
rolesDisplayFromRoles(roles) {
|
rolesDisplayFromRoles(roles) {
|
||||||
@@ -112,7 +112,7 @@ export default {
|
|||||||
id: o.id,
|
id: o.id,
|
||||||
name: o.name,
|
name: o.name,
|
||||||
active: o.active,
|
active: o.active,
|
||||||
userType: window.$gz.enums.get("insideusertype", o.userType),
|
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,
|
||||||
|
|||||||
Reference in New Issue
Block a user