Merge pull request 'fix: e2e' (!1289) from fix_e2e_state_and_date into dev
gitea/salix/pipeline/head There was a failure building this commit Details

Reviewed-on: #1289
Reviewed-by: Joan Sanchez <joan@verdnatura.es>
This commit is contained in:
Alex Moreno 2023-01-31 10:14:21 +00:00
commit 3f1020aebf
4 changed files with 36 additions and 30 deletions

View File

@ -23,6 +23,7 @@ describe('Worker time control path', () => {
it('should go to the next month, go to current month and go 1 month in the past', async() => { it('should go to the next month, go to current month and go 1 month in the past', async() => {
let date = new Date(); let date = new Date();
date.setDate(1);
date.setMonth(date.getMonth() + 1); date.setMonth(date.getMonth() + 1);
let month = date.toLocaleString('default', {month: 'long'}); let month = date.toLocaleString('default', {month: 'long'});
@ -32,6 +33,7 @@ describe('Worker time control path', () => {
expect(result).toContain(month); expect(result).toContain(month);
date = new Date(); date = new Date();
date.setDate(1);
month = date.toLocaleString('default', {month: 'long'}); month = date.toLocaleString('default', {month: 'long'});
await page.click(selectors.workerTimeControl.previousMonthButton); await page.click(selectors.workerTimeControl.previousMonthButton);
@ -40,6 +42,7 @@ describe('Worker time control path', () => {
expect(result).toContain(month); expect(result).toContain(month);
date = new Date(); date = new Date();
date.setDate(1);
date.setMonth(date.getMonth() - 1); date.setMonth(date.getMonth() - 1);
const timestamp = Math.round(date.getTime() / 1000); const timestamp = Math.round(date.getTime() / 1000);
month = date.toLocaleString('default', {month: 'long'}); month = date.toLocaleString('default', {month: 'long'});

View File

@ -87,6 +87,7 @@ ngModule.vnComponent('vnButtonMenu', {
selectFields: '<?', selectFields: '<?',
initialData: '<?', initialData: '<?',
showFilter: '<?', showFilter: '<?',
fields: '<?',
field: '=?', field: '=?',
url: '@?', url: '@?',
data: '<?', data: '<?',

View File

@ -22,6 +22,7 @@
disabled="!$ctrl.isEditable" disabled="!$ctrl.isEditable"
label="State" label="State"
value-field="code" value-field="code"
fields="['id', 'name', 'alertLevel', 'code']"
url="States/editableStates" url="States/editableStates"
on-change="$ctrl.changeState(value)"> on-change="$ctrl.changeState(value)">
</vn-button-menu> </vn-button-menu>

View File

@ -1,6 +1,6 @@
<vn-card class="summary"> <vn-card class="summary">
<h5> <h5>
<a <a
ng-if="::$ctrl.summary.id" ng-if="::$ctrl.summary.id"
vn-tooltip="Go to the ticket" vn-tooltip="Go to the ticket"
ui-sref="ticket.card.summary({id: {{::$ctrl.summary.id}}})" ui-sref="ticket.card.summary({id: {{::$ctrl.summary.id}}})"
@ -8,36 +8,37 @@
<vn-icon-button icon="launch"></vn-icon-button> <vn-icon-button icon="launch"></vn-icon-button>
</a> </a>
<span> <span>
Ticket #{{$ctrl.summary.id}} - {{$ctrl.summary.client.name}} Ticket #{{$ctrl.summary.id}} - {{$ctrl.summary.client.name}}
({{$ctrl.summary.client.id}}) - {{$ctrl.summary.nickname}} ({{$ctrl.summary.client.id}}) - {{$ctrl.summary.nickname}}
</span> </span>
<vn-button-menu <vn-button-menu
disabled="!$ctrl.isEditable" disabled="!$ctrl.isEditable"
class="message" class="message"
label="Change state" label="Change state"
value-field="code" value-field="code"
fields="['id', 'name', 'alertLevel', 'code']"
url="States/editableStates" url="States/editableStates"
on-change="$ctrl.changeState(value)"> on-change="$ctrl.changeState(value)">
</vn-button-menu> </vn-button-menu>
<vn-ticket-descriptor-menu <vn-ticket-descriptor-menu
ng-if="!$ctrl.isOnTicketCard" ng-if="!$ctrl.isOnTicketCard"
ticket-id="$ctrl.summary.id" ticket-id="$ctrl.summary.id"
parent-reload="$ctrl.reload()" parent-reload="$ctrl.reload()"
/> />
</h5> </h5>
<vn-horizontal> <vn-horizontal>
<vn-one> <vn-one>
<vn-label-value label="State" <vn-label-value label="State"
value="{{$ctrl.summary.ticketState.state.name}}"> value="{{$ctrl.summary.ticketState.state.name}}">
</vn-label-value> </vn-label-value>
<vn-label-value label="Salesperson"> <vn-label-value label="Salesperson">
<span <span
ng-click="workerDescriptor.show($event, $ctrl.summary.client.salesPersonFk)" ng-click="workerDescriptor.show($event, $ctrl.summary.client.salesPersonFk)"
class="link"> class="link">
{{$ctrl.summary.client.salesPersonUser.name}} {{$ctrl.summary.client.salesPersonUser.name}}
</span> </span>
</vn-label-value> </vn-label-value>
<vn-label-value label="Agency" <vn-label-value label="Agency"
value="{{$ctrl.summary.agencyMode.name}}"> value="{{$ctrl.summary.agencyMode.name}}">
</vn-label-value> </vn-label-value>
<vn-label-value label="Zone"> <vn-label-value label="Zone">
@ -47,11 +48,11 @@
{{$ctrl.summary.zone.name}} {{$ctrl.summary.zone.name}}
</span> </span>
</vn-label-value> </vn-label-value>
<vn-label-value label="Warehouse" <vn-label-value label="Warehouse"
value="{{$ctrl.summary.warehouse.name}}"> value="{{$ctrl.summary.warehouse.name}}">
</vn-label-value> </vn-label-value>
<vn-label-value label="Route"> <vn-label-value label="Route">
<span <span
ng-click="routeDescriptor.show($event, $ctrl.summary.routeFk)" ng-click="routeDescriptor.show($event, $ctrl.summary.routeFk)"
class="link"> class="link">
{{$ctrl.summary.routeFk}} {{$ctrl.summary.routeFk}}
@ -66,17 +67,17 @@
</vn-label-value> </vn-label-value>
</vn-one> </vn-one>
<vn-two> <vn-two>
<vn-label-value label="Shipped" <vn-label-value label="Shipped"
value="{{$ctrl.summary.shipped | date: 'dd/MM/yyyy HH:mm'}}"> value="{{$ctrl.summary.shipped | date: 'dd/MM/yyyy HH:mm'}}">
</vn-label-value> </vn-label-value>
<vn-label-value label="Landed" <vn-label-value label="Landed"
value="{{$ctrl.summary.landed | date: 'dd/MM/yyyy'}}"> value="{{$ctrl.summary.landed | date: 'dd/MM/yyyy'}}">
</vn-label-value> </vn-label-value>
<vn-label-value label="Package size" <vn-label-value label="Package size"
value="{{$ctrl.summary.packages}}"> value="{{$ctrl.summary.packages}}">
</vn-label-value> </vn-label-value>
<vn-label-value label="Address phone" <vn-label-value label="Address phone"
ng-if="$ctrl.summary.address.phone != null" ng-if="$ctrl.summary.address.phone != null"
value="{{$ctrl.summary.address.phone}}"> value="{{$ctrl.summary.address.phone}}">
</vn-label-value> </vn-label-value>
<vn-label-value label="Address mobile" <vn-label-value label="Address mobile"
@ -109,7 +110,7 @@
</vn-one> </vn-one>
<vn-auto name="sales"> <vn-auto name="sales">
<h4> <h4>
<a <a
ui-sref="ticket.card.sale({id:$ctrl.ticket.id})" ui-sref="ticket.card.sale({id:$ctrl.ticket.id})"
target="_self"> target="_self">
<span translate vn-tooltip="Go to">Sale</span> <span translate vn-tooltip="Go to">Sale</span>
@ -146,13 +147,13 @@
vn-tooltip="{{::$ctrl.$t('Claim')}}: {{::sale.claimBeginning.claimFk}}"> vn-tooltip="{{::$ctrl.$t('Claim')}}: {{::sale.claimBeginning.claimFk}}">
</vn-icon> </vn-icon>
</a> </a>
<vn-icon <vn-icon
ng-show="::(sale.visible < 0)" ng-show="::(sale.visible < 0)"
color-main color-main
icon="warning" icon="warning"
vn-tooltip="Visible: {{::sale.visible || 0}}"> vn-tooltip="Visible: {{::sale.visible || 0}}">
</vn-icon> </vn-icon>
<vn-icon ng-show="sale.reserved" <vn-icon ng-show="sale.reserved"
icon="icon-reserve" icon="icon-reserve"
translate-attr="{title: 'Reserved'}"> translate-attr="{title: 'Reserved'}">
</vn-icon> </vn-icon>
@ -170,22 +171,22 @@
</vn-icon> </vn-icon>
</vn-td> </vn-td>
<vn-td number shrink> <vn-td number shrink>
<span <span
ng-click="itemDescriptor.show($event, sale.itemFk, sale.id, $ctrl.ticket.shipped)" ng-click="itemDescriptor.show($event, sale.itemFk, sale.id, $ctrl.ticket.shipped)"
class="link"> class="link">
{{sale.itemFk | zeroFill:6}} {{sale.itemFk | zeroFill:6}}
</span> </span>
</vn-td> </vn-td>
<vn-td number shrink> <vn-td number shrink>
<vn-chip <vn-chip
class="transparent" class="transparent"
ng-class="{'alert': sale.visible < 0}"> ng-class="{'alert': sale.visible < 0}">
{{::sale.visible}} {{::sale.visible}}
</vn-chip> </vn-chip>
</vn-td> </vn-td>
<vn-td number shrink> <vn-td number shrink>
<vn-chip <vn-chip
class="transparent" class="transparent"
ng-class="{'alert': sale.available < 0}"> ng-class="{'alert': sale.available < 0}">
{{::sale.available}} {{::sale.available}}
</vn-chip> </vn-chip>
@ -216,7 +217,7 @@
</vn-auto> </vn-auto>
<vn-one ng-if="$ctrl.summary.packagings.length != 0"> <vn-one ng-if="$ctrl.summary.packagings.length != 0">
<h4> <h4>
<a <a
ui-sref="ticket.card.package({id:$ctrl.ticket.id})" ui-sref="ticket.card.package({id:$ctrl.ticket.id})"
target="_self"> target="_self">
<span translate vn-tooltip="Go to">Packages</span> <span translate vn-tooltip="Go to">Packages</span>
@ -241,7 +242,7 @@
</vn-one> </vn-one>
<vn-one class="services" ng-if="$ctrl.summary.services.length != 0"> <vn-one class="services" ng-if="$ctrl.summary.services.length != 0">
<h4> <h4>
<a <a
ui-sref="ticket.card.service({id:$ctrl.ticket.id})" ui-sref="ticket.card.service({id:$ctrl.ticket.id})"
target="_self"> target="_self">
<span translate vn-tooltip="Go to">Service</span> <span translate vn-tooltip="Go to">Service</span>
@ -276,7 +277,7 @@
<vn-horizontal> <vn-horizontal>
<vn-auto ng-if="$ctrl.summary.requests.length != 0"> <vn-auto ng-if="$ctrl.summary.requests.length != 0">
<h4> <h4>
<a <a
ui-sref="ticket.card.request.index({id:$ctrl.ticket.id})" ui-sref="ticket.card.request.index({id:$ctrl.ticket.id})"
target="_self"> target="_self">
<span translate vn-tooltip="Go to">Purchase request</span> <span translate vn-tooltip="Go to">Purchase request</span>
@ -304,7 +305,7 @@
<vn-td number>{{::request.quantity}}</vn-td> <vn-td number>{{::request.quantity}}</vn-td>
<vn-td number>{{::request.price}}</vn-td> <vn-td number>{{::request.price}}</vn-td>
<vn-td number> <vn-td number>
<span <span
ng-show="::request.saleFk" ng-show="::request.saleFk"
ng-click="itemDescriptor.show($event, request.sale.itemFk, request.sale.id)" ng-click="itemDescriptor.show($event, request.sale.itemFk, request.sale.id)"
class="link"> class="link">
@ -336,9 +337,9 @@
<vn-invoice-out-descriptor-popover <vn-invoice-out-descriptor-popover
vn-id="invoice-out-descriptor"> vn-id="invoice-out-descriptor">
</vn-invoice-out-descriptor-popover> </vn-invoice-out-descriptor-popover>
<vn-worker-descriptor-popover <vn-worker-descriptor-popover
vn-id="workerDescriptor"> vn-id="workerDescriptor">
</vn-worker-descriptor-popover> </vn-worker-descriptor-popover>
<vn-zone-descriptor-popover <vn-zone-descriptor-popover
vn-id="zoneDescriptor"> vn-id="zoneDescriptor">
</vn-zone-descriptor-popover> </vn-zone-descriptor-popover>