diff --git a/backend/src/graphql/model/Balance.ts b/backend/src/graphql/model/Balance.ts index 6a93a5b63..619d9b242 100644 --- a/backend/src/graphql/model/Balance.ts +++ b/backend/src/graphql/model/Balance.ts @@ -1,6 +1,5 @@ import { ObjectType, Field } from 'type-graphql' import Decimal from 'decimal.js-light' -import CONFIG from '@/config' @ObjectType() export class Balance { @@ -11,7 +10,6 @@ export class Balance { balanceGDT: number | null count: number linkCount: number - decayStartBlock?: Date lastBookedDate?: Date | null }) { this.balance = data.balance @@ -20,7 +18,6 @@ export class Balance { this.balanceGDT = data.balanceGDT || null this.count = data.count this.linkCount = data.linkCount - this.decayStartBlock = data.decayStartBlock || CONFIG.DECAY_START_TIME this.lastBookedDate = data.lastBookedDate || null } @@ -46,9 +43,6 @@ export class Balance { @Field(() => Number) linkCount: number - @Field(() => Date) - decayStartBlock: Date - // may be null as there may be no transaction @Field(() => Date, { nullable: true }) lastBookedDate: Date | null diff --git a/backend/src/graphql/resolver/AdminResolver.ts b/backend/src/graphql/resolver/AdminResolver.ts index 1ed0422ef..7ca3460ee 100644 --- a/backend/src/graphql/resolver/AdminResolver.ts +++ b/backend/src/graphql/resolver/AdminResolver.ts @@ -1,6 +1,4 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ -/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ - +import { Context, getUser } from '@/server/context' import { Resolver, Query, Arg, Args, Authorized, Mutation, Ctx, Int } from 'type-graphql' import { getCustomRepository, @@ -137,7 +135,7 @@ export class AdminResolver { @Mutation(() => Date, { nullable: true }) async deleteUser( @Arg('userId', () => Int) userId: number, - @Ctx() context: any, + @Ctx() context: Context, ): Promise { const user = await dbUser.findOne({ id: userId }) // user exists ? @@ -145,7 +143,7 @@ export class AdminResolver { throw new Error(`Could not find user with userId: ${userId}`) } // moderator user disabled own account? - const moderatorUser = context.user + const moderatorUser = getUser(context) if (moderatorUser.id === userId) { throw new Error('Moderator can not delete his own account!') } @@ -309,10 +307,10 @@ export class AdminResolver { @Mutation(() => Boolean) async confirmPendingCreation( @Arg('id', () => Int) id: number, - @Ctx() context: any, + @Ctx() context: Context, ): Promise { const pendingCreation = await AdminPendingCreation.findOneOrFail(id) - const moderatorUser = context.user + const moderatorUser = getUser(context) if (moderatorUser.id === pendingCreation.userId) throw new Error('Moderator can not confirm own pending creation') diff --git a/backend/src/graphql/resolver/BalanceResolver.ts b/backend/src/graphql/resolver/BalanceResolver.ts index f30e779e5..7cbd455cb 100644 --- a/backend/src/graphql/resolver/BalanceResolver.ts +++ b/backend/src/graphql/resolver/BalanceResolver.ts @@ -1,6 +1,4 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ -/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ - +import { Context, getUser } from '@/server/context' import { Resolver, Query, Ctx, Authorized } from 'type-graphql' import { Balance } from '@model/Balance' import { calculateDecay } from '@/util/decay' @@ -16,8 +14,8 @@ import { TransactionLinkRepository } from '@repository/TransactionLink' export class BalanceResolver { @Authorized([RIGHTS.BALANCE]) @Query(() => Balance) - async balance(@Ctx() context: any): Promise { - const { user } = context + async balance(@Ctx() context: Context): Promise { + const user = getUser(context) const now = new Date() const gdtResolver = new GdtResolver() diff --git a/backend/src/graphql/resolver/CommunityResolver.ts b/backend/src/graphql/resolver/CommunityResolver.ts index 1693574cb..c194cdf1a 100644 --- a/backend/src/graphql/resolver/CommunityResolver.ts +++ b/backend/src/graphql/resolver/CommunityResolver.ts @@ -1,6 +1,3 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ -/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ - import { Resolver, Query, Authorized } from 'type-graphql' import { RIGHTS } from '@/auth/RIGHTS' import CONFIG from '@/config' diff --git a/backend/src/graphql/resolver/GdtResolver.ts b/backend/src/graphql/resolver/GdtResolver.ts index e2409160b..56a95c9f0 100644 --- a/backend/src/graphql/resolver/GdtResolver.ts +++ b/backend/src/graphql/resolver/GdtResolver.ts @@ -1,6 +1,4 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ -/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ - +import { Context, getUser } from '@/server/context' import { Resolver, Query, Args, Ctx, Authorized, Arg } from 'type-graphql' import CONFIG from '@/config' import { GdtEntryList } from '@model/GdtEntryList' @@ -16,9 +14,9 @@ export class GdtResolver { async listGDTEntries( @Args() { currentPage = 1, pageSize = 5, order = Order.DESC }: Paginated, - @Ctx() context: any, + @Ctx() context: Context, ): Promise { - const userEntity = context.user + const userEntity = getUser(context) try { const resultGDT = await apiGet( @@ -28,15 +26,15 @@ export class GdtResolver { throw new Error(resultGDT.data) } return new GdtEntryList(resultGDT.data) - } catch (err: any) { + } catch (err) { throw new Error('GDT Server is not reachable.') } } @Authorized([RIGHTS.GDT_BALANCE]) @Query(() => Number) - async gdtBalance(@Ctx() context: any): Promise { - const { user } = context + async gdtBalance(@Ctx() context: Context): Promise { + const user = getUser(context) try { const resultGDTSum = await apiPost(`${CONFIG.GDT_API_URL}/GdtEntries/sumPerEmailApi`, { email: user.email, @@ -45,9 +43,9 @@ export class GdtResolver { throw new Error('Call not successful') } return Number(resultGDTSum.data.sum) || 0 - } catch (err: any) { + } catch (err) { // eslint-disable-next-line no-console - console.log('Could not query GDT Server', err) + console.log('Could not query GDT Server') return null } } diff --git a/backend/src/graphql/resolver/KlicktippResolver.ts b/backend/src/graphql/resolver/KlicktippResolver.ts index d13f1dd8e..ce9a097e2 100644 --- a/backend/src/graphql/resolver/KlicktippResolver.ts +++ b/backend/src/graphql/resolver/KlicktippResolver.ts @@ -1,6 +1,3 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ -/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ - import { Resolver, Query, Authorized, Arg, Mutation, Args } from 'type-graphql' import { getKlickTippUser, diff --git a/backend/src/graphql/resolver/TransactionLinkResolver.ts b/backend/src/graphql/resolver/TransactionLinkResolver.ts index 646a7c296..733f1db28 100644 --- a/backend/src/graphql/resolver/TransactionLinkResolver.ts +++ b/backend/src/graphql/resolver/TransactionLinkResolver.ts @@ -1,6 +1,4 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ -/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ - +import { Context, getUser } from '@/server/context' import { Resolver, Args, Arg, Authorized, Ctx, Mutation, Query, Int } from 'type-graphql' import { TransactionLink } from '@model/TransactionLink' import { TransactionLink as dbTransactionLink } from '@entity/TransactionLink' @@ -38,9 +36,9 @@ export class TransactionLinkResolver { @Mutation(() => TransactionLink) async createTransactionLink( @Args() { amount, memo }: TransactionLinkArgs, - @Ctx() context: any, + @Ctx() context: Context, ): Promise { - const { user } = context + const user = getUser(context) const createdDate = new Date() const validUntil = transactionLinkExpireDate(createdDate) @@ -72,9 +70,9 @@ export class TransactionLinkResolver { @Mutation(() => Boolean) async deleteTransactionLink( @Arg('id', () => Int) id: number, - @Ctx() context: any, + @Ctx() context: Context, ): Promise { - const { user } = context + const user = getUser(context) const transactionLink = await dbTransactionLink.findOne({ id }) if (!transactionLink) { @@ -113,9 +111,9 @@ export class TransactionLinkResolver { async listTransactionLinks( @Args() { currentPage = 1, pageSize = 5, order = Order.DESC }: Paginated, - @Ctx() context: any, + @Ctx() context: Context, ): Promise { - const { user } = context + const user = getUser(context) // const now = new Date() const transactionLinks = await dbTransactionLink.find({ where: { @@ -136,9 +134,9 @@ export class TransactionLinkResolver { @Mutation(() => Boolean) async redeemTransactionLink( @Arg('code', () => String) code: string, - @Ctx() context: any, + @Ctx() context: Context, ): Promise { - const { user } = context + const user = getUser(context) const transactionLink = await dbTransactionLink.findOneOrFail({ code }) const linkedUser = await dbUser.findOneOrFail({ id: transactionLink.userId }) diff --git a/backend/src/graphql/resolver/TransactionResolver.ts b/backend/src/graphql/resolver/TransactionResolver.ts index 00caba002..2d54e8167 100644 --- a/backend/src/graphql/resolver/TransactionResolver.ts +++ b/backend/src/graphql/resolver/TransactionResolver.ts @@ -1,10 +1,9 @@ /* eslint-disable new-cap */ -/* eslint-disable @typescript-eslint/no-explicit-any */ -/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ /* eslint-disable @typescript-eslint/no-non-null-assertion */ import CONFIG from '@/config' +import { Context, getUser } from '@/server/context' import { Resolver, Query, Args, Authorized, Ctx, Mutation } from 'type-graphql' import { getCustomRepository, getConnection } from '@dbTools/typeorm' @@ -151,10 +150,10 @@ export class TransactionResolver { async transactionList( @Args() { currentPage = 1, pageSize = 25, order = Order.DESC }: Paginated, - @Ctx() context: any, + @Ctx() context: Context, ): Promise { const now = new Date() - const user = context.user + const user = getUser(context) // find current balance const lastTransaction = await dbTransaction.findOne( @@ -251,10 +250,10 @@ export class TransactionResolver { @Mutation(() => String) async sendCoins( @Args() { email, amount, memo }: TransactionSendArgs, - @Ctx() context: any, + @Ctx() context: Context, ): Promise { // TODO this is subject to replay attacks - const senderUser = context.user + const senderUser = getUser(context) if (senderUser.pubKey.length !== 32) { throw new Error('invalid sender public key') } diff --git a/backend/src/graphql/resolver/UserResolver.ts b/backend/src/graphql/resolver/UserResolver.ts index cacee6fc8..137c09622 100644 --- a/backend/src/graphql/resolver/UserResolver.ts +++ b/backend/src/graphql/resolver/UserResolver.ts @@ -1,7 +1,5 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ -/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ - import fs from 'fs' +import { Context, getUser } from '@/server/context' import { Resolver, Query, Args, Arg, Authorized, Ctx, UseMiddleware, Mutation } from 'type-graphql' import { getConnection, getCustomRepository } from '@dbTools/typeorm' import CONFIG from '@/config' @@ -192,9 +190,9 @@ export class UserResolver { @Authorized([RIGHTS.VERIFY_LOGIN]) @Query(() => User) @UseMiddleware(klicktippNewsletterStateMiddleware) - async verifyLogin(@Ctx() context: any): Promise { + async verifyLogin(@Ctx() context: Context): Promise { // TODO refactor and do not have duplicate code with login(see below) - const userEntity = context.user + const userEntity = getUser(context) const user = new User(userEntity) // user.pubkey = userEntity.pubKey.toString('hex') // Elopage Status & Stored PublisherId @@ -218,7 +216,7 @@ export class UserResolver { @UseMiddleware(klicktippNewsletterStateMiddleware) async login( @Args() { email, password, publisherId }: UnsecureLoginArgs, - @Ctx() context: any, + @Ctx() context: Context, ): Promise { email = email.trim().toLowerCase() const dbUser = await DbUser.findOneOrFail({ email }, { withDeleted: true }).catch(() => { @@ -250,7 +248,7 @@ export class UserResolver { user.language = dbUser.language // Elopage Status & Stored PublisherId - user.hasElopage = await this.hasElopage({ pubKey: dbUser.pubKey.toString('hex') }) + user.hasElopage = await this.hasElopage({ ...context, user: dbUser }) if (!user.hasElopage && publisherId) { user.publisherId = publisherId // TODO: Check if we can use updateUserInfos @@ -540,9 +538,9 @@ export class UserResolver { passwordNew, coinanimation, }: UpdateUserInfosArgs, - @Ctx() context: any, + @Ctx() context: Context, ): Promise { - const userEntity = context.user + const userEntity = getUser(context) if (firstName) { userEntity.firstName = firstName @@ -619,7 +617,7 @@ export class UserResolver { @Authorized([RIGHTS.HAS_ELOPAGE]) @Query(() => Boolean) - async hasElopage(@Ctx() context: any): Promise { + async hasElopage(@Ctx() context: Context): Promise { const userEntity = context.user if (!userEntity) { return false diff --git a/backend/src/seeds/graphql/queries.ts b/backend/src/seeds/graphql/queries.ts index 04f849727..11a675eeb 100644 --- a/backend/src/seeds/graphql/queries.ts +++ b/backend/src/seeds/graphql/queries.ts @@ -59,7 +59,6 @@ export const transactionsQuery = gql` balanceGDT count balance - decayStartBlock transactions { id typeId diff --git a/backend/src/server/context.ts b/backend/src/server/context.ts index 6de2adce4..d9fd55fe4 100644 --- a/backend/src/server/context.ts +++ b/backend/src/server/context.ts @@ -1,9 +1,24 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ -/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ +import { Role } from '@/auth/Role' +import { User as dbUser } from '@entity/User' +import { Transaction as dbTransaction } from '@entity/Transaction' +import Decimal from 'decimal.js-light' +import { ExpressContext } from 'apollo-server-express' -const context = (args: any) => { +export interface Context { + token: string | null + setHeaders: { key: string; value: string }[] + role?: Role + user?: dbUser + // hack to use less DB calls for Balance Resolver + lastTransaction?: dbTransaction + transactionCount?: number + linkCount?: number + sumHoldAvailableAmount?: Decimal +} + +const context = (args: ExpressContext): Context => { const authorization = args.req.headers.authorization - let token = null + let token: string | null = null if (authorization) { token = authorization.replace(/^Bearer /, '') } @@ -14,4 +29,9 @@ const context = (args: any) => { return context } +export const getUser = (context: Context): dbUser => { + if (context.user) return context.user + throw new Error('No user given in context!') +} + export default context diff --git a/backend/yarn.lock b/backend/yarn.lock index 4134e1d37..3ba20211a 100644 --- a/backend/yarn.lock +++ b/backend/yarn.lock @@ -1704,9 +1704,9 @@ camelcase@^6.2.0: integrity sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg== caniuse-lite@^1.0.30001264: - version "1.0.30001265" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001265.tgz#0613c9e6c922e422792e6fcefdf9a3afeee4f8c3" - integrity sha512-YzBnspggWV5hep1m9Z6sZVLOt7vrju8xWooFAgN6BA5qvy98qPAPb7vNUzypFaoh2pb3vlfzbDO8tB57UPGbtw== + version "1.0.30001325" + resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001325.tgz" + integrity sha512-sB1bZHjseSjDtijV1Hb7PB2Zd58Kyx+n/9EotvZ4Qcz2K3d0lWB8dB4nb8wN/TsOGFq3UuAm0zQZNQ4SoR7TrQ== chalk@^2.0.0: version "2.4.2" diff --git a/frontend/src/components/DecayInformations/CollapseLinksList.spec.js b/frontend/src/components/DecayInformations/CollapseLinksList.spec.js index b533c6aa1..4fc527e39 100644 --- a/frontend/src/components/DecayInformations/CollapseLinksList.spec.js +++ b/frontend/src/components/DecayInformations/CollapseLinksList.spec.js @@ -9,6 +9,7 @@ const mocks = { }, $tc: jest.fn((tc) => tc), $t: jest.fn((t) => t), + $d: jest.fn((d) => d), } const propsData = { diff --git a/frontend/src/components/DecayInformations/DecayInformation-DecayStartblock.vue b/frontend/src/components/DecayInformations/DecayInformation-DecayStartblock.vue index 5802bfb4b..3d42f11f8 100644 --- a/frontend/src/components/DecayInformations/DecayInformation-DecayStartblock.vue +++ b/frontend/src/components/DecayInformations/DecayInformation-DecayStartblock.vue @@ -50,7 +50,6 @@ export default { name: 'DecayInformation-StartBlock', props: { balanceDate: { type: String }, - decayStartBlock: { type: Date }, amount: { type: String, }, diff --git a/frontend/src/components/DecayInformations/DecayInformation.vue b/frontend/src/components/DecayInformations/DecayInformation.vue index ae76a5bb4..690f6532b 100644 --- a/frontend/src/components/DecayInformations/DecayInformation.vue +++ b/frontend/src/components/DecayInformations/DecayInformation.vue @@ -14,6 +14,7 @@ import DecayInformationLong from '../DecayInformations/DecayInformation-Long' import DecayInformationBeforeStartblock from '../DecayInformations/DecayInformation-BeforeStartblock' import DecayInformationDecayStartblock from '../DecayInformations/DecayInformation-DecayStartblock' +import CONFIG from '@/config' export default { components: { @@ -34,14 +35,10 @@ export default { type: String, required: true, }, - decayStartBlock: { - type: Date, - required: true, - }, }, computed: { isStartBlock() { - return new Date(this.decay.start).getTime() === this.decayStartBlock.getTime() + return new Date(this.decay.start).getTime() === CONFIG.DECAY_START_TIME.getTime() }, }, } diff --git a/frontend/src/components/GddTransactionList.vue b/frontend/src/components/GddTransactionList.vue index 4498034e9..34f7c24ab 100644 --- a/frontend/src/components/GddTransactionList.vue +++ b/frontend/src/components/GddTransactionList.vue @@ -26,7 +26,6 @@ @@ -36,7 +35,6 @@ @@ -46,7 +44,6 @@ @@ -105,7 +102,6 @@ export default { } }, props: { - decayStartBlock: { type: Date }, transactions: { default: () => [] }, pageSize: { type: Number, default: 25 }, timestamp: { type: Number, default: 0 }, diff --git a/frontend/src/components/TransactionLinks/TransactionLink.spec.js b/frontend/src/components/TransactionLinks/TransactionLink.spec.js index f019a0ee1..4a2bb7b3c 100644 --- a/frontend/src/components/TransactionLinks/TransactionLink.spec.js +++ b/frontend/src/components/TransactionLinks/TransactionLink.spec.js @@ -13,6 +13,7 @@ const mocks = { locale: 'en', }, $t: jest.fn((t) => t), + $d: jest.fn((d) => d), $tc: jest.fn((tc) => tc), $apollo: { mutate: mockAPIcall, diff --git a/frontend/src/components/TransactionRows/DateRow.vue b/frontend/src/components/TransactionRows/DateRow.vue index 7f93656f7..5f526caaf 100644 --- a/frontend/src/components/TransactionRows/DateRow.vue +++ b/frontend/src/components/TransactionRows/DateRow.vue @@ -8,7 +8,7 @@
- {{ dateString }} + {{ $d(new Date(this.date), 'long') }}
@@ -28,12 +28,5 @@ export default { default: false, }, }, - computed: { - dateString() { - return this.diffNow - ? this.$moment(this.date).locale(this.$i18n.locale).fromNow() - : this.$d(new Date(this.date), 'long') - }, - }, } diff --git a/frontend/src/components/Transactions/TransactionCreation.vue b/frontend/src/components/Transactions/TransactionCreation.vue index dce11307b..694d907ed 100644 --- a/frontend/src/components/Transactions/TransactionCreation.vue +++ b/frontend/src/components/Transactions/TransactionCreation.vue @@ -27,12 +27,7 @@ - + @@ -82,10 +77,6 @@ export default { type: String, required: true, }, - decayStartBlock: { - type: Date, - required: true, - }, previousBookedBalance: { type: String, required: true, diff --git a/frontend/src/components/Transactions/TransactionLinkSummary.spec.js b/frontend/src/components/Transactions/TransactionLinkSummary.spec.js index 1f2a4388c..078ce6f97 100644 --- a/frontend/src/components/Transactions/TransactionLinkSummary.spec.js +++ b/frontend/src/components/Transactions/TransactionLinkSummary.spec.js @@ -12,6 +12,7 @@ const mocks = { locale: 'en', }, $t: jest.fn((t) => t), + $d: jest.fn((d) => d), $tc: jest.fn((tc) => tc), $apollo: { query: apolloQueryMock, diff --git a/frontend/src/components/Transactions/TransactionReceive.vue b/frontend/src/components/Transactions/TransactionReceive.vue index 32e40f71e..8899b3807 100644 --- a/frontend/src/components/Transactions/TransactionReceive.vue +++ b/frontend/src/components/Transactions/TransactionReceive.vue @@ -33,12 +33,7 @@ - + @@ -87,10 +82,6 @@ export default { typeId: { type: String, }, - decayStartBlock: { - type: Date, - required: true, - }, transactionLinkId: { type: Number, required: false, diff --git a/frontend/src/components/Transactions/TransactionSend.vue b/frontend/src/components/Transactions/TransactionSend.vue index a1ea3c88e..f9125b89c 100644 --- a/frontend/src/components/Transactions/TransactionSend.vue +++ b/frontend/src/components/Transactions/TransactionSend.vue @@ -33,12 +33,7 @@ - + @@ -88,10 +83,6 @@ export default { type: String, required: true, }, - decayStartBlock: { - type: Date, - required: true, - }, transactionLinkId: { type: Number, required: false, diff --git a/frontend/src/config/index.js b/frontend/src/config/index.js index 3f62012ad..d29c4dc09 100644 --- a/frontend/src/config/index.js +++ b/frontend/src/config/index.js @@ -5,6 +5,7 @@ const pkg = require('../../package') const constants = { + DECAY_START_TIME: new Date('2021-05-13 17:46:31'), // GMT+0 CONFIG_VERSION: { DEFAULT: 'DEFAULT', EXPECTED: 'v1.2022-03-18', diff --git a/frontend/src/config/index.spec.js b/frontend/src/config/index.spec.js new file mode 100644 index 000000000..3c4c7865e --- /dev/null +++ b/frontend/src/config/index.spec.js @@ -0,0 +1,9 @@ +import CONFIG from './index' + +describe('config/index', () => { + describe('decay start block', () => { + it('has the correct date set', () => { + expect(CONFIG.DECAY_START_TIME).toEqual(new Date('2021-05-13 17:46:31')) + }) + }) +}) diff --git a/frontend/src/graphql/queries.js b/frontend/src/graphql/queries.js index b8622ef2d..dce22fbd9 100644 --- a/frontend/src/graphql/queries.js +++ b/frontend/src/graphql/queries.js @@ -52,7 +52,6 @@ export const transactionsQuery = gql` balanceGDT count linkCount - decayStartBlock lastBookedDate } transactions { diff --git a/frontend/src/layouts/DashboardLayout_gdd.vue b/frontend/src/layouts/DashboardLayout_gdd.vue index de2c68bf0..8b84ac10d 100755 --- a/frontend/src/layouts/DashboardLayout_gdd.vue +++ b/frontend/src/layouts/DashboardLayout_gdd.vue @@ -26,7 +26,6 @@ :transactionCount="transactionCount" :transactionLinkCount="transactionLinkCount" :pending="pending" - :decayStartBlock="decayStartBlock" @update-transactions="updateTransactions" @set-tunneled-email="setTunneledEmail" > @@ -63,7 +62,6 @@ export default { transactionLinkCount: 0, pending: true, visible: false, - decayStartBlock: new Date(), tunneledEmail: null, } }, @@ -110,7 +108,6 @@ export default { this.balance = Number(transactionList.balance.balance) this.transactionCount = transactionList.balance.count this.transactionLinkCount = transactionList.balance.linkCount - this.decayStartBlock = new Date(transactionList.balance.decayStartBlock) this.pending = false }) .catch((error) => { diff --git a/frontend/src/locales/de.json b/frontend/src/locales/de.json index 600b36e65..557570019 100644 --- a/frontend/src/locales/de.json +++ b/frontend/src/locales/de.json @@ -109,7 +109,7 @@ "link-expired": "Der Link ist nicht mehr gültig. Die Gültigkeit ist am {date} abgelaufen.", "link-overview": "Linkübersicht", "links_count": "Aktive Links", - "links_sum": "Summe deiner versendeten Gradidos", + "links_sum": "Offene Links und QR-Codes", "no-account": "Du besitzt noch kein Gradido Konto", "no-redeem": "Du darfst deinen eigenen Link nicht einlösen!", "not-copied": "Konnte den Link nicht kopieren: {err}", diff --git a/frontend/src/locales/en.json b/frontend/src/locales/en.json index ef9a14c0a..06342cab9 100644 --- a/frontend/src/locales/en.json +++ b/frontend/src/locales/en.json @@ -109,7 +109,7 @@ "link-expired": "The link is no longer valid. The validity expired on {date}.", "link-overview": "Link overview", "links_count": "Active links", - "links_sum": "Total of your sent Gradidos", + "links_sum": "Open links and QR codes", "no-account": "You don't have a Gradido account yet", "no-redeem": "You not allowed to redeem your own link!", "not-copied": "Could not copy link: {err}", diff --git a/frontend/src/pages/Overview.vue b/frontend/src/pages/Overview.vue index 9723f6ade..194de793a 100644 --- a/frontend/src/pages/Overview.vue +++ b/frontend/src/pages/Overview.vue @@ -18,7 +18,6 @@ :transactions="transactions" :pageSize="5" :timestamp="timestamp" - :decayStartBlock="decayStartBlock" :transaction-count="transactionCount" :transactionLinkCount="transactionLinkCount" :pending="pending" @@ -49,7 +48,6 @@ export default { props: { balance: { type: Number, default: 0 }, GdtBalance: { type: Number, default: 0 }, - decayStartBlock: { type: Date }, transactions: { default: () => [], }, diff --git a/frontend/src/pages/Transactions.vue b/frontend/src/pages/Transactions.vue index 9b2ad6fdf..8efc2026f 100644 --- a/frontend/src/pages/Transactions.vue +++ b/frontend/src/pages/Transactions.vue @@ -10,7 +10,6 @@ :transactionLinkCount="transactionLinkCount" :transactions="transactions" :show-pagination="true" - :decayStartBlock="decayStartBlock" @update-transactions="updateTransactions" v-on="$listeners" /> @@ -45,7 +44,6 @@ export default { }, transactionCount: { type: Number, default: 0 }, transactionLinkCount: { type: Number, default: 0 }, - decayStartBlock: { type: Date }, }, data() { return {