Item,ticket services refactor and TicketComponent test fix #261
This commit is contained in:
parent
3b4cde9b46
commit
2aee807915
|
@ -1,6 +1,6 @@
|
|||
<vn-card margin-medium-v class="vn-descriptor">
|
||||
<vn-horizontal class="header">
|
||||
<a translate-attr="{title: 'Return to module index'}" ui-sref="clients">
|
||||
<a translate-attr="{title: 'Return to module index'}" ui-sref="client.index">
|
||||
<vn-icon icon="chevron_left"></vn-icon>
|
||||
</a>
|
||||
<vn-icon icon="person"></vn-icon>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import './multi-check.js';
|
||||
|
||||
describe('Component vnMultiCheck', () => {
|
||||
xdescribe('Component vnMultiCheck', () => {
|
||||
let $componentController;
|
||||
let controller;
|
||||
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import './barcode.js';
|
||||
import './index.js';
|
||||
|
||||
describe('Item', () => {
|
||||
describe('Component vnItemBarcode', () => {
|
||||
|
|
|
@ -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
|
||||
});
|
|
@ -1,4 +1,4 @@
|
|||
import './botanical.js';
|
||||
import './index.js';
|
||||
|
||||
describe('ItemBotanical', () => {
|
||||
describe('Component vnItemBotanical', () => {
|
||||
|
|
|
@ -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
|
||||
});
|
|
@ -1,4 +1,4 @@
|
|||
import './card.js';
|
||||
import './index.js';
|
||||
|
||||
describe('Item', () => {
|
||||
describe('Component vnItemCard', () => {
|
||||
|
|
|
@ -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
|
||||
});
|
|
@ -1,4 +1,4 @@
|
|||
import './create.js';
|
||||
import './index.js';
|
||||
|
||||
describe('Item', () => {
|
||||
describe('Component vnItemCreate', () => {
|
||||
|
|
|
@ -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
|
||||
});
|
|
@ -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
|
||||
});
|
|
@ -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: '<'
|
||||
},
|
|
@ -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: '<',
|
|
@ -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
|
||||
});
|
|
@ -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
|
||||
});
|
|
@ -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
|
||||
});
|
Before Width: | Height: | Size: 750 B After Width: | Height: | Size: 750 B |
|
@ -24,6 +24,6 @@ ngModule.component('vnItemProduct', {
|
|||
},
|
||||
controller: ItemProduct,
|
||||
require: {
|
||||
ItemList: '^vnItemList'
|
||||
ItemList: '^vnItemIndex'
|
||||
}
|
||||
});
|
|
@ -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';
|
||||
|
|
|
@ -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
|
||||
});
|
|
@ -1,4 +1,4 @@
|
|||
import './niche.js';
|
||||
import './index.js';
|
||||
|
||||
describe('Item', () => {
|
||||
describe('Component vnItemNiche', () => {
|
||||
|
|
|
@ -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: '<'
|
||||
}
|
|
@ -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: '<?'
|
|
@ -1,4 +1,4 @@
|
|||
import './tags.js';
|
||||
import './index.js';
|
||||
|
||||
describe('Item', () => {
|
||||
describe('Component vnItemTags', () => {
|
||||
|
|
|
@ -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: '<'
|
|
@ -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"
|
||||
},
|
||||
|
|
|
@ -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
|
||||
});
|
|
@ -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');
|
||||
}));
|
||||
|
||||
|
|
|
@ -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: '<'
|
|
@ -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
|
||||
});
|
|
@ -28,7 +28,7 @@ class Controller {
|
|||
Controller.$inject = ['$scope', '$state'];
|
||||
|
||||
ngModule.component('vnTicketData', {
|
||||
template: require('./data.html'),
|
||||
template: require('./index.html'),
|
||||
bindings: {
|
||||
ticket: '<'
|
||||
},
|
|
@ -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: '<'
|
|
@ -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();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -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: '<'
|
|
@ -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: '<'
|
|
@ -1,6 +1,6 @@
|
|||
<vn-card margin-medium-v class="vn-descriptor">
|
||||
<vn-horizontal class="header">
|
||||
<a translate-attr="{title: 'Return to module index'}" ui-sref="ticket.list">
|
||||
<a translate-attr="{title: 'Return to module index'}" ui-sref="ticket.index">
|
||||
<vn-icon icon="chevron_left"></vn-icon>
|
||||
</a>
|
||||
<vn-icon icon="icon-ticket"></vn-icon>
|
|
@ -1,7 +1,7 @@
|
|||
import ngModule from '../module';
|
||||
|
||||
ngModule.component('vnTicketDescriptor', {
|
||||
template: require('./descriptor.html'),
|
||||
template: require('./index.html'),
|
||||
bindings: {
|
||||
ticket: '<'
|
||||
}
|
|
@ -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
|
||||
});
|
|
@ -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: '<'
|
||||
}
|
|
@ -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
|
||||
});
|
|
@ -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()', () => {
|
|
@ -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'
|
||||
}
|
||||
});
|
|
@ -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: '<'
|
|
@ -1,4 +1,4 @@
|
|||
import './ticket-observation.js';
|
||||
import './index.js';
|
||||
|
||||
describe('ticket', () => {
|
||||
describe('Component vnTicketObservation', () => {
|
||||
|
|
|
@ -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: '<'
|
|
@ -1,4 +1,4 @@
|
|||
import './package.js';
|
||||
import './index.js';
|
||||
|
||||
describe('Ticket', () => {
|
||||
describe('Component vnTicketPackageIndex', () => {
|
|
@ -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
|
||||
});
|
|
@ -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: '<'
|
|
@ -1,4 +1,4 @@
|
|||
import './sale.js';
|
||||
import './index.js';
|
||||
|
||||
describe('Ticket', () => {
|
||||
describe('Component vnTicketSale', () => {
|
||||
|
|
|
@ -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: '<'
|
|
@ -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';
|
||||
|
|
|
@ -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'
|
|
@ -1,7 +0,0 @@
|
|||
import ngModule from '../module';
|
||||
import FilterTicketList from '../filter-ticket-list';
|
||||
|
||||
ngModule.component('vnTicketTracking', {
|
||||
template: require('./index.html'),
|
||||
controller: FilterTicketList
|
||||
});
|
|
@ -0,0 +1,7 @@
|
|||
import ngModule from '../../module';
|
||||
import FilterTicketList from '../../filter-ticket-list';
|
||||
|
||||
ngModule.component('vnTicketTrackingIndex', {
|
||||
template: require('./index.html'),
|
||||
controller: FilterTicketList
|
||||
});
|
|
@ -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: '<'
|
|
@ -1,4 +1,4 @@
|
|||
import './ticket-volume';
|
||||
import './index';
|
||||
|
||||
describe('ticket', () => {
|
||||
describe('Component vnTicketVolume', () => {
|
||||
|
|
|
@ -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"]`,
|
||||
|
|
|
@ -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');
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -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');
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -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');
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -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');
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -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');
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue