refs #5468 eliminados getters a VnUser
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Vicent Llopis 2023-05-12 09:02:55 +02:00
parent b10f90fbe1
commit 3f26072787
5 changed files with 29 additions and 32 deletions

View File

@ -124,7 +124,7 @@
],
"scopes": {
"preview": {
"fields": ["id", "name", "username", "roleFk", "nickname", "lang", "active", "created", "updated", "image", "hasGrant", "realm"]
"fields": ["id", "name", "username", "roleFk", "nickname", "lang", "active", "created", "updated", "image", "hasGrant", "realm", "email"]
}
}
}

View File

@ -1,9 +1,7 @@
<mg-ajax path="VnUsers/{{post.params.id}}/privileges" options="vnPost"></mg-ajax>
<vn-watcher
vn-id="watcher"
url="VnUsers"
data="$ctrl.user"
id-value="$ctrl.$params.id"
form="form"
save="post">
</vn-watcher>

View File

@ -2,33 +2,18 @@ import ngModule from '../module';
import Section from 'salix/components/section';
export default class Controller extends Section {
set user(value) {
this._user = value;
this.$.summary = null;
if (!value) return;
const filter = {
where: {id: value.id},
include: {
relation: 'role',
scope: {
fields: ['id', 'name']
}
}
};
this.$http.get(`VnUsers/preview`, {filter})
.then(res => {
const [summary] = res.data;
this.$.summary = summary;
});
}
get isHr() {
return this.aclService.hasAny(['hr']);
}
get user() {
return this._user;
}
set user(value) {
this._user = value;
if (!value) return;
}
get isHr() {
return this.aclService.hasAny(['hr']);
}
}
ngModule.component('vnUserPrivileges', {

View File

@ -1,7 +1,5 @@
<vn-watcher
vn-id="watcher"
url="VnUsers"
id-field="id"
data="$ctrl.account"
form="form">
</vn-watcher>
@ -51,9 +49,9 @@
label="Save">
</vn-submit>
<vn-button
ng-if="$ctrl.canChangePassword"
label="Change password"
vn-dialog="change-pass">
ng-if="$ctrl.canChangePassword"
label="Change password"
vn-dialog="change-pass">
</vn-button>
<vn-button
class="cancel"

View File

@ -8,6 +8,22 @@ export default class Controller extends Section {
this.canEnableCheckBox = true;
}
set client(value) {
this._client = value;
if (!value) return;
const filter = {where: {id: value.id}};
this.$http.get(`VnUsers/preview`, {filter})
.then(res => {
const [user] = res.data;
this.account = user;
});
}
get client() {
return this._client;
}
$onChanges() {
if (this.client) {
this.account = this.client.account;