{{_.title}}
-- {{clientName}} -
-{{clientName}}
-- {{_.agencyContact}} -
-- {{{_.agencyContactData}}} -
-diff --git a/back/model-config.json b/back/model-config.json index 3140d7cd3..d7c5410ad 100644 --- a/back/model-config.json +++ b/back/model-config.json @@ -37,5 +37,8 @@ }, "WorkerTeamCollegues": { "dataSource": "vn" + }, + "Sip": { + "dataSource": "vn" } } \ No newline at end of file diff --git a/back/models/sip.json b/back/models/sip.json new file mode 100644 index 000000000..de6af8ad8 --- /dev/null +++ b/back/models/sip.json @@ -0,0 +1,38 @@ +{ + "name": "Sip", + "base": "VnModel", + "options": { + "mysql": { + "table": "pbx.sip" + } + }, + "properties": { + "code": { + "type": "Number", + "id": true, + "mysql": { + "columnName": "extension" + } + }, + "password": { + "type": "string", + "mysql": { + "columnName": "secret" + } + }, + "name": { + "type": "string", + "mysql": { + "columnName": "caller_id" + } + } + }, + "relations": { + "user": { + "type": "belongsTo", + "model": "Account", + "foreignKey": "user_id" + } + } +} + \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 497803c4c..2d5c8cb33 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -19,13 +19,4 @@ services: - NODE_ENV volumes: - /containers/salix:/etc/salix - - /mnt/storage/pdfs:/var/lib/salix/pdfs - mailer: - image: registry.verdnatura.es/salix-mailer:${TAG} - restart: unless-stopped - build: - context: services/mailer - environment: - - NODE_ENV - volumes: - - /containers/vn-mailer:/etc/vn-mailer \ No newline at end of file + - /mnt/storage/pdfs:/var/lib/salix/pdfs \ No newline at end of file diff --git a/e2e/helpers/nightmare.js b/e2e/helpers/nightmare.js index 62a408d21..f88396fbf 100644 --- a/e2e/helpers/nightmare.js +++ b/e2e/helpers/nightmare.js @@ -2,12 +2,19 @@ import Nightmare from 'nightmare'; export default function createNightmare(width = 1280, height = 720) { - const nightmare = new Nightmare({show: process.env.E2E_SHOW, typeInterval: 10, x: 0, y: 0, waitTimeout: 2000}) - .viewport(width, height); + const nightmare = new Nightmare({ + show: process.env.E2E_SHOW, + typeInterval: 10, + x: 0, + y: 0, + waitTimeout: 2000 + }).viewport(width, height); - nightmare.on('console', (type, message) => { + nightmare.on('console', (type, message, ...args) => { if (type === 'error') fail(message); + else + console[type](message, ...args); }); nightmare.header('Accept-Language', 'en'); diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index d7cb35447..932ecc845 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -35,7 +35,7 @@ export default { cancelButton: `vn-button[href="#!/client/index"]` }, clientDescriptor: { - moreMenu: `vn-client-descriptor > vn-card > div vn-icon-menu > div > vn-icon`, + moreMenu: `vn-client-descriptor vn-icon-menu > div > vn-icon`, simpleTicketButton: 'vn-client-descriptor vn-popover > div > div.content > div > div.list > ul > li' }, clientBasicData: { @@ -189,7 +189,7 @@ export default { cancelButton: `button[ui-sref="item.index"]` }, itemDescriptor: { - moreMenu: `vn-item-descriptor > vn-card > div vn-icon-menu > div > vn-icon`, + moreMenu: `vn-item-descriptor vn-icon-menu > div > vn-icon`, moreMenuRegularizeButton: `vn-item-descriptor vn-icon-menu > div > vn-drop-down > vn-popover ul > li:nth-child(1)`, regularizeQuantityInput: `vn-item-descriptor > vn-dialog > div > form > div.body > tpl-body > div > vn-textfield > div > div > div.infix > input`, regularizeWarehouseAutocomplete: `#warehouse`, @@ -303,7 +303,7 @@ export default { createButton: `${components.vnSubmit}` }, ticketDescriptor: { - moreMenu: `vn-ticket-descriptor > vn-card > div vn-icon-menu > div > vn-icon`, + moreMenu: `vn-ticket-descriptor vn-icon-menu > div > vn-icon`, moreMenuAddToTurn: `vn-ticket-descriptor vn-icon-menu > div > vn-drop-down > vn-popover ul > li:nth-child(1)`, moreMenuDeleteTicket: `vn-ticket-descriptor vn-icon-menu > div > vn-drop-down > vn-popover ul > li:nth-child(2)`, acceptDeleteTicketButton: `vn-ticket-descriptor button[response="ACCEPT"]`, @@ -338,7 +338,7 @@ export default { saleDescriptorPopover: 'vn-ticket-sale vn-item-descriptor-popover > vn-popover', saleDescriptorPopoverSummaryButton: 'vn-item-descriptor-popover a[href="#!/item/1/summary"]', saleButton: `vn-left-menu a[ui-sref="ticket.card.sale"]`, - descriptorItemDiaryButton: `vn-item-descriptor > vn-card > div > vn-horizontal.quicklinks.ng-scope > vn-horizontal > a > vn-icon > i`, + descriptorItemDiaryButton: `vn-item-descriptor .quicklinks.ng-scope > vn-horizontal > a > vn-icon > i`, newItemButton: 'vn-float-button[icon="add"]', firstSaleText: `vn-table div > vn-tbody > vn-tr:nth-child(1)`, firstSaleThumbnailImage: 'vn-ticket-sale:nth-child(1) vn-td:nth-child(3) > img', diff --git a/e2e/paths/item-module/09_regularize_item.spec.js b/e2e/paths/item-module/09_regularize_item.spec.js index fa1f98449..07ceb4e62 100644 --- a/e2e/paths/item-module/09_regularize_item.spec.js +++ b/e2e/paths/item-module/09_regularize_item.spec.js @@ -145,10 +145,10 @@ describe('Item regularize path', () => { expect(url.hash).toEqual('#!/ticket/index'); }); - it('should search for the ticket with id 22 once again', async() => { + it('should search for the ticket with id 23 once again', async() => { const result = await nightmare .wait(selectors.ticketsIndex.searchTicketInput) - .type(selectors.ticketsIndex.searchTicketInput, 'id:22') + .type(selectors.ticketsIndex.searchTicketInput, 'id:23') .click(selectors.ticketsIndex.searchButton) .waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1) .countElement(selectors.ticketsIndex.searchResult); @@ -158,7 +158,7 @@ describe('Item regularize path', () => { it(`should now click on the search result to access to the ticket summary`, async() => { const url = await nightmare - .waitForTextInElement(selectors.ticketsIndex.searchResult, '22') + .waitForTextInElement(selectors.ticketsIndex.searchResult, '23') .waitToClick(selectors.ticketsIndex.searchResult) .waitForURL('/summary') .parsedUrl(); diff --git a/front/core/components/array-model/array-model.js b/front/core/components/array-model/array-model.js index 00f7ea9a4..e1bbb7eea 100644 --- a/front/core/components/array-model/array-model.js +++ b/front/core/components/array-model/array-model.js @@ -154,7 +154,7 @@ export default class ArrayModel extends ModelProxy { let aType = typeof a; - if (aType === typeof b) + if (aType === typeof b) { switch (aType) { case 'string': return a.localeCompare(b); @@ -166,6 +166,7 @@ export default class ArrayModel extends ModelProxy { if (a instanceof Date && b instanceof Date) return a.getTime() - b.getTime(); } + } if (a === undefined) return -1; @@ -183,11 +184,12 @@ export default class ArrayModel extends ModelProxy { let mergedWhere = []; let wheres = [dst.where, src.where]; - for (let where of wheres) + for (let where of wheres) { if (Array.isArray(where)) mergedWhere = mergedWhere.concat(where); else if (where) mergedWhere.push(where); + } switch (mergedWhere.length) { case 0: diff --git a/front/core/components/button-menu/button-menu.html b/front/core/components/button-menu/button-menu.html index a4a46f7fe..80323a9d9 100644 --- a/front/core/components/button-menu/button-menu.html +++ b/front/core/components/button-menu/button-menu.html @@ -1,13 +1,13 @@
\ No newline at end of file diff --git a/front/core/components/button-menu/button-menu.js b/front/core/components/button-menu/button-menu.js index dd9b5b133..41f26cfbe 100644 --- a/front/core/components/button-menu/button-menu.js +++ b/front/core/components/button-menu/button-menu.js @@ -8,6 +8,7 @@ export default class ButtonMenu extends Input { super($element, $scope); this.$transclude = $transclude; this.input = this.element.querySelector('.mdl-button'); + $element.on('click', e => this.onClick(e)); } get model() { @@ -42,11 +43,16 @@ export default class ButtonMenu extends Input { } onClick(event) { + if (event.defaultPrevented) return; event.preventDefault(); this.emit('open'); this.showDropDown(); } + onDropDownClick(event) { + event.preventDefault(); + } + onDropDownSelect(value) { this.field = value; this.emit('change', {value}); @@ -70,7 +76,7 @@ export default class ButtonMenu extends Input { 'limit', 'searchFunction' ]); - this.$.dropDown.show(this.input); + this.$.dropDown.show(this.element); } } ButtonMenu.$inject = ['$element', '$scope', '$transclude']; diff --git a/front/core/components/button-menu/style.scss b/front/core/components/button-menu/style.scss index 740822cde..53dbb963a 100644 --- a/front/core/components/button-menu/style.scss +++ b/front/core/components/button-menu/style.scss @@ -1,17 +1,19 @@ -vn-button-menu{ +vn-button-menu { position: relative; + cursor: pointer; + .button-menu__button { padding: 0 10px; } - vn-label{ + vn-label { float: left; margin-top: 1px; } - vn-icon{ + vn-icon { float: left; margin-top: 3px; } - vn-icon.button-menu__arrow_down{ + vn-icon.button-menu__arrow_down { margin: 6px 0 0 5px; } } \ No newline at end of file diff --git a/front/core/components/drop-down/drop-down.js b/front/core/components/drop-down/drop-down.js index c24f1c8c6..123df1994 100755 --- a/front/core/components/drop-down/drop-down.js +++ b/front/core/components/drop-down/drop-down.js @@ -110,8 +110,8 @@ export default class DropDown extends Component { show(parent, search) { this._activeOption = -1; this.search = search; - this.buildList(); this.$.popover.show(parent || this.parent); + this.buildList(); } /** @@ -218,6 +218,7 @@ export default class DropDown extends Component { } onLoadMoreClick(event) { + if (event.defaultPrevented) return; event.preventDefault(); this.model.loadMore(); } @@ -225,7 +226,10 @@ export default class DropDown extends Component { onContainerClick(event) { if (event.defaultPrevented) return; let index = getPosition(this.ul, event); - if (index != -1) this.selectOption(index); + if (index != -1) { + event.preventDefault(); + this.selectOption(index); + } } onDocKeyDown(event) { diff --git a/front/core/components/icon-menu/icon-menu.html b/front/core/components/icon-menu/icon-menu.html index 8ace39c5d..f59f24125 100644 --- a/front/core/components/icon-menu/icon-menu.html +++ b/front/core/components/icon-menu/icon-menu.html @@ -1,14 +1,11 @@ \ No newline at end of file diff --git a/front/core/components/icon-menu/style.scss b/front/core/components/icon-menu/style.scss index 154196508..06f66127f 100644 --- a/front/core/components/icon-menu/style.scss +++ b/front/core/components/icon-menu/style.scss @@ -1,4 +1,6 @@ vn-icon-menu { + cursor: pointer; + vn-drop-down { font-family: 'vn-font' } diff --git a/front/core/components/popover/style.scss b/front/core/components/popover/style.scss index b44554439..b912adb9d 100644 --- a/front/core/components/popover/style.scss +++ b/front/core/components/popover/style.scss @@ -6,6 +6,7 @@ left: 0; right: 0; bottom: 0; + color: initial; opacity: 0; transform: translateY(-.6em); diff --git a/front/salix/components/app/style.scss b/front/salix/components/app/style.scss index 0ae9895bf..e66b46634 100644 --- a/front/salix/components/app/style.scss +++ b/front/salix/components/app/style.scss @@ -12,7 +12,7 @@ vn-app { top: 0; left: 0; width: 100%; - z-index: 1; + z-index: 5; box-shadow: 0 .1em .2em rgba(1, 1, 1, .2); .logo { @@ -27,5 +27,29 @@ vn-app { } .main-view { padding-top: 4em; + + vn-main-block { + display: block; + margin: 0 auto; + padding-left: 16em; + + .left-block { + position: fixed; + z-index: 5; + top: 4em; + left: 0; + bottom: 0; + width: 16em; + min-width: 16em; + background-color: white; + box-shadow: 0 .1em .2em rgba(1, 1, 1, .2); + overflow: auto; + } + .right-block { + width: 16em; + min-width: 16em; + padding-left: 1em; + } + } } } diff --git a/front/salix/styles/descriptor.scss b/front/salix/styles/descriptor.scss new file mode 100644 index 000000000..18f08adf6 --- /dev/null +++ b/front/salix/styles/descriptor.scss @@ -0,0 +1,74 @@ + +@import "./effects"; +@import "./colors"; +@import "./padding"; + +.vn-descriptor { + box-shadow: 0 .1em .2em rgba(1, 1, 1, .2); + + & > .header { + display: flex; + background: $main-01; + color: white; + justify-content: space-between; + align-items: stretch; + color: white; + + & > * { + min-width: 1.8em; + @extend %clickable; + display: flex; + align-items: center; + justify-content: center; + padding: .5em; + + & > vn-icon { + font-size: 1.8em; + } + } + } + & > .body { + @extend .pad-small; + + & > * { + @extend .pad-small; + } + & > .icons { + display: flex; + align-items: center; + justify-content: center; + padding: 0; + + & > vn-icon { + @extend .pad-small; + color: #666; + opacity: .4; + font-size: 1.5em; + + &.bright { + color: $main-01; + opacity: 1; + } + } + } + & > .quicklinks { + display: flex; + align-items: center; + justify-content: center; + padding: 0; + + & > a { + @extend .pad-small; + + & > vn-icon { + font-size: 1.8em; + padding: 0; + + & > i { + line-height: 36px + } + } + } + } + } +} \ No newline at end of file diff --git a/front/salix/styles/index.js b/front/salix/styles/index.js index d80763912..9e0d1ee49 100644 --- a/front/salix/styles/index.js +++ b/front/salix/styles/index.js @@ -7,7 +7,8 @@ import './background.scss'; import './border.scss'; import './font-style.scss'; import './misc.scss'; -import './summary.scss'; import './colors.scss'; import './effects.scss'; import './order-product.scss'; +import './summary.scss'; +import './descriptor.scss'; diff --git a/front/salix/styles/misc.scss b/front/salix/styles/misc.scss index edca86f95..851936e6e 100644 --- a/front/salix/styles/misc.scss +++ b/front/salix/styles/misc.scss @@ -161,91 +161,6 @@ vn-tool-bar { } } -vn-main-block { - display: block; - margin: 0 auto; - - .left-block { - position: fixed; - z-index: 1; - top: 4em; - left: 0; - bottom: 0; - width: 16em; - min-width: 16em; - background-color: white; - box-shadow: 0 .1em .2em rgba(1, 1, 1, .2); - overflow: auto; - } - & > vn-horizontal > vn-one > [ui-view] { - padding-left: 16em; - } - .right-block { - width: 16em; - min-width: 16em; - padding-left: 1em; - } -} - -.vn-descriptor { - .header { - background: $main-01; - color: white; - justify-content: space-between; - align-items: stretch; - - & > vn-icon { - padding: .1em; - font-size: 2.5em; - } - & > a , & > vn-icon-menu { - @extend %clickable; - display: flex; - align-items: center; - padding: .5em; - color: white; - text-decoration: none; - - & > vn-icon { - font-size: 1.8em; - } - - & vn-drop-down{ - color: initial; - } - } - } - .footer { - text-align: center; - & > vn-icon { - color: #666; - opacity: .4; - padding: 0 5% 0 5%; - font-size: 1.5em; - } - & > vn-icon.bright { - color: $main-01; - opacity: 1; - } - } - - .quicklinks { - justify-content: center; - align-items: center; - - & > a { - & > vn-icon { - font-size: 1.8em; - padding: 0; - } - - & > vn-icon i { - line-height: 36px - } - } - } -} - .vn-list { max-width: 36em; margin: 0 auto; diff --git a/front/salix/styles/summary.scss b/front/salix/styles/summary.scss index d636f4c29..70fda5461 100644 --- a/front/salix/styles/summary.scss +++ b/front/salix/styles/summary.scss @@ -48,15 +48,6 @@ } vn-label-value > section { margin-bottom: .3em; - - & > vn-label { - display: block; - font-size: .9em; - - &::after { - content: initial; - } - } } } } diff --git a/modules/agency/front/descriptor/index.html b/modules/agency/front/descriptor/index.html index 450714055..27042bdfc 100644 --- a/modules/agency/front/descriptor/index.html +++ b/modules/agency/front/descriptor/index.html @@ -1,4 +1,4 @@ -Visible
@@ -41,7 +41,9 @@{{$ctrl.item.available}}
{{_.dear}}
-{{{_.bodyDescription}}}
--
{{_.sectionHowToBuyDescription}}
-{{_.sectionHowToBuyStock}}
-{{_.sectionHowToBuyDelivery}}
- -{{_.sectionHowToPayDescription}}
-{{_.sectionToConsiderDescription}}
- -{{_.sectionClaimsPolicyDescription}}
-{{{_.doubtsText}}}
-- {{{salesPersonName}}} - {{{salesPersonPhone}}} - {{{salesPersonEmail}}} -
-{{_.fiscalAddress}}
-{{_.privacy}}
-{{_.privacyLaw}}
-{{_.dear}}
- -{{_.bodyDescription}}
-{{_.termLimits}}
-- {{_.payMethod}} - -
- {{_.legalActions}} -
{{_.contact}}
- -{{_.waitingForNews}}
-{{_.conclusion}}
- --
{{_.hello}} #{{alias}}
-{{message}}
-Hola, {{recipientName}}
-{{_.bodyDescription}} {{senderName}}:
-"{{message}}"
-
{{_.noticeDescription}} '{{categoryName}}'. {{_.unsubscribe}}
-{{_.fiscalAddress}}
-{{_.privacy}}
-{{_.privacyLaw}}
-{{_.dear}}
-{{_.bodyDescription}}
--
{{paymentAdvice}}
-{{_.notifyError}}
-{{_.dear}}
-{{_.bodyDescription}}
-{{{_.followGuide}}}
-{{{_.downloadFrom}}}
- -{{_.sectionQLabelDescription}}
- -{{_.sectionHelpDescription}}
-{{{_.sectionHelpDownloadRemoteSupport}}}
- -- {{{salesPersonName}}} - {{{salesPersonPhone}}} - {{{salesPersonEmail}}} -
-- {{clientName}} -
-- {{_.agencyContact}} -
-- {{{_.agencyContactData}}} -
-- {{clientName}} -
-- {{clientName}} -
-{{_.bodyDescription}}
-{{_.clientAdvice}}
- -{{_.mandatoryFields}}
-{{_.sendOrder}}
-