Show address city & province on ticket summary #414
This commit is contained in:
parent
c9a43d98b8
commit
291c00e2da
|
@ -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}}">
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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: {
|
||||
|
|
Loading…
Reference in New Issue