Merge branch '2138-zone_event_m3' of verdnatura/salix into dev
gitea/salix/dev This commit looks good
Details
gitea/salix/dev This commit looks good
Details
This commit is contained in:
commit
78a6c38882
|
@ -0,0 +1,2 @@
|
|||
ALTER TABLE `vn`.`zoneEvent`
|
||||
ADD COLUMN m3Max DECIMAL(10,2) UNSIGNED NULL DEFAULT NULL AFTER bonus;
|
|
@ -788,7 +788,7 @@ export default {
|
|||
createdThermograph: 'vn-travel-thermograph-index vn-tbody > vn-tr',
|
||||
upload: 'vn-travel-thermograph-create button[type=submit]'
|
||||
},
|
||||
agencyBasicData: {
|
||||
zoneBasicData: {
|
||||
name: 'vn-zone-basic-data vn-textfield[ng-model="$ctrl.zone.name"]',
|
||||
agency: 'vn-zone-basic-data vn-autocomplete[ng-model="$ctrl.zone.agencyModeFk"]',
|
||||
maxVolume: 'vn-zone-basic-data vn-input-number[ng-model="$ctrl.zone.m3Max"]',
|
||||
|
|
|
@ -1,103 +0,0 @@
|
|||
import selectors from '../../helpers/selectors.js';
|
||||
import getBrowser from '../../helpers/puppeteer';
|
||||
|
||||
describe('Agency basic data path', () => {
|
||||
let browser;
|
||||
let page;
|
||||
|
||||
beforeAll(async() => {
|
||||
browser = await getBrowser();
|
||||
page = browser.page;
|
||||
await page.loginAndModule('deliveryBoss', 'zone'); // turns up the agency module name and route aint the same lol
|
||||
await page.accessToSearchResult('10');
|
||||
await page.accessToSection('zone.card.basicData');
|
||||
});
|
||||
|
||||
afterAll(async() => {
|
||||
await browser.close();
|
||||
});
|
||||
|
||||
it('should reach the basic data section', async() => {
|
||||
let url = await page.expectURL('#!/zone/10/basic-data');
|
||||
|
||||
expect(url).toBe(true);
|
||||
});
|
||||
|
||||
it('should edit de form and then save', async() => {
|
||||
await page.clearInput(selectors.agencyBasicData.name);
|
||||
await page.write(selectors.agencyBasicData.name, 'Brimstone teleportation');
|
||||
await page.autocompleteSearch(selectors.agencyBasicData.agency, 'Quantum break device');
|
||||
await page.write(selectors.agencyBasicData.maxVolume, '10');
|
||||
await page.clearInput(selectors.agencyBasicData.travelingDays);
|
||||
await page.write(selectors.agencyBasicData.travelingDays, '1');
|
||||
await page.clearInput(selectors.agencyBasicData.closing);
|
||||
await page.type(selectors.agencyBasicData.closing, '2100');
|
||||
await page.clearInput(selectors.agencyBasicData.price);
|
||||
await page.write(selectors.agencyBasicData.price, '999');
|
||||
await page.clearInput(selectors.agencyBasicData.bonus);
|
||||
await page.write(selectors.agencyBasicData.bonus, '100');
|
||||
await page.clearInput(selectors.agencyBasicData.inflation);
|
||||
await page.write(selectors.agencyBasicData.inflation, '200');
|
||||
await page.waitToClick(selectors.agencyBasicData.volumetric);
|
||||
await page.waitToClick(selectors.agencyBasicData.saveButton);
|
||||
});
|
||||
|
||||
it('should reload the section', async() => {
|
||||
await page.reloadSection('zone.card.basicData');
|
||||
let url = await page.expectURL('#!/zone/10/basic-data');
|
||||
|
||||
expect(url).toBe(true);
|
||||
});
|
||||
|
||||
it('should confirm the name was updated', async() => {
|
||||
const result = await page.waitToGetProperty(selectors.agencyBasicData.name, 'value');
|
||||
|
||||
expect(result).toEqual('Brimstone teleportation');
|
||||
});
|
||||
|
||||
it('should confirm the agency was updated', async() => {
|
||||
const result = await page.waitToGetProperty(selectors.agencyBasicData.agency, 'value');
|
||||
|
||||
expect(result).toEqual('Quantum break device');
|
||||
});
|
||||
|
||||
it('should confirm the max volume was updated', async() => {
|
||||
const result = await page.waitToGetProperty(selectors.agencyBasicData.maxVolume, 'value');
|
||||
|
||||
expect(result).toEqual('10');
|
||||
});
|
||||
|
||||
it('should confirm the traveling days were updated', async() => {
|
||||
const result = await page.waitToGetProperty(selectors.agencyBasicData.travelingDays, 'value');
|
||||
|
||||
expect(result).toEqual('1');
|
||||
});
|
||||
|
||||
it('should confirm the closing hour was updated', async() => {
|
||||
const result = await page.waitToGetProperty(selectors.agencyBasicData.closing, 'value');
|
||||
|
||||
expect(result).toEqual('21:00');
|
||||
});
|
||||
|
||||
it('should confirm the price was updated', async() => {
|
||||
const result = await page.waitToGetProperty(selectors.agencyBasicData.price, 'value');
|
||||
|
||||
expect(result).toEqual('999');
|
||||
});
|
||||
|
||||
it('should confirm the bonus was updated', async() => {
|
||||
const result = await page.waitToGetProperty(selectors.agencyBasicData.bonus, 'value');
|
||||
|
||||
expect(result).toEqual('100');
|
||||
});
|
||||
|
||||
it('should confirm the inflation was updated', async() => {
|
||||
const result = await page.waitToGetProperty(selectors.agencyBasicData.inflation, 'value');
|
||||
|
||||
expect(result).toEqual('200');
|
||||
});
|
||||
|
||||
it('should confirm the volumetric checkbox was checked', async() => {
|
||||
await page.waitForClassPresent(selectors.agencyBasicData.volumetric, 'checked');
|
||||
});
|
||||
});
|
|
@ -0,0 +1,103 @@
|
|||
import selectors from '../../helpers/selectors.js';
|
||||
import getBrowser from '../../helpers/puppeteer';
|
||||
|
||||
describe('Zone basic data path', () => {
|
||||
let browser;
|
||||
let page;
|
||||
|
||||
beforeAll(async() => {
|
||||
browser = await getBrowser();
|
||||
page = browser.page;
|
||||
await page.loginAndModule('deliveryBoss', 'zone'); // turns up the zone module name and route aint the same lol
|
||||
await page.accessToSearchResult('10');
|
||||
await page.accessToSection('zone.card.basicData');
|
||||
});
|
||||
|
||||
afterAll(async() => {
|
||||
await browser.close();
|
||||
});
|
||||
|
||||
it('should reach the basic data section', async() => {
|
||||
let url = await page.expectURL('#!/zone/10/basic-data');
|
||||
|
||||
expect(url).toBe(true);
|
||||
});
|
||||
|
||||
it('should edit de form and then save', async() => {
|
||||
await page.clearInput(selectors.zoneBasicData.name);
|
||||
await page.write(selectors.zoneBasicData.name, 'Brimstone teleportation');
|
||||
await page.autocompleteSearch(selectors.zoneBasicData.agency, 'Quantum break device');
|
||||
await page.write(selectors.zoneBasicData.maxVolume, '10');
|
||||
await page.clearInput(selectors.zoneBasicData.travelingDays);
|
||||
await page.write(selectors.zoneBasicData.travelingDays, '1');
|
||||
await page.clearInput(selectors.zoneBasicData.closing);
|
||||
await page.type(selectors.zoneBasicData.closing, '2100');
|
||||
await page.clearInput(selectors.zoneBasicData.price);
|
||||
await page.write(selectors.zoneBasicData.price, '999');
|
||||
await page.clearInput(selectors.zoneBasicData.bonus);
|
||||
await page.write(selectors.zoneBasicData.bonus, '100');
|
||||
await page.clearInput(selectors.zoneBasicData.inflation);
|
||||
await page.write(selectors.zoneBasicData.inflation, '200');
|
||||
await page.waitToClick(selectors.zoneBasicData.volumetric);
|
||||
await page.waitToClick(selectors.zoneBasicData.saveButton);
|
||||
});
|
||||
|
||||
it('should reload the section', async() => {
|
||||
await page.reloadSection('zone.card.basicData');
|
||||
let url = await page.expectURL('#!/zone/10/basic-data');
|
||||
|
||||
expect(url).toBe(true);
|
||||
});
|
||||
|
||||
it('should confirm the name was updated', async() => {
|
||||
const result = await page.waitToGetProperty(selectors.zoneBasicData.name, 'value');
|
||||
|
||||
expect(result).toEqual('Brimstone teleportation');
|
||||
});
|
||||
|
||||
it('should confirm the agency was updated', async() => {
|
||||
const result = await page.waitToGetProperty(selectors.zoneBasicData.agency, 'value');
|
||||
|
||||
expect(result).toEqual('Quantum break device');
|
||||
});
|
||||
|
||||
it('should confirm the max volume was updated', async() => {
|
||||
const result = await page.waitToGetProperty(selectors.zoneBasicData.maxVolume, 'value');
|
||||
|
||||
expect(result).toEqual('10');
|
||||
});
|
||||
|
||||
it('should confirm the traveling days were updated', async() => {
|
||||
const result = await page.waitToGetProperty(selectors.zoneBasicData.travelingDays, 'value');
|
||||
|
||||
expect(result).toEqual('1');
|
||||
});
|
||||
|
||||
it('should confirm the closing hour was updated', async() => {
|
||||
const result = await page.waitToGetProperty(selectors.zoneBasicData.closing, 'value');
|
||||
|
||||
expect(result).toEqual('21:00');
|
||||
});
|
||||
|
||||
it('should confirm the price was updated', async() => {
|
||||
const result = await page.waitToGetProperty(selectors.zoneBasicData.price, 'value');
|
||||
|
||||
expect(result).toEqual('999');
|
||||
});
|
||||
|
||||
it('should confirm the bonus was updated', async() => {
|
||||
const result = await page.waitToGetProperty(selectors.zoneBasicData.bonus, 'value');
|
||||
|
||||
expect(result).toEqual('100');
|
||||
});
|
||||
|
||||
it('should confirm the inflation was updated', async() => {
|
||||
const result = await page.waitToGetProperty(selectors.zoneBasicData.inflation, 'value');
|
||||
|
||||
expect(result).toEqual('200');
|
||||
});
|
||||
|
||||
it('should confirm the volumetric checkbox was checked', async() => {
|
||||
await page.waitForClassPresent(selectors.zoneBasicData.volumetric, 'checked');
|
||||
});
|
||||
});
|
|
@ -12,7 +12,7 @@ export default function moduleImport(moduleName) {
|
|||
case 'ticket' : return import('ticket/front');
|
||||
case 'order' : return import('order/front');
|
||||
case 'claim' : return import('claim/front');
|
||||
case 'agency' : return import('agency/front');
|
||||
case 'zone' : return import('zone/front');
|
||||
case 'travel' : return import('travel/front');
|
||||
case 'worker' : return import('worker/front');
|
||||
case 'invoiceOut' : return import('invoiceOut/front');
|
||||
|
|
|
@ -32,7 +32,7 @@ Remove: Quitar
|
|||
|
||||
# Modules
|
||||
|
||||
Agencies: Agencias
|
||||
Zones: Zonas
|
||||
Claims: Reclamaciones
|
||||
Clients: Clientes
|
||||
Items: Artículos
|
||||
|
|
|
@ -2,7 +2,7 @@ import 'angular';
|
|||
import 'angular-mocks';
|
||||
import core from './front/core/module.js';
|
||||
import './front/salix/components/app/app.js';
|
||||
import './modules/agency/front/module.js';
|
||||
import './modules/zone/front/module.js';
|
||||
import './modules/claim/front/module.js';
|
||||
import './modules/client/front/module.js';
|
||||
import './modules/invoiceOut/front/module.js';
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
import {ng} from 'core/vendor';
|
||||
|
||||
export default ng.module('agency', ['vnCore']);
|
|
@ -41,6 +41,9 @@
|
|||
},
|
||||
"bonus": {
|
||||
"type": "Number"
|
||||
},
|
||||
"m3Max": {
|
||||
"type": "Number"
|
||||
}
|
||||
},
|
||||
"relations": {
|
|
@ -5,7 +5,7 @@ describe('Agency Component vnZoneCard', () => {
|
|||
let $httpBackend;
|
||||
let data = {id: 1, name: 'fooName'};
|
||||
|
||||
beforeEach(ngModule('agency'));
|
||||
beforeEach(ngModule('zone'));
|
||||
|
||||
beforeEach(angular.mock.inject(($componentController, _$httpBackend_, $stateParams) => {
|
||||
$httpBackend = _$httpBackend_;
|
|
@ -6,7 +6,7 @@ describe('Agency Component vnZoneCreate', () => {
|
|||
let $state;
|
||||
let controller;
|
||||
|
||||
beforeEach(ngModule('agency'));
|
||||
beforeEach(ngModule('zone'));
|
||||
|
||||
beforeEach(angular.mock.inject(($componentController, $rootScope, _$state_) => {
|
||||
$scope = $rootScope.$new();
|
|
@ -75,6 +75,10 @@
|
|||
label="Bonus"
|
||||
value="{{::row.bonus | currency:'EUR':2}}">
|
||||
</vn-label-value>
|
||||
<vn-label-value
|
||||
label="Max m3"
|
||||
value="{{::row.m3Max}}">
|
||||
</vn-label-value>
|
||||
</vn-item-section>
|
||||
<vn-item-section side>
|
||||
<vn-icon-button
|
||||
|
@ -130,25 +134,35 @@
|
|||
ng-model="$ctrl.selected.ended">
|
||||
</vn-date-picker>
|
||||
</vn-horizontal>
|
||||
<vn-input-time
|
||||
label="Closing"
|
||||
ng-model="$ctrl.selected.hour">
|
||||
</vn-input-time>
|
||||
<vn-horizontal>
|
||||
<vn-input-time
|
||||
label="Closing"
|
||||
ng-model="$ctrl.selected.hour">
|
||||
</vn-input-time>
|
||||
<vn-input-number
|
||||
label="Traveling days"
|
||||
ng-model="$ctrl.selected.travelingDays"
|
||||
min="0"
|
||||
step="1">
|
||||
</vn-input-number>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-input-number
|
||||
label="Price"
|
||||
ng-model="$ctrl.selected.price"
|
||||
min="0"
|
||||
step="0.01">
|
||||
</vn-input-number>
|
||||
<vn-input-number
|
||||
label="Bonus"
|
||||
ng-model="$ctrl.selected.bonus"
|
||||
min="0"
|
||||
step="0.01">
|
||||
</vn-input-number>
|
||||
</vn-horizontal>
|
||||
<vn-input-number
|
||||
label="Traveling days"
|
||||
ng-model="$ctrl.selected.travelingDays"
|
||||
min="0"
|
||||
step="1">
|
||||
</vn-input-number>
|
||||
<vn-input-number
|
||||
label="Price"
|
||||
ng-model="$ctrl.selected.price"
|
||||
min="0"
|
||||
step="0.01">
|
||||
</vn-input-number>
|
||||
<vn-input-number
|
||||
label="Bonus"
|
||||
ng-model="$ctrl.selected.bonus"
|
||||
label="Max m3"
|
||||
ng-model="$ctrl.selected.m3Max"
|
||||
min="0"
|
||||
step="0.01">
|
||||
</vn-input-number>
|
|
@ -4,7 +4,7 @@ describe('Agency Component vnZoneIndex', () => {
|
|||
let $componentController;
|
||||
let controller;
|
||||
|
||||
beforeEach(ngModule('agency'));
|
||||
beforeEach(ngModule('zone'));
|
||||
|
||||
beforeEach(angular.mock.inject(_$componentController_ => {
|
||||
$componentController = _$componentController_;
|
|
@ -0,0 +1,3 @@
|
|||
import {ng} from 'core/vendor';
|
||||
|
||||
export default ng.module('zone', ['vnCore']);
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"module": "agency",
|
||||
"name": "Agencies",
|
||||
"icon" : "icon-delivery",
|
||||
"module": "zone",
|
||||
"name": "Zones",
|
||||
"icon" : "location_on",
|
||||
"validations" : true,
|
||||
"dependencies": ["worker"],
|
||||
"menus": {
|
||||
"main": [
|
||||
{"state": "zone.index", "icon": "icon-delivery"},
|
||||
{"state": "zone.index", "icon": "location_on"},
|
||||
{"state": "zone.deliveryDays", "icon": "today"}
|
||||
],
|
||||
"card": [
|
|
@ -7,7 +7,7 @@ describe('component vnZoneSummary', () => {
|
|||
let $httpBackend;
|
||||
let $httpParamSerializer;
|
||||
|
||||
beforeEach(ngModule('agency'));
|
||||
beforeEach(ngModule('zone'));
|
||||
|
||||
beforeEach(angular.mock.inject(($componentController, $rootScope, _$httpBackend_, _$httpParamSerializer_) => {
|
||||
$httpBackend = _$httpBackend_;
|
Loading…
Reference in New Issue