From ebcbd5068f7b6c9764fa5eadf83dbb730ae7303a Mon Sep 17 00:00:00 2001 From: Bernat Exposito Domenech Date: Wed, 17 Jun 2020 09:49:14 +0200 Subject: [PATCH] add restrictions in ticket descriptor --- modules/ticket/front/descriptor/index.html | 3 ++- modules/ticket/front/descriptor/index.js | 22 +++++++++++++------ modules/ticket/front/descriptor/index.spec.js | 2 ++ 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/modules/ticket/front/descriptor/index.html b/modules/ticket/front/descriptor/index.html index ede553b72..2f0400f6b 100644 --- a/modules/ticket/front/descriptor/index.html +++ b/modules/ticket/front/descriptor/index.html @@ -5,6 +5,7 @@ @@ -60,7 +61,7 @@ { + this.isEditable = res.data; + }); + } + showChangeShipped() { this.newShipped = this.ticket.shipped; this.$.changeShippedDialog.show(); diff --git a/modules/ticket/front/descriptor/index.spec.js b/modules/ticket/front/descriptor/index.spec.js index 41a2cceea..ef032d775 100644 --- a/modules/ticket/front/descriptor/index.spec.js +++ b/modules/ticket/front/descriptor/index.spec.js @@ -28,8 +28,10 @@ describe('Ticket Component vnTicketDescriptor', () => { beforeEach(angular.mock.inject(($componentController, _$httpBackend_, _$state_) => { $httpBackend = _$httpBackend_; $httpBackend.whenGET(`Tickets/${ticket.id}/canHaveStowaway`).respond(true); + $httpBackend.whenGET(`Tickets/1/isEditable`).respond(true); $state = _$state_; + $state.params.id = 1; $state.getCurrentPath = () => [null, {state: {name: 'ticket'}}]; controller = $componentController('vnTicketDescriptor', {$element: null}, {ticket});