Merge branch 'dev' into 3032-ticket_card_components_volume_error
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
commit
c9f235df97
|
@ -1,6 +1,7 @@
|
||||||
<vn-crud-model
|
<vn-crud-model
|
||||||
vn-id="ticketsModel"
|
vn-id="ticketsModel"
|
||||||
limit="10"
|
limit="10"
|
||||||
|
auto-load="true"
|
||||||
data="tickets">
|
data="tickets">
|
||||||
</vn-crud-model>
|
</vn-crud-model>
|
||||||
<vn-card class="summary">
|
<vn-card class="summary">
|
||||||
|
|
|
@ -7,7 +7,7 @@ class Controller extends Summary {
|
||||||
this._invoiceOut = value;
|
this._invoiceOut = value;
|
||||||
if (value && value.id) {
|
if (value && value.id) {
|
||||||
this.getSummary();
|
this.getSummary();
|
||||||
this.getTickets();
|
this.$.ticketsModel.url = `InvoiceOuts/${this.invoiceOut.id}/getTickets`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,14 +19,6 @@ class Controller extends Summary {
|
||||||
return this.$http.get(`InvoiceOuts/${this.invoiceOut.id}/summary`)
|
return this.$http.get(`InvoiceOuts/${this.invoiceOut.id}/summary`)
|
||||||
.then(res => this.summary = res.data);
|
.then(res => this.summary = res.data);
|
||||||
}
|
}
|
||||||
|
|
||||||
getTickets() {
|
|
||||||
this.$.$applyAsync(() => {
|
|
||||||
const query = `InvoiceOuts/${this.invoiceOut.id}/getTickets`;
|
|
||||||
this.$.ticketsModel.url = query;
|
|
||||||
this.$.ticketsModel.refresh();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngModule.vnComponent('vnInvoiceOutSummary', {
|
ngModule.vnComponent('vnInvoiceOutSummary', {
|
||||||
|
|
|
@ -27,17 +27,5 @@ describe('InvoiceOut', () => {
|
||||||
expect(controller.summary).toEqual('the data you are looking for');
|
expect(controller.summary).toEqual('the data you are looking for');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('getTickets()', () => {
|
|
||||||
it('should perform a and then call to the ticketModel refresh() method', () => {
|
|
||||||
jest.spyOn(controller.$.ticketsModel, 'refresh');
|
|
||||||
|
|
||||||
controller.getTickets();
|
|
||||||
$scope.$apply();
|
|
||||||
|
|
||||||
expect(controller.$.ticketsModel.url).toEqual('InvoiceOuts/1/getTickets');
|
|
||||||
expect(controller.$.ticketsModel.refresh).toHaveBeenCalledWith();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue