From 3a7413dda1f618de1521e28b8e29728ec3180a0d Mon Sep 17 00:00:00 2001 From: Bernat Date: Tue, 5 Feb 2019 08:44:56 +0100 Subject: [PATCH 1/6] update acl --- services/db/install/changes/1.2-CHECK/24.ACL.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 services/db/install/changes/1.2-CHECK/24.ACL.sql diff --git a/services/db/install/changes/1.2-CHECK/24.ACL.sql b/services/db/install/changes/1.2-CHECK/24.ACL.sql new file mode 100644 index 000000000..6043c4fb6 --- /dev/null +++ b/services/db/install/changes/1.2-CHECK/24.ACL.sql @@ -0,0 +1,2 @@ +INSERT INTO `salix`.`ACL` (`id`, `model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES (144, 'Stowaway', '*', '*', 'ALLOW', 'ROLE', 'employee'); +INSERT INTO `salix`.`ACL` (`id`, `model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES (145, 'Ticket', 'getPossibleStowaways', 'READ', 'ALLOW', 'ROLE', 'employee'); From 1dbb75a1b89a193e2d23b09af7ec355c6741df0d Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Tue, 5 Feb 2019 09:13:15 +0100 Subject: [PATCH 2/6] vnSideMenu, vnBackground, style fixes --- front/Dockerfile | 1 - front/core/locale/es.yml | 3 +- front/salix/components/app/app.html | 19 +-- front/salix/components/app/app.js | 48 ++---- front/salix/components/app/style.scss | 60 +------ .../salix/components/background/background.js | 1 + front/salix/components/background/style.scss | 26 ++++ front/salix/components/index.js | 2 + .../salix/components/main-menu/main-menu.html | 47 +++--- front/salix/components/main-menu/main-menu.js | 16 +- front/salix/components/main-menu/style.scss | 7 +- .../salix/components/side-menu/side-menu.html | 9 ++ front/salix/components/side-menu/side-menu.js | 78 ++++++++++ front/salix/components/side-menu/style.scss | 37 +++++ front/salix/index.ejs | 2 +- front/salix/manifest.json | 8 +- front/salix/styles/descriptor.scss | 5 + front/salix/styles/variables.scss | 4 + modules/agency/front/calendar/index.js | 11 -- modules/agency/front/card/index.html | 4 +- modules/agency/front/location/index.html | 7 +- modules/claim/front/card/index.html | 4 +- modules/client/front/card/index.html | 4 +- .../front/descriptor-popover/style.scss | 5 +- modules/client/front/search-panel/index.html | 146 +++++++++--------- modules/item/front/card/index.html | 4 +- .../item/front/descriptor-popover/style.scss | 4 - .../ticket-descriptor-popover/style.scss | 6 +- modules/order/front/card/index.html | 4 +- modules/order/front/catalog/index.html | 7 +- modules/order/front/filter/index.js | 11 +- modules/ticket/front/card/index.html | 4 +- modules/worker/front/card/index.html | 4 +- webpack.config.js | 12 +- 34 files changed, 331 insertions(+), 279 deletions(-) create mode 100644 front/salix/components/background/background.js create mode 100644 front/salix/components/background/style.scss create mode 100644 front/salix/components/side-menu/side-menu.html create mode 100644 front/salix/components/side-menu/side-menu.js create mode 100644 front/salix/components/side-menu/style.scss create mode 100644 front/salix/styles/variables.scss diff --git a/front/Dockerfile b/front/Dockerfile index 0bbf71f40..d6fe5d4f8 100644 --- a/front/Dockerfile +++ b/front/Dockerfile @@ -13,6 +13,5 @@ COPY front/nginx.conf sites-available/salix RUN rm sites-enabled/default && ln -s ../sites-available/salix sites-enabled/salix COPY dist /salix/dist -COPY front/salix/manifest.json /salix/dist/ CMD ["nginx", "-g", "daemon off;"] diff --git a/front/core/locale/es.yml b/front/core/locale/es.yml index 10d172444..3cd6428f3 100644 --- a/front/core/locale/es.yml +++ b/front/core/locale/es.yml @@ -37,4 +37,5 @@ September: Septiembre October: Octubre November: Noviembre December: Diciembre -Has delivery: Hay reparto \ No newline at end of file +Has delivery: Hay reparto +Loading: Cargando \ No newline at end of file diff --git a/front/salix/components/app/app.html b/front/salix/components/app/app.html index 922b48ce8..c69d07375 100644 --- a/front/salix/components/app/app.html +++ b/front/salix/components/app/app.html @@ -3,10 +3,10 @@ Logo + class="show-menu" + ng-if="$ctrl.leftMenu" + ng-click="$ctrl.leftMenu.show()">
{{$ctrl.$state.current.description}} @@ -14,20 +14,15 @@ + class="show-menu" + ng-if="$ctrl.rightMenu" + ng-click="$ctrl.rightMenu.show()">
+ ng-class="{padding: $ctrl.showTopbar}">
-
-
\ No newline at end of file diff --git a/front/salix/components/app/app.js b/front/salix/components/app/app.js index 6a8ecb247..edf482712 100644 --- a/front/salix/components/app/app.js +++ b/front/salix/components/app/app.js @@ -1,19 +1,18 @@ import ngModule from '../../module'; import './style.scss'; +/** + * The main graphical application component. + * + * @property {SideMenu} leftMenu The left menu, if it's present + * @property {SideMenu} rightMenu The left menu, if it's present + */ export default class App { - constructor($, $element, vnApp, $state, $transitions) { + constructor($, $state, vnApp) { Object.assign(this, { $, - $element, - vnApp, - $state - }); - - $transitions.onStart({}, transition => { - let state = transition.targetState().name(); - this.showLeftMenuButton = state.split('.').length >= 3; - this.hideMenus(); + $state, + vnApp }); } @@ -30,33 +29,6 @@ export default class App { return state && state != 'login'; } - get leftMenu() { - return this.$element[0].querySelector('.left-menu'); - } - - showLeftMenu() { - if (!this.leftMenu) return; - this.leftMenu.classList.add('shown'); - this.leftMenuShown = true; - } - - showRightMenu() { - if (!this.rightMenu) return; - this.rightMenu.classList.add('shown'); - this.rightMenuShown = true; - } - - hideMenus() { - if (this.leftMenuShown) { - this.leftMenu.classList.remove('shown'); - this.leftMenuShown = false; - } - if (this.rightMenuShown) { - this.rightMenu.classList.remove('shown'); - this.rightMenuShown = false; - } - } - showMessage(message) { this.$.snackbar.show({message: message}); } @@ -69,7 +41,7 @@ export default class App { this.$.snackbar.showError({message: message}); } } -App.$inject = ['$scope', '$element', 'vnApp', '$state', '$transitions']; +App.$inject = ['$scope', '$state', 'vnApp']; ngModule.component('vnApp', { template: require('./app.html'), diff --git a/front/salix/components/app/style.scss b/front/salix/components/app/style.scss index 2103c4251..6cb07e4aa 100644 --- a/front/salix/components/app/style.scss +++ b/front/salix/components/app/style.scss @@ -1,9 +1,6 @@ @import "background"; @import "margin"; - -$menu-width: 16em; -$topbar-height: 4em; -$mobile-width: 800px; +@import "variables"; body { @extend .bg-content; @@ -72,27 +69,6 @@ vn-app { margin: 0 auto; padding-left: $menu-width; - %side-menu { - display: block; - position: fixed; - z-index: 5; - bottom: 0; - width: $menu-width; - min-width: $menu-width; - background-color: white; - box-shadow: 0 .1em .2em rgba(1, 1, 1, .2); - overflow: auto; - } - .left-menu { - @extend %side-menu; - top: $topbar-height; - left: 0; - } - .right-menu { - @extend %side-menu; - top: $topbar-height; - right: 0; - } } .main-with-right-menu { padding-right: $menu-width; @@ -102,18 +78,6 @@ vn-app { } } } - & > .background { - display: none; - position: fixed; - top: 0; - left: 0; - width: 100%; - height: 100%; - background-color: black; - z-index: 14; - opacity: 0; - transition: opacity 200ms ease-out; - } @media screen and (max-width: $mobile-width) { & > vn-topbar > header { @@ -135,32 +99,10 @@ vn-app { } vn-main-block { padding-left: 0; - - %side-menu-mobile { - top: 0; - transition: transform 200ms ease-out; - z-index: 15; - - &.shown { - transform: translateZ(0) translateX(0); - } - } - .left-menu { - @extend %side-menu-mobile; - transform: translateZ(0) translateX(-$menu-width); - } - .right-menu { - @extend %side-menu-mobile; - transform: translateZ(0) translateX($menu-width); - } } .main-with-right-menu { padding-right: 0; } } - & > .background.shown { - display: block; - opacity: .3; - } } } diff --git a/front/salix/components/background/background.js b/front/salix/components/background/background.js new file mode 100644 index 000000000..423b033ce --- /dev/null +++ b/front/salix/components/background/background.js @@ -0,0 +1 @@ +import './style.scss'; diff --git a/front/salix/components/background/style.scss b/front/salix/components/background/style.scss new file mode 100644 index 000000000..c75b69c52 --- /dev/null +++ b/front/salix/components/background/style.scss @@ -0,0 +1,26 @@ +@import "variables"; + +@keyframes fadein { + from { + opacity: 0; + } +} + +vn-background { + display: none; + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: black; + z-index: 14; + + @media screen and (max-width: $mobile-width) { + &.shown { + display: block; + opacity: .3; + animation: 500ms ease-out fadein; + } + } +} diff --git a/front/salix/components/index.js b/front/salix/components/index.js index b90b221a4..a5ce18e4c 100644 --- a/front/salix/components/index.js +++ b/front/salix/components/index.js @@ -2,6 +2,8 @@ import './app/app'; import './login/login'; import './home/home'; import './main-menu/main-menu'; +import './background/background'; +import './side-menu/side-menu'; import './left-menu/left-menu'; import './topbar/topbar'; import './user-configuration-popover'; diff --git a/front/salix/components/main-menu/main-menu.html b/front/salix/components/main-menu/main-menu.html index b607450b8..188f854eb 100644 --- a/front/salix/components/main-menu/main-menu.html +++ b/front/salix/components/main-menu/main-menu.html @@ -5,26 +5,31 @@ class="unselectable"> {{currentUserName}}
- - - -
    -
  • - - {{::mod.name}} -
  • -
-
- - +
+ + + +
    +
  • + + {{::mod.name}} +
  • +
+
+
+
+ + +
- + \ No newline at end of file diff --git a/front/salix/components/main-menu/main-menu.js b/front/salix/components/main-menu/main-menu.js index 684f63aab..287c89d97 100644 --- a/front/salix/components/main-menu/main-menu.js +++ b/front/salix/components/main-menu/main-menu.js @@ -2,13 +2,13 @@ import ngModule from '../../module'; import './style.scss'; export default class MainMenu { - constructor($translate, $scope, $http, $window, vnModules, vnAuth) { - this.$ = $scope; - this.$http = $http; - this.$translate = $translate; - this.$window = $window; - this.modules = vnModules.get(); - this.vnAuth = vnAuth; + constructor($, $http, vnAuth, vnModules) { + Object.assign(this, { + $, + $http, + vnAuth, + modules: vnModules.get() + }); } $onInit() { @@ -30,7 +30,7 @@ export default class MainMenu { this.vnAuth.logout(); } } -MainMenu.$inject = ['$translate', '$scope', '$http', '$window', 'vnModules', 'vnAuth']; +MainMenu.$inject = ['$scope', '$http', 'vnAuth', 'vnModules']; ngModule.component('vnMainMenu', { template: require('./main-menu.html'), diff --git a/front/salix/components/main-menu/style.scss b/front/salix/components/main-menu/style.scss index 24ca495ea..87cd78557 100644 --- a/front/salix/components/main-menu/style.scss +++ b/front/salix/components/main-menu/style.scss @@ -12,7 +12,7 @@ vn-main-menu { & > * { cursor: pointer; - padding-left: .3em; + padding-left: .6em; &:hover { color: $main-01; @@ -21,10 +21,9 @@ vn-main-menu { & > #user { vertical-align: middle; font-weight: bold; - padding-right: .4em; + margin-right: .2em; } - & > vn-icon, - & > a > vn-icon { + & > div > vn-icon { display: block; font-size: 2.1em; } diff --git a/front/salix/components/side-menu/side-menu.html b/front/salix/components/side-menu/side-menu.html new file mode 100644 index 000000000..b56d3cece --- /dev/null +++ b/front/salix/components/side-menu/side-menu.html @@ -0,0 +1,9 @@ + + + diff --git a/front/salix/components/side-menu/side-menu.js b/front/salix/components/side-menu/side-menu.js new file mode 100644 index 000000000..14220c4a3 --- /dev/null +++ b/front/salix/components/side-menu/side-menu.js @@ -0,0 +1,78 @@ +import ngModule from '../../module'; +import './style.scss'; + +/** + * A side menu. + * + * @property {String} side [left|right] The side where the menu is displayed + * @property {Boolean} shown Whether the menu it's currently displayed (Only for small viewports) + */ +export default class SideMenu { + constructor($, $element, $window, $transitions) { + Object.assign(this, { + $, + $element, + $window, + $transitions, + side: 'left' + }); + } + + $onInit() { + this.menu = this.$element[0].querySelector('.menu'); + + if (this.side == 'right') { + this.menu.classList.add('right'); + this.app.rightMenu = this; + } else { + this.menu.classList.add('left'); + this.app.leftMenu = this; + } + } + + $onDestroy() { + if (this.side == 'right') + this.app.rightMenu = null; + else + this.app.leftMenu = null; + } + + onEscape(event) { + if (!event.defaultPrevented && event.key == 'Escape') { + event.preventDefault(); + this.hide(); + this.$.$digest(); + } + } + + onTransition(transition) { + if (transition.from().name !== transition.to().name) + this.hide(); + } + + show() { + this.shown = true; + this.handler = e => this.onEscape(e); + this.$window.addEventListener('keydown', this.handler); + this.stateHandler = this.$transitions.onStart({}, t => this.onTransition(t)); + } + + hide() { + this.$window.removeEventListener('keydown', this.handler); + this.stateHandler(); + this.shown = false; + } +} +SideMenu.$inject = ['$scope', '$element', '$window', '$transitions']; + +ngModule.component('vnSideMenu', { + template: require('./side-menu.html'), + controller: SideMenu, + transclude: true, + bindings: { + side: '@?' + }, + require: { + app: '^vnApp' + } +}); diff --git a/front/salix/components/side-menu/style.scss b/front/salix/components/side-menu/style.scss new file mode 100644 index 000000000..98084022d --- /dev/null +++ b/front/salix/components/side-menu/style.scss @@ -0,0 +1,37 @@ +@import "variables"; + +vn-side-menu > .menu { + display: block; + position: fixed; + z-index: 5; + bottom: 0; + width: $menu-width; + min-width: $menu-width; + background-color: white; + box-shadow: 0 .1em .2em rgba(1, 1, 1, .2); + overflow: auto; + top: $topbar-height; + + &.left { + left: 0; + } + &.right { + right: 0; + } + + @media screen and (max-width: $mobile-width) { + top: 0; + transition: transform 200ms ease-out; + z-index: 15; + + &.left { + transform: translateZ(0) translateX(-$menu-width); + } + &.right { + transform: translateZ(0) translateX($menu-width); + } + &.shown { + transform: translateZ(0) translateX(0); + } + } +} diff --git a/front/salix/index.ejs b/front/salix/index.ejs index 9f4535540..3aed9d9a6 100644 --- a/front/salix/index.ejs +++ b/front/salix/index.ejs @@ -4,7 +4,7 @@ - + diff --git a/front/salix/manifest.json b/front/salix/manifest.json index bf7e237fb..29deedbcd 100644 --- a/front/salix/manifest.json +++ b/front/salix/manifest.json @@ -1,12 +1,12 @@ { "name": "Salix", + "start_url": "index.html", + "display": "standalone", + "theme_color": "#3d3d3d", "icons": [ { "src": "favicon.ico", "sizes": "512x512" } - ], - "start_url": "index.html", - "display": "standalone", - "theme_color": "#3d3d3d" + ] } diff --git a/front/salix/styles/descriptor.scss b/front/salix/styles/descriptor.scss index 7837a8326..ddd4ea73e 100644 --- a/front/salix/styles/descriptor.scss +++ b/front/salix/styles/descriptor.scss @@ -77,4 +77,9 @@ } } } +} +vn-popover { + .vn-descriptor > .header > a:first-child { + visibility: hidden; + } } \ No newline at end of file diff --git a/front/salix/styles/variables.scss b/front/salix/styles/variables.scss new file mode 100644 index 000000000..cadbe1fa4 --- /dev/null +++ b/front/salix/styles/variables.scss @@ -0,0 +1,4 @@ + +$menu-width: 16em; +$topbar-height: 4em; +$mobile-width: 800px; \ No newline at end of file diff --git a/modules/agency/front/calendar/index.js b/modules/agency/front/calendar/index.js index a26b705a8..f08a47601 100644 --- a/modules/agency/front/calendar/index.js +++ b/modules/agency/front/calendar/index.js @@ -17,14 +17,6 @@ class Controller { this.ndMonth = this.$scope.ndMonth; } - $onInit() { - this.app.rightMenu = this.$element[0]; - } - - $onDestroy() { - this.app.rightMenu = null; - } - get zone() { return this._zone; } @@ -152,9 +144,6 @@ Controller.$inject = ['$element', '$scope', '$stateParams', '$http']; ngModule.component('vnZoneCalendar', { template: require('./index.html'), controller: Controller, - require: { - app: '^vnApp' - }, bindings: { zone: '<' } diff --git a/modules/agency/front/card/index.html b/modules/agency/front/card/index.html index 2b981bf29..db5881e42 100644 --- a/modules/agency/front/card/index.html +++ b/modules/agency/front/card/index.html @@ -1,7 +1,7 @@ -
+ -
+
diff --git a/modules/agency/front/location/index.html b/modules/agency/front/location/index.html index 1e2983284..27de3bc1f 100644 --- a/modules/agency/front/location/index.html +++ b/modules/agency/front/location/index.html @@ -16,8 +16,7 @@ on-selection="$ctrl.onSelection(item)"> - - + + + \ No newline at end of file diff --git a/modules/claim/front/card/index.html b/modules/claim/front/card/index.html index 82ce962cb..3a445f0b1 100644 --- a/modules/claim/front/card/index.html +++ b/modules/claim/front/card/index.html @@ -1,7 +1,7 @@ -
+ -
+
diff --git a/modules/client/front/card/index.html b/modules/client/front/card/index.html index 5c8b6f334..3732e0d07 100644 --- a/modules/client/front/card/index.html +++ b/modules/client/front/card/index.html @@ -1,7 +1,7 @@ -
+ -
+
diff --git a/modules/client/front/descriptor-popover/style.scss b/modules/client/front/descriptor-popover/style.scss index 84938dc9c..0262c4ac0 100644 --- a/modules/client/front/descriptor-popover/style.scss +++ b/modules/client/front/descriptor-popover/style.scss @@ -5,8 +5,5 @@ vn-client-descriptor-popover { & > vn-card{ margin: 0!important; } - .header > a:first-child { - display: none - } } -} \ No newline at end of file +} diff --git a/modules/client/front/search-panel/index.html b/modules/client/front/search-panel/index.html index a5553fcbf..9fb1aaf3e 100644 --- a/modules/client/front/search-panel/index.html +++ b/modules/client/front/search-panel/index.html @@ -1,75 +1,75 @@
-
- - - - - - - - - - - - - - - {{firstName}} {{name}} - - - - - - - - - - - - - - - - - - - - - -
+
+ + + + + + + + + + + + + + + {{firstName}} {{name}} + + + + + + + + + + + + + + + + + + + + + +
diff --git a/modules/item/front/card/index.html b/modules/item/front/card/index.html index d4cf5ad43..aa84532d1 100644 --- a/modules/item/front/card/index.html +++ b/modules/item/front/card/index.html @@ -1,7 +1,7 @@ -
+ -
+
diff --git a/modules/item/front/descriptor-popover/style.scss b/modules/item/front/descriptor-popover/style.scss index 839fc992f..dfc11ab9d 100644 --- a/modules/item/front/descriptor-popover/style.scss +++ b/modules/item/front/descriptor-popover/style.scss @@ -3,9 +3,5 @@ vn-item-descriptor-popover { display: block; width: 16em; min-height: 28em; - - .header > a:first-child { - display: none - } } } \ No newline at end of file diff --git a/modules/item/front/ticket-descriptor-popover/style.scss b/modules/item/front/ticket-descriptor-popover/style.scss index d41d28a87..58e65d320 100644 --- a/modules/item/front/ticket-descriptor-popover/style.scss +++ b/modules/item/front/ticket-descriptor-popover/style.scss @@ -4,12 +4,8 @@ vn-ticket-descriptor-popover { width: 16em; max-height: 28em; - &>vn-card { + & > vn-card { margin: 0!important; } - - .header > a:first-child { - display: none - } } } \ No newline at end of file diff --git a/modules/order/front/card/index.html b/modules/order/front/card/index.html index b0874ec48..96aa94f6c 100644 --- a/modules/order/front/card/index.html +++ b/modules/order/front/card/index.html @@ -1,7 +1,7 @@ -
+ -
+
diff --git a/modules/order/front/catalog/index.html b/modules/order/front/catalog/index.html index 8de456b93..819afca79 100644 --- a/modules/order/front/catalog/index.html +++ b/modules/order/front/catalog/index.html @@ -97,10 +97,9 @@ - - + + + diff --git a/modules/order/front/filter/index.js b/modules/order/front/filter/index.js index aa3f3cc3d..276f3d141 100644 --- a/modules/order/front/filter/index.js +++ b/modules/order/front/filter/index.js @@ -14,14 +14,6 @@ class Controller { this.tags = []; } - $onInit() { - this.app.rightMenu = this.$element[0]; - } - - $onDestroy() { - this.app.rightMenu = null; - } - get order() { return this._order; } @@ -174,8 +166,7 @@ ngModule.component('vnCatalogFilter', { template: require('./index.html'), controller: Controller, require: { - catalog: '^vnOrderCatalog', - app: '^vnApp' + catalog: '^vnOrderCatalog' }, bindings: { order: '<', diff --git a/modules/ticket/front/card/index.html b/modules/ticket/front/card/index.html index ca8c7d88b..72df32b68 100644 --- a/modules/ticket/front/card/index.html +++ b/modules/ticket/front/card/index.html @@ -1,7 +1,7 @@ -
+ -
+
diff --git a/modules/worker/front/card/index.html b/modules/worker/front/card/index.html index 79d4c7511..80f1f7a61 100644 --- a/modules/worker/front/card/index.html +++ b/modules/worker/front/card/index.html @@ -1,7 +1,7 @@ -
+ -
+
diff --git a/webpack.config.js b/webpack.config.js index 7824e2e2b..b889f9e6a 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -29,7 +29,13 @@ let baseConfig = { loader: 'json-loader!yaml-loader' }, { test: /\.html$/, - loader: 'html-loader' + loader: 'html-loader', + options: { + attrs: [ + 'img:src', + 'link:href' + ] + } }, { test: /\.css$/, loader: 'style-loader!css-loader' @@ -50,6 +56,10 @@ let baseConfig = { }, { test: /\.(svg|png|ttf|woff|woff2)$/, loader: 'file-loader' + }, { + test: /manifest\.json$/, + type: 'javascript/auto', + loader: 'file-loader' } ] }, From 6c2fe1d4a389711610aa1333cf3fc07696045344 Mon Sep 17 00:00:00 2001 From: Gerard Date: Tue, 5 Feb 2019 09:27:01 +0100 Subject: [PATCH 3/6] #1036 order.line --- loopback/locale/es.json | 3 ++- modules/order/front/line/index.html | 2 +- modules/order/front/line/index.js | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/loopback/locale/es.json b/loopback/locale/es.json index 648989cb6..da4100a5a 100644 --- a/loopback/locale/es.json +++ b/loopback/locale/es.json @@ -65,5 +65,6 @@ "INVALID_USER_NAME": "El nombre de usuario solo debe contener letras minúsculas o, a partir del segundo carácter, números o subguiones, no esta permitido el uso de la letra ñ", "You can't create a ticket for a frozen client": "No puedes crear un ticket para un cliente congelado", "You can't create a ticket for a inactive client": "No puedes crear un ticket para un cliente inactivo", - "Tag value cannot be blank": "El valor del tag no puede quedar en blanco" + "Tag value cannot be blank": "El valor del tag no puede quedar en blanco", + "ORDER_EMPTY": "Cesta vacía" } \ No newline at end of file diff --git a/modules/order/front/line/index.html b/modules/order/front/line/index.html index 4bb1dc4ce..a2e28ac2f 100644 --- a/modules/order/front/line/index.html +++ b/modules/order/front/line/index.html @@ -70,7 +70,7 @@ diff --git a/modules/order/front/line/index.js b/modules/order/front/line/index.js index e25d50532..84067b5ec 100644 --- a/modules/order/front/line/index.js +++ b/modules/order/front/line/index.js @@ -92,6 +92,7 @@ class Controller { this.$http.post(query).then(() => { this.vnApp.showSuccess(this.$translate.instant('Order confirmed')); + this.$state.go(`ticket.index`, {clientFk: this.order.clientFk}); }); } } From 8f575fbc45a58931d500b2bde6e0f9aa29c422fa Mon Sep 17 00:00:00 2001 From: Gerard Date: Tue, 5 Feb 2019 09:37:01 +0100 Subject: [PATCH 4/6] strings added to the locale --- modules/order/front/line/locale/es.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/order/front/line/locale/es.yml b/modules/order/front/line/locale/es.yml index ba3a3fee6..688778561 100644 --- a/modules/order/front/line/locale/es.yml +++ b/modules/order/front/line/locale/es.yml @@ -1,2 +1,3 @@ -Remove item: Eliminar articulo -Order confirmed: Pedido confirmado \ No newline at end of file +Delete row: Eliminar linea +Order confirmed: Pedido confirmado +Are you sure you want to delete this row?: ¿Estas seguro de que quieres borrar esta línea? \ No newline at end of file From 2c9a10f27700dc5b8770bfd69d80cd4b9aaf2942 Mon Sep 17 00:00:00 2001 From: Bernat Date: Tue, 5 Feb 2019 09:49:33 +0100 Subject: [PATCH 5/6] update structure db #9764 --- back/models/user-table-configuration.json | 6 ++-- .../1.2-CHECK/23-userTableConfiguration.sql | 30 +++++++++++++++++++ 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/back/models/user-table-configuration.json b/back/models/user-table-configuration.json index 084d64e27..4a35f66cf 100644 --- a/back/models/user-table-configuration.json +++ b/back/models/user-table-configuration.json @@ -21,10 +21,10 @@ } }, "relations": { - "worker": { + "user": { "type": "belongsTo", - "model": "Worker", - "foreignKey": "workerFk" + "model": "Account", + "foreignKey": "userFk" } } } diff --git a/services/db/install/changes/1.2-CHECK/23-userTableConfiguration.sql b/services/db/install/changes/1.2-CHECK/23-userTableConfiguration.sql index 089b38a36..c7212f7ba 100644 --- a/services/db/install/changes/1.2-CHECK/23-userTableConfiguration.sql +++ b/services/db/install/changes/1.2-CHECK/23-userTableConfiguration.sql @@ -16,3 +16,33 @@ ADD CONSTRAINT `fgn_worker` REFERENCES `vn2008`.`Trabajadores` (`Id_Trabajador`) ON DELETE CASCADE ON UPDATE CASCADE; + +ALTER TABLE `salix`.`userTableConfiguration` +DROP FOREIGN KEY `fgn_worker`; +ALTER TABLE `salix`.`userTableConfiguration` +CHANGE COLUMN `workerFk` `userFk` INT(10) NOT NULL ; +ALTER TABLE `salix`.`userTableConfiguration` +ADD CONSTRAINT `fgn_worker` + FOREIGN KEY (`userFk`) + REFERENCES `vn2008`.`Trabajadores` (`Id_Trabajador`) + ON DELETE CASCADE + ON UPDATE CASCADE; + +ALTER TABLE `salix`.`userTableConfiguration` +DROP FOREIGN KEY `fgn_worker`; +ALTER TABLE `salix`.`userTableConfiguration` +DROP INDEX `fgn_worker_idx` ; + + + +ALTER TABLE `salix`.`userTableConfiguration` +CHANGE COLUMN `userFk` `userFk` INT(10) UNSIGNED NOT NULL ; + + ALTER TABLE `salix`.`userTableConfiguration` +ADD INDEX `fgn_user_idx` (`userFk` ASC); +ALTER TABLE `salix`.`userTableConfiguration` +ADD CONSTRAINT `fgn_user` + FOREIGN KEY (`userFk`) + REFERENCES `account`.`user` (`id`) + ON DELETE CASCADE + ON UPDATE CASCADE; From b2dc6ce8c6624025b81eb0cd14da25b14a9736fc Mon Sep 17 00:00:00 2001 From: Bernat Date: Tue, 5 Feb 2019 10:48:33 +0100 Subject: [PATCH 6/6] #9746 update structure db --- back/model-config.json | 2 +- ...nfiguration.json => user-config-view.json} | 4 +- .../changes/1.2-CHECK/23-userConfigView.sql | 9 ++++ .../1.2-CHECK/23-userTableConfiguration.sql | 48 ------------------- 4 files changed, 12 insertions(+), 51 deletions(-) rename back/models/{user-table-configuration.json => user-config-view.json} (85%) create mode 100644 services/db/install/changes/1.2-CHECK/23-userConfigView.sql delete mode 100644 services/db/install/changes/1.2-CHECK/23-userTableConfiguration.sql diff --git a/back/model-config.json b/back/model-config.json index 7a7b7af56..0a0772b04 100644 --- a/back/model-config.json +++ b/back/model-config.json @@ -38,7 +38,7 @@ "Vehicle": { "dataSource": "vn" }, - "UserTableConfiguration": { + "UserConfigView": { "dataSource": "vn" } } diff --git a/back/models/user-table-configuration.json b/back/models/user-config-view.json similarity index 85% rename from back/models/user-table-configuration.json rename to back/models/user-config-view.json index 4a35f66cf..1cb933079 100644 --- a/back/models/user-table-configuration.json +++ b/back/models/user-config-view.json @@ -1,9 +1,9 @@ { - "name": "UserTableConfiguration", + "name": "UserConfigView", "base": "VnModel", "options": { "mysql": { - "table": "salix.userTableConfiguration" + "table": "salix.userConfigView" } }, "properties": { diff --git a/services/db/install/changes/1.2-CHECK/23-userConfigView.sql b/services/db/install/changes/1.2-CHECK/23-userConfigView.sql new file mode 100644 index 000000000..855b77f0f --- /dev/null +++ b/services/db/install/changes/1.2-CHECK/23-userConfigView.sql @@ -0,0 +1,9 @@ + +CREATE TABLE `salix`.`userConfigView` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `userFk` int(10) unsigned NOT NULL, + `tableCode` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `configuration` text COLLATE utf8_unicode_ci, + PRIMARY KEY (`id`), + UNIQUE KEY `uniqueUser_TableCode` (`userFk`,`tableCode`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; diff --git a/services/db/install/changes/1.2-CHECK/23-userTableConfiguration.sql b/services/db/install/changes/1.2-CHECK/23-userTableConfiguration.sql deleted file mode 100644 index c7212f7ba..000000000 --- a/services/db/install/changes/1.2-CHECK/23-userTableConfiguration.sql +++ /dev/null @@ -1,48 +0,0 @@ -CREATE TABLE `salix`.`userTableConfiguration` ( - `id` INT NOT NULL AUTO_INCREMENT, - `workerFk` INT(11) NOT NULL, - `tableCode` VARCHAR(255) NOT NULL, - `configuration` TEXT NULL, - PRIMARY KEY (`id`)); - - - - -ALTER TABLE `salix`.`userTableConfiguration` -ADD INDEX `fgn_worker_idx` (`workerFk` ASC); -ALTER TABLE `salix`.`userTableConfiguration` -ADD CONSTRAINT `fgn_worker` - FOREIGN KEY (`workerFk`) - REFERENCES `vn2008`.`Trabajadores` (`Id_Trabajador`) - ON DELETE CASCADE - ON UPDATE CASCADE; - -ALTER TABLE `salix`.`userTableConfiguration` -DROP FOREIGN KEY `fgn_worker`; -ALTER TABLE `salix`.`userTableConfiguration` -CHANGE COLUMN `workerFk` `userFk` INT(10) NOT NULL ; -ALTER TABLE `salix`.`userTableConfiguration` -ADD CONSTRAINT `fgn_worker` - FOREIGN KEY (`userFk`) - REFERENCES `vn2008`.`Trabajadores` (`Id_Trabajador`) - ON DELETE CASCADE - ON UPDATE CASCADE; - -ALTER TABLE `salix`.`userTableConfiguration` -DROP FOREIGN KEY `fgn_worker`; -ALTER TABLE `salix`.`userTableConfiguration` -DROP INDEX `fgn_worker_idx` ; - - - -ALTER TABLE `salix`.`userTableConfiguration` -CHANGE COLUMN `userFk` `userFk` INT(10) UNSIGNED NOT NULL ; - - ALTER TABLE `salix`.`userTableConfiguration` -ADD INDEX `fgn_user_idx` (`userFk` ASC); -ALTER TABLE `salix`.`userTableConfiguration` -ADD CONSTRAINT `fgn_user` - FOREIGN KEY (`userFk`) - REFERENCES `account`.`user` (`id`) - ON DELETE CASCADE - ON UPDATE CASCADE;