linter errors
This commit is contained in:
parent
d85a4da1ab
commit
1ad44f22b4
|
@ -155,6 +155,7 @@ export default class Watcher extends Component {
|
|||
});
|
||||
}
|
||||
|
||||
|
||||
return this.$q((resolve, reject) => {
|
||||
this.$http.post(this.url, changedData).then(
|
||||
json => this.writeData(json, resolve),
|
||||
|
@ -203,10 +204,9 @@ export default class Watcher extends Component {
|
|||
if (this.data)
|
||||
Object.assign(this.data, this.orgData);
|
||||
this.$state.go(this.state);
|
||||
} else {
|
||||
} else
|
||||
this.state = null;
|
||||
}
|
||||
}
|
||||
|
||||
writeData(json, resolve) {
|
||||
Object.assign(this.data, json.data);
|
||||
|
@ -236,6 +236,7 @@ export default class Watcher extends Component {
|
|||
}
|
||||
);
|
||||
}
|
||||
|
||||
return newCopy;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,8 +12,8 @@ class Controller {
|
|||
this.deletable = false;
|
||||
this.edit = {};
|
||||
this.moreOptions = [
|
||||
{callback: this.showAddTurnDialog, name: "Add turn", always: true},
|
||||
{callback: this.showDeleteTicketDialog, name: "Delete ticket", always: true},
|
||||
{callback: this.showAddTurnDialog, name: 'Add turn', always: true},
|
||||
{callback: this.showDeleteTicketDialog, name: 'Delete ticket', always: true},
|
||||
{callback: this.markAsReserved, name: 'Mark as reserved'},
|
||||
{callback: this.unmarkAsReserved, name: 'Unmark as reserved'},
|
||||
{callback: this.showEditDialog, name: 'Update discount'},
|
||||
|
@ -77,9 +77,10 @@ class Controller {
|
|||
}
|
||||
|
||||
get isChecked() {
|
||||
if (this.sales)
|
||||
if (this.sales) {
|
||||
for (let instance of this.sales)
|
||||
if (instance.checked) return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -87,16 +88,18 @@ class Controller {
|
|||
getCheckedLines() {
|
||||
let lines = [];
|
||||
let data = this.sales;
|
||||
if (data)
|
||||
for (let i = 0; i < data.length; i++)
|
||||
if (data) {
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
if (data[i].checked)
|
||||
lines.push({id: data[i].id, instance: i});
|
||||
}
|
||||
}
|
||||
return lines;
|
||||
}
|
||||
|
||||
// Change State
|
||||
onStateOkClick() {
|
||||
let filter = {where: {code: "OK"}, fields: ["id"]};
|
||||
let filter = {where: {code: 'OK'}, fields: ['id']};
|
||||
let json = encodeURIComponent(JSON.stringify(filter));
|
||||
this.$http.get(`/ticket/api/States?filter=${json}`).then(res => {
|
||||
this.onStateChange(res.data[0].id);
|
||||
|
@ -197,7 +200,7 @@ class Controller {
|
|||
let sales = this.getCheckedLines();
|
||||
|
||||
this.$http.post(`/api/Sales/MoveToNewTicket`, {ticket: ticket, sales: sales}).then(res => {
|
||||
let url = this.$state.href("ticket.card.sale", {id: res.data.id}, {absolute: true});
|
||||
let url = this.$state.href('ticket.card.sale', {id: res.data.id}, {absolute: true});
|
||||
window.open(url, '_blank');
|
||||
this.$scope.transfer.hide();
|
||||
this.$scope.model.refresh();
|
||||
|
@ -215,13 +218,12 @@ class Controller {
|
|||
for (let i = 0; i < sales.length; i++)
|
||||
sales[i].quantity = this.sales[sales[i].instance].quantity;
|
||||
this.$http.post(`claim/api/Claims/createFromSales`, {claim: claim, sales: sales}).then(res => {
|
||||
let url = this.$state.href("claim.card.basicData", {id: res.data.id}, {absolute: true});
|
||||
window.open(url, '_blank');
|
||||
this.$state.go('claim.card.basicData', {id: res.data.id});
|
||||
});
|
||||
}
|
||||
|
||||
goToTicket(ticketID) {
|
||||
this.$state.go("ticket.card.sale", {id: ticketID});
|
||||
this.$state.go('ticket.card.sale', {id: ticketID});
|
||||
}
|
||||
|
||||
// Focus First Input
|
||||
|
@ -288,6 +290,7 @@ class Controller {
|
|||
this.vnApp.showSuccess(this.$translate.instant('Data saved!'));
|
||||
});
|
||||
}
|
||||
|
||||
this.$scope.editPricePopover.hide();
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
const app = require(`${servicesDir}/ticket/server/server`);
|
||||
|
||||
describe('sale getClaimableFromTicket()', () => {
|
||||
it('should throw an error if the ticket is not editable', async() => {
|
||||
it('should return the claimable sales of a given ticket', async () => {
|
||||
let claimableFromTicket = await app.models.Sale.getClaimableFromTicket(16);
|
||||
|
||||
expect(claimableFromTicket[0].concept).toBe('Gem of Time');
|
||||
|
|
Loading…
Reference in New Issue