Hide line items by default for confirmed reimbursements
This commit is contained in:
@@ -1,10 +1,19 @@
|
||||
import Component from '@glimmer/component';
|
||||
import { action } from '@ember/object';
|
||||
import { tracked } from '@glimmer/tracking';
|
||||
import { inject as service } from '@ember/service';
|
||||
import config from 'kredits-web/config/environment';
|
||||
|
||||
export default class ReimbursementItemComponent extends Component {
|
||||
@service kredits;
|
||||
@tracked showExpenseDetails = false;
|
||||
|
||||
constructor(owner, args) {
|
||||
super(owner, args);
|
||||
if (this.isUnconfirmed && !this.args.reimbursement.vetoed) {
|
||||
this.showExpenseDetails = true;
|
||||
}
|
||||
}
|
||||
|
||||
get ipfsGatewayUrl () {
|
||||
return config.ipfs.gatewayUrl;
|
||||
@@ -22,6 +31,11 @@ export default class ReimbursementItemComponent extends Component {
|
||||
return this.isUnconfirmed && this.kredits.currentUserIsCore;
|
||||
}
|
||||
|
||||
@action
|
||||
toggleExpenseDetails () {
|
||||
this.showExpenseDetails = !this.showExpenseDetails;
|
||||
}
|
||||
|
||||
@action
|
||||
veto (id) {
|
||||
this.kredits.vetoReimbursement(id).then(transaction => {
|
||||
|
||||
Reference in New Issue
Block a user