refs #5334 descriptor
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Carlos Satorres 2023-05-16 13:10:26 +02:00
parent d09889b08a
commit 9f9963af56
2 changed files with 53 additions and 125 deletions

View File

@ -7,63 +7,30 @@
ng-click="$ctrl.handleExcluded()"
translate
ng-if="!$ctrl.excluded">
Click to exclude the user from getting disabled
</vn-item>
<vn-item
ng-click="$ctrl.handleExcluded()"
translate
ng-if="$ctrl.excluded">
Click to allow the user to be disabled
Delete
</vn-item>
</slot-menu>
<slot-body>
<h2>{{worker.department.name}}</h2>
<p>{{worker.department.id}}</p>
<div class="attributes">
<vn-label-value
label="User"
value="{{$ctrl.worker.user.name}}">
label="Chat"
value="{{$ctrl.worker.department.chatName}}">
</vn-label-value>
<vn-label-value
label="Email"
value="{{$ctrl.worker.user.emailUser.email}}">
value="{{$ctrl.worker.department.emailNotification}}">
</vn-label-value>
<vn-label-value
label="Department"
value="{{$ctrl.worker.department.department.name}}">
label="Self-consumption customer"
value="{{$ctrl.worker.department.clientFK}}">
</vn-label-value>
<vn-label-value
label="Phone"
value="{{$ctrl.worker.phone}}">
</vn-label-value>
<vn-label-value
label="Extension"
value="{{$ctrl.worker.sip.extension}}">
label="Boss department"
value="{{$ctrl.worker.department.workerFk}}">
</vn-label-value>
</div>
<div class="icons">
<vn-icon
vn-tooltip="This user can't be disabled"
icon="person"
ng-if="$ctrl.worker.excluded">
</vn-icon>
</div>
<div class="quicklinks">
<div ng-transclude="btnOne">
<vn-quick-link
tooltip="Go to client"
state="['client.card.summary', {id: $ctrl.id}]"
icon="person">
</vn-quick-link>
</div>
<div ng-transclude="btnTwo">
<vn-quick-link
vn-acl="hr"
vn-acl-action="remove"
tooltip="Go to user"
state="['account.card.summary', {id: $ctrl.id}]"
icon="face">
</vn-quick-link>
</div>
<div ng-transclude="btnThree"></div>
</div>
</slot-body>
</vn-descriptor-content>

View File

@ -7,90 +7,51 @@ class Controller extends Descriptor {
this.$rootScope = $rootScope;
}
// get worker() {
// return this.entity;
// }
get department() {
return this.entity;
}
// set worker(value) {
// this.entity = value;
set department(value) {
this.entity = value;
}
loadData() {
const filter = {
include: [
{
relation: 'user',
scope: {
fields: ['name'],
include: {
relation: 'emailUser',
scope: {
fields: ['email']
}
}
}
}, {
relation: 'client',
scope: {
fields: ['fi']
}
}, {
relation: 'sip',
scope: {
fields: ['extension']
}
}, {
relation: 'department',
scope: {
include: {
relation: 'department'
}
}
}
]
};
// if (value)
// this.getIsExcluded();
// }
// get excluded() {
// return this.entity.excluded;
// }
// set excluded(value) {
// this.entity.excluded = value;
// }
// getIsExcluded() {
// this.$http.get(`workerDisableExcludeds/${this.entity.id}/exists`).then(data => {
// this.excluded = data.data.exists;
// });
// }
// handleExcluded() {
// if (this.excluded) {
// this.$http.delete(`workerDisableExcludeds/${this.entity.id}`);
// this.excluded = false;
// } else {
// this.$http.post(`workerDisableExcludeds`, {workerFk: this.entity.id, dated: new Date});
// this.excluded = true;
// }
// }
// loadData() {
// const filter = {
// include: [
// {
// relation: 'user',
// scope: {
// fields: ['name'],
// include: {
// relation: 'emailUser',
// scope: {
// fields: ['email']
// }
// }
// }
// }, {
// relation: 'client',
// scope: {
// fields: ['fi']
// }
// }, {
// relation: 'sip',
// scope: {
// fields: ['extension']
// }
// }, {
// relation: 'department',
// scope: {
// include: {
// relation: 'department'
// }
// }
// }
// ]
// };
// return this.getData(`Workers/${this.id}`, {filter})
// .then(res => this.entity = res.data);
// }
// onUploadResponse() {
// const timestamp = Date.vnNew().getTime();
// const src = this.$rootScope.imagePath('user', '520x520', this.worker.id);
// const zoomSrc = this.$rootScope.imagePath('user', '1600x1600', this.worker.id);
// const newSrc = `${src}&t=${timestamp}`;
// const newZoomSrc = `${zoomSrc}&t=${timestamp}`;
// this.$.photo.setAttribute('src', newSrc);
// this.$.photo.setAttribute('zoom-image', newZoomSrc);
// }
return this.getData(`Workers/${this.id}`, {filter})
.then(res => this.entity = res.data);
}
}
Controller.$inject = ['$element', '$scope', '$rootScope'];