Merge pull request '2540-entry_descriptorPopover' (#428) from 2540-entry_descriptorPopover into dev
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
Reviewed-on: #428 Reviewed-by: Carlos Jimenez <carlosjr@verdnatura.es>
This commit is contained in:
commit
faea343e41
|
@ -73,6 +73,7 @@
|
||||||
"I have deleted the ticket id": "I have deleted the ticket id [{{id}}]({{{url}}})",
|
"I have deleted the ticket id": "I have deleted the ticket id [{{id}}]({{{url}}})",
|
||||||
"I have restored the ticket id": "I have restored the ticket id [{{id}}]({{{url}}})",
|
"I have restored the ticket id": "I have restored the ticket id [{{id}}]({{{url}}})",
|
||||||
"Changed this data from the ticket": "I have changed the data from the ticket [{{ticketId}}]({{{ticketUrl}}}): {{{changes}}}",
|
"Changed this data from the ticket": "I have changed the data from the ticket [{{ticketId}}]({{{ticketUrl}}}): {{{changes}}}",
|
||||||
|
"The grade must be similar to the last one": "The grade must be similar to the last one",
|
||||||
"agencyModeFk": "Agency",
|
"agencyModeFk": "Agency",
|
||||||
"clientFk": "Client",
|
"clientFk": "Client",
|
||||||
"zoneFk": "Zone",
|
"zoneFk": "Zone",
|
||||||
|
|
|
@ -55,8 +55,8 @@
|
||||||
</span>
|
</span>
|
||||||
</vn-td>
|
</vn-td>
|
||||||
<vn-td number>
|
<vn-td number>
|
||||||
<span ng-class="::{link: sale.isTicket}"
|
<span class="link"
|
||||||
ng-click="$ctrl.showTicketDescriptor($event, sale)"
|
ng-click="$ctrl.showDescriptor($event, sale)"
|
||||||
name="origin">
|
name="origin">
|
||||||
{{::sale.origin | dashIfEmpty}}
|
{{::sale.origin | dashIfEmpty}}
|
||||||
</span>
|
</span>
|
||||||
|
@ -94,3 +94,7 @@
|
||||||
<vn-client-descriptor-popover
|
<vn-client-descriptor-popover
|
||||||
vn-id="clientDescriptor">
|
vn-id="clientDescriptor">
|
||||||
</vn-client-descriptor-popover>
|
</vn-client-descriptor-popover>
|
||||||
|
<vn-entry-descriptor-popover
|
||||||
|
vn-id="entryDescriptor">
|
||||||
|
</vn-entry-descriptor-popover>
|
||||||
|
|
||||||
|
|
|
@ -58,10 +58,12 @@ class Controller extends Section {
|
||||||
this.$anchorScroll();
|
this.$anchorScroll();
|
||||||
}
|
}
|
||||||
|
|
||||||
showTicketDescriptor(event, sale) {
|
showDescriptor(event, sale) {
|
||||||
if (!sale.isTicket) return;
|
let descriptor = 'entryDescriptor';
|
||||||
|
if (sale.isTicket)
|
||||||
|
descriptor = 'ticketDescriptor';
|
||||||
|
|
||||||
this.$.ticketDescriptor.show(event.target, sale.origin);
|
this.$[descriptor].show(event.target, sale.origin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -60,6 +60,34 @@ describe('Item', () => {
|
||||||
expect(controller.$anchorScroll).toHaveBeenCalledWith();
|
expect(controller.$anchorScroll).toHaveBeenCalledWith();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('showDescriptor ()', () => {
|
||||||
|
it('should call to the entryDescriptor show() method', () => {
|
||||||
|
controller.$.entryDescriptor = {};
|
||||||
|
controller.$.entryDescriptor.show = jest.fn();
|
||||||
|
|
||||||
|
const $event = new Event('click');
|
||||||
|
const target = document.createElement('div');
|
||||||
|
target.dispatchEvent($event);
|
||||||
|
const data = {id: 1, origin: 1};
|
||||||
|
controller.showDescriptor($event, data);
|
||||||
|
|
||||||
|
expect(controller.$.entryDescriptor.show).toHaveBeenCalledWith($event.target, data.origin);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should call to the ticketDescriptor show() method', () => {
|
||||||
|
controller.$.ticketDescriptor = {};
|
||||||
|
controller.$.ticketDescriptor.show = jest.fn();
|
||||||
|
|
||||||
|
const $event = new Event('click');
|
||||||
|
const target = document.createElement('div');
|
||||||
|
target.dispatchEvent($event);
|
||||||
|
const data = {id: 1, origin: 1, isTicket: true};
|
||||||
|
controller.showDescriptor($event, data);
|
||||||
|
|
||||||
|
expect(controller.$.ticketDescriptor.show).toHaveBeenCalledWith($event.target, data.origin);
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
"name": "Items",
|
"name": "Items",
|
||||||
"icon": "icon-item",
|
"icon": "icon-item",
|
||||||
"validations" : true,
|
"validations" : true,
|
||||||
"dependencies": ["worker", "client", "ticket"],
|
"dependencies": ["worker", "client", "ticket", "entry"],
|
||||||
"menus": {
|
"menus": {
|
||||||
"main": [
|
"main": [
|
||||||
{"state": "item.index", "icon": "icon-item"},
|
{"state": "item.index", "icon": "icon-item"},
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
"name": "Travels",
|
"name": "Travels",
|
||||||
"icon": "local_airport",
|
"icon": "local_airport",
|
||||||
"validations": true,
|
"validations": true,
|
||||||
"dependencies": ["worker"],
|
"dependencies": ["worker", "entry"],
|
||||||
"menus": {
|
"menus": {
|
||||||
"main": [
|
"main": [
|
||||||
{"state": "travel.index", "icon": "local_airport"}
|
{"state": "travel.index", "icon": "local_airport"}
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
value="{{$ctrl.travelData.ref}}">
|
value="{{$ctrl.travelData.ref}}">
|
||||||
</vn-label-value>
|
</vn-label-value>
|
||||||
<vn-label-value
|
<vn-label-value
|
||||||
label="m3"
|
label="m³"
|
||||||
value="{{$ctrl.travelData.m3}}">
|
value="{{$ctrl.travelData.m3}}">
|
||||||
</vn-label-value>
|
</vn-label-value>
|
||||||
<vn-label-value
|
<vn-label-value
|
||||||
|
@ -63,7 +63,7 @@
|
||||||
<vn-th shrink>Package</vn-th>
|
<vn-th shrink>Package</vn-th>
|
||||||
<vn-th shrink>CC</vn-th>
|
<vn-th shrink>CC</vn-th>
|
||||||
<vn-th shrink>Pallet</vn-th>
|
<vn-th shrink>Pallet</vn-th>
|
||||||
<vn-th shrink>m3</vn-th>
|
<vn-th shrink>m³</vn-th>
|
||||||
<vn-th shrink></vn-th>
|
<vn-th shrink></vn-th>
|
||||||
</vn-tr>
|
</vn-tr>
|
||||||
</vn-thead>
|
</vn-thead>
|
||||||
|
@ -75,7 +75,12 @@
|
||||||
disabled="true">
|
disabled="true">
|
||||||
</vn-check>
|
</vn-check>
|
||||||
</vn-td>
|
</vn-td>
|
||||||
<vn-td shrink>{{entry.id}} </vn-td>
|
<vn-td shrink>
|
||||||
|
<span class="link"
|
||||||
|
vn-click-stop="entryDescriptor.show($event, entry.id)">
|
||||||
|
{{entry.id}}
|
||||||
|
</span>
|
||||||
|
</vn-td>
|
||||||
<vn-td expand>{{entry.supplierName}}</vn-td>
|
<vn-td expand>{{entry.supplierName}}</vn-td>
|
||||||
<vn-td shrink>{{entry.ref}}</vn-td>
|
<vn-td shrink>{{entry.ref}}</vn-td>
|
||||||
<vn-td shrink>{{entry.hb}}</vn-td>
|
<vn-td shrink>{{entry.hb}}</vn-td>
|
||||||
|
@ -141,4 +146,7 @@
|
||||||
</vn-table>
|
</vn-table>
|
||||||
</vn-auto>
|
</vn-auto>
|
||||||
</vn-horizontal>
|
</vn-horizontal>
|
||||||
</vn-card>
|
</vn-card>
|
||||||
|
<vn-entry-descriptor-popover
|
||||||
|
vn-id="entryDescriptor">
|
||||||
|
</vn-entry-descriptor-popover>
|
|
@ -9,7 +9,7 @@ Received: Recibida
|
||||||
Agency: Agencia
|
Agency: Agencia
|
||||||
Entries: Entradas
|
Entries: Entradas
|
||||||
Confirmed: Confirmada
|
Confirmed: Confirmada
|
||||||
Entry Id: Entrada Id
|
Entry Id: Id entrada
|
||||||
Supplier: Proveedor
|
Supplier: Proveedor
|
||||||
Pallet: Pallet
|
Pallet: Pallet
|
||||||
Freight: Porte
|
Freight: Porte
|
||||||
|
|
|
@ -73,7 +73,7 @@
|
||||||
value="{{::row.bonus | currency:'EUR':2}}">
|
value="{{::row.bonus | currency:'EUR':2}}">
|
||||||
</vn-label-value>
|
</vn-label-value>
|
||||||
<vn-label-value
|
<vn-label-value
|
||||||
label="Max m3"
|
label="Max m³"
|
||||||
value="{{::row.m3Max}}">
|
value="{{::row.m3Max}}">
|
||||||
</vn-label-value>
|
</vn-label-value>
|
||||||
</vn-item-section>
|
</vn-item-section>
|
||||||
|
@ -166,7 +166,7 @@
|
||||||
</vn-input-number>
|
</vn-input-number>
|
||||||
</vn-horizontal>
|
</vn-horizontal>
|
||||||
<vn-input-number
|
<vn-input-number
|
||||||
label="Max m3"
|
label="Max m³"
|
||||||
ng-model="$ctrl.selected.m3Max"
|
ng-model="$ctrl.selected.m3Max"
|
||||||
min="0"
|
min="0"
|
||||||
step="0.01">
|
step="0.01">
|
||||||
|
|
Loading…
Reference in New Issue