Add IPFS inspect button to reimbursements
This commit is contained in:
@@ -2,6 +2,7 @@ import Component from '@glimmer/component';
|
|||||||
import { sort } from '@ember/object/computed';
|
import { sort } from '@ember/object/computed';
|
||||||
import { action } from '@ember/object';
|
import { action } from '@ember/object';
|
||||||
import { inject as service } from '@ember/service';
|
import { inject as service } from '@ember/service';
|
||||||
|
import config from 'kredits-web/config/environment';
|
||||||
|
|
||||||
export default class ReimbursementListComponent extends Component {
|
export default class ReimbursementListComponent extends Component {
|
||||||
@service kredits;
|
@service kredits;
|
||||||
@@ -9,6 +10,10 @@ export default class ReimbursementListComponent extends Component {
|
|||||||
itemSorting = Object.freeze(['pendingStatus:asc', 'id:desc']);
|
itemSorting = Object.freeze(['pendingStatus:asc', 'id:desc']);
|
||||||
@sort('args.items', 'itemSorting') itemsSorted;
|
@sort('args.items', 'itemSorting') itemsSorted;
|
||||||
|
|
||||||
|
get ipfsGatewayUrl () {
|
||||||
|
return config.ipfs.gatewayUrl;
|
||||||
|
}
|
||||||
|
|
||||||
@action
|
@action
|
||||||
veto (id) {
|
veto (id) {
|
||||||
this.kredits.vetoReimbursement(id).then(transaction => {
|
this.kredits.vetoReimbursement(id).then(transaction => {
|
||||||
|
|||||||
@@ -32,6 +32,10 @@
|
|||||||
</ul>
|
</ul>
|
||||||
{{#if this.kredits.currentUserIsCore}}
|
{{#if this.kredits.currentUserIsCore}}
|
||||||
<p>
|
<p>
|
||||||
|
<a href="{{this.ipfsGatewayUrl}}/{{reimbursement.ipfsHash}}"
|
||||||
|
class="button small" target="_blank" rel="noopener noreferrer">
|
||||||
|
Inspect IPFS data
|
||||||
|
</a>
|
||||||
<button {{on "click" (fn this.veto reimbursement.id)}}
|
<button {{on "click" (fn this.veto reimbursement.id)}}
|
||||||
disabled={{reimbursement.vetoed}}
|
disabled={{reimbursement.vetoed}}
|
||||||
class="button small danger">veto</button>
|
class="button small danger">veto</button>
|
||||||
|
|||||||
Reference in New Issue
Block a user