2378-imap #385
|
@ -0,0 +1,2 @@
|
|||
UPDATE `salix`.`ACL` SET `model` = 'Calendar' WHERE (`id` = '155');
|
||||
UPDATE `salix`.`ACL` SET `model` = 'Calendar' WHERE (`id` = '157');
|
|
@ -1,12 +0,0 @@
|
|||
USE `vn`;
|
||||
CREATE
|
||||
OR REPLACE ALGORITHM = UNDEFINED
|
||||
DEFINER = `root`@`%`
|
||||
SQL SECURITY DEFINER
|
||||
VIEW `workerCalendar2` AS
|
||||
SELECT
|
||||
`ce`.`id` AS `id`,
|
||||
`ce`.`business_id` AS `businessFk`,
|
||||
`ce`.`calendar_state_id` AS `absenceTypeFk`,
|
||||
`ce`.`date` AS `dated`
|
||||
FROM `postgresql`.`calendar_employee` `ce`;
|
|
@ -556,7 +556,7 @@ INSERT INTO `vn`.`ticket`(`id`, `priority`, `agencyModeFk`,`warehouseFk`,`routeF
|
|||
(12, 1, 1, 1, 1, CURDATE(), DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 103, 'Phone Box', 123, NULL, 0, 1, CURDATE()),
|
||||
(13, 1, 7, 1, 6, CURDATE(), DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 103, 'Phone Box', 123, NULL, 0, 3, CURDATE()),
|
||||
(14, 1, 2, 1, NULL, CURDATE(), CURDATE(), 104, 'Malibu Point', 4, NULL, 0, 9, CURDATE()),
|
||||
(15, 1, 7, 1, 6, CURDATE(), DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 105, 'Plastic Cell', 125, NULL, 0, 3, CURDATE()),
|
||||
(15, 1, 7, 1, 6, CURDATE(), DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 105, 'An incredibly long alias for testing purposes', 125, NULL, 0, 3, CURDATE()),
|
||||
(16, 1, 7, 1, 6, CURDATE(), DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 106, 'Many Places', 126, NULL, 0, 3, CURDATE()),
|
||||
(17, 1, 7, 2, 6, CURDATE(), DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 106, 'Many Places', 126, NULL, 0, 3, CURDATE()),
|
||||
(18, 1, 4, 4, 4, CURDATE(), DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 108, 'Cerebro', 128, NULL, 0, 12, CURDATE()),
|
||||
|
|
|
@ -870,7 +870,7 @@ export default {
|
|||
confirmed: 'vn-entry-summary vn-check[label="Confirmed"]',
|
||||
},
|
||||
entryDescriptor: {
|
||||
agency: 'vn-entry-descriptor div.body vn-label-value:nth-child(2) span',
|
||||
agency: 'vn-entry-descriptor div.body vn-label-value:nth-child(1) span',
|
||||
travelsQuicklink: 'vn-entry-descriptor vn-quick-link[icon="local_airport"] > a',
|
||||
entriesQuicklink: 'vn-entry-descriptor vn-quick-link[icon="icon-entry"] > a'
|
||||
}
|
||||
|
|
|
@ -214,7 +214,7 @@ export default class ArrayModel extends ModelProxy {
|
|||
}
|
||||
ArrayModel.$inject = ['$q', '$filter', '$element', '$scope'];
|
||||
|
||||
ngModule.component('vnArrayModel', {
|
||||
ngModule.vnComponent('vnArrayModel', {
|
||||
controller: ArrayModel,
|
||||
bindings: {
|
||||
orgData: '<?',
|
||||
|
|
|
@ -192,7 +192,7 @@ export default class Autocomplete extends Field {
|
|||
|
||||
if (this.translateFields) {
|
||||
if (this.translateFields.indexOf(this.showField) > -1)
|
||||
this.input.value = this.$translate.instant(display);
|
||||
this.input.value = this.$t(display);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -135,7 +135,10 @@ export default class Calendar extends FormInput {
|
|||
$days: [day],
|
||||
$type: 'day'
|
||||
});
|
||||
// this.repaint();
|
||||
|
||||
// Repaint only if 'selection' event is not listening
|
||||
if (!this.$events || this.$events && !this.$events['selection'])
|
||||
this.repaint();
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -8,7 +8,7 @@ describe('Component vnChip', () => {
|
|||
|
||||
beforeEach(ngModule('vnCore'));
|
||||
|
||||
beforeEach(angular.mock.inject(($componentController, $rootScope) => {
|
||||
beforeEach(inject(($componentController, $rootScope) => {
|
||||
$scope = $rootScope.$new();
|
||||
$element = angular.element(`<div>${template}</div>`);
|
||||
controller = $componentController('vnChip', {$element, $scope, $transclude: () => {}});
|
||||
|
|
|
@ -272,7 +272,7 @@ export default class CrudModel extends ModelProxy {
|
|||
}
|
||||
CrudModel.$inject = ['$q', '$http', '$element', '$scope'];
|
||||
|
||||
ngModule.component('vnCrudModel', {
|
||||
ngModule.vnComponent('vnCrudModel', {
|
||||
controller: CrudModel,
|
||||
bindings: {
|
||||
orgData: '<?',
|
||||
|
|
|
@ -21,7 +21,7 @@ export default class DataViewer {
|
|||
}
|
||||
}
|
||||
|
||||
ngModule.component('vnDataViewer', {
|
||||
ngModule.vnComponent('vnDataViewer', {
|
||||
template: require('./index.html'),
|
||||
transclude: true,
|
||||
controller: DataViewer,
|
||||
|
|
|
@ -9,7 +9,7 @@ describe('Component vnDatePicker', () => {
|
|||
|
||||
beforeEach(ngModule('vnCore'));
|
||||
|
||||
beforeEach(angular.mock.inject(($compile, $rootScope, _$filter_) => {
|
||||
beforeEach(inject(($compile, $rootScope, _$filter_) => {
|
||||
$filter = _$filter_;
|
||||
|
||||
$element = $compile(`<vn-date-picker></vn-date-picker>`)($rootScope);
|
||||
|
|
|
@ -5,7 +5,7 @@ describe('Component vnDialog', () => {
|
|||
|
||||
beforeEach(ngModule('vnCore'));
|
||||
|
||||
beforeEach(angular.mock.inject(($rootScope, $compile) => {
|
||||
beforeEach(inject(($rootScope, $compile) => {
|
||||
$scope = $rootScope.$new();
|
||||
$element = $compile('<vn-dialog><tpl-body>Body</tpl-body></vn-dialog>')($scope);
|
||||
controller = $element.controller('vnDialog');
|
||||
|
|
|
@ -276,7 +276,7 @@ export default class DropDown extends Popover {
|
|||
if (this.translateFields) {
|
||||
option = Object.assign({}, option);
|
||||
for (let field of this.translateFields)
|
||||
option[field] = this.$translate.instant(option[field]);
|
||||
option[field] = this.$t(option[field]);
|
||||
}
|
||||
|
||||
let li = this.document.createElement('li');
|
||||
|
|
|
@ -25,7 +25,7 @@ class Icon {
|
|||
}
|
||||
Icon.$inject = ['$attrs'];
|
||||
|
||||
ngModule.component('vnIcon', {
|
||||
ngModule.vnComponent('vnIcon', {
|
||||
template: '<i class="{{::$ctrl.iconClass}} unselectable">{{::$ctrl.iconContent}}</i>',
|
||||
controller: Icon,
|
||||
bindings: {
|
||||
|
|
|
@ -7,7 +7,7 @@ describe('Component vnInputFile', () => {
|
|||
|
||||
beforeEach(ngModule('vnCore'));
|
||||
|
||||
beforeEach(angular.mock.inject(($compile, $rootScope) => {
|
||||
beforeEach(inject(($compile, $rootScope) => {
|
||||
$scope = $rootScope.$new();
|
||||
$element = $compile('<vn-input-file></vn-input-file>')($scope);
|
||||
controller = $element.controller('vnInputFile');
|
||||
|
|
|
@ -6,7 +6,7 @@ describe('Component vnInputNumber', () => {
|
|||
|
||||
beforeEach(ngModule('vnCore'));
|
||||
|
||||
beforeEach(angular.mock.inject(($compile, $rootScope) => {
|
||||
beforeEach(inject(($compile, $rootScope) => {
|
||||
$element = $compile(`<vn-input-number ng-model="model" />`)($rootScope);
|
||||
$ctrl = $element.controller('vnInputNumber');
|
||||
}));
|
||||
|
|
|
@ -7,7 +7,7 @@ describe('Component vnInputTime', () => {
|
|||
|
||||
beforeEach(ngModule('vnCore'));
|
||||
|
||||
beforeEach(angular.mock.inject(($compile, $rootScope, _$filter_) => {
|
||||
beforeEach(inject(($compile, $rootScope, _$filter_) => {
|
||||
$filter = _$filter_;
|
||||
|
||||
$element = $compile(`<vn-input-time></vn-input-time>`)($rootScope);
|
||||
|
|
|
@ -42,7 +42,7 @@ export default class Controller extends Component {
|
|||
}
|
||||
}
|
||||
|
||||
ngModule.component('vnLabelValue', {
|
||||
ngModule.vnComponent('vnLabelValue', {
|
||||
controller: Controller,
|
||||
template: require('./index.html'),
|
||||
transclude: true,
|
||||
|
|
|
@ -30,7 +30,7 @@ export class DataModel extends Component {
|
|||
clear() {}
|
||||
}
|
||||
|
||||
ngModule.component('vnDataModel', {
|
||||
ngModule.vnComponent('vnDataModel', {
|
||||
controller: DataModel,
|
||||
bindings: {
|
||||
data: '=?',
|
||||
|
@ -269,7 +269,7 @@ export default class ModelProxy extends DataModel {
|
|||
}
|
||||
}
|
||||
|
||||
ngModule.component('vnModelProxy', {
|
||||
ngModule.vnComponent('vnModelProxy', {
|
||||
controller: ModelProxy,
|
||||
bindings: {
|
||||
orgData: '<?',
|
||||
|
|
|
@ -11,6 +11,7 @@ import './style.scss';
|
|||
export default class MultiCheck extends FormInput {
|
||||
constructor($element, $scope) {
|
||||
super($element, $scope);
|
||||
this.checkAll = false;
|
||||
this._checked = false;
|
||||
this.checkField = 'checked';
|
||||
this.isIntermediate = false;
|
||||
|
@ -114,7 +115,7 @@ export default class MultiCheck extends FormInput {
|
|||
}
|
||||
}
|
||||
|
||||
ngModule.component('vnMultiCheck', {
|
||||
ngModule.vnComponent('vnMultiCheck', {
|
||||
template: require('./multi-check.html'),
|
||||
controller: MultiCheck,
|
||||
bindings: {
|
||||
|
|
|
@ -7,7 +7,7 @@ describe('Component vnMultiCheck', () => {
|
|||
|
||||
beforeEach(ngModule('vnCore'));
|
||||
|
||||
beforeEach(angular.mock.inject($componentController => {
|
||||
beforeEach(inject($componentController => {
|
||||
$element = angular.element(`<div class="shown"></div>`);
|
||||
controller = $componentController('vnMultiCheck', {$element: $element});
|
||||
controller._model = crudModel;
|
||||
|
|
|
@ -90,7 +90,7 @@ class Pagination extends Component {
|
|||
}
|
||||
}
|
||||
|
||||
ngModule.component('vnPagination', {
|
||||
ngModule.vnComponent('vnPagination', {
|
||||
template: require('./pagination.html'),
|
||||
bindings: {
|
||||
model: '<',
|
||||
|
|
|
@ -22,7 +22,7 @@ export default class Controller extends Component {
|
|||
|
||||
Controller.$inject = ['$element', '$scope', '$window'];
|
||||
|
||||
ngModule.component('vnScrollUp', {
|
||||
ngModule.vnComponent('vnScrollUp', {
|
||||
template: require('./scroll-up.html'),
|
||||
controller: Controller,
|
||||
bindings: {
|
||||
|
|
|
@ -36,7 +36,7 @@ export default class Searchbar extends Component {
|
|||
}
|
||||
|
||||
this.searchState = `${this.baseState}.index`;
|
||||
this.placeholder = this.$translate.instant('Search by', {
|
||||
this.placeholder = this.$t('Search by', {
|
||||
module: this.baseState
|
||||
});
|
||||
}
|
||||
|
@ -189,7 +189,7 @@ export default class Searchbar extends Component {
|
|||
}
|
||||
|
||||
doSearch(filter, source) {
|
||||
if (filter === this.filter) return;
|
||||
if (filter === this.filter && source != 'state') return;
|
||||
let promise = this.onSearch({$params: filter});
|
||||
promise = promise || this.$q.resolve();
|
||||
promise.then(data => this.onFilter(filter, source, data));
|
||||
|
|
|
@ -19,7 +19,7 @@ export default class Portal {
|
|||
}
|
||||
Portal.$inject = ['$transclude', 'vnSlotService'];
|
||||
|
||||
ngModule.component('vnPortal', {
|
||||
ngModule.vnComponent('vnPortal', {
|
||||
controller: Portal,
|
||||
transclude: true,
|
||||
bindings: {
|
||||
|
|
|
@ -144,7 +144,7 @@ export default class Controller extends Component {
|
|||
}
|
||||
}
|
||||
|
||||
ngModule.component('vnSnackbar', {
|
||||
ngModule.vnComponent('vnSnackbar', {
|
||||
template: require('./snackbar.html'),
|
||||
controller: Controller
|
||||
});
|
||||
|
|
|
@ -54,4 +54,4 @@ export const component = {
|
|||
},
|
||||
controller: Spinner
|
||||
};
|
||||
ngModule.component('vnSpinner', component);
|
||||
ngModule.vnComponent('vnSpinner', component);
|
||||
|
|
|
@ -6,7 +6,7 @@ describe('Component vnSpinner', () => {
|
|||
|
||||
beforeEach(ngModule('vnCore'));
|
||||
|
||||
beforeEach(angular.mock.inject(($compile, $rootScope) => {
|
||||
beforeEach(inject(($compile, $rootScope) => {
|
||||
$element = $compile(`<vn-spinner></vn-spinner>`)($rootScope);
|
||||
controller = $element.controller('vnSpinner');
|
||||
}));
|
||||
|
|
|
@ -74,7 +74,7 @@ export default class StepControl {
|
|||
|
||||
StepControl.$inject = ['$state'];
|
||||
|
||||
ngModule.component('vnStepControl', {
|
||||
ngModule.vnComponent('vnStepControl', {
|
||||
template: require('./step-control.html'),
|
||||
controller: StepControl,
|
||||
bindings: {
|
||||
|
|
|
@ -6,7 +6,7 @@ describe('Component vnStepControl', () => {
|
|||
|
||||
beforeEach(ngModule('vnCore'));
|
||||
|
||||
beforeEach(angular.mock.inject(($componentController, _$state_) => {
|
||||
beforeEach(inject(($componentController, _$state_) => {
|
||||
$state = _$state_;
|
||||
jest.spyOn($state, 'go');
|
||||
controller = $componentController('vnStepControl', {$state: $state});
|
||||
|
|
|
@ -45,7 +45,7 @@ export default class Table {
|
|||
|
||||
Table.$inject = ['$scope', '$element', '$transclude'];
|
||||
|
||||
ngModule.component('vnTable', {
|
||||
ngModule.vnComponent('vnTable', {
|
||||
template: require('./index.html'),
|
||||
transclude: true,
|
||||
controller: Table,
|
||||
|
|
|
@ -7,7 +7,7 @@ describe('Component vnTable', () => {
|
|||
|
||||
beforeEach(ngModule('vnCore'));
|
||||
|
||||
beforeEach(angular.mock.inject(($componentController, $rootScope) => {
|
||||
beforeEach(inject(($componentController, $rootScope) => {
|
||||
$scope = $rootScope.$new();
|
||||
$element = angular.element(`
|
||||
<vn-table model="model">
|
||||
|
|
|
@ -94,7 +94,7 @@ export default class Controller extends Component {
|
|||
}
|
||||
Controller.$inject = ['$element', '$scope', '$transclude', '$timeout'];
|
||||
|
||||
ngModule.component('vnTdEditable', {
|
||||
ngModule.vnComponent('vnTdEditable', {
|
||||
template: require('./index.html'),
|
||||
controller: Controller,
|
||||
bindings: {
|
||||
|
|
|
@ -6,7 +6,7 @@ describe('Component vnTextarea', () => {
|
|||
|
||||
beforeEach(ngModule('vnCore'));
|
||||
|
||||
beforeEach(angular.mock.inject(($compile, $rootScope) => {
|
||||
beforeEach(inject(($compile, $rootScope) => {
|
||||
$element = $compile(`<vn-textarea></vn-textarea>`)($rootScope);
|
||||
$ctrl = $element.controller('vnTextarea');
|
||||
}));
|
||||
|
|
|
@ -75,7 +75,7 @@ export default class Th {
|
|||
|
||||
Th.$inject = ['$element'];
|
||||
|
||||
ngModule.component('vnTh', {
|
||||
ngModule.vnComponent('vnTh', {
|
||||
template: require('./index.html'),
|
||||
transclude: true,
|
||||
controller: Th,
|
||||
|
|
|
@ -7,7 +7,7 @@ describe('Component vnTh', () => {
|
|||
|
||||
beforeEach(ngModule('vnCore'));
|
||||
|
||||
beforeEach(angular.mock.inject($componentController => {
|
||||
beforeEach(inject($componentController => {
|
||||
$element = angular.element(`<div>${template}</div>`);
|
||||
controller = $componentController('vnTh', {$element: $element});
|
||||
controller.table = {
|
||||
|
|
|
@ -197,7 +197,7 @@ export default class Tooltip extends Component {
|
|||
}
|
||||
Tooltip.$inject = ['$element', '$scope', '$timeout'];
|
||||
|
||||
ngModule.component('vnTooltip', {
|
||||
ngModule.vnComponent('vnTooltip', {
|
||||
template: require('./tooltip.html'),
|
||||
controller: Tooltip,
|
||||
transclude: true,
|
||||
|
|
|
@ -49,7 +49,7 @@ class Controller {
|
|||
}
|
||||
Controller.$inject = ['$element', '$scope', '$compile'];
|
||||
|
||||
ngModule.component('vnTreeviewChild', {
|
||||
ngModule.vnComponent('vnTreeviewChild', {
|
||||
template: require('./child.html'),
|
||||
controller: Controller,
|
||||
bindings: {
|
||||
|
|
|
@ -2,7 +2,7 @@ import ngModule from '../../module';
|
|||
|
||||
class Controller {}
|
||||
|
||||
ngModule.component('vnTreeviewChilds', {
|
||||
ngModule.vnComponent('vnTreeviewChilds', {
|
||||
template: require('./childs.html'),
|
||||
controller: Controller,
|
||||
bindings: {
|
||||
|
|
|
@ -247,7 +247,7 @@ export default class Treeview extends Component {
|
|||
|
||||
Treeview.$inject = ['$element', '$scope', '$transclude', '$window'];
|
||||
|
||||
ngModule.component('vnTreeview', {
|
||||
ngModule.vnComponent('vnTreeview', {
|
||||
template: require('./index.html'),
|
||||
controller: Treeview,
|
||||
bindings: {
|
||||
|
|
|
@ -267,7 +267,7 @@ export default class Watcher extends Component {
|
|||
}
|
||||
Watcher.$inject = ['$element', '$scope', '$state', '$stateParams', '$transitions', '$http', 'vnApp', '$translate', '$attrs', '$q'];
|
||||
|
||||
ngModule.component('vnWatcher', {
|
||||
ngModule.vnComponent('vnWatcher', {
|
||||
template: require('./watcher.html'),
|
||||
bindings: {
|
||||
url: '@?',
|
||||
|
|
|
@ -12,7 +12,7 @@ describe('Component vnWatcher', () => {
|
|||
|
||||
beforeEach(ngModule('vnCore'));
|
||||
|
||||
beforeEach(angular.mock.inject(($componentController, $rootScope, _$httpBackend_, _$state_, _$q_) => {
|
||||
beforeEach(inject(($componentController, $rootScope, _$httpBackend_, _$state_, _$q_) => {
|
||||
$scope = $rootScope.$new();
|
||||
$element = angular.element('<div></div>');
|
||||
$state = _$state_;
|
||||
|
|
|
@ -7,7 +7,7 @@ describe('Directive zoomImage', () => {
|
|||
|
||||
beforeEach(ngModule('vnCore'));
|
||||
|
||||
beforeEach(angular.mock.inject(($compile, $rootScope) => {
|
||||
beforeEach(inject(($compile, $rootScope) => {
|
||||
compile = $compile;
|
||||
scope = $rootScope.$new();
|
||||
}));
|
||||
|
|
|
@ -5,7 +5,7 @@ describe('factory vnModuleLoader', () => {
|
|||
|
||||
beforeEach(ngModule('vnCore'));
|
||||
|
||||
beforeEach(angular.mock.inject((_vnModuleLoader_, _$rootScope_, $httpBackend, _$window_, $q) => {
|
||||
beforeEach(inject((_vnModuleLoader_, _$rootScope_, $httpBackend, _$window_, $q) => {
|
||||
vnModuleLoader = _vnModuleLoader_;
|
||||
$rootScope = _$rootScope_;
|
||||
$window = _$window_;
|
||||
|
|
|
@ -107,7 +107,7 @@ export class DescriptorContent {
|
|||
}
|
||||
DescriptorContent.$inject = ['$transclude', 'vnModules'];
|
||||
|
||||
ngModule.component('vnDescriptorContent', {
|
||||
ngModule.vnComponent('vnDescriptorContent', {
|
||||
template: require('./index.html'),
|
||||
controller: DescriptorContent,
|
||||
bindings: {
|
||||
|
|
|
@ -2,7 +2,7 @@ import ngModule from '../../module';
|
|||
|
||||
export default class QuickLink {}
|
||||
|
||||
ngModule.component('vnQuickLink', {
|
||||
ngModule.vnComponent('vnQuickLink', {
|
||||
template: require('./quick-link.html'),
|
||||
controller: QuickLink,
|
||||
bindings: {
|
||||
|
|
|
@ -28,7 +28,7 @@ export default class Controller extends Component {
|
|||
}
|
||||
Controller.$inject = ['$element', '$scope', 'vnModules', '$sce'];
|
||||
|
||||
ngModule.component('vnHome', {
|
||||
ngModule.vnComponent('vnHome', {
|
||||
template: require('./home.html'),
|
||||
controller: Controller
|
||||
});
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
import './index.js';
|
||||
|
||||
describe('Component vnMainMenu', () => {
|
||||
let $httpBackend;
|
||||
let controller;
|
||||
|
||||
beforeEach(ngModule('salix'));
|
||||
|
||||
beforeEach(angular.mock.inject(($componentController, _$httpBackend_) => {
|
||||
let vnModules = {get: () => {}};
|
||||
$httpBackend = _$httpBackend_;
|
||||
controller = $componentController('vnMainMenu', {vnModules});
|
||||
}));
|
||||
|
||||
describe('getCurrentUserName()', () => {
|
||||
it(`should set the user name property in the controller`, () => {
|
||||
$httpBackend.expect('GET', `Accounts/getUserData`).respond({name: 'batman'});
|
||||
controller.getCurrentUserName();
|
||||
$httpBackend.flush();
|
||||
|
||||
expect(controller.$.$root.user.name).toEqual('batman');
|
||||
});
|
||||
});
|
||||
});
|
|
@ -21,7 +21,7 @@ export class Layout extends Component {
|
|||
}
|
||||
Layout.$inject = ['$element', '$scope', 'vnModules'];
|
||||
|
||||
ngModule.component('vnLayout', {
|
||||
ngModule.vnComponent('vnLayout', {
|
||||
template: require('./index.html'),
|
||||
controller: Layout,
|
||||
require: {
|
||||
|
|
|
@ -6,7 +6,7 @@ describe('Component vnLayout', () => {
|
|||
|
||||
beforeEach(ngModule('salix'));
|
||||
|
||||
beforeEach(angular.mock.inject(($componentController, _$httpBackend_) => {
|
||||
beforeEach(inject(($componentController, _$httpBackend_) => {
|
||||
let vnModules = {get: () => {}};
|
||||
$httpBackend = _$httpBackend_;
|
||||
let $element = angular.element('<div></div>');
|
||||
|
|
|
@ -117,7 +117,7 @@ export default class LeftMenu {
|
|||
}
|
||||
LeftMenu.$inject = ['$state', '$transitions', 'aclService', '$timeout', '$element'];
|
||||
|
||||
ngModule.component('vnLeftMenu', {
|
||||
ngModule.vnComponent('vnLeftMenu', {
|
||||
template: require('./left-menu.html'),
|
||||
controller: LeftMenu,
|
||||
bindings: {
|
||||
|
|
|
@ -6,7 +6,7 @@ describe('Component vnLeftMenu', () => {
|
|||
|
||||
beforeEach(ngModule('salix'));
|
||||
|
||||
beforeEach(angular.mock.inject(($componentController, $state, $window) => {
|
||||
beforeEach(inject(($componentController, $state, $window) => {
|
||||
$element = angular.element('<div></div>');
|
||||
$state.current.name = 'client.card.summary';
|
||||
$state.current.data = {moduleIndex: 0};
|
||||
|
|
|
@ -37,7 +37,7 @@ export default class Controller {
|
|||
}
|
||||
Controller.$inject = ['$scope', '$element', 'vnAuth'];
|
||||
|
||||
ngModule.component('vnLogin', {
|
||||
ngModule.vnComponent('vnLogin', {
|
||||
template: require('./login.html'),
|
||||
controller: Controller
|
||||
});
|
||||
|
|
|
@ -68,7 +68,7 @@ export default class SideMenu extends Component {
|
|||
}
|
||||
}
|
||||
|
||||
ngModule.component('vnSideMenu', {
|
||||
ngModule.vnComponent('vnSideMenu', {
|
||||
template: require('./side-menu.html'),
|
||||
controller: SideMenu,
|
||||
transclude: true,
|
||||
|
|
|
@ -80,7 +80,7 @@ class Controller {
|
|||
}
|
||||
Controller.$inject = ['$scope', '$translate', 'vnConfig', 'vnAuth'];
|
||||
|
||||
ngModule.component('vnUserPopover', {
|
||||
ngModule.vnComponent('vnUserPopover', {
|
||||
template: require('./index.html'),
|
||||
controller: Controller
|
||||
});
|
||||
|
|
|
@ -7,7 +7,7 @@ describe('Salix', () => {
|
|||
|
||||
beforeEach(ngModule('salix'));
|
||||
|
||||
beforeEach(angular.mock.inject(($componentController, $rootScope, $httpBackend) => {
|
||||
beforeEach(inject(($componentController, $rootScope, $httpBackend) => {
|
||||
$httpBackend.expectGET('UserConfigs/getUserConfig');
|
||||
|
||||
$scope = $rootScope.$new();
|
||||
|
|
|
@ -154,7 +154,7 @@ export default class Controller extends Section {
|
|||
}
|
||||
}
|
||||
|
||||
ngModule.component('vnClaimAction', {
|
||||
ngModule.vnComponent('vnClaimAction', {
|
||||
template: require('./index.html'),
|
||||
controller: Controller,
|
||||
bindings: {
|
||||
|
|
|
@ -9,7 +9,7 @@ describe('claim', () => {
|
|||
|
||||
beforeEach(ngModule('claim'));
|
||||
|
||||
beforeEach(angular.mock.inject(($componentController, _$state_, _$httpBackend_) => {
|
||||
beforeEach(inject(($componentController, _$state_, _$httpBackend_) => {
|
||||
$httpBackend = _$httpBackend_;
|
||||
$state = _$state_;
|
||||
$state.params.id = 1;
|
||||
|
@ -91,7 +91,7 @@ describe('claim', () => {
|
|||
$httpBackend.flush();
|
||||
|
||||
expect(controller.$.model.refresh).toHaveBeenCalledWith();
|
||||
expect(controller.vnApp.showSuccess).toHaveBeenCalledWith('Data saved!');
|
||||
expect(controller.vnApp.showSuccess).toHaveBeenCalled();
|
||||
expect(controller.$.lastTicketsPopover.hide).toHaveBeenCalledWith();
|
||||
});
|
||||
});
|
||||
|
@ -106,7 +106,7 @@ describe('claim', () => {
|
|||
$httpBackend.flush();
|
||||
|
||||
expect(controller.card.reload).toHaveBeenCalledWith();
|
||||
expect(controller.vnApp.showSuccess).toHaveBeenCalledWith('Data saved!');
|
||||
expect(controller.vnApp.showSuccess).toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ class Controller extends Section {
|
|||
}
|
||||
}
|
||||
|
||||
ngModule.component('vnClaimBasicData', {
|
||||
ngModule.vnComponent('vnClaimBasicData', {
|
||||
template: require('./index.html'),
|
||||
controller: Controller,
|
||||
bindings: {
|
||||
|
|
|
@ -8,7 +8,7 @@ describe('Claim', () => {
|
|||
|
||||
beforeEach(ngModule('claim'));
|
||||
|
||||
beforeEach(angular.mock.inject(($componentController, $rootScope) => {
|
||||
beforeEach(inject(($componentController, $rootScope) => {
|
||||
$scope = $rootScope.$new();
|
||||
$scope.watcher = watcher;
|
||||
const $element = angular.element('<vn-claim-basic-data></vn-claim-basic-data>');
|
||||
|
|
|
@ -8,7 +8,7 @@ describe('Claim', () => {
|
|||
|
||||
beforeEach(ngModule('claim'));
|
||||
|
||||
beforeEach(angular.mock.inject(($componentController, _$httpBackend_, $stateParams) => {
|
||||
beforeEach(inject(($componentController, _$httpBackend_, $stateParams) => {
|
||||
$httpBackend = _$httpBackend_;
|
||||
|
||||
let $element = angular.element('<div></div>');
|
||||
|
|
|
@ -75,7 +75,7 @@ class Controller extends Section {
|
|||
this.$http.post(query, saleToAdd).then(() => {
|
||||
this.$.addSales.hide();
|
||||
this.$.model.refresh();
|
||||
this.vnApp.showSuccess(this.$translate.instant('Data saved!'));
|
||||
this.vnApp.showSuccess(this.$t('Data saved!'));
|
||||
|
||||
if (this.aclService.hasAny(['salesAssistant']))
|
||||
this.$state.go('claim.card.development');
|
||||
|
@ -90,7 +90,7 @@ class Controller extends Section {
|
|||
deleteClaimedSale() {
|
||||
let query = `ClaimBeginnings/${this.sale.id}`;
|
||||
this.$http.delete(query).then(() => {
|
||||
this.vnApp.showSuccess(this.$translate.instant('Data saved!'));
|
||||
this.vnApp.showSuccess(this.$t('Data saved!'));
|
||||
this.$.model.remove(this.sale);
|
||||
this.calculateTotals();
|
||||
});
|
||||
|
@ -100,7 +100,7 @@ class Controller extends Section {
|
|||
let params = {id: id, quantity: claimedQuantity};
|
||||
let query = `ClaimBeginnings/`;
|
||||
this.$http.patch(query, params).then(() => {
|
||||
this.vnApp.showSuccess(this.$translate.instant('Data saved!'));
|
||||
this.vnApp.showSuccess(this.$t('Data saved!'));
|
||||
this.calculateTotals();
|
||||
});
|
||||
}
|
||||
|
@ -134,7 +134,7 @@ class Controller extends Section {
|
|||
showEditPopover(event, saleClaimed) {
|
||||
if (this.isEditable) {
|
||||
if (!this.aclService.hasAny(['salesAssistant']))
|
||||
return this.vnApp.showError(this.$translate.instant('Insuficient permisos'));
|
||||
return this.vnApp.showError(this.$t('Insuficient permisos'));
|
||||
|
||||
this.saleClaimed = saleClaimed;
|
||||
this.$.editPopover.parent = event.target;
|
||||
|
@ -175,7 +175,7 @@ class Controller extends Section {
|
|||
this.calculateTotals();
|
||||
this.clearDiscount();
|
||||
|
||||
this.vnApp.showSuccess(this.$translate.instant('Data saved!'));
|
||||
this.vnApp.showSuccess(this.$t('Data saved!'));
|
||||
}).catch(err => {
|
||||
this.vnApp.showError(err.message);
|
||||
});
|
||||
|
@ -196,7 +196,7 @@ class Controller extends Section {
|
|||
|
||||
Controller.$inject = ['$element', '$scope'];
|
||||
|
||||
ngModule.component('vnClaimDetail', {
|
||||
ngModule.vnComponent('vnClaimDetail', {
|
||||
template: require('./index.html'),
|
||||
controller: Controller,
|
||||
bindings: {
|
||||
|
|
|
@ -9,7 +9,7 @@ describe('claim', () => {
|
|||
|
||||
beforeEach(ngModule('claim'));
|
||||
|
||||
beforeEach(angular.mock.inject(($componentController, _$httpBackend_, $rootScope) => {
|
||||
beforeEach(inject(($componentController, _$httpBackend_, $rootScope) => {
|
||||
$scope = $rootScope.$new();
|
||||
$scope.descriptor = {
|
||||
show: () => {}
|
||||
|
@ -80,7 +80,7 @@ describe('claim', () => {
|
|||
controller.deleteClaimedSale();
|
||||
$httpBackend.flush();
|
||||
|
||||
expect(controller.vnApp.showSuccess).toHaveBeenCalledWith('Data saved!');
|
||||
expect(controller.vnApp.showSuccess).toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -91,7 +91,7 @@ describe('claim', () => {
|
|||
controller.setClaimedQuantity(1, 1);
|
||||
$httpBackend.flush();
|
||||
|
||||
expect(controller.vnApp.showSuccess).toHaveBeenCalledWith('Data saved!');
|
||||
expect(controller.vnApp.showSuccess).toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -126,7 +126,7 @@ describe('claim', () => {
|
|||
|
||||
expect(controller.calculateTotals).toHaveBeenCalledWith();
|
||||
expect(controller.clearDiscount).toHaveBeenCalledWith();
|
||||
expect(controller.vnApp.showSuccess).toHaveBeenCalledWith('Data saved!');
|
||||
expect(controller.vnApp.showSuccess).toHaveBeenCalled();
|
||||
expect(controller.$.editPopover.hide).toHaveBeenCalledWith();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -15,7 +15,7 @@ class Controller extends Section {
|
|||
}
|
||||
}
|
||||
|
||||
ngModule.component('vnClaimDevelopment', {
|
||||
ngModule.vnComponent('vnClaimDevelopment', {
|
||||
template: require('./index.html'),
|
||||
controller: Controller,
|
||||
bindings: {
|
||||
|
|
|
@ -9,7 +9,7 @@ describe('Claim', () => {
|
|||
|
||||
beforeEach(ngModule('claim'));
|
||||
|
||||
beforeEach(angular.mock.inject(($componentController, $rootScope) => {
|
||||
beforeEach(inject(($componentController, $rootScope) => {
|
||||
$scope = $rootScope.$new();
|
||||
$scope.watcher = watcher;
|
||||
$scope.model = crudModel;
|
||||
|
|
|
@ -19,7 +19,7 @@ export default class Controller extends Section {
|
|||
}
|
||||
}
|
||||
|
||||
ngModule.component('vnClaimIndex', {
|
||||
ngModule.vnComponent('vnClaimIndex', {
|
||||
template: require('./index.html'),
|
||||
controller: Controller
|
||||
});
|
||||
|
|
|
@ -93,7 +93,7 @@ class Controller extends Section {
|
|||
|
||||
Controller.$inject = ['$element', '$scope', 'vnFile'];
|
||||
|
||||
ngModule.component('vnClaimPhotos', {
|
||||
ngModule.vnComponent('vnClaimPhotos', {
|
||||
template: require('./index.html'),
|
||||
controller: Controller,
|
||||
bindings: {
|
||||
|
|
|
@ -9,7 +9,7 @@ describe('Claim', () => {
|
|||
|
||||
beforeEach(ngModule('claim'));
|
||||
|
||||
beforeEach(angular.mock.inject(($componentController, $rootScope, _$httpBackend_) => {
|
||||
beforeEach(inject(($componentController, $rootScope, _$httpBackend_) => {
|
||||
$httpBackend = _$httpBackend_;
|
||||
$scope = $rootScope.$new();
|
||||
controller = $componentController('vnClaimPhotos', {$element: null, $scope});
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import ngModule from '../module';
|
||||
import SearchPanel from 'core/components/searchbar/search-panel';
|
||||
|
||||
ngModule.component('vnClaimSearchPanel', {
|
||||
ngModule.vnComponent('vnClaimSearchPanel', {
|
||||
template: require('./index.html'),
|
||||
controller: SearchPanel
|
||||
});
|
||||
|
|
|
@ -45,7 +45,7 @@ class Controller extends Section {
|
|||
|
||||
Controller.$inject = ['$element', '$scope', 'vnFile'];
|
||||
|
||||
ngModule.component('vnClaimSummary', {
|
||||
ngModule.vnComponent('vnClaimSummary', {
|
||||
template: require('./index.html'),
|
||||
controller: Controller,
|
||||
bindings: {
|
||||
|
|
|
@ -9,7 +9,7 @@ describe('Claim', () => {
|
|||
|
||||
beforeEach(ngModule('claim'));
|
||||
|
||||
beforeEach(angular.mock.inject(($componentController, _$httpBackend_, $rootScope) => {
|
||||
beforeEach(inject(($componentController, _$httpBackend_, $rootScope) => {
|
||||
$scope = $rootScope.$new();
|
||||
$httpBackend = _$httpBackend_;
|
||||
const $element = angular.element('<vn-claim-summary></vn-claim-summary>');
|
||||
|
@ -20,8 +20,7 @@ describe('Claim', () => {
|
|||
|
||||
describe('getSummary()', () => {
|
||||
it('should perform a query to set summary', () => {
|
||||
$httpBackend.when('GET', `Claims/1/getSummary`).respond(200, 24);
|
||||
$httpBackend.expect('GET', `Claims/1/getSummary`);
|
||||
$httpBackend.expect('GET', `Claims/1/getSummary`).respond(200, 24);
|
||||
controller.getSummary();
|
||||
$httpBackend.flush();
|
||||
|
||||
|
|
|
@ -79,7 +79,7 @@ export default class Controller extends Section {
|
|||
|
||||
Controller.$inject = ['$element', '$scope'];
|
||||
|
||||
ngModule.component('vnClientAddressCreate', {
|
||||
ngModule.vnComponent('vnClientAddressCreate', {
|
||||
template: require('./index.html'),
|
||||
controller: Controller,
|
||||
bindings: {
|
||||
|
|
|
@ -11,7 +11,7 @@ describe('Client', () => {
|
|||
|
||||
beforeEach(ngModule('client'));
|
||||
|
||||
beforeEach(angular.mock.inject(($componentController, $rootScope, _$state_, _$httpBackend_) => {
|
||||
beforeEach(inject(($componentController, $rootScope, _$state_, _$httpBackend_) => {
|
||||
$scope = $rootScope.$new();
|
||||
$httpBackend = _$httpBackend_;
|
||||
$state = _$state_;
|
||||
|
|
|
@ -81,7 +81,7 @@ export default class Controller extends Section {
|
|||
}
|
||||
}
|
||||
|
||||
ngModule.component('vnClientAddressEdit', {
|
||||
ngModule.vnComponent('vnClientAddressEdit', {
|
||||
template: require('./index.html'),
|
||||
controller: Controller,
|
||||
require: {
|
||||
|
|
|
@ -10,7 +10,7 @@ describe('Client', () => {
|
|||
|
||||
beforeEach(ngModule('client'));
|
||||
|
||||
beforeEach(angular.mock.inject(($componentController, $rootScope, _$state_, _$httpBackend_) => {
|
||||
beforeEach(inject(($componentController, $rootScope, _$state_, _$httpBackend_) => {
|
||||
$scope = $rootScope.$new();
|
||||
$httpBackend = _$httpBackend_;
|
||||
$state = _$state_;
|
||||
|
|
|
@ -50,7 +50,7 @@ class Controller extends Section {
|
|||
if (res.data) {
|
||||
this.client.defaultAddressFk = res.data.defaultAddressFk;
|
||||
this.sortAddresses();
|
||||
this.vnApp.showSuccess(this.$translate.instant('Data saved!'));
|
||||
this.vnApp.showSuccess(this.$t('Data saved!'));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ class Controller extends Section {
|
|||
}
|
||||
Controller.$inject = ['$element', '$scope'];
|
||||
|
||||
ngModule.component('vnClientAddressIndex', {
|
||||
ngModule.vnComponent('vnClientAddressIndex', {
|
||||
template: require('./index.html'),
|
||||
controller: Controller,
|
||||
bindings: {
|
||||
|
|
|
@ -10,7 +10,7 @@ describe('Client', () => {
|
|||
|
||||
beforeEach(ngModule('client'));
|
||||
|
||||
beforeEach(angular.mock.inject(($componentController, $rootScope, _$stateParams_, _$httpBackend_) => {
|
||||
beforeEach(inject(($componentController, $rootScope, _$stateParams_, _$httpBackend_) => {
|
||||
$stateParams = _$stateParams_;
|
||||
$stateParams.id = 1;
|
||||
$httpBackend = _$httpBackend_;
|
||||
|
@ -28,8 +28,7 @@ describe('Client', () => {
|
|||
let data = {defaultAddressFk: address.id};
|
||||
let expectedResult = {defaultAddressFk: address.id};
|
||||
|
||||
$httpBackend.when('PATCH', `Clients/1`, data).respond(200, expectedResult);
|
||||
$httpBackend.expect('PATCH', `Clients/1`, data);
|
||||
$httpBackend.expect('PATCH', `Clients/1`, data).respond(200, expectedResult);
|
||||
controller.setDefault(address);
|
||||
$httpBackend.flush();
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ class Controller extends Section {
|
|||
|
||||
Controller.$inject = ['$element', '$scope'];
|
||||
|
||||
ngModule.component('vnClientBalanceIndex', {
|
||||
ngModule.vnComponent('vnClientBalanceIndex', {
|
||||
template: require('./index.html'),
|
||||
controller: Controller,
|
||||
});
|
||||
|
|
|
@ -6,7 +6,7 @@ describe('Client', () => {
|
|||
|
||||
beforeEach(ngModule('client'));
|
||||
|
||||
beforeEach(angular.mock.inject(($componentController, $rootScope) => {
|
||||
beforeEach(inject(($componentController, $rootScope) => {
|
||||
let $scope = $rootScope.$new();
|
||||
const $element = angular.element('<vn-client-balance-index></vn-client-balance-index>');
|
||||
controller = $componentController('vnClientBalanceIndex', {$element, $scope});
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import ngModule from '../module';
|
||||
import Section from 'salix/components/section';
|
||||
|
||||
ngModule.component('vnClientBasicData', {
|
||||
ngModule.vnComponent('vnClientBasicData', {
|
||||
template: require('./index.html'),
|
||||
controller: Section,
|
||||
bindings: {
|
||||
|
|
|
@ -77,7 +77,7 @@ export default class Controller extends Section {
|
|||
}
|
||||
}
|
||||
|
||||
ngModule.component('vnClientBillingData', {
|
||||
ngModule.vnComponent('vnClientBillingData', {
|
||||
template: require('./index.html'),
|
||||
controller: Controller,
|
||||
bindings: {
|
||||
|
|
|
@ -9,7 +9,7 @@ describe('Client', () => {
|
|||
|
||||
beforeEach(ngModule('client'));
|
||||
|
||||
beforeEach(angular.mock.inject(($componentController, $rootScope, _$httpBackend_, _vnApp_) => {
|
||||
beforeEach(inject(($componentController, $rootScope, _$httpBackend_, _vnApp_) => {
|
||||
let $element = angular.element('<vn-client-billing-data></vn-client-billing-data>');
|
||||
$httpBackend = _$httpBackend_;
|
||||
vnApp = _vnApp_;
|
||||
|
|
|
@ -8,7 +8,7 @@ export default class Controller extends ModuleCard {
|
|||
}
|
||||
}
|
||||
|
||||
ngModule.component('vnClientCard', {
|
||||
ngModule.vnComponent('vnClientCard', {
|
||||
template: require('./index.html'),
|
||||
controller: Controller
|
||||
});
|
||||
|
|
|
@ -8,7 +8,7 @@ describe('Client', () => {
|
|||
|
||||
beforeEach(ngModule('client'));
|
||||
|
||||
beforeEach(angular.mock.inject(($componentController, _$httpBackend_, $stateParams) => {
|
||||
beforeEach(inject(($componentController, _$httpBackend_, $stateParams) => {
|
||||
$httpBackend = _$httpBackend_;
|
||||
|
||||
let $element = angular.element('<div></div>');
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import ngModule from '../module';
|
||||
import SearchPanel from 'core/components/searchbar/search-panel';
|
||||
|
||||
ngModule.component('vnConsumptionSearchPanel', {
|
||||
ngModule.vnComponent('vnConsumptionSearchPanel', {
|
||||
template: require('./index.html'),
|
||||
controller: SearchPanel
|
||||
});
|
||||
|
|
|
@ -57,7 +57,7 @@ class Controller extends Section {
|
|||
|
||||
Controller.$inject = ['$element', '$scope', 'vnReport', 'vnEmail'];
|
||||
|
||||
ngModule.component('vnClientConsumption', {
|
||||
ngModule.vnComponent('vnClientConsumption', {
|
||||
template: require('./index.html'),
|
||||
controller: Controller,
|
||||
bindings: {
|
||||
|
|
|
@ -10,7 +10,7 @@ describe('Client', () => {
|
|||
|
||||
beforeEach(ngModule('client'));
|
||||
|
||||
beforeEach(angular.mock.inject(($componentController, $rootScope, _$httpParamSerializer_, _$httpBackend_) => {
|
||||
beforeEach(inject(($componentController, $rootScope, _$httpParamSerializer_, _$httpBackend_) => {
|
||||
$scope = $rootScope.$new();
|
||||
$httpParamSerializer = _$httpParamSerializer_;
|
||||
$httpBackend = _$httpBackend_;
|
||||
|
|
|
@ -5,7 +5,7 @@ class Controller extends Section {
|
|||
add() {
|
||||
this.$.model.insert({
|
||||
clientFk: this.client.id,
|
||||
name: this.$translate.instant('Phone'),
|
||||
name: this.$t('Phone'),
|
||||
phone: null
|
||||
});
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ class Controller extends Section {
|
|||
}
|
||||
}
|
||||
|
||||
ngModule.component('vnClientContact', {
|
||||
ngModule.vnComponent('vnClientContact', {
|
||||
template: require('./index.html'),
|
||||
controller: Controller,
|
||||
bindings: {
|
||||
|
|
|
@ -86,7 +86,7 @@ export default class Controller extends Section {
|
|||
|
||||
Controller.$inject = ['$element', '$scope'];
|
||||
|
||||
ngModule.component('vnClientCreate', {
|
||||
ngModule.vnComponent('vnClientCreate', {
|
||||
template: require('./index.html'),
|
||||
controller: Controller
|
||||
});
|
||||
|
|
|
@ -8,7 +8,7 @@ describe('Client', () => {
|
|||
|
||||
beforeEach(ngModule('client'));
|
||||
|
||||
beforeEach(angular.mock.inject(($componentController, $rootScope, _$state_) => {
|
||||
beforeEach(inject(($componentController, $rootScope, _$state_) => {
|
||||
$scope = $rootScope.$new();
|
||||
$state = _$state_;
|
||||
$scope.watcher = {
|
||||
|
|
|
@ -11,7 +11,7 @@ class Controller extends Section {
|
|||
|
||||
onSubmit() {
|
||||
if (this.$.form.$invalid)
|
||||
return this.vnApp.showError(this.$translate.instant('Some fields are invalid'));
|
||||
return this.vnApp.showError(this.$t('Some fields are invalid'));
|
||||
|
||||
let query = `creditClassifications/createWithInsurance`;
|
||||
let data = this.creditClassification;
|
||||
|
@ -28,7 +28,7 @@ class Controller extends Section {
|
|||
|
||||
Controller.$inject = ['$element', '$scope'];
|
||||
|
||||
ngModule.component('vnClientCreditInsuranceCreate', {
|
||||
ngModule.vnComponent('vnClientCreditInsuranceCreate', {
|
||||
template: require('./index.html'),
|
||||
controller: Controller,
|
||||
require: {
|
||||
|
|
|
@ -8,7 +8,7 @@ describe('Client', () => {
|
|||
|
||||
beforeEach(ngModule('client'));
|
||||
|
||||
beforeEach(angular.mock.inject(($componentController, $rootScope, _$httpBackend_) => {
|
||||
beforeEach(inject(($componentController, $rootScope, _$httpBackend_) => {
|
||||
$httpBackend = _$httpBackend_;
|
||||
$scope = $rootScope.$new();
|
||||
$scope.form = {
|
||||
|
|
|
@ -60,7 +60,7 @@
|
|||
</vn-float-button>
|
||||
<vn-confirm
|
||||
vn-id="close-contract"
|
||||
on-response="$ctrl.returnDialog($response)"
|
||||
on-accept="$ctrl.returnDialog()"
|
||||
question="Close contract"
|
||||
message="Are you sure you want to close this contract?">
|
||||
</vn-confirm>
|
|
@ -51,17 +51,15 @@ class Controller extends Section {
|
|||
this.$.closeContract.show();
|
||||
}
|
||||
|
||||
returnDialog(response) {
|
||||
if (response === 'accept') {
|
||||
returnDialog() {
|
||||
let params = {finished: Date.now()};
|
||||
this.$http.patch(`CreditClassifications/${this.classificationId}`, params).then(() => {
|
||||
this._getClassifications(this.client.id);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ngModule.component('vnClientCreditInsuranceIndex', {
|
||||
ngModule.vnComponent('vnClientCreditInsuranceIndex', {
|
||||
template: require('./index.html'),
|
||||
controller: Controller,
|
||||
bindings: {
|
||||
|
|
|
@ -8,7 +8,7 @@ describe('Client', () => {
|
|||
|
||||
beforeEach(ngModule('client'));
|
||||
|
||||
beforeEach(angular.mock.inject(($componentController, _$httpBackend_, $rootScope) => {
|
||||
beforeEach(inject(($componentController, _$httpBackend_, $rootScope) => {
|
||||
$httpBackend = _$httpBackend_;
|
||||
$scope = $rootScope.$new();
|
||||
const $element = angular.element('<vn-client-credit-insurance-index></vn-client-credit-insurance-index>');
|
||||
|
@ -77,9 +77,8 @@ describe('Client', () => {
|
|||
it('should call the returnDialog method and perform a PATCH query, then call _getClassifications method', () => {
|
||||
jest.spyOn(controller, '_getClassifications').mockReturnThis();
|
||||
controller.classificationId = 1;
|
||||
$httpBackend.when('PATCH', `CreditClassifications/1`).respond(200);
|
||||
$httpBackend.expect('PATCH', `CreditClassifications/1`);
|
||||
controller.returnDialog('accept');
|
||||
$httpBackend.expect('PATCH', `CreditClassifications/1`).respond(200);
|
||||
controller.returnDialog();
|
||||
$httpBackend.flush();
|
||||
|
||||
expect(controller._getClassifications).toHaveBeenCalledWith(101);
|
||||
|
|
|
@ -21,7 +21,7 @@ class Controller extends Section {
|
|||
|
||||
Controller.$inject = ['$element', '$scope'];
|
||||
|
||||
ngModule.component('vnClientCreditInsuranceInsuranceCreate', {
|
||||
ngModule.vnComponent('vnClientCreditInsuranceInsuranceCreate', {
|
||||
template: require('./index.html'),
|
||||
controller: Controller,
|
||||
require: {
|
||||
|
|
|
@ -29,7 +29,7 @@ class Controller extends Section {
|
|||
|
||||
Controller.$inject = ['$element', '$scope'];
|
||||
|
||||
ngModule.component('vnClientCreditInsuranceInsuranceIndex', {
|
||||
ngModule.vnComponent('vnClientCreditInsuranceInsuranceIndex', {
|
||||
template: require('./index.html'),
|
||||
controller: Controller,
|
||||
bindings: {
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue