From 2e22c79e186980466aa60aac0cace6191b79ce15 Mon Sep 17 00:00:00 2001 From: Joan Sanchez Date: Wed, 25 Sep 2019 11:26:12 +0200 Subject: [PATCH 01/13] fixed #1734 canHaveStowaway validation --- loopback/locale/en.json | 3 ++- ...{canBeStowawayed.js => canHaveStowaway.js} | 13 +++++----- .../methods/ticket/getPossibleStowaways.js | 9 ++++--- ...awayed.spec.js => canHaveStowaway.spec.js} | 6 ++--- modules/ticket/back/models/stowaway.js | 9 ++++--- modules/ticket/back/models/ticket.js | 2 +- .../ticket/front/descriptor/addStowaway.html | 11 +++++--- .../ticket/front/descriptor/addStowaway.js | 17 ++++--------- modules/ticket/front/descriptor/index.html | 5 +++- modules/ticket/front/descriptor/index.js | 10 +------- modules/ticket/front/descriptor/index.spec.js | 25 +++++++++++++++++-- 11 files changed, 64 insertions(+), 46 deletions(-) rename modules/ticket/back/methods/ticket/{canBeStowawayed.js => canHaveStowaway.js} (55%) rename modules/ticket/back/methods/ticket/specs/{canBeStowawayed.spec.js => canHaveStowaway.spec.js} (66%) diff --git a/loopback/locale/en.json b/loopback/locale/en.json index 4c29d0a70..862dd999e 100644 --- a/loopback/locale/en.json +++ b/loopback/locale/en.json @@ -55,5 +55,6 @@ "This ticket can not be modified": "This ticket can not be modified", "You can't delete a confirmed order": "You can't delete a confirmed order", "Value has an invalid format": "Value has an invalid format", - "The postcode doesn't exists. Ensure you put the correct format": "The postcode doesn't exists. Ensure you put the correct format" + "The postcode doesn't exists. Ensure you put the correct format": "The postcode doesn't exists. Ensure you put the correct format", + "Can't create stowaway for this ticket": "Can't create stowaway for this ticket" } \ No newline at end of file diff --git a/modules/ticket/back/methods/ticket/canBeStowawayed.js b/modules/ticket/back/methods/ticket/canHaveStowaway.js similarity index 55% rename from modules/ticket/back/methods/ticket/canBeStowawayed.js rename to modules/ticket/back/methods/ticket/canHaveStowaway.js index 72b6d7f46..0d64c2d11 100644 --- a/modules/ticket/back/methods/ticket/canBeStowawayed.js +++ b/modules/ticket/back/methods/ticket/canHaveStowaway.js @@ -1,7 +1,7 @@ module.exports = Self => { - Self.remoteMethod('canBeStowawayed', { - description: 'Returns if a ticket can be stowawayed', + Self.remoteMethod('canHaveStowaway', { + description: 'Returns if a ticket can have stowaway', accessType: 'READ', accepts: [{ arg: 'id', @@ -14,14 +14,15 @@ module.exports = Self => { root: true }, http: { - path: `/:id/canBeStowawayed`, + path: `/:id/canHaveStowaway`, verb: 'GET' } }); - Self.canBeStowawayed = async id => { - const ticket = await Self.app.models.Ticket.findById(id); - const warehouse = await Self.app.models.Warehouse.findById(ticket.warehouseFk); + Self.canHaveStowaway = async id => { + const models = Self.app.models; + const ticket = await models.Ticket.findById(id); + const warehouse = await models.Warehouse.findById(ticket.warehouseFk); if (warehouse && warehouse.hasStowaway) return true; diff --git a/modules/ticket/back/methods/ticket/getPossibleStowaways.js b/modules/ticket/back/methods/ticket/getPossibleStowaways.js index 2b3194f86..f692c9f23 100644 --- a/modules/ticket/back/methods/ticket/getPossibleStowaways.js +++ b/modules/ticket/back/methods/ticket/getPossibleStowaways.js @@ -21,12 +21,13 @@ module.exports = Self => { }); Self.getPossibleStowaways = async ticketFk => { - let canStowaway = await Self.app.models.Ticket.canBeStowawayed(ticketFk); + const models = Self.app.models; + const canHaveStowaway = await models.Ticket.canHaveStowaway(ticketFk); - if (!canStowaway) + if (!canHaveStowaway) throw new UserError(`Can't create stowaway for this ticket`); - let ship = await Self.app.models.Ticket.findById(ticketFk); + let ship = await models.Ticket.findById(ticketFk); if (!ship || !ship.shipped) return []; @@ -38,7 +39,7 @@ module.exports = Self => { highestDate.setHours(23, 59, 59); - let possibleStowaways = await Self.app.models.Ticket.find({ + let possibleStowaways = await models.Ticket.find({ where: { id: {neq: ticketFk}, clientFk: ship.clientFk, diff --git a/modules/ticket/back/methods/ticket/specs/canBeStowawayed.spec.js b/modules/ticket/back/methods/ticket/specs/canHaveStowaway.spec.js similarity index 66% rename from modules/ticket/back/methods/ticket/specs/canBeStowawayed.spec.js rename to modules/ticket/back/methods/ticket/specs/canHaveStowaway.spec.js index 49a775225..231f2581b 100644 --- a/modules/ticket/back/methods/ticket/specs/canBeStowawayed.spec.js +++ b/modules/ticket/back/methods/ticket/specs/canHaveStowaway.spec.js @@ -1,16 +1,16 @@ const app = require('vn-loopback/server/server'); -describe('ticket canBeStowawayed()', () => { +describe('ticket canHaveStowaway()', () => { it('should return true if the ticket warehouse have hasStowaway equal 1', async() => { const ticketId = 16; - let canStowaway = await app.models.Ticket.canBeStowawayed(ticketId); + let canStowaway = await app.models.Ticket.canHaveStowaway(ticketId); expect(canStowaway).toBeTruthy(); }); it('should return false if the ticket warehouse dont have hasStowaway equal 0', async() => { const ticketId = 10; - let canStowaway = await app.models.Ticket.canBeStowawayed(ticketId); + let canStowaway = await app.models.Ticket.canHaveStowaway(ticketId); expect(canStowaway).toBeFalsy(); }); diff --git a/modules/ticket/back/models/stowaway.js b/modules/ticket/back/models/stowaway.js index a8f967d24..aa21e8680 100644 --- a/modules/ticket/back/models/stowaway.js +++ b/modules/ticket/back/models/stowaway.js @@ -3,21 +3,22 @@ const UserError = require('vn-loopback/util/user-error'); module.exports = function(Self) { Self.observe('before save', async function(ctx) { - let isStowaway = await Self.app.models.Ticket.canBeStowawayed(ctx.instance.id); + const models = Self.app.models; + const canHaveStowaway = await models.Ticket.canHaveStowaway(ctx.instance.shipFk); - if (!isStowaway) + if (!canHaveStowaway) throw new UserError(`Can't create stowaway for this ticket`); if (ctx.isNewInstance) { let where = { code: 'BOARDING' }; - let state = await Self.app.models.State.findOne({where}); + let state = await models.State.findOne({where}); let params = {ticketFk: ctx.instance.id, stateFk: state.id}; const loopBackContext = LoopBackContext.getCurrentContext(); let httpCtx = {req: loopBackContext.active}; - await Self.app.models.TicketTracking.changeState(httpCtx, params); + await models.TicketTracking.changeState(httpCtx, params); } }); }; diff --git a/modules/ticket/back/models/ticket.js b/modules/ticket/back/models/ticket.js index 21a41783f..ed3a85da2 100644 --- a/modules/ticket/back/models/ticket.js +++ b/modules/ticket/back/models/ticket.js @@ -25,7 +25,7 @@ module.exports = Self => { require('../methods/ticket/uploadFile')(Self); require('../methods/ticket/addSale')(Self); require('../methods/ticket/transferSales')(Self); - require('../methods/ticket/canBeStowawayed')(Self); + require('../methods/ticket/canHaveStowaway')(Self); Self.observe('before save', async function(ctx) { if (ctx.isNewInstance) return; diff --git a/modules/ticket/front/descriptor/addStowaway.html b/modules/ticket/front/descriptor/addStowaway.html index 349ae137e..74554d2be 100644 --- a/modules/ticket/front/descriptor/addStowaway.html +++ b/modules/ticket/front/descriptor/addStowaway.html @@ -1,13 +1,18 @@ + + + on-open="model.reload()">
Stowaways to add
- + Ticket id @@ -18,7 +23,7 @@ - + {{ticket.id}} {{ticket.landed | dateTime: 'dd/MM/yyyy'}} {{ticket.agencyMode.name}} diff --git a/modules/ticket/front/descriptor/addStowaway.js b/modules/ticket/front/descriptor/addStowaway.js index b5f6d82fe..ad6750fdf 100644 --- a/modules/ticket/front/descriptor/addStowaway.js +++ b/modules/ticket/front/descriptor/addStowaway.js @@ -1,23 +1,16 @@ import ngModule from '../module'; class Controller { - constructor($state, $, $http, vnApp, $translate) { + constructor($stateParams, $, $http, vnApp, $translate) { this.vnApp = vnApp; this.$translate = $translate; this.$ = $; - this.$state = $state; + this.$stateParams = $stateParams; this.$http = $http; } - getPossibleStowaways() { - this.$http.get(`/api/Tickets/${this.ticket.id}/getPossibleStowaways`) - .then(res => { - this.possibleStowaways = res.data; - }); - } - - addStowaway(index) { - let params = {id: this.possibleStowaways[index].id, shipFk: this.ticket.id}; + addStowaway(stowaway) { + let params = {id: stowaway.id, shipFk: this.ticket.id}; this.$http.post(`/api/Stowaways/`, params) .then(() => { this.cardReload(); @@ -35,7 +28,7 @@ class Controller { } } -Controller.$inject = ['$state', '$scope', '$http', 'vnApp', '$translate']; +Controller.$inject = ['$stateParams', '$scope', '$http', 'vnApp', '$translate']; ngModule.component('vnAddStowaway', { template: require('./addStowaway.html'), diff --git a/modules/ticket/front/descriptor/index.html b/modules/ticket/front/descriptor/index.html index 897f58cb2..96dcd0096 100644 --- a/modules/ticket/front/descriptor/index.html +++ b/modules/ticket/front/descriptor/index.html @@ -158,7 +158,10 @@ question="You are going to delete this ticket" message="This ticket will be removed from current route! Continue anyway?"> - + + { + this.$http.get(`/api/Tickets/${this.ticket.id}/canHaveStowaway`).then(response => { if (response.data === true) return this.canShowStowaway = true; diff --git a/modules/ticket/front/descriptor/index.spec.js b/modules/ticket/front/descriptor/index.spec.js index 57ae5abe7..6fc167a41 100644 --- a/modules/ticket/front/descriptor/index.spec.js +++ b/modules/ticket/front/descriptor/index.spec.js @@ -135,12 +135,33 @@ describe('Ticket Component vnTicketDescriptor', () => { }); }); + + describe('showAddStowaway()', () => { + it('should show a dialog with a list of tickets available for an stowaway', () => { + controller.$scope.addStowaway = {}; + controller.$scope.addStowaway.show = jasmine.createSpy('show'); + controller.showAddStowaway(); + + expect(controller.$scope.addStowaway.show).toHaveBeenCalledWith(); + }); + }); + + describe('showRemoveStowaway()', () => { + it('should show a dialog for an stowaway removal', () => { + controller.$scope.removeStowaway = {}; + controller.$scope.removeStowaway.show = jasmine.createSpy('show'); + controller.showRemoveStowaway(); + + expect(controller.$scope.removeStowaway.show).toHaveBeenCalledWith(); + }); + }); + describe('canStowaway()', () => { it('should make a query and return if the ticket can be stowawayed', () => { controller.ticket.id = 16; spyOn(controller, 'isTicketModule').and.callThrough(); - $httpBackend.when('GET', '/api/Tickets/16/canBeStowawayed').respond(true); - $httpBackend.expect('GET', '/api/Tickets/16/canBeStowawayed').respond(true); + $httpBackend.when('GET', '/api/Tickets/16/canHaveStowaway').respond(true); + $httpBackend.expect('GET', '/api/Tickets/16/canHaveStowaway').respond(true); controller.canStowaway(); $httpBackend.flush(); From 10d97674dcba645f14255824195a8173e5fd8a2c Mon Sep 17 00:00:00 2001 From: Joan Sanchez Date: Fri, 4 Oct 2019 09:28:09 +0200 Subject: [PATCH 02/13] update zone and shipped on #1746 --- .../front/basic-data/step-one/index.html | 3 +- .../ticket/front/basic-data/step-one/index.js | 56 +++---- .../front/basic-data/step-one/index.spec.js | 157 +++++++++++++++++- 3 files changed, 179 insertions(+), 37 deletions(-) diff --git a/modules/ticket/front/basic-data/step-one/index.html b/modules/ticket/front/basic-data/step-one/index.html index 3d79b9b68..4e3cf361a 100644 --- a/modules/ticket/front/basic-data/step-one/index.html +++ b/modules/ticket/front/basic-data/step-one/index.html @@ -14,6 +14,7 @@ label="Client" show-field="name" value-field="id" + search-function="{or: [{id: $search}, {name: {like: '%'+ $search +'%'}}]}" field="$ctrl.clientId" initial-data="$ctrl.clientId" order="id"> @@ -23,7 +24,7 @@ label="Address" show-field="nickname" value-field="id" - field="$ctrl.ticket.addressFk" + field="$ctrl.addressId" order="isActive DESC"> {{::isActive ? '' : 'INACTIVE'}} {{::nickname}} diff --git a/modules/ticket/front/basic-data/step-one/index.js b/modules/ticket/front/basic-data/step-one/index.js index 862a7a315..09632ba5a 100644 --- a/modules/ticket/front/basic-data/step-one/index.js +++ b/modules/ticket/front/basic-data/step-one/index.js @@ -26,10 +26,7 @@ class Controller { } get clientId() { - if (this.ticket) - return this.ticket.clientFk; - - return null; + return this.ticket && this.ticket.clientFk; } set clientId(value) { @@ -39,11 +36,24 @@ class Controller { this.onChangeClient(value); } - get warehouseId() { - if (this.ticket) - return this.ticket.warehouseFk; + get addressId() { + return this.ticket && this.ticket.addressFk; + } - return null; + set addressId(value) { + if (value != this.ticket.addressFk) { + this.ticket.addressFk = value; + this.getShipped({ + landed: this.ticket.landed, + addressFk: value, + agencyModeFk: this.ticket.agencyModeFk, + warehouseFk: this.ticket.warehouseFk + }); + } + } + + get warehouseId() { + return this.ticket && this.ticket.warehouseFk; } set warehouseId(value) { @@ -60,10 +70,7 @@ class Controller { get shipped() { - if (this.ticket) - return this.ticket.shipped; - - return null; + return this.ticket && this.ticket.shipped; } set shipped(value) { @@ -77,10 +84,7 @@ class Controller { } get landed() { - if (this.ticket) - return this.ticket.landed; - - return null; + return this.ticket && this.ticket.landed; } set landed(value) { @@ -94,17 +98,14 @@ class Controller { } get agencyModeId() { - if (this.ticket) - return this.ticket.agencyModeFk; - - return null; + return this.ticket && this.ticket.agencyModeFk; } set agencyModeId(value) { if (value != this.ticket.agencyModeFk) { this.ticket.agencyModeFk = value; - this.getShipped({ - landed: this.ticket.landed, + this.getLanded({ + shipped: this.ticket.shipped, addressFk: this.ticket.addressFk, agencyModeFk: value, warehouseFk: this.ticket.warehouseFk @@ -113,10 +114,7 @@ class Controller { } get zoneId() { - if (this.ticket) - return this.ticket.zoneFk; - - return null; + return this.ticket && this.ticket.zoneFk; } set zoneId(value) { @@ -206,9 +204,10 @@ class Controller { this.$http.get(query, {params}).then(res => { if (res.data) { this.ticket.zoneFk = res.data.zoneFk; - this.ticket.landed = res.data.landed; this.ticket.agencyModeFk = res.data.agencyModeFk; this.ticket.warehouseFk = res.data.warehouseFk; + this.ticket.landed = res.data.landed; + this.ticket.shipped = params.shipped; } else { return this.vnApp.showError( this.$translate.instant(`No delivery zone available for this landing date`) @@ -226,9 +225,10 @@ class Controller { this.$http.get(query, {params}).then(res => { if (res.data) { this.ticket.zoneFk = res.data.zoneFk; - this.ticket.shipped = res.data.shipped; this.ticket.agencyModeFk = res.data.agencyModeFk; this.ticket.warehouseFk = res.data.warehouseFk; + this.ticket.landed = params.landed; + this.ticket.shipped = res.data.shipped; } else { return this.vnApp.showError( this.$translate.instant(`No delivery zone available for this landing date`) diff --git a/modules/ticket/front/basic-data/step-one/index.spec.js b/modules/ticket/front/basic-data/step-one/index.spec.js index c743ca911..89ca7f171 100644 --- a/modules/ticket/front/basic-data/step-one/index.spec.js +++ b/modules/ticket/front/basic-data/step-one/index.spec.js @@ -5,14 +5,16 @@ describe('Ticket', () => { let $state; let controller; let $httpBackend; + let $httpParamSerializer; beforeEach(angular.mock.module('ticket', $translateProvider => { $translateProvider.translations('en', {}); })); - beforeEach(angular.mock.inject(($componentController, _$state_, _$httpBackend_) => { + beforeEach(angular.mock.inject(($componentController, _$state_, _$httpBackend_, _$httpParamSerializer_) => { $state = _$state_; $httpBackend = _$httpBackend_; + $httpParamSerializer = _$httpParamSerializer_; controller = $componentController('vnTicketBasicDataStepOne', {$state}); controller.ticket = { addressFk: 121, @@ -37,6 +39,14 @@ describe('Ticket', () => { }); }); + describe('clientId() getter', () => { + it('should return the clientFk property', () => { + controller.ticket = {id: 1, clientFk: 102}; + + expect(controller.clientId).toEqual(102); + }); + }); + describe('clientId() setter', () => { it('should set clientId property and call onChangeClient() method ', () => { spyOn(controller, 'onChangeClient'); @@ -47,6 +57,69 @@ describe('Ticket', () => { }); }); + describe('adressId() getter', () => { + it('should return the addressFk property', () => { + controller.ticket = {id: 1, addressFk: 99}; + + expect(controller.addressId).toEqual(99); + }); + }); + + describe('addressId() setter', () => { + it('should set addressId property and call getShipped() method ', () => { + spyOn(controller, 'getShipped'); + controller.ticket.addressFk = 99; + controller.addressId = 100; + const landed = new Date(); + const spectedResult = { + landed: landed, + addressFk: 100, + agencyModeFk: 7, + warehouseFk: 1 + }; + controller.landed = landed; + + expect(controller.getShipped).toHaveBeenCalledWith(spectedResult); + expect(controller.ticket.addressFk).toEqual(100); + }); + }); + + describe('warehouseId() getter', () => { + it('should return the warehouseId property', () => { + controller.ticket.warehouseFk = 2; + + expect(controller.warehouseId).toEqual(2); + }); + }); + + describe('warehouseId() setter', () => { + it('should set warehouseId property and call getShipped() method ', () => { + spyOn(controller, 'getShipped'); + controller.ticket.warehouseId = 1; + controller.warehouseId = 2; + const landed = new Date(); + const spectedResult = { + landed: landed, + addressFk: 121, + agencyModeFk: 7, + warehouseFk: 2 + }; + controller.landed = landed; + + expect(controller.getShipped).toHaveBeenCalledWith(spectedResult); + expect(controller.ticket.warehouseFk).toEqual(2); + }); + }); + + describe('shipped() getter', () => { + it('should return the shipped property', () => { + const shipped = new Date(); + controller.ticket.shipped = shipped; + + expect(controller.shipped).toEqual(shipped); + }); + }); + describe('shipped() setter', () => { it('should set shipped property and call getLanded() method ', () => { spyOn(controller, 'getLanded'); @@ -59,11 +132,19 @@ describe('Ticket', () => { }; controller.shipped = shipped; - expect(controller.getLanded).toHaveBeenCalledWith(spectedResult); }); }); + describe('landed() getter', () => { + it('should return the landed property', () => { + const landed = new Date(); + controller.ticket.landed = landed; + + expect(controller.landed).toEqual(landed); + }); + }); + describe('landed() setter', () => { it('should set shipped property and call getShipped() method ', () => { spyOn(controller, 'getShipped'); @@ -81,21 +162,29 @@ describe('Ticket', () => { }); }); + describe('agencyModeId() getter', () => { + it('should return the agencyModeFk property', () => { + controller.ticket.agencyModeFk = 66; + + expect(controller.agencyModeId).toEqual(66); + }); + }); + describe('agencyModeId() setter', () => { - it('should set agencyModeId property and call onChangeAgencyMode() method', () => { - spyOn(controller, 'getShipped'); - const landed = new Date(); + it('should set agencyModeId property and call getLanded() method', () => { + spyOn(controller, 'getLanded'); + const shipped = new Date(); const agencyModeId = 8; const spectedResult = { - landed: landed, + shipped: shipped, addressFk: 121, agencyModeFk: agencyModeId, warehouseFk: 1 }; - controller.ticket.landed = landed; + controller.ticket.shipped = shipped; controller.agencyModeId = 8; - expect(controller.getShipped).toHaveBeenCalledWith(spectedResult); + expect(controller.getLanded).toHaveBeenCalledWith(spectedResult); }); it('should do nothing if attempting to set the same agencyMode id', () => { @@ -115,6 +204,14 @@ describe('Ticket', () => { }); }); + describe('zoneId() getter', () => { + it('should return the zoneFk property', () => { + controller.ticket.zoneFk = 10; + + expect(controller.zoneId).toEqual(10); + }); + }); + describe('zoneId() setter', () => { it('should set zoneId property and call onChangeZone() method ', () => { const zoneId = 5; @@ -223,5 +320,49 @@ describe('Ticket', () => { $httpBackend.flush(); }); }); + + describe('getLanded()', () => { + it('should return an available landed date', async() => { + const shipped = new Date(); + const expectedResult = {landed: new Date()}; + const params = { + shipped: shipped, + addressFk: 121, + agencyModeFk: 7, + warehouseFk: 1 + }; + const serializedParams = $httpParamSerializer(params); + + $httpBackend.when('GET', `/api/Agencies/getLanded?${serializedParams}`).respond(200, expectedResult); + $httpBackend.expect('GET', `/api/Agencies/getLanded?${serializedParams}`); + controller.getLanded(params); + $httpBackend.flush(); + + expect(controller.shipped).toEqual(shipped); + expect(controller.landed).toEqual(expectedResult.landed); + }); + }); + + describe('getShipped()', () => { + it('should return an available shipped date', async() => { + const landed = new Date(); + const expectedResult = {shipped: new Date()}; + const params = { + landed: landed, + addressFk: 121, + agencyModeFk: 7, + warehouseFk: 1 + }; + const serializedParams = $httpParamSerializer(params); + + $httpBackend.when('GET', `/api/Agencies/getShipped?${serializedParams}`).respond(200, expectedResult); + $httpBackend.expect('GET', `/api/Agencies/getShipped?${serializedParams}`); + controller.getShipped(params); + $httpBackend.flush(); + + expect(controller.shipped).toEqual(expectedResult.shipped); + expect(controller.landed).toEqual(landed); + }); + }); }); }); From 3b8f472f75d0f693cd0e11ac7200e025e727cfb6 Mon Sep 17 00:00:00 2001 From: Joan Sanchez Date: Fri, 4 Oct 2019 11:18:07 +0200 Subject: [PATCH 03/13] disabled autoload on stowaway model #1747 --- modules/ticket/front/descriptor/addStowaway.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ticket/front/descriptor/addStowaway.html b/modules/ticket/front/descriptor/addStowaway.html index 74554d2be..3efaedc8d 100644 --- a/modules/ticket/front/descriptor/addStowaway.html +++ b/modules/ticket/front/descriptor/addStowaway.html @@ -12,7 +12,7 @@
Stowaways to add
- + Ticket id From ee6a267ac8f94cb140cdc21317641c74def94cf1 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Fri, 4 Oct 2019 16:55:54 +0200 Subject: [PATCH 04/13] #1752 Fixes & CSS refactor --- back/models/account.js | 24 ++++--- front/core/components/date-picker/style.scss | 2 +- front/core/components/index.js | 1 + front/core/components/list/index.js | 1 + .../components/list/style.scss} | 0 front/salix/components/app/style.scss | 3 +- front/salix/components/descriptor/index.js | 1 + .../descriptor/style.scss} | 0 front/salix/components/index.js | 2 + .../salix/components/main-menu/main-menu.html | 2 +- front/salix/components/main-menu/main-menu.js | 9 ++- .../components/main-menu/main-menu.spec.js | 4 +- front/salix/components/summary/index.js | 1 + .../summary/style.scss} | 0 .../user-configuration-popover/index.html | 18 ++++- .../user-configuration-popover/locale/es.yml | 1 + .../user-configuration-popover/style.scss | 27 ++++++- front/salix/styles/background.scss | 2 +- front/salix/styles/display.scss | 35 --------- front/salix/styles/font-style.scss | 16 ----- front/salix/styles/index.js | 8 +-- front/salix/styles/misc.scss | 47 ++++++------ front/salix/styles/photo-list.scss | 1 + front/salix/styles/text.scss | 72 +++++++++++++++++++ front/salix/styles/title.scss | 28 -------- 25 files changed, 174 insertions(+), 131 deletions(-) create mode 100644 front/core/components/list/index.js rename front/{salix/styles/list.scss => core/components/list/style.scss} (100%) create mode 100644 front/salix/components/descriptor/index.js rename front/salix/{styles/descriptor.scss => components/descriptor/style.scss} (100%) create mode 100644 front/salix/components/summary/index.js rename front/salix/{styles/summary.scss => components/summary/style.scss} (100%) delete mode 100644 front/salix/styles/display.scss delete mode 100644 front/salix/styles/font-style.scss create mode 100644 front/salix/styles/text.scss delete mode 100644 front/salix/styles/title.scss diff --git a/back/models/account.js b/back/models/account.js index 40b7e9c12..9e6ecba45 100644 --- a/back/models/account.js +++ b/back/models/account.js @@ -23,15 +23,13 @@ module.exports = Self => { description: 'Gets the current user data', accepts: [ { - arg: 'context', - type: 'object', - http: function(ctx) { - return ctx; - } + arg: 'ctx', + type: 'Object', + http: {source: 'context'} } ], returns: { - type: 'object', + type: 'Object', root: true }, http: { @@ -41,12 +39,18 @@ module.exports = Self => { }); Self.getCurrentUserData = async function(ctx) { - let filter = {fields: ['name']}; let userId = ctx.req.accessToken.userId; - let account = await Self.findById(userId, filter); - let worker = await Self.app.models.Worker.findOne({where: {userFk: userId}, fields: ['id']}); - return {accountName: account.name, workerId: worker.id}; + let account = await Self.findById(userId, { + fields: ['id', 'name', 'nickname'] + }); + + let worker = await Self.app.models.Worker.findOne({ + fields: ['id'], + where: {userFk: userId} + }); + + return Object.assign(account, {workerId: worker.id}); }; /** diff --git a/front/core/components/date-picker/style.scss b/front/core/components/date-picker/style.scss index c982dba62..d33f27b5d 100644 --- a/front/core/components/date-picker/style.scss +++ b/front/core/components/date-picker/style.scss @@ -23,4 +23,4 @@ vn-date-picker { .flatpickr-weekdays, span.flatpickr-weekday { background-color: $color-main; -} \ No newline at end of file +} diff --git a/front/core/components/index.js b/front/core/components/index.js index 1cfb18dca..b6533d504 100644 --- a/front/core/components/index.js +++ b/front/core/components/index.js @@ -39,6 +39,7 @@ import './field'; import './input-number'; import './input-time'; import './input-file'; +import './list'; import './radio'; import './table'; import './td-editable'; diff --git a/front/core/components/list/index.js b/front/core/components/list/index.js new file mode 100644 index 000000000..423b033ce --- /dev/null +++ b/front/core/components/list/index.js @@ -0,0 +1 @@ +import './style.scss'; diff --git a/front/salix/styles/list.scss b/front/core/components/list/style.scss similarity index 100% rename from front/salix/styles/list.scss rename to front/core/components/list/style.scss diff --git a/front/salix/components/app/style.scss b/front/salix/components/app/style.scss index fa9f0706f..062205978 100644 --- a/front/salix/components/app/style.scss +++ b/front/salix/components/app/style.scss @@ -3,7 +3,8 @@ body { background-color: $color-bg; overflow: auto; - height: 100% + height: 100%; + font-family: vn-font; } vn-app { height: inherit; diff --git a/front/salix/components/descriptor/index.js b/front/salix/components/descriptor/index.js new file mode 100644 index 000000000..423b033ce --- /dev/null +++ b/front/salix/components/descriptor/index.js @@ -0,0 +1 @@ +import './style.scss'; diff --git a/front/salix/styles/descriptor.scss b/front/salix/components/descriptor/style.scss similarity index 100% rename from front/salix/styles/descriptor.scss rename to front/salix/components/descriptor/style.scss diff --git a/front/salix/components/index.js b/front/salix/components/index.js index a5ce18e4c..a61b037b0 100644 --- a/front/salix/components/index.js +++ b/front/salix/components/index.js @@ -7,3 +7,5 @@ import './side-menu/side-menu'; import './left-menu/left-menu'; import './topbar/topbar'; import './user-configuration-popover'; +import './descriptor'; +import './summary'; diff --git a/front/salix/components/main-menu/main-menu.html b/front/salix/components/main-menu/main-menu.html index 2e7d70c59..2b88da113 100644 --- a/front/salix/components/main-menu/main-menu.html +++ b/front/salix/components/main-menu/main-menu.html @@ -3,7 +3,7 @@ ng-click="$ctrl.openUserConfiguration($event)" id="user" class="unselectable"> - {{currentUserName}} + {{$root.user.nickname}} { - this.$.currentUserName = json.data.accountName; - window.localStorage.currentUserWorkerId = json.data.workerId; - }); + this.$http.get('/api/Accounts/getCurrentUserData').then(json => { + this.$.$root.user = json.data; + window.localStorage.currentUserWorkerId = json.data.workerId; + }); } openUserConfiguration(event) { diff --git a/front/salix/components/main-menu/main-menu.spec.js b/front/salix/components/main-menu/main-menu.spec.js index 5df681b4e..b695e2795 100644 --- a/front/salix/components/main-menu/main-menu.spec.js +++ b/front/salix/components/main-menu/main-menu.spec.js @@ -16,12 +16,12 @@ describe('Component vnMainMenu', () => { describe('getCurrentUserName()', () => { it(`should set the user name property in the controller`, () => { - $httpBackend.when('GET', `/api/Accounts/getCurrentUserData`).respond({accountName: 'Batman'}); + $httpBackend.when('GET', `/api/Accounts/getCurrentUserData`).respond({name: 'batman'}); $httpBackend.expect('GET', `/api/Accounts/getCurrentUserData`); controller.getCurrentUserName(); $httpBackend.flush(); - expect(controller.$.currentUserName).toEqual('Batman'); + expect(controller.$.$root.user.name).toEqual('batman'); }); }); }); diff --git a/front/salix/components/summary/index.js b/front/salix/components/summary/index.js new file mode 100644 index 000000000..423b033ce --- /dev/null +++ b/front/salix/components/summary/index.js @@ -0,0 +1 @@ +import './style.scss'; diff --git a/front/salix/styles/summary.scss b/front/salix/components/summary/style.scss similarity index 100% rename from front/salix/styles/summary.scss rename to front/salix/components/summary/style.scss diff --git a/front/salix/components/user-configuration-popover/index.html b/front/salix/components/user-configuration-popover/index.html index 8b83e2270..9e002150c 100644 --- a/front/salix/components/user-configuration-popover/index.html +++ b/front/salix/components/user-configuration-popover/index.html @@ -11,7 +11,23 @@ order="code"> - + +
+ +
+
+
+ {{$root.user.nickname}} +
+
+ {{$root.user.name}} +
+
+ + + +
+
.profile-card { + display: flex; + align-items: center; + + & > vn-icon { + font-size: 60px; + border-radius: 50%; + color: $color-font-dark; + background: $color-secondary; + padding: .1em; + } + & > div { + display: flex; + flex-direction: column; + justify-content: space-between; + flex: 1; + + & > .user { + max-width: 10em; + padding-bottom: .5em; + } + } + } } \ No newline at end of file diff --git a/front/salix/styles/background.scss b/front/salix/styles/background.scss index fe74c8291..93bf1a98c 100644 --- a/front/salix/styles/background.scss +++ b/front/salix/styles/background.scss @@ -8,4 +8,4 @@ } .item-disabled { opacity: $color-disabled; -} +} diff --git a/front/salix/styles/display.scss b/front/salix/styles/display.scss deleted file mode 100644 index 8c5827194..000000000 --- a/front/salix/styles/display.scss +++ /dev/null @@ -1,35 +0,0 @@ -.display-block { - display: block; -} - -.form-group { - margin-bottom: 15px; -} - -/* Label del popover */ -.popover-button { - padding: 3px 3px 3px 0px; - height: auto; - min-width: auto; -} - -.popover-label { - font-family: vn-font-bold; - color: black; - padding-top:5px; -} - -/* Icon cuadrado */ -.icon-square{ - min-width: 0px; - height: 46px; - line-height: 0px; -} - -input[type="submit"]:disabled, button:disabled { - opacity: 0.7; -} - -.descriptor-icon{ - font-size:60px; -} diff --git a/front/salix/styles/font-style.scss b/front/salix/styles/font-style.scss deleted file mode 100644 index 90960bb0f..000000000 --- a/front/salix/styles/font-style.scss +++ /dev/null @@ -1,16 +0,0 @@ -@import "./variables"; -@import "./font-family"; - -body { - color: $color-font; - font-family: vn-font; -} -html [uppercase], .uppercase { - text-transform: uppercase; -} -html [color-main], .color-main { - color: $color-main; -} -html [color-secondary], .color-secondary { - color: $color-secondary; -} diff --git a/front/salix/styles/index.js b/front/salix/styles/index.js index d4c026f9f..b6eebb716 100644 --- a/front/salix/styles/index.js +++ b/front/salix/styles/index.js @@ -1,18 +1,14 @@ import './responsive.scss'; -import './title.scss'; import './layout.scss'; -import './display.scss'; import './margin.scss'; import './padding.scss'; import './border.scss'; import './background.scss'; -import './font-style.scss'; +import './font-family.scss'; +import './text.scss'; import './misc.scss'; import './effects.scss'; import './order-product.scss'; -import './summary.scss'; -import './descriptor.scss'; -import './list.scss'; import './modal-form.scss'; import './photo-list.scss'; import './width.scss'; diff --git a/front/salix/styles/misc.scss b/front/salix/styles/misc.scss index 4ecd4fbd6..5bc3d54db 100644 --- a/front/salix/styles/misc.scss +++ b/front/salix/styles/misc.scss @@ -60,24 +60,6 @@ html [fixed-bottom-right] { bottom: 2em; right: 2em; } -html [text-center], .text-center { - text-align: center; -} -html [text-right], .text-right { - text-align: right; -} -html [text-left], .text-left { - text-align: left; -} -html [vn-right], .vn-right { - float: right; -} -html [vn-left], .vn-left { - float: left; -} -html [vn-center], .vn-center { - justify-content: center; -} .list > vn-none { min-width: 60px; } @@ -89,9 +71,6 @@ html [vn-center], .vn-center { color: $color-main; } } -.flatpickr-month, .flatpickr-weekdays, span.flatpickr-weekday { - background-color: $color-main; -} html [pointer], .pointer{ cursor: pointer; } @@ -112,6 +91,9 @@ vn-tool-bar { margin-right: .6em; } } +input[type="submit"]:disabled, button:disabled { + opacity: 0.7; +} /** START - FORM ELEMENTS DISABLED **/ @@ -197,4 +179,25 @@ vn-empty-rows { text-align: center; padding: 1.5em; box-sizing: border-box; -} \ No newline at end of file +} + +/* XXX: Deprecated, use classes with text prefix */ + +[color-main] { + color: $color-main; +} +[color-secondary] { + color: $color-secondary; +} +[uppercase], .uppercase { + text-transform: uppercase; +} +html [text-center], .text-center { + text-align: center; +} +html [text-right], .text-right { + text-align: right; +} +html [text-left], .text-left { + text-align: left; +} diff --git a/front/salix/styles/photo-list.scss b/front/salix/styles/photo-list.scss index b4e6ec698..da3e460ba 100644 --- a/front/salix/styles/photo-list.scss +++ b/front/salix/styles/photo-list.scss @@ -1,4 +1,5 @@ @import "./variables"; + .photo-list { justify-content: center; align-items: flex-start; diff --git a/front/salix/styles/text.scss b/front/salix/styles/text.scss new file mode 100644 index 000000000..bb82fa2a0 --- /dev/null +++ b/front/salix/styles/text.scss @@ -0,0 +1,72 @@ +@import "./variables"; +@import "./font-family"; + +/* Headings */ + +.text-h1, h1 { + font-size: 32pt; +} +.text-h2, h2 { + font-size: 28pt; +} +.text-h3, h3 { + font-size: 24pt; +} +.text-h4, h4 { + font-size: 20pt; +} +.text-h5, h5 { + font-size: 16pt; +} +.text-h6, h6 { + font-size: 14pt; +} +.text-subtitle1 { + font-size: 13pt; +} +.text-subtitle2 { + font-size: 12pt; +} +.text-body1 { + font-size: 11pt; +} +.text-body2 { + font-size: 11pt; +} +.text-caption { + font-size: 11pt; +} +.text-overline { + font-size: 10pt; +} + +h1, h2, h3, h4, h5, h6 { + padding: 0; + margin-top: 0; + margin-bottom: .2em; + font-family: vn-font-bold; +} + +/* Colors */ + +.text-primary { + color: $color-font; +} +.text-secondary { + color: $color-font-secondary; +} + +/* Helpers */ + +.text-uppercase { + text-transform: uppercase; +} +.text-center { + text-align: center; +} +.text-right { + text-align: right; +} +.text-left { + text-align: left; +} diff --git a/front/salix/styles/title.scss b/front/salix/styles/title.scss deleted file mode 100644 index 53a1c2c54..000000000 --- a/front/salix/styles/title.scss +++ /dev/null @@ -1,28 +0,0 @@ -@import "./variables"; - -h1 { - font-size: 32pt; -} -h2 { - font-size: 28pt; -} -h3 { - font-size: 24pt; -} -h4 { - font-size: 20pt; -} -h5 { - font-size: 16pt; -} -h6 { - font-size: 12pt; -} - -h1, h2, h3, h4, h5, h6 { - padding: 0; - margin-top: 0; - margin-bottom: .2em; - font-family: vn-font-bold; - color: $color-font -} \ No newline at end of file From f8ef70b0bba6640eb01a2a0740adfc256fb6953d Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Fri, 4 Oct 2019 17:11:27 +0200 Subject: [PATCH 05/13] #1752 Fixes --- front/salix/components/user-configuration-popover/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/front/salix/components/user-configuration-popover/index.html b/front/salix/components/user-configuration-popover/index.html index 9e002150c..352a9acb6 100644 --- a/front/salix/components/user-configuration-popover/index.html +++ b/front/salix/components/user-configuration-popover/index.html @@ -23,7 +23,7 @@ {{$root.user.name}} - + From 4fa532abb895c8909faa8aaf1f42d0acd691aa7b Mon Sep 17 00:00:00 2001 From: Carlos Jimenez Ruiz Date: Fri, 4 Oct 2019 17:49:51 +0200 Subject: [PATCH 06/13] #1744 ticket.index ocultar columnas expendables --- modules/item/front/last-entries/style.scss | 2 +- modules/ticket/front/index/index.html | 12 ++++++------ modules/ticket/front/index/style.scss | 6 ++++++ 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/modules/item/front/last-entries/style.scss b/modules/item/front/last-entries/style.scss index c2e03b6ed..63ffcb35b 100644 --- a/modules/item/front/last-entries/style.scss +++ b/modules/item/front/last-entries/style.scss @@ -21,7 +21,7 @@ vn-item-last-entries { } } @media screen and (max-width: 1440px) { - .expendable{ + .expendable { display: none; } } diff --git a/modules/ticket/front/index/index.html b/modules/ticket/front/index/index.html index 0f70dea40..acfa6057d 100644 --- a/modules/ticket/front/index/index.html +++ b/modules/ticket/front/index/index.html @@ -42,15 +42,15 @@ Id - Salesperson + Salesperson Date Hour Alias - Province + Province State Agency Warehouse - Invoice + Invoice Closure Total @@ -93,7 +93,7 @@ {{::ticket.id}} - + @@ -113,7 +113,7 @@ {{::ticket.nickname}} - {{::ticket.province}} + {{::ticket.province}} {{::ticket.state}} @@ -121,7 +121,7 @@ {{::ticket.agencyMode}} {{::ticket.warehouse}} - {{::ticket.refFk | dashIfEmpty}} + {{::ticket.refFk | dashIfEmpty}} {{::ticket.zoneLanding | dateTime: 'HH:mm'}} diff --git a/modules/ticket/front/index/style.scss b/modules/ticket/front/index/style.scss index ccf913ff5..7fed21006 100644 --- a/modules/ticket/front/index/style.scss +++ b/modules/ticket/front/index/style.scss @@ -13,4 +13,10 @@ vn-ticket-index { vn-searchbar { width: 100% } + + @media screen and (max-width: 1440px) { + .expendable { + display: none; + } + } } \ No newline at end of file From b12a6666535cd46da9b74a1fc5da65edba887555 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Sat, 5 Oct 2019 00:16:57 +0200 Subject: [PATCH 07/13] CSS padding/margin refactor, glob styles in core --- front/core/components/data-viewer/index.html | 2 +- front/core/components/label-value/style.scss | 3 - front/core/components/list/style.scss | 2 +- front/core/components/searchbar/style.scss | 2 +- front/core/components/subtitle/subtitle.html | 2 +- front/core/components/title/title.html | 2 +- front/core/directives/uvc.html | 4 +- front/core/directives/zoom-image.js | 8 +- .../{styles => directives}/zoom-image.scss | 6 +- front/{salix => core}/styles/background.scss | 0 front/{salix => core}/styles/border.scss | 0 front/{salix => core}/styles/effects.scss | 1 - front/{salix => core}/styles/font-family.scss | 6 + .../styles/fonts/Roboto-Bold.ttf | Bin .../styles/fonts/Roboto-Medium.ttf | Bin .../styles/fonts/Roboto-Regular.ttf | Bin .../{ => icons}/Material-Design-Icons.woff2 | Bin front/core/styles/{ => icons}/salixfont.css | 0 front/core/styles/{ => icons}/salixfont.svg | 0 front/core/styles/{ => icons}/salixfont.ttf | Bin front/core/styles/{ => icons}/salixfont.woff | Bin front/core/styles/index.js | 13 +- front/{salix => core}/styles/layout.scss | 5 - front/core/styles/mdi-override.css | 6 - front/core/styles/mdl-override.scss | 67 ++-- front/{salix => core}/styles/responsive.scss | 0 front/core/styles/spacing.scss | 355 ++++++++++++++++++ front/{salix => core}/styles/text.scss | 0 front/{salix => core}/styles/variables.scss | 22 +- front/{salix => core}/styles/width.scss | 0 front/salix/components/app/style.scss | 3 +- front/salix/components/descriptor/style.scss | 10 +- .../salix/components/left-menu/left-menu.html | 2 +- .../salix/components/main-menu/main-menu.html | 2 +- front/salix/components/summary/style.scss | 8 +- .../user-configuration-popover/index.html | 6 +- front/salix/styles/index.js | 12 +- front/salix/styles/margin.scss | 138 ------- front/salix/styles/misc.scss | 24 +- front/salix/styles/modal-form.scss | 24 +- front/salix/styles/order-product.scss | 10 +- front/salix/styles/padding.scss | 85 ----- front/salix/styles/photo-list.scss | 3 +- modules/agency/front/basic-data/index.html | 2 +- modules/agency/front/calendar/index.html | 4 +- modules/agency/front/create/index.html | 2 +- modules/agency/front/delivery-days/index.html | 4 +- modules/agency/front/edit/index.html | 2 +- modules/agency/front/events/index.html | 6 +- modules/agency/front/events/style.scss | 4 +- modules/agency/front/index/index.html | 6 +- .../front/location-search-panel/index.html | 2 +- modules/agency/front/location/index.html | 4 +- modules/agency/front/main/style.scss | 2 +- modules/agency/front/search-panel/index.html | 2 +- modules/agency/front/summary/index.html | 2 +- modules/claim/front/action/index.html | 6 +- modules/claim/front/basic-data/index.html | 6 +- modules/claim/front/detail/index.html | 10 +- modules/claim/front/development/index.html | 6 +- modules/claim/front/dms/index/style.scss | 4 +- modules/claim/front/index/index.html | 5 +- modules/claim/front/search-panel/index.html | 2 +- .../client/front/address/create/index.html | 12 +- modules/client/front/address/edit/index.html | 12 +- modules/client/front/address/index/index.html | 11 +- modules/client/front/address/index/style.scss | 2 +- .../client/front/balance/create/index.html | 4 +- modules/client/front/balance/index/index.html | 2 +- modules/client/front/basic-data/index.html | 2 +- modules/client/front/billing-data/index.html | 10 +- modules/client/front/contact/index.html | 4 +- modules/client/front/create/index.html | 16 +- .../front/credit-insurance/create/index.html | 2 +- .../front/credit-insurance/index/index.html | 10 +- .../insurance/create/index.html | 2 +- .../insurance/index/index.html | 2 +- modules/client/front/credit/create/index.html | 2 +- modules/client/front/dms/create/index.html | 8 +- modules/client/front/dms/edit/index.html | 8 +- modules/client/front/fiscal-data/index.html | 10 +- modules/client/front/greuge/create/index.html | 2 +- modules/client/front/greuge/index/index.html | 2 +- modules/client/front/index/index.html | 4 +- modules/client/front/note/create/index.html | 2 +- modules/client/front/note/index/index.html | 9 +- modules/client/front/postcode/index.html | 2 +- .../client/front/recovery/create/index.html | 2 +- modules/client/front/sample/create/index.html | 2 +- modules/client/front/search-panel/index.html | 2 +- modules/client/front/sms/index.html | 2 +- modules/client/front/web-access/index.html | 4 +- modules/invoiceOut/front/index/index.html | 5 +- .../invoiceOut/front/search-panel/index.html | 2 +- modules/item/front/barcode/index.html | 2 +- modules/item/front/basic-data/index.html | 2 +- modules/item/front/botanical/index.html | 2 +- modules/item/front/create/index.html | 2 +- modules/item/front/diary/index.html | 2 +- modules/item/front/index/index.html | 5 +- modules/item/front/last-entries/index.html | 2 +- modules/item/front/niche/index.html | 2 +- .../front/request-search-panel/index.html | 4 +- modules/item/front/request/index.html | 10 +- modules/item/front/search-panel/index.html | 4 +- modules/item/front/tags/index.html | 2 +- modules/item/front/tax/index.html | 2 +- modules/order/front/basic-data/index.html | 2 +- .../front/catalog-search-panel/index.html | 4 +- modules/order/front/catalog/index.html | 6 +- modules/order/front/catalog/style.scss | 6 +- modules/order/front/create/index.html | 2 +- modules/order/front/filter/style.scss | 12 +- modules/order/front/index/index.html | 5 +- modules/order/front/line/index.html | 2 +- modules/order/front/prices-popover/index.html | 2 +- modules/order/front/search-panel/index.html | 2 +- modules/order/front/volume/index.html | 2 +- modules/route/front/basic-data/index.html | 2 +- modules/route/front/create/index.html | 2 +- modules/route/front/index/index.html | 6 +- modules/route/front/search-panel/index.html | 2 +- modules/route/front/tickets/index.html | 4 +- .../front/basic-data/step-one/index.html | 2 +- .../front/basic-data/step-three/index.html | 2 +- .../front/basic-data/step-two/index.html | 2 +- modules/ticket/front/component/index.html | 2 +- modules/ticket/front/create/index.html | 2 +- .../ticket/front/descriptor/addStowaway.html | 4 +- modules/ticket/front/descriptor/index.html | 2 +- .../front/descriptor/removeStowaway.html | 4 +- modules/ticket/front/dms/create/index.html | 8 +- modules/ticket/front/dms/edit/index.html | 8 +- modules/ticket/front/dms/index/index.html | 2 +- modules/ticket/front/expedition/index.html | 4 +- modules/ticket/front/index/index.html | 5 +- modules/ticket/front/note/index.html | 8 +- modules/ticket/front/package/index.html | 4 +- modules/ticket/front/picture/index.html | 2 +- .../ticket/front/request/create/index.html | 4 +- modules/ticket/front/request/index/index.html | 2 +- modules/ticket/front/sale-checked/index.html | 2 +- modules/ticket/front/sale-tracking/index.html | 2 +- modules/ticket/front/sale/editDiscount.html | 4 +- modules/ticket/front/sale/index.html | 14 +- modules/ticket/front/search-panel/index.html | 2 +- modules/ticket/front/services/index.html | 10 +- modules/ticket/front/tracking/edit/index.html | 2 +- .../ticket/front/tracking/index/index.html | 2 +- modules/ticket/front/volume/index.html | 2 +- modules/ticket/front/weekly/create/index.html | 2 +- modules/ticket/front/weekly/index/index.html | 6 +- modules/travel/front/index/index.html | 5 +- modules/travel/front/search-panel/index.html | 2 +- modules/worker/front/account/index.html | 33 ++ modules/worker/front/basic-data/index.html | 2 +- modules/worker/front/calendar/index.html | 4 +- modules/worker/front/calendar/style.scss | 2 +- modules/worker/front/department/index.html | 6 +- modules/worker/front/index/index.html | 4 +- modules/worker/front/pbx/index.html | 2 +- modules/worker/front/search-panel/index.html | 2 +- modules/worker/front/summary/index.html | 2 +- modules/worker/front/time-control/index.html | 8 +- webpack.config.js | 2 +- 165 files changed, 765 insertions(+), 599 deletions(-) rename front/core/{styles => directives}/zoom-image.scss (100%) rename front/{salix => core}/styles/background.scss (100%) rename front/{salix => core}/styles/border.scss (100%) rename front/{salix => core}/styles/effects.scss (99%) rename front/{salix => core}/styles/font-family.scss (58%) rename front/{salix => core}/styles/fonts/Roboto-Bold.ttf (100%) rename front/{salix => core}/styles/fonts/Roboto-Medium.ttf (100%) rename front/{salix => core}/styles/fonts/Roboto-Regular.ttf (100%) rename front/core/styles/{ => icons}/Material-Design-Icons.woff2 (100%) rename front/core/styles/{ => icons}/salixfont.css (100%) rename front/core/styles/{ => icons}/salixfont.svg (100%) rename front/core/styles/{ => icons}/salixfont.ttf (100%) rename front/core/styles/{ => icons}/salixfont.woff (100%) rename front/{salix => core}/styles/layout.scss (89%) delete mode 100644 front/core/styles/mdi-override.css rename front/{salix => core}/styles/responsive.scss (100%) create mode 100644 front/core/styles/spacing.scss rename front/{salix => core}/styles/text.scss (100%) rename front/{salix => core}/styles/variables.scss (92%) rename front/{salix => core}/styles/width.scss (100%) delete mode 100644 front/salix/styles/margin.scss delete mode 100644 front/salix/styles/padding.scss create mode 100644 modules/worker/front/account/index.html diff --git a/front/core/components/data-viewer/index.html b/front/core/components/data-viewer/index.html index dd696fda3..8c843d869 100644 --- a/front/core/components/data-viewer/index.html +++ b/front/core/components/data-viewer/index.html @@ -2,7 +2,7 @@
+ class="vn-pt-md">
section { content: ':'; } } - & > span { - color: $color-font; - } & > vn-icon { vertical-align: middle; color: $color-font-secondary; diff --git a/front/core/components/list/style.scss b/front/core/components/list/style.scss index 3a6d0d6d9..7560d3288 100644 --- a/front/core/components/list/style.scss +++ b/front/core/components/list/style.scss @@ -14,7 +14,7 @@ color: inherit; & > vn-horizontal { - padding: $pad-medium; + padding: $spacing-md; & > vn-one { overflow: hidden; diff --git a/front/core/components/searchbar/style.scss b/front/core/components/searchbar/style.scss index e663f7cb9..3915c2089 100644 --- a/front/core/components/searchbar/style.scss +++ b/front/core/components/searchbar/style.scss @@ -13,6 +13,6 @@ vn-searchbar { max-height: 48em; & > form { - padding: $pad-large; + padding: $spacing-lg; } } \ No newline at end of file diff --git a/front/core/components/subtitle/subtitle.html b/front/core/components/subtitle/subtitle.html index ac00ac0c2..40c244006 100644 --- a/front/core/components/subtitle/subtitle.html +++ b/front/core/components/subtitle/subtitle.html @@ -1,2 +1,2 @@ -
+
\ No newline at end of file diff --git a/front/core/components/title/title.html b/front/core/components/title/title.html index 773b40040..cfdad746f 100644 --- a/front/core/components/title/title.html +++ b/front/core/components/title/title.html @@ -1,3 +1,3 @@ -

+

\ No newline at end of file diff --git a/front/core/directives/uvc.html b/front/core/directives/uvc.html index 0248aefc1..907ea6f2a 100644 --- a/front/core/directives/uvc.html +++ b/front/core/directives/uvc.html @@ -8,10 +8,10 @@ class="modal-form" vn-id="uvc"> - +
Fields to show
-
+
.body { - padding: $pad-small; + padding: $spacing-sm; & > * { - padding: $pad-small; + padding: $spacing-sm; } & > .attributes > h5 { - padding-bottom: $pad-small; + padding-bottom: $spacing-sm; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; @@ -45,7 +45,7 @@ padding: 0; & > vn-icon { - padding: $pad-small; + padding: $spacing-sm; color: $color-secondary; font-size: 1.5em; @@ -62,7 +62,7 @@ padding: 0; & > a { - padding: $pad-small; + padding: $spacing-sm; & > vn-icon { font-size: 1.8em; diff --git a/front/salix/components/left-menu/left-menu.html b/front/salix/components/left-menu/left-menu.html index 31dcb7903..12cea49a3 100644 --- a/front/salix/components/left-menu/left-menu.html +++ b/front/salix/components/left-menu/left-menu.html @@ -1,4 +1,4 @@ -
-