mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-12 23:35:50 +00:00
Merge branch 'master' into 2892-Frontend-multiple-auto-logout-messages
This commit is contained in:
commit
69317bea38
@ -1,11 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="redeem-information">
|
<div class="redeem-information">
|
||||||
<b-jumbotron bg-variant="muted" text-variant="dark" border-variant="info">
|
<b-jumbotron bg-variant="muted" text-variant="dark" border-variant="info">
|
||||||
<h1 v-if="isContributionLink">
|
<h1 v-if="amount === ''">{{ $t('gdd_per_link.redeemlink-error') }}</h1>
|
||||||
|
<h1 v-if="isContributionLink && amount !== ''">
|
||||||
{{ CONFIG.COMMUNITY_NAME }}
|
{{ CONFIG.COMMUNITY_NAME }}
|
||||||
{{ $t('contribution-link.thanksYouWith') }} {{ amount | GDD }}
|
{{ $t('contribution-link.thanksYouWith') }} {{ amount | GDD }}
|
||||||
</h1>
|
</h1>
|
||||||
<h1 v-else>
|
<h1 v-if="!isContributionLink && amount !== ''">
|
||||||
{{ user.firstName }}
|
{{ user.firstName }}
|
||||||
{{ $t('transaction-link.send_you') }} {{ amount | GDD }}
|
{{ $t('transaction-link.send_you') }} {{ amount | GDD }}
|
||||||
</h1>
|
</h1>
|
||||||
|
|||||||
@ -3,7 +3,12 @@
|
|||||||
<redeem-information v-bind="linkData" :isContributionLink="isContributionLink" />
|
<redeem-information v-bind="linkData" :isContributionLink="isContributionLink" />
|
||||||
<b-jumbotron>
|
<b-jumbotron>
|
||||||
<div class="mb-3 text-center">
|
<div class="mb-3 text-center">
|
||||||
<b-button variant="gradido" @click="$emit('mutation-link', linkData.amount)" size="lg">
|
<b-button
|
||||||
|
variant="gradido"
|
||||||
|
@click="$emit('mutation-link', linkData.amount)"
|
||||||
|
size="lg"
|
||||||
|
:disabled="!validLink"
|
||||||
|
>
|
||||||
{{ $t('gdd_per_link.redeem') }}
|
{{ $t('gdd_per_link.redeem') }}
|
||||||
</b-button>
|
</b-button>
|
||||||
</div>
|
</div>
|
||||||
@ -21,6 +26,7 @@ export default {
|
|||||||
props: {
|
props: {
|
||||||
linkData: { type: Object, required: true },
|
linkData: { type: Object, required: true },
|
||||||
isContributionLink: { type: Boolean, default: false },
|
isContributionLink: { type: Boolean, default: false },
|
||||||
|
validLink: { type: Boolean, default: false },
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -210,6 +210,7 @@
|
|||||||
"redeemed": "Erfolgreich eingelöst! Deinem Konto wurden {n} GDD gutgeschrieben.",
|
"redeemed": "Erfolgreich eingelöst! Deinem Konto wurden {n} GDD gutgeschrieben.",
|
||||||
"redeemed-at": "Der Link wurde bereits am {date} eingelöst.",
|
"redeemed-at": "Der Link wurde bereits am {date} eingelöst.",
|
||||||
"redeemed-title": "eingelöst",
|
"redeemed-title": "eingelöst",
|
||||||
|
"redeemlink-error": "Dieser Einlöse-Link ist nicht vollständig.",
|
||||||
"to-login": "Log dich ein",
|
"to-login": "Log dich ein",
|
||||||
"to-register": "Registriere ein neues Konto.",
|
"to-register": "Registriere ein neues Konto.",
|
||||||
"validUntil": "Gültig bis",
|
"validUntil": "Gültig bis",
|
||||||
|
|||||||
@ -210,6 +210,7 @@
|
|||||||
"redeemed": "Successfully redeemed! Your account has been credited with {n} GDD.",
|
"redeemed": "Successfully redeemed! Your account has been credited with {n} GDD.",
|
||||||
"redeemed-at": "The link was already redeemed on {date}.",
|
"redeemed-at": "The link was already redeemed on {date}.",
|
||||||
"redeemed-title": "redeemed",
|
"redeemed-title": "redeemed",
|
||||||
|
"redeemlink-error": "This redemption link is not complete.",
|
||||||
"to-login": "Log in",
|
"to-login": "Log in",
|
||||||
"to-register": "Register a new account.",
|
"to-register": "Register a new account.",
|
||||||
"validUntil": "Valid until",
|
"validUntil": "Valid until",
|
||||||
|
|||||||
@ -374,12 +374,12 @@ describe('TransactionLink', () => {
|
|||||||
|
|
||||||
describe('error on transaction link query', () => {
|
describe('error on transaction link query', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
apolloQueryMock.mockRejectedValue({ message: 'Ouchh!' })
|
apolloQueryMock.mockRejectedValue({ message: 'gdd_per_link.redeemlink-error' })
|
||||||
wrapper = Wrapper()
|
wrapper = Wrapper()
|
||||||
})
|
})
|
||||||
|
|
||||||
it('toasts an error message', () => {
|
it('toasts an error message', () => {
|
||||||
expect(toastErrorSpy).toBeCalledWith('Ouchh!')
|
expect(toastErrorSpy).toBeCalledWith('gdd_per_link.redeemlink-error')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@ -14,6 +14,7 @@
|
|||||||
<redeem-valid
|
<redeem-valid
|
||||||
:linkData="linkData"
|
:linkData="linkData"
|
||||||
:isContributionLink="isContributionLink"
|
:isContributionLink="isContributionLink"
|
||||||
|
:validLink="validLink"
|
||||||
@mutation-link="mutationLink"
|
@mutation-link="mutationLink"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
@ -47,12 +48,13 @@ export default {
|
|||||||
return {
|
return {
|
||||||
linkData: {
|
linkData: {
|
||||||
__typename: 'TransactionLink',
|
__typename: 'TransactionLink',
|
||||||
amount: '123.45',
|
amount: '',
|
||||||
memo: 'memo',
|
memo: '',
|
||||||
user: {
|
user: {
|
||||||
firstName: 'Bibi',
|
firstName: '',
|
||||||
},
|
},
|
||||||
deletedAt: null,
|
deletedAt: null,
|
||||||
|
validLink: false,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -67,13 +69,14 @@ export default {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
|
this.validLink = true
|
||||||
this.linkData = result.data.queryTransactionLink
|
this.linkData = result.data.queryTransactionLink
|
||||||
if (this.linkData.__typename === 'ContributionLink' && this.$store.state.token) {
|
if (this.linkData.__typename === 'ContributionLink' && this.$store.state.token) {
|
||||||
this.mutationLink(this.linkData.amount)
|
this.mutationLink(this.linkData.amount)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch(() => {
|
||||||
this.toastError(err.message)
|
this.toastError(this.$t('gdd_per_link.redeemlink-error'))
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
mutationLink(amount) {
|
mutationLink(amount) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user