3377-modifyStyles #798
|
@ -3,7 +3,7 @@
|
|||
url="Tickets"
|
||||
link="{clientFk: $ctrl.client.id}"
|
||||
filter="::$ctrl.ticketFilter"
|
||||
limit="5"
|
||||
limit="10"
|
||||
data="tickets"
|
||||
order="shipped DESC, id">
|
||||
</vn-crud-model>
|
||||
|
@ -287,7 +287,7 @@
|
|||
<vn-horizontal>
|
||||
<vn-one>
|
||||
<h4 translate>Latest tickets</h4>
|
||||
<vn-table model="ticketsModel" class="scrollable sm">
|
||||
<vn-table model="ticketsModel">
|
||||
<vn-thead>
|
||||
<vn-tr>
|
||||
<vn-th field="id" number>Id</vn-th>
|
||||
|
|
|
@ -121,11 +121,17 @@
|
|||
data="$ctrl.possibleTickets">
|
||||
</vn-crud-model>
|
||||
<vn-dialog
|
||||
vn-id="possibleTicketsDialog"
|
||||
on-accept="$ctrl.setTicketsRoute()"
|
||||
message="Tickets to add">
|
||||
vn-id="possibleTicketsDialog">
|
||||
<tpl-title>
|
||||
<vn-horizontal>
|
||||
<span translate>Tickets to add</span>
|
||||
<div class="button-right">
|
||||
vicent marked this conversation as resolved
Outdated
|
||||
<vn-button label="Add" ng-click="$ctrl.setTicketsRoute()"></vn-button>
|
||||
</div>
|
||||
</vn-horizontal>
|
||||
</tpl-title>
|
||||
<tpl-body>
|
||||
<vn-data-viewer class="vn-pa-md" model="possibleTicketsModel">
|
||||
<vn-data-viewer model="possibleTicketsModel">
|
||||
<vn-table model="possibleTicketsModel" auto-load="false">
|
||||
<vn-thead>
|
||||
<vn-tr>
|
||||
|
@ -154,7 +160,7 @@
|
|||
{{::ticket.id}}
|
||||
</span>
|
||||
</vn-td>
|
||||
<vn-td number>
|
||||
<vn-td expand>
|
||||
<span class="link" ng-click="clientDescriptor.show($event, ticket.clientFk)">
|
||||
{{::ticket.nickname}}
|
||||
</span>
|
||||
|
@ -168,10 +174,6 @@
|
|||
</vn-table>
|
||||
</vn-data-viewer>
|
||||
</tpl-body>
|
||||
<tpl-buttons>
|
||||
<input type="button" response="cancel" translate-attr="{value: 'Cancel'}"/>
|
||||
<button response="accept" translate>Add</button>
|
||||
</tpl-buttons>
|
||||
</vn-dialog>
|
||||
<vn-float-button
|
||||
icon="add"
|
||||
|
|
|
@ -132,6 +132,7 @@ class Controller extends Section {
|
|||
this.$.model.data = this.$.model.data.concat(tickets);
|
||||
this.vnApp.showSuccess(this.$t('Data saved!'));
|
||||
this.updateVolume();
|
||||
this.$.possibleTicketsDialog.hide();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -197,6 +197,9 @@ describe('Route', () => {
|
|||
|
||||
describe('setTicketsRoute()', () => {
|
||||
it('should perform a POST query to add tickets to the route', () => {
|
||||
controller.$.possibleTicketsDialog = {hide: () => {}};
|
||||
jest.spyOn(controller.$.possibleTicketsDialog, 'hide');
|
||||
|
||||
controller.$params = {id: 1101};
|
||||
controller.$.model.data = [{id: 1, checked: false}];
|
||||
|
||||
|
@ -223,6 +226,7 @@ describe('Route', () => {
|
|||
$httpBackend.flush();
|
||||
|
||||
expect(controller.$.model.data).toEqual(expectedResult);
|
||||
expect(controller.$.possibleTicketsDialog.hide).toHaveBeenCalledWith();
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -8,3 +8,9 @@ vn-route-tickets form{
|
|||
max-width: 30px;
|
||||
}
|
||||
}
|
||||
|
||||
.button-right{
|
||||
display: block;
|
||||
padding-right: 50px;
|
||||
text-align: right;
|
||||
}
|
Loading…
Reference in New Issue
styles are better placed in a style.scss file