#1243 ticket.log columna worker

This commit is contained in:
Carlos Jimenez Ruiz 2019-04-02 11:04:53 +02:00
parent 0b977d3b0b
commit 570e2b5732
14 changed files with 57 additions and 53 deletions

View File

@ -449,7 +449,7 @@ export default {
}, },
ticketLog: { ticketLog: {
logButton: `vn-left-menu a[ui-sref="ticket.card.log"]`, logButton: `vn-left-menu a[ui-sref="ticket.card.log"]`,
changedBy: 'vn-ticket-log > vn-log > vn-vertical > vn-card > div > vn-vertical > vn-table > div > vn-tbody > vn-tr > vn-td:nth-child(1) > div > div:nth-child(1) > span.value.ng-scope.ng-binding', changedBy: 'vn-ticket-log > vn-log > vn-vertical > vn-card > div > vn-vertical > vn-table > div > vn-tbody > vn-tr:nth-child(1) > vn-td:nth-child(2) > span',
actionTaken: 'vn-ticket-log > vn-log > vn-vertical > vn-card > div > vn-vertical > vn-table > div > vn-tbody > vn-tr > vn-td:nth-child(1) > div > div:nth-child(3) > span.value.ng-scope.ng-binding', actionTaken: 'vn-ticket-log > vn-log > vn-vertical > vn-card > div > vn-vertical > vn-table > div > vn-tbody > vn-tr > vn-td:nth-child(1) > div > div:nth-child(3) > span.value.ng-scope.ng-binding',
id: 'vn-ticket-log > vn-log > vn-vertical > vn-card > div > vn-vertical > vn-table > div > vn-tbody > vn-tr > vn-td.before > vn-one:nth-child(1) > div > span.value.ng-scope.ng-binding' id: 'vn-ticket-log > vn-log > vn-vertical > vn-card > div > vn-vertical > vn-table > div > vn-tbody > vn-tr > vn-td.before > vn-one:nth-child(1) > div > span.value.ng-scope.ng-binding'
}, },

View File

@ -23,30 +23,4 @@ describe('Ticket List components path', () => {
expect(base).toContain('Base'); expect(base).toContain('Base');
expect(base.length).toBeGreaterThan(minLength); expect(base.length).toBeGreaterThan(minLength);
}); });
it('should confirm the total margin is correct', async() => {
const name = 'Margin €';
const minLength = name.length;
const margin = await nightmare
.waitPropertyLength(selectors.ticketComponents.margin, 'innerText', minLength)
.waitToGetProperty(selectors.ticketComponents.margin, 'innerText');
expect(margin).toContain('Margin');
expect(margin.length).toBeGreaterThan(minLength);
});
it('should confirm the total total is correct', async() => {
const name = 'Total €';
const minLength = name.length;
const total = await nightmare
.waitPropertyLength(selectors.ticketComponents.total, 'innerText', minLength)
.waitToGetProperty(selectors.ticketComponents.total, 'innerText');
expect(total).toContain('Total');
expect(total.length).toBeGreaterThan(minLength);
});
}); });

View File

@ -40,7 +40,6 @@ import './input-range';
import './chip'; import './chip';
import './input-number'; import './input-number';
import './input-time'; import './input-time';
import './log';
import './treeview'; import './treeview';
import './treeview/child'; import './treeview/child';
import './calendar'; import './calendar';

View File

@ -1,21 +0,0 @@
import ngModule from '../../module';
import './style.scss';
export default class Controller {
constructor() {
this.actionsText = {
'insert': 'Creates',
'update': 'Updates',
'delete': 'Deletes',
'select': 'Views'
};
}
}
ngModule.component('vnLog', {
controller: Controller,
template: require('./index.html'),
bindings: {
model: '<'
}
});

View File

@ -3,6 +3,7 @@
"name": "Agencies", "name": "Agencies",
"icon" : "icon-delivery", "icon" : "icon-delivery",
"validations" : true, "validations" : true,
"dependencies": ["worker"],
"menu": [ "menu": [
{"state": "zone.card.basicData", "icon": "settings"}, {"state": "zone.card.basicData", "icon": "settings"},
{"state": "zone.card.location", "icon": "my_location"} {"state": "zone.card.location", "icon": "my_location"}

View File

@ -3,6 +3,7 @@
"name": "Clients", "name": "Clients",
"icon": "icon-person", "icon": "icon-person",
"validations" : true, "validations" : true,
"dependencies": ["worker"],
"menu": [ "menu": [
{"state": "client.card.basicData", "icon": "settings"}, {"state": "client.card.basicData", "icon": "settings"},
{"state": "client.card.fiscalData", "icon": "account_balance"}, {"state": "client.card.fiscalData", "icon": "account_balance"},

View File

@ -3,7 +3,7 @@
"name": "Invoices out", "name": "Invoices out",
"icon": "icon-invoices1", "icon": "icon-invoices1",
"validations" : true, "validations" : true,
"dependencies": ["client", "ticket"], "dependencies": ["worker", "client", "ticket"],
"routes": [ "routes": [
{ {
"url": "/invoice-out", "url": "/invoice-out",

View File

@ -4,7 +4,6 @@ export default class Controller {
constructor($scope, vnToken) { constructor($scope, vnToken) {
this.accessToken = vnToken.token; this.accessToken = vnToken.token;
this.$ = $scope; this.$ = $scope;
this.ticketSelected = null;
this.filter = { this.filter = {
include: [ include: [

View File

@ -2,6 +2,7 @@
"module": "travel", "module": "travel",
"name": "Travels", "name": "Travels",
"validations": true, "validations": true,
"dependencies": ["worker"],
"routes": [ "routes": [
{ {
"url": "/travel", "url": "/travel",

View File

@ -10,3 +10,4 @@ import './basic-data';
import './pbx'; import './pbx';
import './department'; import './department';
import './calendar'; import './calendar';
import './log';

View File

@ -21,7 +21,12 @@
<div class="changes"> <div class="changes">
<div> <div>
<span translate class="label">Changed by</span><span class="label">: </span> <span translate class="label">Changed by</span><span class="label">: </span>
<span translate class="value">{{::log.user.name | dashIfEmpty}}</span> <span
class="link"
ng-click="$ctrl.showWorkerDescriptor($event, log.user.id)"
translate
class="value">{{::log.user.name | dashIfEmpty}}
</span>
</div> </div>
<div> <div>
<span translate class="label">Model</span><span class="label">: </span> <span translate class="label">Model</span><span class="label">: </span>
@ -38,7 +43,12 @@
</div> </div>
</vn-td> </vn-td>
<vn-td class="expendable"> <vn-td class="expendable">
{{::log.user.name}} <span
class="link"
ng-click="$ctrl.showWorkerDescriptor($event, log.user.id)"
translate
class="value">{{::log.user.name | dashIfEmpty}}
</span>
</vn-td> </vn-td>
<vn-td class="expendable"> <vn-td class="expendable">
{{::log.changedModel}} {{::log.changedModel}}
@ -82,3 +92,7 @@
<vn-pagination model="$ctrl.model"></vn-pagination> <vn-pagination model="$ctrl.model"></vn-pagination>
</vn-card> </vn-card>
</vn-vertical> </vn-vertical>
<vn-worker-descriptor-popover
vn-id="workerDescriptor"
user-id="$ctrl.selectedWorker">
</vn-worker-descriptor-popover>

View File

@ -0,0 +1,35 @@
import ngModule from '../module';
import './style.scss';
export default class Controller {
constructor($scope) {
this.$ = $scope;
this.actionsText = {
'insert': 'Creates',
'update': 'Updates',
'delete': 'Deletes',
'select': 'Views'
};
}
showWorkerDescriptor(event, userId) {
if (event.defaultPrevented) return;
event.preventDefault();
event.stopPropagation();
this.selectedWorker = userId;
this.$.workerDescriptor.parent = event.target;
this.$.workerDescriptor.show();
}
}
Controller.$inject = ['$scope'];
ngModule.component('vnLog', {
controller: Controller,
template: require('./index.html'),
bindings: {
model: '<'
}
});