Show address city & province on ticket summary #414

This commit is contained in:
Joan Sanchez 2018-07-18 09:23:51 +02:00
parent c9a43d98b8
commit 291c00e2da
4 changed files with 23 additions and 3 deletions

View File

@ -32,7 +32,7 @@
value="{{$ctrl.summary.routeFk}}">
</vn-label-value>
<vn-label-value label="Address"
value="{{$ctrl.summary.address.street}}">
value="{{$ctrl.formattedAddress}}">
</vn-label-value>
<vn-label-value label="Phone"
value="{{$ctrl.summary.address.phone}}">

View File

@ -17,6 +17,15 @@ class Controller {
});
}
get formattedAddress() {
if (!this.summary) return;
let address = this.summary.address;
let province = address.province ? `(${address.province.name})` : '';
return `${address.street} - ${address.city} ${province}`;
}
showDescriptor(event, itemFk) {
this.$scope.descriptor.itemFk = itemFk;
this.$scope.descriptor.parent = event.target;

View File

@ -1,7 +1,7 @@
import selectors from '../../helpers/selectors.js';
import createNightmare from '../../helpers/helpers';
fdescribe('Item', () => {
describe('Item', () => {
describe('Create botanical path', () => {
const nightmare = createNightmare();

View File

@ -45,7 +45,18 @@ module.exports = Self => {
}
}
},
{relation: 'address', scope: {fields: ['street', 'phone']}},
{
relation: 'address',
scope: {
fields: ['street', 'city', 'provinceFk', 'phone'],
include: {
relation: 'province',
scope: {
fields: ['name']
}
}
}
},
{
relation: 'notes',
scope: {