Hide line items by default for confirmed reimbursements
This commit is contained in:
@@ -1,10 +1,19 @@
|
|||||||
import Component from '@glimmer/component';
|
import Component from '@glimmer/component';
|
||||||
import { action } from '@ember/object';
|
import { action } from '@ember/object';
|
||||||
|
import { tracked } from '@glimmer/tracking';
|
||||||
import { inject as service } from '@ember/service';
|
import { inject as service } from '@ember/service';
|
||||||
import config from 'kredits-web/config/environment';
|
import config from 'kredits-web/config/environment';
|
||||||
|
|
||||||
export default class ReimbursementItemComponent extends Component {
|
export default class ReimbursementItemComponent extends Component {
|
||||||
@service kredits;
|
@service kredits;
|
||||||
|
@tracked showExpenseDetails = false;
|
||||||
|
|
||||||
|
constructor(owner, args) {
|
||||||
|
super(owner, args);
|
||||||
|
if (this.isUnconfirmed && !this.args.reimbursement.vetoed) {
|
||||||
|
this.showExpenseDetails = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
get ipfsGatewayUrl () {
|
get ipfsGatewayUrl () {
|
||||||
return config.ipfs.gatewayUrl;
|
return config.ipfs.gatewayUrl;
|
||||||
@@ -22,6 +31,11 @@ export default class ReimbursementItemComponent extends Component {
|
|||||||
return this.isUnconfirmed && this.kredits.currentUserIsCore;
|
return this.isUnconfirmed && this.kredits.currentUserIsCore;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@action
|
||||||
|
toggleExpenseDetails () {
|
||||||
|
this.showExpenseDetails = !this.showExpenseDetails;
|
||||||
|
}
|
||||||
|
|
||||||
@action
|
@action
|
||||||
veto (id) {
|
veto (id) {
|
||||||
this.kredits.vetoReimbursement(id).then(transaction => {
|
this.kredits.vetoReimbursement(id).then(transaction => {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<li data-reimbursement-id={{@reimbursement.id}}
|
<li data-reimbursement-id={{@reimbursement.id}}
|
||||||
class="{{item-status @reimbursement}}">
|
class="{{item-status @reimbursement}}"
|
||||||
|
{{on "click" this.toggleExpenseDetails}}>
|
||||||
<p class="meta">
|
<p class="meta">
|
||||||
<span class="recipient">
|
<span class="recipient">
|
||||||
<UserAvatar @contributor={{@reimbursement.contributor}} />
|
<UserAvatar @contributor={{@reimbursement.contributor}} />
|
||||||
@@ -13,7 +14,9 @@
|
|||||||
{{sats-to-btc @reimbursement.amount}}</span> <span class="symbol">BTC</span>
|
{{sats-to-btc @reimbursement.amount}}</span> <span class="symbol">BTC</span>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
{{#if this.showExpenseDetails}}
|
||||||
<ExpenseList @expenses={{@reimbursement.expenses}} />
|
<ExpenseList @expenses={{@reimbursement.expenses}} />
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
<div class="meta">
|
<div class="meta">
|
||||||
<p class="confirmation-eta">
|
<p class="confirmation-eta">
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<ul class="item-list spaced reimbursement-list {{if @loading 'loading'}}">
|
<ul class="item-list collapsible spaced reimbursement-list {{if @loading 'loading'}}">
|
||||||
{{#each this.itemsSorted as |item|}}
|
{{#each this.itemsSorted as |item|}}
|
||||||
<ReimbursementItem @reimbursement={{item}} />
|
<ReimbursementItem @reimbursement={{item}} />
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
|||||||
@@ -16,6 +16,16 @@ ul.item-list {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.collapsible {
|
||||||
|
> li {
|
||||||
|
border-left: 1px solid transparent;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
border-left: 1px solid $blue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
&.loading {
|
&.loading {
|
||||||
@include loading-border-top;
|
@include loading-border-top;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user