Summary boss shown on descriptor

This commit is contained in:
jorgebl 2021-02-24 16:12:44 +01:00
parent 06dcb4b28c
commit 1f1db53d41
3 changed files with 26 additions and 15 deletions

View File

@ -42,6 +42,11 @@
"model": "Account",
"foreignKey": "userFk"
},
"boss": {
"type": "belongsTo",
"model": "Account",
"foreignKey": "bossFk"
},
"client": {
"type": "belongsTo",
"model": "Client",
@ -61,11 +66,6 @@
"type": "hasMany",
"model": "WorkerTeamCollegues",
"foreignKey": "workerFk"
},
"boss": {
"type": "belongsTo",
"model": "Worker",
"foreignKey": "bossFk"
}
}
}

View File

@ -31,8 +31,12 @@
value="{{worker.department.department.name}}">
</vn-label-value>
<vn-label-value
label="Boss"
value="{{worker.boss.firstName}}">
label="Boss">
<span
ng-click="workerDescriptor.show($event, worker.boss.id)"
class="link">
{{::worker.boss.nickname}}
</span>
</vn-label-value>
<vn-label-value label="Phone"
value="{{worker.phone}}">
@ -55,3 +59,6 @@
</vn-one>
</vn-horizontal>
</vn-card>
<vn-worker-descriptor-popover
vn-id="workerDescriptor">
</vn-worker-descriptor-popover>

View File

@ -11,8 +11,8 @@ class Controller extends Summary {
this.$.worker = null;
if (!value) return;
let query = `Workers/${value.id}`;
let filter = {
const query = `Workers/${value.id}`;
const filter = {
include: [
{
relation: 'user',
@ -31,16 +31,20 @@ class Controller extends Summary {
}
}]
}
}, {
},
{
relation: 'client',
scope: {fields: ['fi']}
}, {
},
{
relation: 'boss',
scope: {fields: ['id', 'firstName']}
}, {
scope: {fields: ['id', 'nickname']}
},
{
relation: 'sip',
scope: {fields: ['extension']}
}, {
},
{
relation: 'department',
scope: {
include: {