From 3f26072787028c265a0dec4a42a2c44514c65475 Mon Sep 17 00:00:00 2001 From: vicent Date: Fri, 12 May 2023 09:02:55 +0200 Subject: [PATCH] refs #5468 eliminados getters a VnUser --- back/models/vn-user.json | 2 +- modules/account/front/privileges/index.html | 2 -- modules/account/front/privileges/index.js | 33 ++++++--------------- modules/client/front/web-access/index.html | 8 ++--- modules/client/front/web-access/index.js | 16 ++++++++++ 5 files changed, 29 insertions(+), 32 deletions(-) diff --git a/back/models/vn-user.json b/back/models/vn-user.json index c0df160cd..fb38ad27a 100644 --- a/back/models/vn-user.json +++ b/back/models/vn-user.json @@ -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"] } } } diff --git a/modules/account/front/privileges/index.html b/modules/account/front/privileges/index.html index 8e33b708e..8b345698d 100644 --- a/modules/account/front/privileges/index.html +++ b/modules/account/front/privileges/index.html @@ -1,9 +1,7 @@ diff --git a/modules/account/front/privileges/index.js b/modules/account/front/privileges/index.js index 5b470773b..017d878de 100644 --- a/modules/account/front/privileges/index.js +++ b/modules/account/front/privileges/index.js @@ -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', { diff --git a/modules/client/front/web-access/index.html b/modules/client/front/web-access/index.html index 15dc5ed58..74407ba5c 100644 --- a/modules/client/front/web-access/index.html +++ b/modules/client/front/web-access/index.html @@ -1,7 +1,5 @@ @@ -51,9 +49,9 @@ label="Save"> + ng-if="$ctrl.canChangePassword" + label="Change password" + vn-dialog="change-pass"> { + const [user] = res.data; + this.account = user; + }); + } + + get client() { + return this._client; + } + $onChanges() { if (this.client) { this.account = this.client.account;