This commit is contained in:
parent
cf632040e7
commit
e26eedb51c
|
@ -7,15 +7,16 @@ class Controller extends ModuleCard {
|
||||||
fields: ['id', 'name', 'code', 'workerFk', 'isProduction', 'chatName',
|
fields: ['id', 'name', 'code', 'workerFk', 'isProduction', 'chatName',
|
||||||
'isTeleworking', 'notificationEmail', 'hasToRefill', 'hasToSendMail', 'hasToMistake', 'clientFk'],
|
'isTeleworking', 'notificationEmail', 'hasToRefill', 'hasToSendMail', 'hasToMistake', 'clientFk'],
|
||||||
include: [
|
include: [
|
||||||
{
|
{relation: 'client',
|
||||||
relation: 'client',
|
scope: {
|
||||||
scope: {fields: ['name']}
|
fields: ['id', 'name']
|
||||||
},
|
}},
|
||||||
{
|
{
|
||||||
relation: 'worker',
|
relation: 'worker',
|
||||||
scope: {fields: ['name']}
|
scope: {
|
||||||
|
fields: ['id', 'firstName', 'lastName']
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -24,11 +24,11 @@
|
||||||
</vn-label-value>
|
</vn-label-value>
|
||||||
<vn-label-value
|
<vn-label-value
|
||||||
label="Self-consumption customer"
|
label="Self-consumption customer"
|
||||||
value="{{$ctrl.department.clientFK}}">
|
value="{{$ctrl.department.client.name}}">
|
||||||
</vn-label-value>
|
</vn-label-value>
|
||||||
<vn-label-value
|
<vn-label-value
|
||||||
label="Boss department"
|
label="Boss department"
|
||||||
value="{{$ctrl.department.workerFk}}">
|
value="{{$ctrl.department.worker.firstName}} {{$ctrl.department.worker.secondName}}">
|
||||||
</vn-label-value>
|
</vn-label-value>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -19,13 +19,15 @@ class Controller extends Descriptor {
|
||||||
fields: ['id', 'name', 'code', 'workerFk', 'isProduction', 'chatName',
|
fields: ['id', 'name', 'code', 'workerFk', 'isProduction', 'chatName',
|
||||||
'isTeleworking', 'notificationEmail', 'hasToRefill', 'hasToSendMail', 'hasToMistake', 'clientFk'],
|
'isTeleworking', 'notificationEmail', 'hasToRefill', 'hasToSendMail', 'hasToMistake', 'clientFk'],
|
||||||
include: [
|
include: [
|
||||||
{
|
{relation: 'client',
|
||||||
relation: 'client',
|
scope: {
|
||||||
scope: {fields: ['name']}
|
fields: ['id', 'name']
|
||||||
},
|
}},
|
||||||
{
|
{
|
||||||
relation: 'worker',
|
relation: 'worker',
|
||||||
scope: {fields: ['name']}
|
scope: {
|
||||||
|
fields: ['id', 'firstName', 'lastName']
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,26 +0,0 @@
|
||||||
import './index.js';
|
|
||||||
|
|
||||||
describe('vnWorkerDescriptor', () => {
|
|
||||||
let controller;
|
|
||||||
let $httpBackend;
|
|
||||||
|
|
||||||
beforeEach(ngModule('worker'));
|
|
||||||
|
|
||||||
beforeEach(inject(($componentController, _$httpBackend_) => {
|
|
||||||
$httpBackend = _$httpBackend_;
|
|
||||||
controller = $componentController('vnWorkerDescriptor', {$element: null});
|
|
||||||
}));
|
|
||||||
|
|
||||||
describe('loadData()', () => {
|
|
||||||
it(`should perform a get query to store the worker data into the controller`, () => {
|
|
||||||
const id = 1;
|
|
||||||
const response = 'foo';
|
|
||||||
|
|
||||||
$httpBackend.expectRoute('GET', `Workers/${id}`).respond(response);
|
|
||||||
controller.id = id;
|
|
||||||
$httpBackend.flush();
|
|
||||||
|
|
||||||
expect(controller.worker).toEqual(response);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
Loading…
Reference in New Issue