Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into dev
gitea/salix/dev This commit looks good
Details
gitea/salix/dev This commit looks good
Details
This commit is contained in:
commit
c72381f9c1
|
@ -40,6 +40,11 @@
|
|||
</vn-label-value>
|
||||
</vn-one>
|
||||
<vn-horizontal class="buttons">
|
||||
<vn-icon-button
|
||||
ng-click="$ctrl.filterTickets(client, $event)"
|
||||
vn-tooltip="Client tickets"
|
||||
icon="icon-ticket">
|
||||
</vn-icon-button>
|
||||
<vn-icon-button
|
||||
ng-click="$ctrl.openSummary(client, $event)"
|
||||
vn-tooltip="Preview"
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
import ngModule from '../module';
|
||||
|
||||
export default class Controller {
|
||||
constructor($scope, $stateParams) {
|
||||
constructor($scope, $state) {
|
||||
this.$ = $scope;
|
||||
this.$state = $state;
|
||||
this.clientSelected = null;
|
||||
}
|
||||
|
||||
|
@ -42,8 +43,16 @@ export default class Controller {
|
|||
this.clientSelected = client;
|
||||
this.$.dialogSummaryClient.show();
|
||||
}
|
||||
|
||||
filterTickets(client, event) {
|
||||
let state = `ticket.index`;
|
||||
let params = {q: `{"clientFk": ${client.id}}`};
|
||||
|
||||
event.preventDefault();
|
||||
this.$state.go(state, params);
|
||||
}
|
||||
Controller.$inject = ['$scope', '$stateParams'];
|
||||
}
|
||||
Controller.$inject = ['$scope', '$state'];
|
||||
|
||||
ngModule.component('vnClientIndex', {
|
||||
template: require('./index.html'),
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
import './index';
|
||||
|
||||
describe('Client index', () => {
|
||||
let $scope;
|
||||
let controller;
|
||||
|
||||
beforeEach(angular.mock.module('client', $translateProvider => {
|
||||
$translateProvider.translations('en', {});
|
||||
}));
|
||||
|
||||
beforeEach(angular.mock.inject(($componentController, $rootScope, $state) => {
|
||||
$scope = $rootScope.$new();
|
||||
controller = $componentController('vnClientIndex', {$scope, $state});
|
||||
}));
|
||||
|
||||
describe('x()', () => {
|
||||
it('should request to patch the propagation of tax status', () => {
|
||||
const client = {id: 101};
|
||||
const event = {preventDefault: () => {}};
|
||||
spyOn(event, 'preventDefault');
|
||||
spyOn(controller.$state, 'go');
|
||||
|
||||
controller.filterTickets(client, event);
|
||||
|
||||
expect(event.preventDefault).toHaveBeenCalledWith();
|
||||
expect(controller.$state.go).toHaveBeenCalledWith('ticket.index', jasmine.any(Object));
|
||||
});
|
||||
});
|
||||
});
|
|
@ -3,3 +3,4 @@ Phone: Teléfono
|
|||
Town/City: Ciudad
|
||||
Email: E-mail
|
||||
View client: Ver cliente
|
||||
Client tickets: Listado de tickets del cliente
|
Loading…
Reference in New Issue