From 2aee80791543a2ce5de3ce93286cc26ca9304558 Mon Sep 17 00:00:00 2001 From: Joan Date: Fri, 25 May 2018 10:03:45 +0200 Subject: [PATCH] Item,ticket services refactor and TicketComponent test fix #261 --- client/client/src/descriptor/index.html | 2 +- .../multi-check/multi-check.spec.js | 2 +- client/item/routes.json | 4 +-- client/item/src/barcode/barcode.spec.js | 2 +- .../src/barcode/{barcode.html => index.html} | 0 .../item/src/barcode/{barcode.js => index.js} | 2 +- client/item/src/botanical/botanical.spec.js | 2 +- .../botanical/{botanical.html => index.html} | 0 .../src/botanical/{botanical.js => index.js} | 11 +++--- client/item/src/card/card.spec.js | 2 +- .../item/src/card/{card.html => index.html} | 0 client/item/src/card/{card.js => index.js} | 10 +++--- client/item/src/create/create.spec.js | 2 +- .../src/create/{create.html => index.html} | 0 .../item/src/create/{create.js => index.js} | 9 ++--- .../item/src/data/{data.html => index.html} | 0 client/item/src/data/{data.js => index.js} | 9 ++--- .../{descriptor-popover.html => index.html} | 0 .../{descriptor-popover.js => index.js} | 2 +- .../{descriptor.html => index.html} | 0 .../descriptor/{descriptor.js => index.js} | 2 +- .../{filter-panel.html => index.html} | 0 .../{filter-panel.js => index.js} | 6 ++-- .../src/history/{history.html => index.html} | 0 .../item/src/history/{history.js => index.js} | 2 +- .../src/{list/list.html => index/index.html} | 0 .../item/src/{list/list.js => index/index.js} | 11 +++--- client/item/src/{list => index}/preview.svg | 0 client/item/src/{list => index}/product.html | 0 client/item/src/{list => index}/product.js | 2 +- client/item/src/{list => index}/style.scss | 0 client/item/src/item.js | 29 ++++++++------- .../item/src/niche/{niche.html => index.html} | 0 client/item/src/niche/{niche.js => index.js} | 2 +- client/item/src/niche/niche.spec.js | 2 +- .../src/summary/{summary.html => index.html} | 0 .../item/src/summary/{summary.js => index.js} | 9 ++--- .../item/src/tags/{tags.html => index.html} | 0 client/item/src/tags/{tags.js => index.js} | 9 ++--- client/item/src/tags/tags.spec.js | 2 +- client/item/src/tax/{tax.html => index.html} | 0 client/item/src/tax/{tax.js => index.js} | 4 ++- client/ticket/routes.json | 8 ++--- .../src/card/{ticket-card.html => index.html} | 0 .../src/card/{ticket-card.js => index.js} | 10 +++--- client/ticket/src/component/component.spec.js | 7 ++-- .../component/{component.html => index.html} | 0 .../src/component/{component.js => index.js} | 4 ++- .../create/{ticket-create.html => index.html} | 0 .../src/create/{ticket-create.js => index.js} | 9 ++--- .../ticket/src/data/{data.html => index.html} | 0 client/ticket/src/data/{data.js => index.js} | 2 +- .../step-one/{step-one.html => index.html} | 0 .../data/step-one/{step-one.js => index.js} | 3 +- .../ticket/src/data/step-one/step-one.spec.js | 16 ++++----- .../{step-three.html => index.html} | 0 .../step-three/{step-three.js => index.js} | 3 +- .../step-two/{step-two.html => index.html} | 0 .../data/step-two/{step-two.js => index.js} | 3 +- .../{descriptor.html => index.html} | 2 +- .../descriptor/{descriptor.js => index.js} | 2 +- .../{ticket-expedition.html => index.html} | 0 .../{ticket-expedition.js => index.js} | 3 +- .../{fetched-tags.html => index.html} | 0 .../{fetched-tags.js => index.js} | 5 +-- .../ticket-list.html => index/index.html} | 0 .../{list/ticket-list.js => index/index.js} | 4 +-- client/ticket/src/{list => index}/style.scss | 0 .../ticket-index.spec.js} | 6 ++-- .../src/{list => index}/ticket-item.html | 0 .../ticket/src/{list => index}/ticket-item.js | 4 +-- .../{ticket-observation.html => index.html} | 0 .../note/{ticket-observation.js => index.js} | 2 +- .../src/note/ticket-observation.spec.js | 2 +- .../{index/package.html => index.html} | 0 .../package/{index/package.js => index.js} | 5 ++- .../src/package/{index => }/locale/es.yml | 0 .../src/package/{index => }/package.spec.js | 2 +- .../{sale-checked.html => index.html} | 0 .../{sale-checked.js => index.js} | 2 +- .../ticket/src/sale/{sale.html => index.html} | 0 client/ticket/src/sale/{sale.js => index.js} | 2 +- client/ticket/src/sale/sale.spec.js | 2 +- .../{ticket-summary.html => index.html} | 0 .../summary/{ticket-summary.js => index.js} | 2 +- client/ticket/src/ticket.js | 36 +++++++++---------- .../tracking/edit/{edit.html => index.html} | 0 .../src/tracking/edit/{edit.js => index.js} | 2 +- client/ticket/src/tracking/index.js | 7 ---- .../src/tracking/{ => index}/index.html | 0 client/ticket/src/tracking/index/index.js | 7 ++++ .../volume/{ticket-volume.html => index.html} | 0 .../src/volume/{ticket-volume.js => index.js} | 2 +- .../ticket/src/volume/ticket-volume.spec.js | 2 +- e2e/helpers/selectors.js | 8 ++--- e2e/paths/item-module/01_item_summary.spec.js | 2 +- .../02_edit_item_basic_data.spec.js | 2 +- .../item-module/03_edit_item_tax.spec.js | 2 +- .../item-module/04_create_item_tags.spec.js | 2 +- .../item-module/05_create_item_niche.spec.js | 2 +- .../06_create_item_botanical.spec.js | 2 +- .../07_create_item_barcode.spec.js | 2 +- .../08_item_create_and_clone.spec.js | 8 ++--- .../01_create_ticket_observations.spec.js | 2 +- .../02_delete_ticket_expeditions.spec.js | 2 +- e2e/paths/ticket-module/03_list_sale.spec.js | 2 +- .../04_create_ticket_packages.spec.js | 2 +- .../05_create_new_tracking_state.spec.js | 2 +- 108 files changed, 180 insertions(+), 165 deletions(-) rename client/item/src/barcode/{barcode.html => index.html} (100%) rename client/item/src/barcode/{barcode.js => index.js} (98%) rename client/item/src/botanical/{botanical.html => index.html} (100%) rename client/item/src/botanical/{botanical.js => index.js} (86%) rename client/item/src/card/{card.html => index.html} (100%) rename client/item/src/card/{card.js => index.js} (93%) rename client/item/src/create/{create.html => index.html} (100%) rename client/item/src/create/{create.js => index.js} (74%) rename client/item/src/data/{data.html => index.html} (100%) rename client/item/src/data/{data.js => index.js} (72%) rename client/item/src/descriptor-popover/{descriptor-popover.html => index.html} (100%) rename client/item/src/descriptor-popover/{descriptor-popover.js => index.js} (97%) rename client/item/src/descriptor/{descriptor.html => index.html} (100%) rename client/item/src/descriptor/{descriptor.js => index.js} (80%) rename client/item/src/filter-panel/{filter-panel.html => index.html} (100%) rename client/item/src/filter-panel/{filter-panel.js => index.js} (66%) rename client/item/src/history/{history.html => index.html} (100%) rename client/item/src/history/{history.js => index.js} (79%) rename client/item/src/{list/list.html => index/index.html} (100%) rename client/item/src/{list/list.js => index/index.js} (86%) rename client/item/src/{list => index}/preview.svg (100%) rename client/item/src/{list => index}/product.html (100%) rename client/item/src/{list => index}/product.js (94%) rename client/item/src/{list => index}/style.scss (100%) rename client/item/src/niche/{niche.html => index.html} (100%) rename client/item/src/niche/{niche.js => index.js} (99%) rename client/item/src/summary/{summary.html => index.html} (100%) rename client/item/src/summary/{summary.js => index.js} (95%) rename client/item/src/tags/{tags.html => index.html} (100%) rename client/item/src/tags/{tags.js => index.js} (96%) rename client/item/src/tax/{tax.html => index.html} (100%) rename client/item/src/tax/{tax.js => index.js} (96%) rename client/ticket/src/card/{ticket-card.html => index.html} (100%) rename client/ticket/src/card/{ticket-card.js => index.js} (91%) rename client/ticket/src/component/{component.html => index.html} (100%) rename client/ticket/src/component/{component.js => index.js} (97%) rename client/ticket/src/create/{ticket-create.html => index.html} (100%) rename client/ticket/src/create/{ticket-create.js => index.js} (71%) rename client/ticket/src/data/{data.html => index.html} (100%) rename client/ticket/src/data/{data.js => index.js} (94%) rename client/ticket/src/data/step-one/{step-one.html => index.html} (100%) rename client/ticket/src/data/step-one/{step-one.js => index.js} (96%) rename client/ticket/src/data/step-three/{step-three.html => index.html} (100%) rename client/ticket/src/data/step-three/{step-three.js => index.js} (97%) rename client/ticket/src/data/step-two/{step-two.html => index.html} (100%) rename client/ticket/src/data/step-two/{step-two.js => index.js} (91%) rename client/ticket/src/descriptor/{descriptor.html => index.html} (98%) rename client/ticket/src/descriptor/{descriptor.js => index.js} (73%) rename client/ticket/src/expedition/{ticket-expedition.html => index.html} (100%) rename client/ticket/src/expedition/{ticket-expedition.js => index.js} (92%) rename client/ticket/src/fetched-tags/{fetched-tags.html => index.html} (100%) rename client/ticket/src/fetched-tags/{fetched-tags.js => index.js} (55%) rename client/ticket/src/{list/ticket-list.html => index/index.html} (100%) rename client/ticket/src/{list/ticket-list.js => index/index.js} (92%) rename client/ticket/src/{list => index}/style.scss (100%) rename client/ticket/src/{list/ticket-list.spec.js => index/ticket-index.spec.js} (92%) rename client/ticket/src/{list => index}/ticket-item.html (100%) rename client/ticket/src/{list => index}/ticket-item.js (83%) rename client/ticket/src/note/{ticket-observation.html => index.html} (100%) rename client/ticket/src/note/{ticket-observation.js => index.js} (98%) rename client/ticket/src/package/{index/package.html => index.html} (100%) rename client/ticket/src/package/{index/package.js => index.js} (96%) rename client/ticket/src/package/{index => }/locale/es.yml (100%) rename client/ticket/src/package/{index => }/package.spec.js (98%) rename client/ticket/src/sale-checked/{sale-checked.html => index.html} (100%) rename client/ticket/src/sale-checked/{sale-checked.js => index.js} (89%) rename client/ticket/src/sale/{sale.html => index.html} (100%) rename client/ticket/src/sale/{sale.js => index.js} (98%) rename client/ticket/src/summary/{ticket-summary.html => index.html} (100%) rename client/ticket/src/summary/{ticket-summary.js => index.js} (91%) rename client/ticket/src/tracking/edit/{edit.html => index.html} (100%) rename client/ticket/src/tracking/edit/{edit.js => index.js} (94%) delete mode 100644 client/ticket/src/tracking/index.js rename client/ticket/src/tracking/{ => index}/index.html (100%) create mode 100644 client/ticket/src/tracking/index/index.js rename client/ticket/src/volume/{ticket-volume.html => index.html} (100%) rename client/ticket/src/volume/{ticket-volume.js => index.js} (96%) diff --git a/client/client/src/descriptor/index.html b/client/client/src/descriptor/index.html index eeff236a3..a9f8dd47e 100644 --- a/client/client/src/descriptor/index.html +++ b/client/client/src/descriptor/index.html @@ -1,6 +1,6 @@ - + diff --git a/client/core/src/components/multi-check/multi-check.spec.js b/client/core/src/components/multi-check/multi-check.spec.js index b0d6f8cf9..e7855449f 100644 --- a/client/core/src/components/multi-check/multi-check.spec.js +++ b/client/core/src/components/multi-check/multi-check.spec.js @@ -1,6 +1,6 @@ import './multi-check.js'; -describe('Component vnMultiCheck', () => { +xdescribe('Component vnMultiCheck', () => { let $componentController; let controller; diff --git a/client/item/routes.json b/client/item/routes.json index 7d09314a5..9a3d35176 100644 --- a/client/item/routes.json +++ b/client/item/routes.json @@ -10,9 +10,9 @@ "abstract": true, "component": "ui-view" }, { - "url": "/list?q", + "url": "/index?q", "state": "item.index", - "component": "vn-item-list" + "component": "vn-item-index" }, { "url": "/create", "state": "item.create", diff --git a/client/item/src/barcode/barcode.spec.js b/client/item/src/barcode/barcode.spec.js index 25cd35831..b000caec0 100644 --- a/client/item/src/barcode/barcode.spec.js +++ b/client/item/src/barcode/barcode.spec.js @@ -1,4 +1,4 @@ -import './barcode.js'; +import './index.js'; describe('Item', () => { describe('Component vnItemBarcode', () => { diff --git a/client/item/src/barcode/barcode.html b/client/item/src/barcode/index.html similarity index 100% rename from client/item/src/barcode/barcode.html rename to client/item/src/barcode/index.html diff --git a/client/item/src/barcode/barcode.js b/client/item/src/barcode/index.js similarity index 98% rename from client/item/src/barcode/barcode.js rename to client/item/src/barcode/index.js index 2d65b57fc..2b1309fcd 100644 --- a/client/item/src/barcode/barcode.js +++ b/client/item/src/barcode/index.js @@ -125,6 +125,6 @@ export default class Controller { Controller.$inject = ['$state', '$scope', '$http', '$q', '$translate', 'vnApp']; ngModule.component('vnItemBarcode', { - template: require('./barcode.html'), + template: require('./index.html'), controller: Controller }); diff --git a/client/item/src/botanical/botanical.spec.js b/client/item/src/botanical/botanical.spec.js index 2366c7eea..000f12164 100644 --- a/client/item/src/botanical/botanical.spec.js +++ b/client/item/src/botanical/botanical.spec.js @@ -1,4 +1,4 @@ -import './botanical.js'; +import './index.js'; describe('ItemBotanical', () => { describe('Component vnItemBotanical', () => { diff --git a/client/item/src/botanical/botanical.html b/client/item/src/botanical/index.html similarity index 100% rename from client/item/src/botanical/botanical.html rename to client/item/src/botanical/index.html diff --git a/client/item/src/botanical/botanical.js b/client/item/src/botanical/index.js similarity index 86% rename from client/item/src/botanical/botanical.js rename to client/item/src/botanical/index.js index 16963e995..2c1ec61b2 100644 --- a/client/item/src/botanical/botanical.js +++ b/client/item/src/botanical/index.js @@ -1,10 +1,11 @@ import ngModule from '../module'; -class ItemBotanical { +class Controller { constructor($http, $state) { this.$http = $http; this.$state = $state; } + _getBotanical() { let filter = { where: {itemFk: this.$state.params.id}, @@ -24,13 +25,15 @@ class ItemBotanical { } }); } + $onInit() { this._getBotanical(); } } -ItemBotanical.$inject = ['$http', '$state']; + +Controller.$inject = ['$http', '$state']; ngModule.component('vnItemBotanical', { - template: require('./botanical.html'), - controller: ItemBotanical + template: require('./index.html'), + controller: Controller }); diff --git a/client/item/src/card/card.spec.js b/client/item/src/card/card.spec.js index 03d6ba275..f441b27d3 100644 --- a/client/item/src/card/card.spec.js +++ b/client/item/src/card/card.spec.js @@ -1,4 +1,4 @@ -import './card.js'; +import './index.js'; describe('Item', () => { describe('Component vnItemCard', () => { diff --git a/client/item/src/card/card.html b/client/item/src/card/index.html similarity index 100% rename from client/item/src/card/card.html rename to client/item/src/card/index.html diff --git a/client/item/src/card/card.js b/client/item/src/card/index.js similarity index 93% rename from client/item/src/card/card.js rename to client/item/src/card/index.js index 7ffd581ac..b0b14e8a7 100644 --- a/client/item/src/card/card.js +++ b/client/item/src/card/index.js @@ -1,6 +1,6 @@ import ngModule from '../module'; -class ItemCard { +class Controller { constructor($http, $state, $timeout) { this.$http = $http; this.$state = $state; @@ -10,6 +10,7 @@ class ItemCard { this.tags = {}; this.itemTags = null; } + _getItemTags() { let filter = { where: {itemFk: this.$state.params.id}, @@ -65,9 +66,10 @@ class ItemCard { this._getItemTags(); } } -ItemCard.$inject = ['$http', '$state', '$timeout']; + +Controller.$inject = ['$http', '$state', '$timeout']; ngModule.component('vnItemCard', { - template: require('./card.html'), - controller: ItemCard + template: require('./index.html'), + controller: Controller }); diff --git a/client/item/src/create/create.spec.js b/client/item/src/create/create.spec.js index afadc285f..80bdd68ad 100644 --- a/client/item/src/create/create.spec.js +++ b/client/item/src/create/create.spec.js @@ -1,4 +1,4 @@ -import './create.js'; +import './index.js'; describe('Item', () => { describe('Component vnItemCreate', () => { diff --git a/client/item/src/create/create.html b/client/item/src/create/index.html similarity index 100% rename from client/item/src/create/create.html rename to client/item/src/create/index.html diff --git a/client/item/src/create/create.js b/client/item/src/create/index.js similarity index 74% rename from client/item/src/create/create.js rename to client/item/src/create/index.js index a74394891..b983078ea 100644 --- a/client/item/src/create/create.js +++ b/client/item/src/create/index.js @@ -1,6 +1,6 @@ import ngModule from '../module'; -class ItemCreate { +class Controller { constructor($scope, $state) { this.$ = $scope; this.$state = $state; @@ -15,9 +15,10 @@ class ItemCreate { ); } } -ItemCreate.$inject = ['$scope', '$state']; + +Controller.$inject = ['$scope', '$state']; ngModule.component('vnItemCreate', { - template: require('./create.html'), - controller: ItemCreate + template: require('./index.html'), + controller: Controller }); diff --git a/client/item/src/data/data.html b/client/item/src/data/index.html similarity index 100% rename from client/item/src/data/data.html rename to client/item/src/data/index.html diff --git a/client/item/src/data/data.js b/client/item/src/data/index.js similarity index 72% rename from client/item/src/data/data.js rename to client/item/src/data/index.js index bd3884555..899ce8fd3 100644 --- a/client/item/src/data/data.js +++ b/client/item/src/data/index.js @@ -1,10 +1,11 @@ import ngModule from '../module'; -class ItemData { +class Controller { constructor($scope, $timeout) { this.$scope = $scope; this.$timeout = $timeout; } + $onChanges(data) { this.$timeout(() => { this.$scope.watcher.data = data.item.currentValue; @@ -12,12 +13,12 @@ class ItemData { } } -ItemData.$inject = ['$scope', '$timeout']; +Controller.$inject = ['$scope', '$timeout']; ngModule.component('vnItemData', { - template: require('./data.html'), + template: require('./index.html'), bindings: { item: '<' }, - controller: ItemData + controller: Controller }); diff --git a/client/item/src/descriptor-popover/descriptor-popover.html b/client/item/src/descriptor-popover/index.html similarity index 100% rename from client/item/src/descriptor-popover/descriptor-popover.html rename to client/item/src/descriptor-popover/index.html diff --git a/client/item/src/descriptor-popover/descriptor-popover.js b/client/item/src/descriptor-popover/index.js similarity index 97% rename from client/item/src/descriptor-popover/descriptor-popover.js rename to client/item/src/descriptor-popover/index.js index 31e3bede1..c54300119 100644 --- a/client/item/src/descriptor-popover/descriptor-popover.js +++ b/client/item/src/descriptor-popover/index.js @@ -88,7 +88,7 @@ class Controller extends Component { Controller.$inject = ['$element', '$scope', '$http', '$timeout']; ngModule.component('vnItemDescriptorPopover', { - template: require('./descriptor-popover.html'), + template: require('./index.html'), bindings: { itemFk: '<' }, diff --git a/client/item/src/descriptor/descriptor.html b/client/item/src/descriptor/index.html similarity index 100% rename from client/item/src/descriptor/descriptor.html rename to client/item/src/descriptor/index.html diff --git a/client/item/src/descriptor/descriptor.js b/client/item/src/descriptor/index.js similarity index 80% rename from client/item/src/descriptor/descriptor.js rename to client/item/src/descriptor/index.js index edfc8eaf7..5d443b8e9 100644 --- a/client/item/src/descriptor/descriptor.js +++ b/client/item/src/descriptor/index.js @@ -2,7 +2,7 @@ import ngModule from '../module'; import './style.scss'; ngModule.component('vnItemDescriptor', { - template: require('./descriptor.html'), + template: require('./index.html'), bindings: { item: '<', itemTags: '<', diff --git a/client/item/src/filter-panel/filter-panel.html b/client/item/src/filter-panel/index.html similarity index 100% rename from client/item/src/filter-panel/filter-panel.html rename to client/item/src/filter-panel/index.html diff --git a/client/item/src/filter-panel/filter-panel.js b/client/item/src/filter-panel/index.js similarity index 66% rename from client/item/src/filter-panel/filter-panel.js rename to client/item/src/filter-panel/index.js index 608918b51..695a4710f 100644 --- a/client/item/src/filter-panel/filter-panel.js +++ b/client/item/src/filter-panel/index.js @@ -1,6 +1,6 @@ import ngModule from '../module'; -class ItemFilterPanel { +class Controller { constructor() { this.onSubmit = () => {}; } @@ -11,6 +11,6 @@ class ItemFilterPanel { } ngModule.component('vnItemFilterPanel', { - template: require('./filter-panel.html'), - controller: ItemFilterPanel + template: require('./index.html'), + controller: Controller }); diff --git a/client/item/src/history/history.html b/client/item/src/history/index.html similarity index 100% rename from client/item/src/history/history.html rename to client/item/src/history/index.html diff --git a/client/item/src/history/history.js b/client/item/src/history/index.js similarity index 79% rename from client/item/src/history/history.js rename to client/item/src/history/index.js index a6f8d154e..f788bf1da 100644 --- a/client/item/src/history/history.js +++ b/client/item/src/history/index.js @@ -2,6 +2,6 @@ import ngModule from '../module'; import FilterItemList from '../filter-item-list'; ngModule.component('vnItemHistory', { - template: require('./history.html'), + template: require('./index.html'), controller: FilterItemList }); diff --git a/client/item/src/list/list.html b/client/item/src/index/index.html similarity index 100% rename from client/item/src/list/list.html rename to client/item/src/index/index.html diff --git a/client/item/src/list/list.js b/client/item/src/index/index.js similarity index 86% rename from client/item/src/list/list.js rename to client/item/src/index/index.js index a7ed9a6c0..8ddc7ada4 100644 --- a/client/item/src/list/list.js +++ b/client/item/src/index/index.js @@ -2,7 +2,7 @@ import ngModule from '../module'; import './product'; import './style.scss'; -class ItemList { +class Controller { constructor($http, $state, $scope) { this.$http = $http; @@ -42,9 +42,10 @@ class ItemList { this.$scope.preview.show(); } } -ItemList.$inject = ['$http', '$state', '$scope']; -ngModule.component('vnItemList', { - template: require('./list.html'), - controller: ItemList +Controller.$inject = ['$http', '$state', '$scope']; + +ngModule.component('vnItemIndex', { + template: require('./index.html'), + controller: Controller }); diff --git a/client/item/src/list/preview.svg b/client/item/src/index/preview.svg similarity index 100% rename from client/item/src/list/preview.svg rename to client/item/src/index/preview.svg diff --git a/client/item/src/list/product.html b/client/item/src/index/product.html similarity index 100% rename from client/item/src/list/product.html rename to client/item/src/index/product.html diff --git a/client/item/src/list/product.js b/client/item/src/index/product.js similarity index 94% rename from client/item/src/list/product.js rename to client/item/src/index/product.js index 2d845a6d6..71d730e29 100644 --- a/client/item/src/list/product.js +++ b/client/item/src/index/product.js @@ -24,6 +24,6 @@ ngModule.component('vnItemProduct', { }, controller: ItemProduct, require: { - ItemList: '^vnItemList' + ItemList: '^vnItemIndex' } }); diff --git a/client/item/src/list/style.scss b/client/item/src/index/style.scss similarity index 100% rename from client/item/src/list/style.scss rename to client/item/src/index/style.scss diff --git a/client/item/src/item.js b/client/item/src/item.js index e0450d377..384e91661 100644 --- a/client/item/src/item.js +++ b/client/item/src/item.js @@ -1,18 +1,17 @@ export * from './module'; +import './index'; import './filter-item-list'; -import './list/list'; -import './filter-panel/filter-panel'; -import './create/create'; -import './card/card'; -import './descriptor/descriptor'; -import './data/data'; -import './tags/tags'; -import './tax/tax'; -import './history/history'; -import './niche/niche'; -import './botanical/botanical'; -import './barcode/barcode'; -import './summary/summary'; -import './descriptor-popover/descriptor-popover'; - +import './filter-panel'; +import './create'; +import './card'; +import './descriptor'; +import './data'; +import './tags'; +import './tax'; +import './history'; +import './niche'; +import './botanical'; +import './barcode'; +import './summary'; +import './descriptor-popover'; diff --git a/client/item/src/niche/niche.html b/client/item/src/niche/index.html similarity index 100% rename from client/item/src/niche/niche.html rename to client/item/src/niche/index.html diff --git a/client/item/src/niche/niche.js b/client/item/src/niche/index.js similarity index 99% rename from client/item/src/niche/niche.js rename to client/item/src/niche/index.js index d140e4b56..a01d3e139 100644 --- a/client/item/src/niche/niche.js +++ b/client/item/src/niche/index.js @@ -144,6 +144,6 @@ export default class Controller { Controller.$inject = ['$stateParams', '$scope', '$http', '$translate', 'vnApp']; ngModule.component('vnItemNiche', { - template: require('./niche.html'), + template: require('./index.html'), controller: Controller }); diff --git a/client/item/src/niche/niche.spec.js b/client/item/src/niche/niche.spec.js index 3c29de40b..c42fb781c 100644 --- a/client/item/src/niche/niche.spec.js +++ b/client/item/src/niche/niche.spec.js @@ -1,4 +1,4 @@ -import './niche.js'; +import './index.js'; describe('Item', () => { describe('Component vnItemNiche', () => { diff --git a/client/item/src/summary/summary.html b/client/item/src/summary/index.html similarity index 100% rename from client/item/src/summary/summary.html rename to client/item/src/summary/index.html diff --git a/client/item/src/summary/summary.js b/client/item/src/summary/index.js similarity index 95% rename from client/item/src/summary/summary.js rename to client/item/src/summary/index.js index 4101daaaa..ceda1d500 100644 --- a/client/item/src/summary/summary.js +++ b/client/item/src/summary/index.js @@ -1,6 +1,6 @@ import ngModule from '../module'; -class ItemSummary { +class Controller { constructor($http) { this.$http = $http; } @@ -83,11 +83,12 @@ class ItemSummary { } } } -ItemSummary.$inject = ['$http']; + +Controller.$inject = ['$http']; ngModule.component('vnItemSummary', { - template: require('./summary.html'), - controller: ItemSummary, + template: require('./index.html'), + controller: Controller, bindings: { item: '<' } diff --git a/client/item/src/tags/tags.html b/client/item/src/tags/index.html similarity index 100% rename from client/item/src/tags/tags.html rename to client/item/src/tags/index.html diff --git a/client/item/src/tags/tags.js b/client/item/src/tags/index.js similarity index 96% rename from client/item/src/tags/tags.js rename to client/item/src/tags/index.js index 1dad06d82..66997ae5e 100644 --- a/client/item/src/tags/tags.js +++ b/client/item/src/tags/index.js @@ -1,6 +1,6 @@ import ngModule from '../module'; -class ItemTags { +class Controller { constructor($stateParams, $scope, $http, $translate, vnApp) { this.params = $stateParams; this.$scope = $scope; @@ -156,11 +156,12 @@ class ItemTags { this._getItemTags(); } } -ItemTags.$inject = ['$stateParams', '$scope', '$http', '$translate', 'vnApp']; + +Controller.$inject = ['$stateParams', '$scope', '$http', '$translate', 'vnApp']; ngModule.component('vnItemTags', { - template: require('./tags.html'), - controller: ItemTags, + template: require('./index.html'), + controller: Controller, bindings: { itemTags: '=', selection: ' { describe('Component vnItemTags', () => { diff --git a/client/item/src/tax/tax.html b/client/item/src/tax/index.html similarity index 100% rename from client/item/src/tax/tax.html rename to client/item/src/tax/index.html diff --git a/client/item/src/tax/tax.js b/client/item/src/tax/index.js similarity index 96% rename from client/item/src/tax/tax.js rename to client/item/src/tax/index.js index 90a11b942..7f45df878 100644 --- a/client/item/src/tax/tax.js +++ b/client/item/src/tax/index.js @@ -26,6 +26,7 @@ export default class Controller { this.classes = json.data; }); } + submit() { let data = []; for (let tax of this.taxes) @@ -35,10 +36,11 @@ export default class Controller { this.$http.post(url, data); } } + Controller.$inject = ['$stateParams', '$http']; ngModule.component('vnItemTax', { - template: require('./tax.html'), + template: require('./index.html'), controller: Controller, bindings: { item: '<' diff --git a/client/ticket/routes.json b/client/ticket/routes.json index 2d481ba72..eb65fe367 100644 --- a/client/ticket/routes.json +++ b/client/ticket/routes.json @@ -11,9 +11,9 @@ "component": "ui-view" }, { - "url": "/list?q", - "state": "ticket.list", - "component": "vn-ticket-list" + "url": "/index?q", + "state": "ticket.index", + "component": "vn-ticket-index" }, { "url": "/create", @@ -146,7 +146,7 @@ { "url" : "/index", "state": "ticket.card.tracking.index", - "component": "vn-ticket-tracking", + "component": "vn-ticket-tracking-index", "params": { "ticket": "$ctrl.ticket" }, diff --git a/client/ticket/src/card/ticket-card.html b/client/ticket/src/card/index.html similarity index 100% rename from client/ticket/src/card/ticket-card.html rename to client/ticket/src/card/index.html diff --git a/client/ticket/src/card/ticket-card.js b/client/ticket/src/card/index.js similarity index 91% rename from client/ticket/src/card/ticket-card.js rename to client/ticket/src/card/index.js index 291c9c55a..22c126960 100644 --- a/client/ticket/src/card/ticket-card.js +++ b/client/ticket/src/card/index.js @@ -1,6 +1,6 @@ import ngModule from '../module'; -class TicketCard { +class Controller { constructor($http, $state) { this.$http = $http; this.$state = $state; @@ -47,13 +47,15 @@ class TicketCard { $onInit() { this._getTicket(); } + reload() { this._getTicket(); } } -TicketCard.$inject = ['$http', '$state']; + +Controller.$inject = ['$http', '$state']; ngModule.component('vnTicketCard', { - template: require('./ticket-card.html'), - controller: TicketCard + template: require('./index.html'), + controller: Controller }); diff --git a/client/ticket/src/component/component.spec.js b/client/ticket/src/component/component.spec.js index eb7268402..083b774e3 100644 --- a/client/ticket/src/component/component.spec.js +++ b/client/ticket/src/component/component.spec.js @@ -1,16 +1,19 @@ -import './component.js'; +import './index.js'; describe('ticket', () => { describe('Component vnTicketComponents', () => { let $componentController; + let $state; let controller; beforeEach(() => { angular.mock.module('ticket'); }); - beforeEach(angular.mock.inject(_$componentController_ => { + beforeEach(angular.mock.inject((_$componentController_, _$state_) => { $componentController = _$componentController_; + $state = _$state_; + $state.params.id = '1'; controller = $componentController('vnTicketComponents'); })); diff --git a/client/ticket/src/component/component.html b/client/ticket/src/component/index.html similarity index 100% rename from client/ticket/src/component/component.html rename to client/ticket/src/component/index.html diff --git a/client/ticket/src/component/component.js b/client/ticket/src/component/index.js similarity index 97% rename from client/ticket/src/component/component.js rename to client/ticket/src/component/index.js index 92e20852e..4eb51fe70 100644 --- a/client/ticket/src/component/component.js +++ b/client/ticket/src/component/index.js @@ -19,6 +19,7 @@ class Controller extends FilterTicketList { } return sum; } + base() { let sum; if (this.sales) { @@ -30,6 +31,7 @@ class Controller extends FilterTicketList { } return sum; } + profitMargin() { let sum; if (this.sales) { @@ -46,7 +48,7 @@ class Controller extends FilterTicketList { Controller.$inject = ['$scope', '$timeout', '$state']; ngModule.component('vnTicketComponents', { - template: require('./component.html'), + template: require('./index.html'), controller: Controller, bindings: { ticket: '<' diff --git a/client/ticket/src/create/ticket-create.html b/client/ticket/src/create/index.html similarity index 100% rename from client/ticket/src/create/ticket-create.html rename to client/ticket/src/create/index.html diff --git a/client/ticket/src/create/ticket-create.js b/client/ticket/src/create/index.js similarity index 71% rename from client/ticket/src/create/ticket-create.js rename to client/ticket/src/create/index.js index f9b33c16d..d7a59d800 100644 --- a/client/ticket/src/create/ticket-create.js +++ b/client/ticket/src/create/index.js @@ -1,6 +1,6 @@ import ngModule from '../module'; -class TicketCreate { +class Controller { constructor($scope, $state) { this.$ = $scope; this.$state = $state; @@ -13,9 +13,10 @@ class TicketCreate { ); } } -TicketCreate.$inject = ['$scope', '$state']; + +Controller.$inject = ['$scope', '$state']; ngModule.component('vnTicketCreate', { - template: require('./ticket-create.html'), - controller: TicketCreate + template: require('./index.html'), + controller: Controller }); diff --git a/client/ticket/src/data/data.html b/client/ticket/src/data/index.html similarity index 100% rename from client/ticket/src/data/data.html rename to client/ticket/src/data/index.html diff --git a/client/ticket/src/data/data.js b/client/ticket/src/data/index.js similarity index 94% rename from client/ticket/src/data/data.js rename to client/ticket/src/data/index.js index f2492fc6e..df04b75ea 100644 --- a/client/ticket/src/data/data.js +++ b/client/ticket/src/data/index.js @@ -28,7 +28,7 @@ class Controller { Controller.$inject = ['$scope', '$state']; ngModule.component('vnTicketData', { - template: require('./data.html'), + template: require('./index.html'), bindings: { ticket: '<' }, diff --git a/client/ticket/src/data/step-one/step-one.html b/client/ticket/src/data/step-one/index.html similarity index 100% rename from client/ticket/src/data/step-one/step-one.html rename to client/ticket/src/data/step-one/index.html diff --git a/client/ticket/src/data/step-one/step-one.js b/client/ticket/src/data/step-one/index.js similarity index 96% rename from client/ticket/src/data/step-one/step-one.js rename to client/ticket/src/data/step-one/index.js index 56bd74db6..f74a64c54 100644 --- a/client/ticket/src/data/step-one/step-one.js +++ b/client/ticket/src/data/step-one/index.js @@ -42,6 +42,7 @@ class Controller { return true; }, res => { + console.log(res); if (res.data.error.message === 'NO_AGENCY_AVAILABLE') this.vnApp.showError( this.$translate.instant(`There's no available agency for this landing date`) @@ -58,7 +59,7 @@ class Controller { Controller.$inject = ['$scope', '$http', '$translate', 'vnApp']; ngModule.component('vnTicketDataStepOne', { - template: require('./step-one.html'), + template: require('./index.html'), controller: Controller, bindings: { ticket: '<' diff --git a/client/ticket/src/data/step-one/step-one.spec.js b/client/ticket/src/data/step-one/step-one.spec.js index 051547e87..f00198308 100644 --- a/client/ticket/src/data/step-one/step-one.spec.js +++ b/client/ticket/src/data/step-one/step-one.spec.js @@ -1,4 +1,4 @@ -import './step-one.js'; +import './index.js'; describe('ticket', () => { describe('Component vnTicketDataStepOne', () => { @@ -25,8 +25,8 @@ describe('ticket', () => { addressFk: 121, agencyModeFk: 1, companyFk: 442, - shipped: Date.now(), - landed: Date.now() + shipped: new Date(), + landed: new Date() }; let result = controller.isFormInvalid(); @@ -42,20 +42,20 @@ describe('ticket', () => { addressFk: 121, agencyModeFk: 1, companyFk: 442, - shipped: Date.now(), - landed: Date.now() + shipped: new Date(), + landed: new Date() }; let data = { addressFk: 121, agencyModeFk: 1, - landed: Date.now() + landed: new Date() }; - let response = {error: {message: 'NO_AGENCY_AVAILABLE'}}; + let response = {data: {error: new Error('NO_AGENCY_AVAILABLE')}}; $httpBackend.whenPOST(`/ticket/api/sales/1/priceDifference`, data).respond(400, response); $httpBackend.expectPOST(`/ticket/api/sales/1/priceDifference`, data); - controller.onStepChange(); + await controller.onStepChange(); $httpBackend.flush(); }); }); diff --git a/client/ticket/src/data/step-three/step-three.html b/client/ticket/src/data/step-three/index.html similarity index 100% rename from client/ticket/src/data/step-three/step-three.html rename to client/ticket/src/data/step-three/index.html diff --git a/client/ticket/src/data/step-three/step-three.js b/client/ticket/src/data/step-three/index.js similarity index 97% rename from client/ticket/src/data/step-three/step-three.js rename to client/ticket/src/data/step-three/index.js index f09400bf3..f5b738996 100644 --- a/client/ticket/src/data/step-three/step-three.js +++ b/client/ticket/src/data/step-three/index.js @@ -1,7 +1,6 @@ import ngModule from '../../module'; class Controller { - constructor($http, $scope, $state, $translate, vnApp) { this.$http = $http; this.$scope = $scope; @@ -50,7 +49,7 @@ class Controller { Controller.$inject = ['$http', '$scope', '$state', '$translate', 'vnApp']; ngModule.component('vnTicketDataStepThree', { - template: require('./step-three.html'), + template: require('./index.html'), controller: Controller, bindings: { ticket: '<' diff --git a/client/ticket/src/data/step-two/step-two.html b/client/ticket/src/data/step-two/index.html similarity index 100% rename from client/ticket/src/data/step-two/step-two.html rename to client/ticket/src/data/step-two/index.html diff --git a/client/ticket/src/data/step-two/step-two.js b/client/ticket/src/data/step-two/index.js similarity index 91% rename from client/ticket/src/data/step-two/step-two.js rename to client/ticket/src/data/step-two/index.js index b0ed76a00..493299f52 100644 --- a/client/ticket/src/data/step-two/step-two.js +++ b/client/ticket/src/data/step-two/index.js @@ -1,7 +1,6 @@ import ngModule from '../../module'; class Controller { - constructor($http) { this.$http = $http; } @@ -18,7 +17,7 @@ class Controller { Controller.$inject = ['$http']; ngModule.component('vnTicketDataStepTwo', { - template: require('./step-two.html'), + template: require('./index.html'), controller: Controller, bindings: { ticket: '<' diff --git a/client/ticket/src/descriptor/descriptor.html b/client/ticket/src/descriptor/index.html similarity index 98% rename from client/ticket/src/descriptor/descriptor.html rename to client/ticket/src/descriptor/index.html index bc6274560..2f00e811a 100644 --- a/client/ticket/src/descriptor/descriptor.html +++ b/client/ticket/src/descriptor/index.html @@ -1,6 +1,6 @@ - + diff --git a/client/ticket/src/descriptor/descriptor.js b/client/ticket/src/descriptor/index.js similarity index 73% rename from client/ticket/src/descriptor/descriptor.js rename to client/ticket/src/descriptor/index.js index 907e6ea09..ee40fdd94 100644 --- a/client/ticket/src/descriptor/descriptor.js +++ b/client/ticket/src/descriptor/index.js @@ -1,7 +1,7 @@ import ngModule from '../module'; ngModule.component('vnTicketDescriptor', { - template: require('./descriptor.html'), + template: require('./index.html'), bindings: { ticket: '<' } diff --git a/client/ticket/src/expedition/ticket-expedition.html b/client/ticket/src/expedition/index.html similarity index 100% rename from client/ticket/src/expedition/ticket-expedition.html rename to client/ticket/src/expedition/index.html diff --git a/client/ticket/src/expedition/ticket-expedition.js b/client/ticket/src/expedition/index.js similarity index 92% rename from client/ticket/src/expedition/ticket-expedition.js rename to client/ticket/src/expedition/index.js index 244c3cb04..4eb91af50 100644 --- a/client/ticket/src/expedition/ticket-expedition.js +++ b/client/ticket/src/expedition/index.js @@ -7,6 +7,7 @@ class Controller extends FilterTicketList { this.params = $stateParams; this.$http = $http; } + deleteExpedition(expedition) { this.$http.delete(`/ticket/api/Expeditions/${expedition.id}`, this.params).then( () => this.$.index.accept() @@ -17,6 +18,6 @@ class Controller extends FilterTicketList { Controller.$inject = ['$scope', '$timeout', '$state', '$http']; ngModule.component('vnTicketExpedition', { - template: require('./ticket-expedition.html'), + template: require('./index.html'), controller: Controller }); diff --git a/client/ticket/src/fetched-tags/fetched-tags.html b/client/ticket/src/fetched-tags/index.html similarity index 100% rename from client/ticket/src/fetched-tags/fetched-tags.html rename to client/ticket/src/fetched-tags/index.html diff --git a/client/ticket/src/fetched-tags/fetched-tags.js b/client/ticket/src/fetched-tags/index.js similarity index 55% rename from client/ticket/src/fetched-tags/fetched-tags.js rename to client/ticket/src/fetched-tags/index.js index e993aba11..1b8341bdc 100644 --- a/client/ticket/src/fetched-tags/fetched-tags.js +++ b/client/ticket/src/fetched-tags/index.js @@ -1,10 +1,7 @@ import ngModule from '../module'; -class Controller {} - ngModule.component('vnFetchedTags', { - template: require('./fetched-tags.html'), - controller: Controller, + template: require('./index.html'), bindings: { sale: '<' } diff --git a/client/ticket/src/list/ticket-list.html b/client/ticket/src/index/index.html similarity index 100% rename from client/ticket/src/list/ticket-list.html rename to client/ticket/src/index/index.html diff --git a/client/ticket/src/list/ticket-list.js b/client/ticket/src/index/index.js similarity index 92% rename from client/ticket/src/list/ticket-list.js rename to client/ticket/src/index/index.js index d1aa2ac86..fe75368e3 100644 --- a/client/ticket/src/list/ticket-list.js +++ b/client/ticket/src/index/index.js @@ -41,7 +41,7 @@ export default class Controller { Controller.$inject = ['$scope']; -ngModule.component('vnTicketList', { - template: require('./ticket-list.html'), +ngModule.component('vnTicketIndex', { + template: require('./index.html'), controller: Controller }); diff --git a/client/ticket/src/list/style.scss b/client/ticket/src/index/style.scss similarity index 100% rename from client/ticket/src/list/style.scss rename to client/ticket/src/index/style.scss diff --git a/client/ticket/src/list/ticket-list.spec.js b/client/ticket/src/index/ticket-index.spec.js similarity index 92% rename from client/ticket/src/list/ticket-list.spec.js rename to client/ticket/src/index/ticket-index.spec.js index 6a50756a2..f6a004948 100644 --- a/client/ticket/src/list/ticket-list.spec.js +++ b/client/ticket/src/index/ticket-index.spec.js @@ -1,7 +1,7 @@ -import './ticket-list.js'; +import './index.js'; describe('ticket', () => { - describe('Component vnTicketList', () => { + describe('Component vnTicketIndex', () => { let $componentController; let controller; @@ -11,7 +11,7 @@ describe('ticket', () => { beforeEach(angular.mock.inject(_$componentController_ => { $componentController = _$componentController_; - controller = $componentController('vnTicketList'); + controller = $componentController('vnTicketIndex'); })); describe('compareDate()', () => { diff --git a/client/ticket/src/list/ticket-item.html b/client/ticket/src/index/ticket-item.html similarity index 100% rename from client/ticket/src/list/ticket-item.html rename to client/ticket/src/index/ticket-item.html diff --git a/client/ticket/src/list/ticket-item.js b/client/ticket/src/index/ticket-item.js similarity index 83% rename from client/ticket/src/list/ticket-item.js rename to client/ticket/src/index/ticket-item.js index 94252b9d2..c62a989d9 100644 --- a/client/ticket/src/list/ticket-item.js +++ b/client/ticket/src/index/ticket-item.js @@ -8,7 +8,7 @@ class Controller { preview(event) { event.preventDefault(); - this.list.openSummary(this.ticket); + this.index.openSummary(this.ticket); } } @@ -19,6 +19,6 @@ ngModule.component('vnTicketItem', { ticket: '<' }, require: { - list: '^vnTicketList' + index: '^vnTicketIndex' } }); diff --git a/client/ticket/src/note/ticket-observation.html b/client/ticket/src/note/index.html similarity index 100% rename from client/ticket/src/note/ticket-observation.html rename to client/ticket/src/note/index.html diff --git a/client/ticket/src/note/ticket-observation.js b/client/ticket/src/note/index.js similarity index 98% rename from client/ticket/src/note/ticket-observation.js rename to client/ticket/src/note/index.js index f2e9f3425..e682b5514 100644 --- a/client/ticket/src/note/ticket-observation.js +++ b/client/ticket/src/note/index.js @@ -132,7 +132,7 @@ class Controller { Controller.$inject = ['$stateParams', '$scope', '$http', '$translate', 'vnApp']; ngModule.component('vnTicketObservation', { - template: require('./ticket-observation.html'), + template: require('./index.html'), controller: Controller, bindings: { ticket: '<' diff --git a/client/ticket/src/note/ticket-observation.spec.js b/client/ticket/src/note/ticket-observation.spec.js index ceed1d232..7d58abd81 100644 --- a/client/ticket/src/note/ticket-observation.spec.js +++ b/client/ticket/src/note/ticket-observation.spec.js @@ -1,4 +1,4 @@ -import './ticket-observation.js'; +import './index.js'; describe('ticket', () => { describe('Component vnTicketObservation', () => { diff --git a/client/ticket/src/package/index/package.html b/client/ticket/src/package/index.html similarity index 100% rename from client/ticket/src/package/index/package.html rename to client/ticket/src/package/index.html diff --git a/client/ticket/src/package/index/package.js b/client/ticket/src/package/index.js similarity index 96% rename from client/ticket/src/package/index/package.js rename to client/ticket/src/package/index.js index 78b3bca94..a3f1119f9 100644 --- a/client/ticket/src/package/index/package.js +++ b/client/ticket/src/package/index.js @@ -1,7 +1,6 @@ -import ngModule from '../../module'; +import ngModule from '../module'; class Controller { - constructor($http, $scope, $translate, vnApp) { this.$http = $http; this.$ = $scope; @@ -85,7 +84,7 @@ class Controller { Controller.$inject = ['$http', '$scope', '$translate', 'vnApp']; ngModule.component('vnTicketPackageIndex', { - template: require('./package.html'), + template: require('./index.html'), controller: Controller, bindings: { ticket: '<' diff --git a/client/ticket/src/package/index/locale/es.yml b/client/ticket/src/package/locale/es.yml similarity index 100% rename from client/ticket/src/package/index/locale/es.yml rename to client/ticket/src/package/locale/es.yml diff --git a/client/ticket/src/package/index/package.spec.js b/client/ticket/src/package/package.spec.js similarity index 98% rename from client/ticket/src/package/index/package.spec.js rename to client/ticket/src/package/package.spec.js index 50aa0c23e..81bddc9f6 100644 --- a/client/ticket/src/package/index/package.spec.js +++ b/client/ticket/src/package/package.spec.js @@ -1,4 +1,4 @@ -import './package.js'; +import './index.js'; describe('Ticket', () => { describe('Component vnTicketPackageIndex', () => { diff --git a/client/ticket/src/sale-checked/sale-checked.html b/client/ticket/src/sale-checked/index.html similarity index 100% rename from client/ticket/src/sale-checked/sale-checked.html rename to client/ticket/src/sale-checked/index.html diff --git a/client/ticket/src/sale-checked/sale-checked.js b/client/ticket/src/sale-checked/index.js similarity index 89% rename from client/ticket/src/sale-checked/sale-checked.js rename to client/ticket/src/sale-checked/index.js index ff5bf01a4..5feb145c6 100644 --- a/client/ticket/src/sale-checked/sale-checked.js +++ b/client/ticket/src/sale-checked/index.js @@ -12,6 +12,6 @@ class Controller extends FilterTicketList { Controller.$inject = ['$scope', '$timeout', '$state']; ngModule.component('vnTicketSaleChecked', { - template: require('./sale-checked.html'), + template: require('./index.html'), controller: Controller }); diff --git a/client/ticket/src/sale/sale.html b/client/ticket/src/sale/index.html similarity index 100% rename from client/ticket/src/sale/sale.html rename to client/ticket/src/sale/index.html diff --git a/client/ticket/src/sale/sale.js b/client/ticket/src/sale/index.js similarity index 98% rename from client/ticket/src/sale/sale.js rename to client/ticket/src/sale/index.js index eb95de8ee..d00f619b5 100644 --- a/client/ticket/src/sale/sale.js +++ b/client/ticket/src/sale/index.js @@ -67,7 +67,7 @@ class Controller extends FilterTicketList { Controller.$inject = ['$scope', '$timeout', '$state', '$http']; ngModule.component('vnTicketSale', { - template: require('./sale.html'), + template: require('./index.html'), controller: Controller, bindings: { ticket: '<' diff --git a/client/ticket/src/sale/sale.spec.js b/client/ticket/src/sale/sale.spec.js index dd7da0867..9ce3cef2e 100644 --- a/client/ticket/src/sale/sale.spec.js +++ b/client/ticket/src/sale/sale.spec.js @@ -1,4 +1,4 @@ -import './sale.js'; +import './index.js'; describe('Ticket', () => { describe('Component vnTicketSale', () => { diff --git a/client/ticket/src/summary/ticket-summary.html b/client/ticket/src/summary/index.html similarity index 100% rename from client/ticket/src/summary/ticket-summary.html rename to client/ticket/src/summary/index.html diff --git a/client/ticket/src/summary/ticket-summary.js b/client/ticket/src/summary/index.js similarity index 91% rename from client/ticket/src/summary/ticket-summary.js rename to client/ticket/src/summary/index.js index e66fdd3fa..cb17ba909 100644 --- a/client/ticket/src/summary/ticket-summary.js +++ b/client/ticket/src/summary/index.js @@ -20,7 +20,7 @@ class Controller { Controller.$inject = ['$http']; ngModule.component('vnTicketSummary', { - template: require('./ticket-summary.html'), + template: require('./index.html'), controller: Controller, bindings: { ticket: '<' diff --git a/client/ticket/src/ticket.js b/client/ticket/src/ticket.js index 1ec452142..6719d535f 100644 --- a/client/ticket/src/ticket.js +++ b/client/ticket/src/ticket.js @@ -1,21 +1,21 @@ export * from './module'; -import './list/ticket-list'; -import './create/ticket-create'; -import './card/ticket-card'; -import './descriptor/descriptor'; -import './summary/ticket-summary'; -import './data/data'; -import './data/step-one/step-one'; -import './data/step-two/step-two'; -import './data/step-three/step-three'; -import './note/ticket-observation'; -import './expedition/ticket-expedition'; -import './volume/ticket-volume'; -import './package/index/package'; -import './sale/sale'; +import './index'; +import './create'; +import './card'; +import './descriptor'; +import './summary'; +import './data'; +import './data/step-one'; +import './data/step-two'; +import './data/step-three'; +import './note'; +import './expedition'; +import './volume'; +import './package/index'; +import './sale'; import './tracking/index'; -import './tracking/edit/edit'; -import './fetched-tags/fetched-tags'; -import './sale-checked/sale-checked'; -import './component/component'; +import './tracking/edit'; +import './fetched-tags'; +import './sale-checked'; +import './component'; diff --git a/client/ticket/src/tracking/edit/edit.html b/client/ticket/src/tracking/edit/index.html similarity index 100% rename from client/ticket/src/tracking/edit/edit.html rename to client/ticket/src/tracking/edit/index.html diff --git a/client/ticket/src/tracking/edit/edit.js b/client/ticket/src/tracking/edit/index.js similarity index 94% rename from client/ticket/src/tracking/edit/edit.js rename to client/ticket/src/tracking/edit/index.js index 1d6c3e4b4..baf5e19a0 100644 --- a/client/ticket/src/tracking/edit/edit.js +++ b/client/ticket/src/tracking/edit/index.js @@ -23,7 +23,7 @@ class Controller { Controller.$inject = ['$scope', '$state', 'vnApp', '$translate']; ngModule.component('vnTicketTrackingEdit', { - template: require('./edit.html'), + template: require('./index.html'), controller: Controller, require: { card: '^vnTicketCard' diff --git a/client/ticket/src/tracking/index.js b/client/ticket/src/tracking/index.js deleted file mode 100644 index fc0777775..000000000 --- a/client/ticket/src/tracking/index.js +++ /dev/null @@ -1,7 +0,0 @@ -import ngModule from '../module'; -import FilterTicketList from '../filter-ticket-list'; - -ngModule.component('vnTicketTracking', { - template: require('./index.html'), - controller: FilterTicketList -}); diff --git a/client/ticket/src/tracking/index.html b/client/ticket/src/tracking/index/index.html similarity index 100% rename from client/ticket/src/tracking/index.html rename to client/ticket/src/tracking/index/index.html diff --git a/client/ticket/src/tracking/index/index.js b/client/ticket/src/tracking/index/index.js new file mode 100644 index 000000000..8c5e95ea7 --- /dev/null +++ b/client/ticket/src/tracking/index/index.js @@ -0,0 +1,7 @@ +import ngModule from '../../module'; +import FilterTicketList from '../../filter-ticket-list'; + +ngModule.component('vnTicketTrackingIndex', { + template: require('./index.html'), + controller: FilterTicketList +}); diff --git a/client/ticket/src/volume/ticket-volume.html b/client/ticket/src/volume/index.html similarity index 100% rename from client/ticket/src/volume/ticket-volume.html rename to client/ticket/src/volume/index.html diff --git a/client/ticket/src/volume/ticket-volume.js b/client/ticket/src/volume/index.js similarity index 96% rename from client/ticket/src/volume/ticket-volume.js rename to client/ticket/src/volume/index.js index d0235dd91..2b473cd45 100644 --- a/client/ticket/src/volume/ticket-volume.js +++ b/client/ticket/src/volume/index.js @@ -33,7 +33,7 @@ class Controller extends FilterTicketList { Controller.$inject = ['$scope', '$http', '$translate', '$timeout', '$state']; ngModule.component('vnTicketVolume', { - template: require('./ticket-volume.html'), + template: require('./index.html'), controller: Controller, bindings: { ticket: '<' diff --git a/client/ticket/src/volume/ticket-volume.spec.js b/client/ticket/src/volume/ticket-volume.spec.js index bd367ee6c..d630bad0a 100644 --- a/client/ticket/src/volume/ticket-volume.spec.js +++ b/client/ticket/src/volume/ticket-volume.spec.js @@ -1,4 +1,4 @@ -import './ticket-volume'; +import './index'; describe('ticket', () => { describe('Component vnTicketVolume', () => { diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index 20fb52730..932a0777d 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -8,12 +8,12 @@ export default { applicationsMenuButton: `#apps`, applicationsMenuVisible: `vn-main-menu [vn-id="apps-menu"] ul`, clientsButton: `vn-main-menu [vn-id="apps-menu"] ul > li[ui-sref="client.index"]`, - ticketsButton: `vn-main-menu [vn-id="apps-menu"] ul > li[ui-sref="ticket.list"]` + ticketsButton: `vn-main-menu [vn-id="apps-menu"] ul > li[ui-sref="ticket.index"]` }, moduleAccessView: { clientsSectionButton: `vn-home a[ui-sref="client.index"]`, itemsSectionButton: `vn-home a[ui-sref="item.index"]`, - ticketsSectionButton: `vn-home a[ui-sref="ticket.list"]` + ticketsSectionButton: `vn-home a[ui-sref="ticket.index"]` }, clientsIndex: { searchClientInput: `${components.vnTextfield}`, @@ -157,10 +157,10 @@ export default { searchResult: `vn-item-product a`, searchResultPreviewButton: `vn-item-product .buttons > [icon="desktop_windows"]`, searchResultCloneButton: `vn-item-product .buttons > [icon="icon-clone"]`, - acceptClonationAlertButton: `vn-item-list [vn-id="clone"] [response="ACCEPT"]`, + acceptClonationAlertButton: `vn-item-index [vn-id="clone"] [response="ACCEPT"]`, searchItemInput: `${components.vnTextfield}`, searchButton: `${components.vnSearchBar} > vn-icon-button`, - closeItemSummaryPreview: 'vn-item-list [vn-id="preview"] button.close' + closeItemSummaryPreview: 'vn-item-index [vn-id="preview"] button.close' }, itemCreateView: { name: `${components.vnTextfield}[name="name"]`, diff --git a/e2e/paths/item-module/01_item_summary.spec.js b/e2e/paths/item-module/01_item_summary.spec.js index caee7f0fb..14bcf6200 100644 --- a/e2e/paths/item-module/01_item_summary.spec.js +++ b/e2e/paths/item-module/01_item_summary.spec.js @@ -16,7 +16,7 @@ describe('Item', () => { .wait(selectors.itemsIndex.createItemButton) .parsedUrl() .then(url => { - expect(url.hash).toEqual('#!/item/list'); + expect(url.hash).toEqual('#!/item/index'); }); }); diff --git a/e2e/paths/item-module/02_edit_item_basic_data.spec.js b/e2e/paths/item-module/02_edit_item_basic_data.spec.js index d6a5fac5c..1edf433be 100644 --- a/e2e/paths/item-module/02_edit_item_basic_data.spec.js +++ b/e2e/paths/item-module/02_edit_item_basic_data.spec.js @@ -16,7 +16,7 @@ describe('Item', () => { .wait(selectors.itemsIndex.createItemButton) .parsedUrl() .then(url => { - expect(url.hash).toEqual('#!/item/list'); + expect(url.hash).toEqual('#!/item/index'); }); }); diff --git a/e2e/paths/item-module/03_edit_item_tax.spec.js b/e2e/paths/item-module/03_edit_item_tax.spec.js index 0e8713706..9795074a7 100644 --- a/e2e/paths/item-module/03_edit_item_tax.spec.js +++ b/e2e/paths/item-module/03_edit_item_tax.spec.js @@ -16,7 +16,7 @@ describe('Item', () => { .wait(selectors.itemsIndex.createItemButton) .parsedUrl() .then(url => { - expect(url.hash).toEqual('#!/item/list'); + expect(url.hash).toEqual('#!/item/index'); }); }); diff --git a/e2e/paths/item-module/04_create_item_tags.spec.js b/e2e/paths/item-module/04_create_item_tags.spec.js index 2354df3fe..ec9534d12 100644 --- a/e2e/paths/item-module/04_create_item_tags.spec.js +++ b/e2e/paths/item-module/04_create_item_tags.spec.js @@ -16,7 +16,7 @@ describe('Item', () => { .wait(selectors.itemsIndex.createItemButton) .parsedUrl() .then(url => { - expect(url.hash).toEqual('#!/item/list'); + expect(url.hash).toEqual('#!/item/index'); }); }); diff --git a/e2e/paths/item-module/05_create_item_niche.spec.js b/e2e/paths/item-module/05_create_item_niche.spec.js index 5468ceeb1..137ce2e4e 100644 --- a/e2e/paths/item-module/05_create_item_niche.spec.js +++ b/e2e/paths/item-module/05_create_item_niche.spec.js @@ -16,7 +16,7 @@ describe('Item', () => { .wait(selectors.itemsIndex.createItemButton) .parsedUrl() .then(url => { - expect(url.hash).toEqual('#!/item/list'); + expect(url.hash).toEqual('#!/item/index'); }); }); diff --git a/e2e/paths/item-module/06_create_item_botanical.spec.js b/e2e/paths/item-module/06_create_item_botanical.spec.js index 00eea71e2..1d2274803 100644 --- a/e2e/paths/item-module/06_create_item_botanical.spec.js +++ b/e2e/paths/item-module/06_create_item_botanical.spec.js @@ -16,7 +16,7 @@ describe('Item', () => { .wait(selectors.itemsIndex.createItemButton) .parsedUrl() .then(url => { - expect(url.hash).toEqual('#!/item/list'); + expect(url.hash).toEqual('#!/item/index'); }); }); diff --git a/e2e/paths/item-module/07_create_item_barcode.spec.js b/e2e/paths/item-module/07_create_item_barcode.spec.js index b1f1d9364..c326d2ac1 100644 --- a/e2e/paths/item-module/07_create_item_barcode.spec.js +++ b/e2e/paths/item-module/07_create_item_barcode.spec.js @@ -16,7 +16,7 @@ describe('Item', () => { .wait(selectors.itemsIndex.createItemButton) .parsedUrl() .then(url => { - expect(url.hash).toEqual('#!/item/list'); + expect(url.hash).toEqual('#!/item/index'); }); }); diff --git a/e2e/paths/item-module/08_item_create_and_clone.spec.js b/e2e/paths/item-module/08_item_create_and_clone.spec.js index f07d2ac75..2a4e7b8cf 100644 --- a/e2e/paths/item-module/08_item_create_and_clone.spec.js +++ b/e2e/paths/item-module/08_item_create_and_clone.spec.js @@ -15,7 +15,7 @@ describe('Item', () => { .wait(selectors.itemsIndex.createItemButton) .parsedUrl() .then(url => { - expect(url.hash).toEqual('#!/item/list'); + expect(url.hash).toEqual('#!/item/index'); }); }); @@ -47,7 +47,7 @@ describe('Item', () => { .wait(selectors.itemsIndex.createItemButton) .parsedUrl() .then(url => { - expect(url.hash).toEqual('#!/item/list'); + expect(url.hash).toEqual('#!/item/index'); }); }); @@ -107,10 +107,10 @@ describe('Item', () => { return nightmare .click(selectors.itemBasicData.goToItemIndexButton) .wait(selectors.itemsIndex.createItemButton) - .waitForURL('#!/item/list') + .waitForURL('#!/item/index') .parsedUrl() .then(url => { - expect(url.hash).toContain('#!/item/list'); + expect(url.hash).toContain('#!/item/index'); }); }); diff --git a/e2e/paths/ticket-module/01_create_ticket_observations.spec.js b/e2e/paths/ticket-module/01_create_ticket_observations.spec.js index 3f6599bca..9905145d8 100644 --- a/e2e/paths/ticket-module/01_create_ticket_observations.spec.js +++ b/e2e/paths/ticket-module/01_create_ticket_observations.spec.js @@ -16,7 +16,7 @@ describe('Ticket', () => { .wait(selectors.ticketsIndex.createTicketButton) .parsedUrl() .then(url => { - expect(url.hash).toEqual('#!/ticket/list'); + expect(url.hash).toEqual('#!/ticket/index'); }); }); diff --git a/e2e/paths/ticket-module/02_delete_ticket_expeditions.spec.js b/e2e/paths/ticket-module/02_delete_ticket_expeditions.spec.js index f5cf14114..559358439 100644 --- a/e2e/paths/ticket-module/02_delete_ticket_expeditions.spec.js +++ b/e2e/paths/ticket-module/02_delete_ticket_expeditions.spec.js @@ -16,7 +16,7 @@ describe('Ticket', () => { .wait(selectors.ticketsIndex.createTicketButton) .parsedUrl() .then(url => { - expect(url.hash).toEqual('#!/ticket/list'); + expect(url.hash).toEqual('#!/ticket/index'); }); }); diff --git a/e2e/paths/ticket-module/03_list_sale.spec.js b/e2e/paths/ticket-module/03_list_sale.spec.js index 983b45d67..d9cf449a9 100644 --- a/e2e/paths/ticket-module/03_list_sale.spec.js +++ b/e2e/paths/ticket-module/03_list_sale.spec.js @@ -18,7 +18,7 @@ describe('Ticket', () => { .wait(selectors.ticketsIndex.createTicketButton) .parsedUrl() .then(url => { - expect(url.hash).toEqual('#!/ticket/list'); + expect(url.hash).toEqual('#!/ticket/index'); }); }); diff --git a/e2e/paths/ticket-module/04_create_ticket_packages.spec.js b/e2e/paths/ticket-module/04_create_ticket_packages.spec.js index 3ede66af2..1b98f9190 100644 --- a/e2e/paths/ticket-module/04_create_ticket_packages.spec.js +++ b/e2e/paths/ticket-module/04_create_ticket_packages.spec.js @@ -18,7 +18,7 @@ // .wait(selectors.ticketsIndex.createTicketButton) // .parsedUrl() // .then(url => { -// expect(url.hash).toEqual('#!/ticket/list'); +// expect(url.hash).toEqual('#!/ticket/index'); // }); // }); diff --git a/e2e/paths/ticket-module/05_create_new_tracking_state.spec.js b/e2e/paths/ticket-module/05_create_new_tracking_state.spec.js index b0547be0e..028c195a9 100644 --- a/e2e/paths/ticket-module/05_create_new_tracking_state.spec.js +++ b/e2e/paths/ticket-module/05_create_new_tracking_state.spec.js @@ -18,7 +18,7 @@ describe('Ticket', () => { .wait(selectors.ticketsIndex.createTicketButton) .parsedUrl() .then(url => { - expect(url.hash).toEqual('#!/ticket/list'); + expect(url.hash).toEqual('#!/ticket/index'); }); });