-
+
{{::sale.item.name}}
diff --git a/modules/ticket/front/picture/index.js b/modules/ticket/front/picture/index.js
index 257a53e6c..50d7cc777 100644
--- a/modules/ticket/front/picture/index.js
+++ b/modules/ticket/front/picture/index.js
@@ -13,16 +13,6 @@ class Controller extends Section {
}
};
}
-
- showDescriptor(event, itemFk) {
- this.$.descriptor.itemFk = itemFk;
- this.$.descriptor.parent = event.target;
- this.$.descriptor.show();
- }
-
- onDescriptorLoad() {
- this.$.popover.relocate();
- }
}
ngModule.component('vnTicketPicture', {
diff --git a/modules/ticket/front/request/index/index.html b/modules/ticket/front/request/index/index.html
index 3dd8691d5..670470ccf 100644
--- a/modules/ticket/front/request/index/index.html
+++ b/modules/ticket/front/request/index/index.html
@@ -43,14 +43,14 @@
+ ng-click="workerDescriptor.show($event, request.requesterFk)">
{{::request.requester.user.nickname | dashIfEmpty}}
+ ng-click="workerDescriptor.show($event, request.attenderFk)">
{{::request.atender.user.nickname | dashIfEmpty}}
diff --git a/modules/ticket/front/request/index/index.js b/modules/ticket/front/request/index/index.js
index c2e6dc123..122feae1c 100644
--- a/modules/ticket/front/request/index/index.js
+++ b/modules/ticket/front/request/index/index.js
@@ -16,8 +16,7 @@ class Controller extends Section {
}
}
}
- },
- {
+ }, {
relation: 'requester',
scope: {
include: {
@@ -27,8 +26,7 @@ class Controller extends Section {
}
}
}
- },
- {
+ }, {
relation: 'sale'
}
]
@@ -60,14 +58,6 @@ class Controller extends Section {
this.$.itemDescriptor.show();
}
- showWorkerDescriptor(event, workerFk) {
- event.preventDefault();
- event.stopImmediatePropagation();
- this.selectedWorker = workerFk;
- this.$.workerDescriptor.parent = event.target;
- this.$.workerDescriptor.show();
- }
-
getRequestState(state) {
switch (state) {
case null:
diff --git a/modules/ticket/front/request/index/index.spec.js b/modules/ticket/front/request/index/index.spec.js
index 17f085010..b62447fd5 100644
--- a/modules/ticket/front/request/index/index.spec.js
+++ b/modules/ticket/front/request/index/index.spec.js
@@ -6,9 +6,8 @@ describe('Ticket', () => {
beforeEach(ngModule('ticket'));
- beforeEach(angular.mock.inject($componentController => {
- const $element = angular.element('
');
- controller = $componentController('vnTicketRequestIndex', {$element});
+ beforeEach(inject($componentController => {
+ controller = $componentController('vnTicketRequestIndex', {$element: null});
}));
describe('getRequestState()', () => {
diff --git a/modules/ticket/front/sale-checked/index.js b/modules/ticket/front/sale-checked/index.js
index 1fd9b662b..9bb5fd19a 100644
--- a/modules/ticket/front/sale-checked/index.js
+++ b/modules/ticket/front/sale-checked/index.js
@@ -33,10 +33,6 @@ class Controller extends Section {
this.$.descriptor.parent = event.target;
this.$.descriptor.show();
}
-
- onDescriptorLoad() {
- this.$.popover.relocate();
- }
}
ngModule.component('vnTicketSaleChecked', {
diff --git a/modules/ticket/front/sale-tracking/index.html b/modules/ticket/front/sale-tracking/index.html
index b097653eb..967160915 100644
--- a/modules/ticket/front/sale-tracking/index.html
+++ b/modules/ticket/front/sale-tracking/index.html
@@ -52,7 +52,7 @@
+ ng-click="workerDescriptor.show($event, sale.workerFk)">
{{::sale.userNickname | dashIfEmpty}}
diff --git a/modules/ticket/front/sale-tracking/index.js b/modules/ticket/front/sale-tracking/index.js
index 8dca9c026..bd41add25 100644
--- a/modules/ticket/front/sale-tracking/index.js
+++ b/modules/ticket/front/sale-tracking/index.js
@@ -18,18 +18,6 @@ class Controller extends Section {
this.$.itemDescriptor.parent = event.target;
this.$.itemDescriptor.show();
}
-
- showWorkerDescriptor(event, workerFk) {
- event.preventDefault();
- event.stopImmediatePropagation();
- this.selectedWorker = workerFk;
- this.$.workerDescriptor.parent = event.target;
- this.$.workerDescriptor.show();
- }
-
- onDescriptorLoad() {
- this.$.popover.relocate();
- }
}
ngModule.component('vnTicketSaleTracking', {
diff --git a/modules/ticket/front/sale/index.html b/modules/ticket/front/sale/index.html
index 51798537f..efa4f0285 100644
--- a/modules/ticket/front/sale/index.html
+++ b/modules/ticket/front/sale/index.html
@@ -9,176 +9,175 @@
-
-
-
-
-
-
-
-
-
-
-
- Id
- Quantity
- Item
- Price
- Disc
- Amount
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{sale.itemFk}}
-
-
-
- {{id}} - {{name}}
-
-
-
-
- {{sale.quantity}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{sale.price | currency: 'EUR':2}}
-
-
-
-
- {{(sale.discount / 100) | percentage}}
-
-
-
- {{$ctrl.getSaleTotal(sale) | currency: 'EUR':2}}
-
+
+
+
+
+
+
+
+
+
+
+ Id
+ Quantity
+ Item
+ Price
+ Disc
+ Amount
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{sale.itemFk}}
+
+
+
+ {{id}} - {{name}}
+
+
+
+
+ {{sale.quantity}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{sale.price | currency: 'EUR':2}}
+
+
+
+
+ {{(sale.discount / 100) | percentage}}
+
+
+
+ {{$ctrl.getSaleTotal(sale) | currency: 'EUR':2}}
+
+
@@ -200,7 +199,6 @@
vn-bind="+"
fixed-bottom-right>
-
diff --git a/modules/ticket/front/sale/index.js b/modules/ticket/front/sale/index.js
index 0bf960b1e..78cedc7f2 100644
--- a/modules/ticket/front/sale/index.js
+++ b/modules/ticket/front/sale/index.js
@@ -228,16 +228,6 @@ class Controller extends Section {
}
}
- showRemoveLinesDialog() {
- this.$.deleteLines.show();
- }
-
- showTransferPopover(event) {
- this.setTransferParams();
- this.$.transfer.parent = event.target;
- this.$.transfer.show();
- }
-
setTransferParams() {
const checkedSales = JSON.stringify(this.checkedLines());
const sales = JSON.parse(checkedSales);
@@ -312,10 +302,6 @@ class Controller extends Section {
this.$.descriptor.show();
}
- onDescriptorLoad() {
- this.$.popover.relocate();
- }
-
showEditPricePopover(event, sale) {
if (!this.isEditable) return;
this.sale = sale;
diff --git a/modules/ticket/front/summary/index.js b/modules/ticket/front/summary/index.js
index 7e892b265..1ad9cf4b3 100644
--- a/modules/ticket/front/summary/index.js
+++ b/modules/ticket/front/summary/index.js
@@ -61,10 +61,6 @@ class Controller extends Section {
this.$.descriptor.show();
}
- onDescriptorLoad() {
- this.$.popover.relocate();
- }
-
get isEditable() {
try {
return !this.ticket.state.state.alertLevel;
diff --git a/modules/ticket/front/tracking/index/index.html b/modules/ticket/front/tracking/index/index.html
index 99d0b838a..bf22bfb98 100644
--- a/modules/ticket/front/tracking/index/index.html
+++ b/modules/ticket/front/tracking/index/index.html
@@ -24,7 +24,7 @@
+ ng-click="workerDescriptor.show($event, tracking.worker.user.id)">
{{::tracking.worker.user.nickname | dashIfEmpty}}
diff --git a/modules/ticket/front/tracking/index/index.js b/modules/ticket/front/tracking/index/index.js
index e58dc4300..2826cbf26 100644
--- a/modules/ticket/front/tracking/index/index.js
+++ b/modules/ticket/front/tracking/index/index.js
@@ -17,8 +17,7 @@ class Controller extends Section {
}
}
}
- },
- {
+ }, {
relation: 'state',
scope: {
fields: ['name']
@@ -27,14 +26,6 @@ class Controller extends Section {
]
};
}
-
- showWorkerDescriptor(event, workerFk) {
- event.preventDefault();
- event.stopImmediatePropagation();
- this.selectedWorker = workerFk;
- this.$.workerDescriptor.parent = event.target;
- this.$.workerDescriptor.show();
- }
}
ngModule.component('vnTicketTrackingIndex', {
diff --git a/modules/ticket/front/volume/index.js b/modules/ticket/front/volume/index.js
index bf616cb24..0395afa8d 100644
--- a/modules/ticket/front/volume/index.js
+++ b/modules/ticket/front/volume/index.js
@@ -60,10 +60,6 @@ class Controller extends Section {
this.$.descriptor.parent = event.target;
this.$.descriptor.show();
}
-
- onDescriptorLoad() {
- this.$.popover.relocate();
- }
}
ngModule.component('vnTicketVolume', {
diff --git a/modules/ticket/front/volume/index.spec.js b/modules/ticket/front/volume/index.spec.js
index 2f6efee21..7807bfe10 100644
--- a/modules/ticket/front/volume/index.spec.js
+++ b/modules/ticket/front/volume/index.spec.js
@@ -66,16 +66,21 @@ describe('ticket', () => {
});
});
- /* it('should join the sale volumes to its respective sale', () => {
+ /*
+ it('should join the sale volumes to its respective sale', () => {
controller.ticket = {id: 1};
- let response = {volumes: [{saleFk: 1, m3: 0.008}, {saleFk: 2, m3: 0.003}]};
- $httpBackend.whenGET(`tickets/1/getVolume`).respond(response);
- $httpBackend.expectGET(`tickets/1/getVolume`);
+ let response = {volumes: [
+ {saleFk: 1, m3: 0.008},
+ {saleFk: 2, m3: 0.003}
+ ]};
+
+ $httpBackend.expectGET(`tickets/1/getVolume`).respond(response);
controller.onDataChange();
$httpBackend.flush();
expect($scope.model.data[0].volume.m3).toBe(0.008);
expect($scope.model.data[1].volume.m3).toBe(0.003);
- }); */
+ });
+ */
});
});
diff --git a/modules/worker/front/dms/index/index.html b/modules/worker/front/dms/index/index.html
index 1bf1af61e..e1cc1c90f 100644
--- a/modules/worker/front/dms/index/index.html
+++ b/modules/worker/front/dms/index/index.html
@@ -56,7 +56,7 @@
-
@@ -64,7 +64,7 @@
@@ -74,10 +74,7 @@
-
-
-
@@ -87,5 +84,5 @@
vn-id="confirm"
message="This file will be deleted"
question="Are you sure you want to continue?"
- on-response="$ctrl.deleteDms($response)">
+ on-accept="$ctrl.deleteDms($data)">
\ No newline at end of file
diff --git a/modules/worker/front/dms/index/index.js b/modules/worker/front/dms/index/index.js
index d322145a0..a950c1a42 100644
--- a/modules/worker/front/dms/index/index.js
+++ b/modules/worker/front/dms/index/index.js
@@ -19,51 +19,37 @@ class Controller extends Component {
'file',
'created',
],
- include: [{
- relation: 'dmsType',
- scope: {
- fields: ['name']
+ include: [
+ {
+ relation: 'dmsType',
+ scope: {
+ fields: ['name']
+ }
+ }, {
+ relation: 'worker',
+ scope: {
+ fields: ['userFk'],
+ include: {
+ relation: 'user',
+ scope: {
+ fields: ['nickname']
+ }
+ },
+ }
}
- },
- {
- relation: 'worker',
- scope: {
- fields: ['userFk'],
- include: {
- relation: 'user',
- scope: {
- fields: ['nickname']
- }
- },
- }
- }]
+ ]
},
}
};
}
- showWorkerDescriptor(event, workerFk) {
- event.preventDefault();
- event.stopImmediatePropagation();
- this.$.workerDescriptor.parent = event.target;
- this.$.workerDescriptor.workerFk = workerFk;
- this.$.workerDescriptor.show();
- }
-
- showDeleteConfirm(index) {
- this.dmsIndex = index;
- this.$.confirm.show();
- }
-
- deleteDms(response) {
- if (response === 'accept') {
- const workerDmsId = this.workerDms[this.dmsIndex].id;
- const query = `WorkerDms/${workerDmsId}/removeFile`;
- this.$http.post(query).then(() => {
- this.$.model.remove(this.dmsIndex);
- this.vnApp.showSuccess(this.$translate.instant('Data saved!'));
+ deleteDms(index) {
+ const workerDmsId = this.workerDms[index].dmsFk;
+ return this.$http.post(`WorkerDms/${workerDmsId}/removeFile`)
+ .then(() => {
+ this.$.model.remove(index);
+ this.vnApp.showSuccess(this.$t('Data saved!'));
});
- }
}
}
diff --git a/modules/worker/front/dms/index/index.spec.js b/modules/worker/front/dms/index/index.spec.js
index 074f11524..9c1e87011 100644
--- a/modules/worker/front/dms/index/index.spec.js
+++ b/modules/worker/front/dms/index/index.spec.js
@@ -4,36 +4,33 @@ import crudModel from 'core/mocks/crud-model';
describe('Worker', () => {
describe('Component vnWorkerDmsIndex', () => {
let $scope;
- let $element;
let $httpBackend;
let controller;
beforeEach(ngModule('worker'));
- beforeEach(angular.mock.inject(($componentController, $rootScope, _$httpBackend_) => {
+ beforeEach(inject(($componentController, $rootScope, _$httpBackend_) => {
$httpBackend = _$httpBackend_;
$scope = $rootScope.$new();
- $element = angular.element(` {
it('should make an HTTP Post query', () => {
- const workerDmsId = 1;
- const dmsIndex = 0;
jest.spyOn(controller.vnApp, 'showSuccess');
jest.spyOn(controller.$.model, 'remove');
- controller.workerDms = [{id: 1, dmsFk: 4}];
- controller.dmsIndex = dmsIndex;
- $httpBackend.when('POST', `WorkerDms/${workerDmsId}/removeFile`).respond({});
- $httpBackend.expect('POST', `WorkerDms/${workerDmsId}/removeFile`);
- controller.deleteDms('accept');
+ const workerDmsId = 4;
+ const dmsIndex = 0;
+ controller.workerDms = [{id: 1, dmsFk: 4}];
+
+ $httpBackend.expectPOST(`WorkerDms/${workerDmsId}/removeFile`).respond();
+ controller.deleteDms(dmsIndex);
$httpBackend.flush();
expect(controller.$.model.remove).toHaveBeenCalledWith(dmsIndex);
- expect(controller.vnApp.showSuccess).toHaveBeenCalledWith('Data saved!');
+ expect(controller.vnApp.showSuccess).toHaveBeenCalled();
});
});
});
diff --git a/modules/worker/front/log/index.html b/modules/worker/front/log/index.html
index bfa60a8c3..7b2ffa445 100644
--- a/modules/worker/front/log/index.html
+++ b/modules/worker/front/log/index.html
@@ -32,7 +32,7 @@
Changed by:
{{::log.user.name | dashIfEmpty}}
@@ -53,7 +53,7 @@