mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-14 13:17:24 +01:00
* Read IP blocks from database * begin building general blocking solution * add new frontend files * Add UI for managing blockers * correctly reset local data after creating blocker * Tweak wording * Add UI for managing blockers * restructure admin pages * improve test coverage * Improve blocker UI * add blocker to block emails from registration * lint fix * fix * lint fixes * fix import * add new permission for managing blockers * improve permission check * fix managing permissions from admin * improve navbar display for non fullAccess admin * update block error strings * lint fix * add option to errorHandler to skip logging * validate blocker value during input * improve blocker form display * chore(subproj): reconcile habitica-images * fix(scripts): use same Mongo version for dev/test * fix(whitespace): eof * documentation improvements * remove nconf import * remove old test --------- Co-authored-by: Kalista Payne <kalista@habitica.com> Co-authored-by: Kalista Payne <sabrecat@gmail.com>
70 lines
1.5 KiB
Vue
70 lines
1.5 KiB
Vue
<template>
|
|
<div class="card mt-2">
|
|
<div class="card-header">
|
|
<h3
|
|
class="mb-0 mt-0"
|
|
:class="{'open': expand}"
|
|
@click="toggleTransactionsOpen"
|
|
>
|
|
Transactions
|
|
</h3>
|
|
</div>
|
|
<div
|
|
v-if="expand"
|
|
class="card-body"
|
|
>
|
|
<purchase-history-table
|
|
:gem-transactions="gemTransactions"
|
|
:hourglass-transactions="hourglassTransactions"
|
|
/>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import PurchaseHistoryTable from '../../../ui/purchaseHistoryTable.vue';
|
|
import { userStateMixin } from '../../../../mixins/userState';
|
|
|
|
export default {
|
|
components: {
|
|
PurchaseHistoryTable,
|
|
},
|
|
mixins: [userStateMixin],
|
|
props: {
|
|
hero: {
|
|
type: Object,
|
|
required: true,
|
|
},
|
|
resetCounter: {
|
|
type: Number,
|
|
required: true,
|
|
},
|
|
},
|
|
data () {
|
|
return {
|
|
expand: false,
|
|
gemTransactions: [],
|
|
hourglassTransactions: [],
|
|
};
|
|
},
|
|
watch: {
|
|
resetCounter () {
|
|
if (this.expand) {
|
|
this.expand = !this.expand;
|
|
this.toggleTransactionsOpen();
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
async toggleTransactionsOpen () {
|
|
this.expand = !this.expand;
|
|
if (this.expand) {
|
|
const transactions = await this.$store.dispatch('members:getPurchaseHistory', { memberId: this.hero._id });
|
|
this.gemTransactions = transactions.filter(transaction => transaction.currency === 'gems');
|
|
this.hourglassTransactions = transactions.filter(transaction => transaction.currency === 'hourglasses');
|
|
}
|
|
},
|
|
},
|
|
};
|
|
</script>
|