mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Merge branch 'master' into 1813-QR-Code-Popup
This commit is contained in:
commit
17a96a5c6f
@ -1,4 +1,4 @@
|
||||
CONFIG_VERSION=v5.2022-04-12
|
||||
CONFIG_VERSION=v6.2022-04-21
|
||||
|
||||
# Server
|
||||
PORT=4000
|
||||
@ -27,6 +27,7 @@ KLICKTIPP_APIKEY_EN=SomeFakeKeyEN
|
||||
COMMUNITY_NAME=Gradido Entwicklung
|
||||
COMMUNITY_URL=http://localhost/
|
||||
COMMUNITY_REGISTER_URL=http://localhost/register
|
||||
COMMUNITY_REDEEM_URL=http://localhost/redeem/{code}
|
||||
COMMUNITY_DESCRIPTION=Die lokale Entwicklungsumgebung von Gradido.
|
||||
|
||||
# Login Server
|
||||
|
||||
@ -26,6 +26,7 @@ KLICKTIPP_APIKEY_EN=$KLICKTIPP_APIKEY_EN
|
||||
COMMUNITY_NAME=$COMMUNITY_NAME
|
||||
COMMUNITY_URL=$COMMUNITY_URL
|
||||
COMMUNITY_REGISTER_URL=$COMMUNITY_REGISTER_URL
|
||||
COMMUNITY_REDEEM_URL=$COMMUNITY_REDEEM_URL
|
||||
COMMUNITY_DESCRIPTION=$COMMUNITY_DESCRIPTION
|
||||
|
||||
# Login Server
|
||||
|
||||
@ -14,7 +14,7 @@ const constants = {
|
||||
DECAY_START_TIME: new Date('2021-05-13 17:46:31'), // GMT+0
|
||||
CONFIG_VERSION: {
|
||||
DEFAULT: 'DEFAULT',
|
||||
EXPECTED: 'v5.2022-04-12',
|
||||
EXPECTED: 'v6.2022-04-21',
|
||||
CURRENT: '',
|
||||
},
|
||||
}
|
||||
@ -50,6 +50,7 @@ const community = {
|
||||
COMMUNITY_NAME: process.env.COMMUNITY_NAME || 'Gradido Entwicklung',
|
||||
COMMUNITY_URL: process.env.COMMUNITY_URL || 'http://localhost/',
|
||||
COMMUNITY_REGISTER_URL: process.env.COMMUNITY_REGISTER_URL || 'http://localhost/register',
|
||||
COMMUNITY_REDEEM_URL: process.env.COMMUNITY_REDEEM_URL || 'http://localhost/redeem/{code}',
|
||||
COMMUNITY_DESCRIPTION:
|
||||
process.env.COMMUNITY_DESCRIPTION || 'Die lokale Entwicklungsumgebung von Gradido.',
|
||||
}
|
||||
|
||||
@ -2,6 +2,7 @@ import { ObjectType, Field, Int } from 'type-graphql'
|
||||
import Decimal from 'decimal.js-light'
|
||||
import { TransactionLink as dbTransactionLink } from '@entity/TransactionLink'
|
||||
import { User } from './User'
|
||||
import CONFIG from '@/config'
|
||||
|
||||
@ObjectType()
|
||||
export class TransactionLink {
|
||||
@ -17,6 +18,7 @@ export class TransactionLink {
|
||||
this.deletedAt = transactionLink.deletedAt
|
||||
this.redeemedAt = transactionLink.redeemedAt
|
||||
this.redeemedBy = redeemedBy
|
||||
this.link = CONFIG.COMMUNITY_REDEEM_URL.replace(/{code}/g, this.code)
|
||||
}
|
||||
|
||||
@Field(() => Number)
|
||||
@ -51,6 +53,9 @@ export class TransactionLink {
|
||||
|
||||
@Field(() => User, { nullable: true })
|
||||
redeemedBy: User | null
|
||||
|
||||
@Field(() => String)
|
||||
link: string
|
||||
}
|
||||
|
||||
@ObjectType()
|
||||
|
||||
@ -24,7 +24,7 @@ COMMUNITY_REGISTER_URL=https://stage1.gradido.net/register
|
||||
COMMUNITY_DESCRIPTION="Gradido Development Stage1 Test Community"
|
||||
|
||||
# backend
|
||||
BACKEND_CONFIG_VERSION=v5.2022-04-12
|
||||
BACKEND_CONFIG_VERSION=v6.2022-04-21
|
||||
|
||||
JWT_EXPIRES_IN=30m
|
||||
GDT_API_URL=https://gdt.gradido.net
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="clipboard-copy">
|
||||
<b-input-group size="lg" class="mb-3" prepend="Link">
|
||||
<b-form-input :value="text" type="text" readonly></b-form-input>
|
||||
<b-form-input :value="link" type="text" readonly></b-form-input>
|
||||
<b-input-group-append>
|
||||
<b-button size="sm" text="Button" variant="success" @click="CopyLink">
|
||||
{{ $t('gdd_per_link.copy') }}
|
||||
@ -14,12 +14,12 @@
|
||||
export default {
|
||||
name: 'ClipboardCopy',
|
||||
props: {
|
||||
text: { type: String, required: true },
|
||||
link: { type: String, required: true },
|
||||
},
|
||||
methods: {
|
||||
CopyLink() {
|
||||
navigator.clipboard
|
||||
.writeText(this.url)
|
||||
.writeText(this.link)
|
||||
.then(() => {
|
||||
this.toastSuccess(this.$t('gdd_per_link.link-copied'))
|
||||
})
|
||||
|
||||
@ -17,6 +17,7 @@ const propsData = {
|
||||
{
|
||||
amount: '5',
|
||||
code: 'ce28664b5308c17f931c0367',
|
||||
link: 'http://localhost/redeem/ce28664b5308c17f931c0367',
|
||||
createdAt: '2022-03-16T14:22:40.000Z',
|
||||
holdAvailableAmount: '5.13109484759482747111',
|
||||
id: 87,
|
||||
@ -27,6 +28,7 @@ const propsData = {
|
||||
{
|
||||
amount: '6',
|
||||
code: 'ce28664b5308c17f931c0367',
|
||||
link: 'http://localhost/redeem/ce28664b5308c17f931c0367',
|
||||
createdAt: '2022-03-16T14:22:40.000Z',
|
||||
holdAvailableAmount: '5.13109484759482747111',
|
||||
id: 86,
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
<b-card class="p-0 gradido-custom-background">
|
||||
<div class="h3 mb-4">{{ $t('gdd_per_link.created') }}</div>
|
||||
|
||||
<clipboard-copy :text="link" />
|
||||
<clipboard-copy :link="link" />
|
||||
|
||||
<div class="text-center">
|
||||
<figure-qr-code :text="link" />
|
||||
@ -28,15 +28,10 @@ export default {
|
||||
FigureQrCode,
|
||||
},
|
||||
props: {
|
||||
code: {
|
||||
link: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
link() {
|
||||
return `${window.location.origin}/redeem/${this.code}`
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -22,7 +22,7 @@ const mocks = {
|
||||
|
||||
const propsData = {
|
||||
amount: '75',
|
||||
code: 'c00000000c000000c0000',
|
||||
link: 'http://localhost/redeem/c00000000c000000c0000',
|
||||
holdAvailableAmount: '5.13109484759482747111',
|
||||
id: 12,
|
||||
memo: 'Katzenauge, Eulenschrei, was verschwunden komm herbei!',
|
||||
|
||||
@ -79,7 +79,7 @@ export default {
|
||||
},
|
||||
props: {
|
||||
amount: { type: String, required: true },
|
||||
code: { type: String, required: true },
|
||||
link: { type: String, required: true },
|
||||
holdAvailableAmount: { type: String, required: true },
|
||||
id: { type: Number, required: true },
|
||||
memo: { type: String, required: true },
|
||||
@ -120,9 +120,6 @@ export default {
|
||||
decay() {
|
||||
return `${this.amount - this.holdAvailableAmount}`
|
||||
},
|
||||
link() {
|
||||
return `${window.location.origin}/redeem/${this.code}`
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -44,7 +44,7 @@ describe('TransactionLinkSummary', () => {
|
||||
listTransactionLinks: [
|
||||
{
|
||||
amount: '75',
|
||||
code: 'ce28664b5308c17f931c0367',
|
||||
link: 'http://localhost/redeem/ce28664b5308c17f931c0367',
|
||||
createdAt: '2022-03-16T14:22:40.000Z',
|
||||
holdAvailableAmount: '5.13109484759482747111',
|
||||
id: 86,
|
||||
@ -55,7 +55,7 @@ describe('TransactionLinkSummary', () => {
|
||||
},
|
||||
{
|
||||
amount: '85',
|
||||
code: 'ce28664b5308c17f931c0367',
|
||||
link: 'http://localhost/redeem/ce28664b5308c17f931c0367',
|
||||
createdAt: '2022-03-16T14:22:40.000Z',
|
||||
holdAvailableAmount: '5.13109484759482747111',
|
||||
id: 107,
|
||||
@ -65,7 +65,7 @@ describe('TransactionLinkSummary', () => {
|
||||
},
|
||||
{
|
||||
amount: '95',
|
||||
code: 'ce28664b5308c17f931c0367',
|
||||
link: 'http://localhost/redeem/ce28664b5308c17f931c0367',
|
||||
createdAt: '2022-03-16T14:22:40.000Z',
|
||||
holdAvailableAmount: '5.13109484759482747111',
|
||||
id: 92,
|
||||
@ -76,7 +76,7 @@ describe('TransactionLinkSummary', () => {
|
||||
},
|
||||
{
|
||||
amount: '150',
|
||||
code: 'ce28664b5308c17f931c0367',
|
||||
link: 'http://localhost/redeem/ce28664b5308c17f931c0367',
|
||||
createdAt: '2022-03-16T14:22:40.000Z',
|
||||
holdAvailableAmount: '5.13109484759482747111',
|
||||
id: 16,
|
||||
@ -132,6 +132,27 @@ describe('TransactionLinkSummary', () => {
|
||||
it('has no component CollapseLinksList', () => {
|
||||
expect(wrapper.findComponent({ name: 'CollapseLinksList' }).isVisible()).toBe(false)
|
||||
})
|
||||
|
||||
describe('reopen transaction link details', () => {
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks()
|
||||
wrapper.find('div.transaction-link-details').trigger('click')
|
||||
})
|
||||
|
||||
it('calls the API to get the list transaction links', () => {
|
||||
expect(apolloQueryMock).toBeCalledWith({
|
||||
query: listTransactionLinks,
|
||||
variables: {
|
||||
currentPage: 1,
|
||||
},
|
||||
fetchPolicy: 'network-only',
|
||||
})
|
||||
})
|
||||
|
||||
it('has four transactionLinks', () => {
|
||||
expect(wrapper.vm.transactionLinks).toHaveLength(4)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('load more transaction links', () => {
|
||||
@ -142,7 +163,7 @@ describe('TransactionLinkSummary', () => {
|
||||
listTransactionLinks: [
|
||||
{
|
||||
amount: '76',
|
||||
code: 'ce28664b5308c17f931c0367',
|
||||
link: 'http://localhost/redeem/ce28664b5308c17f931c0367',
|
||||
createdAt: '2022-03-16T14:22:40.000Z',
|
||||
holdAvailableAmount: '5.13109484759482747111',
|
||||
id: 87,
|
||||
@ -153,7 +174,7 @@ describe('TransactionLinkSummary', () => {
|
||||
},
|
||||
{
|
||||
amount: '86',
|
||||
code: 'ce28664b5308c17f931c0367',
|
||||
link: 'http://localhost/redeem/ce28664b5308c17f931c0367',
|
||||
createdAt: '2022-03-16T14:22:40.000Z',
|
||||
holdAvailableAmount: '5.13109484759482747111',
|
||||
id: 108,
|
||||
@ -164,7 +185,7 @@ describe('TransactionLinkSummary', () => {
|
||||
},
|
||||
{
|
||||
amount: '96',
|
||||
code: 'ce28664b5308c17f931c0367',
|
||||
link: 'http://localhost/redeem/ce28664b5308c17f931c0367',
|
||||
createdAt: '2022-03-16T14:22:40.000Z',
|
||||
holdAvailableAmount: '5.13109484759482747111',
|
||||
id: 93,
|
||||
@ -175,7 +196,7 @@ describe('TransactionLinkSummary', () => {
|
||||
},
|
||||
{
|
||||
amount: '150',
|
||||
code: 'ce28664b5308c17f931c0367',
|
||||
link: 'http://localhost/redeem/ce28664b5308c17f931c0367',
|
||||
createdAt: '2022-03-16T14:22:40.000Z',
|
||||
holdAvailableAmount: '5.13109484759482747111',
|
||||
id: 17,
|
||||
|
||||
@ -83,6 +83,7 @@ export default {
|
||||
if (this.visible) {
|
||||
this.visible = false
|
||||
} else {
|
||||
this.transactionLinks = []
|
||||
this.updateListTransactionLinks()
|
||||
this.visible = true
|
||||
}
|
||||
|
||||
@ -75,7 +75,7 @@ export const sendCoins = gql`
|
||||
export const createTransactionLink = gql`
|
||||
mutation($amount: Decimal!, $memo: String!) {
|
||||
createTransactionLink(amount: $amount, memo: $memo) {
|
||||
code
|
||||
link
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
@ -139,7 +139,7 @@ export const listTransactionLinks = gql`
|
||||
amount
|
||||
holdAvailableAmount
|
||||
memo
|
||||
code
|
||||
link
|
||||
createdAt
|
||||
validUntil
|
||||
redeemedAt
|
||||
|
||||
@ -162,7 +162,11 @@ describe('Send', () => {
|
||||
describe('transaction form link', () => {
|
||||
beforeEach(async () => {
|
||||
apolloMutationMock.mockResolvedValue({
|
||||
data: { createTransactionLink: { code: '0123456789' } },
|
||||
data: {
|
||||
createTransactionLink: {
|
||||
link: 'http://localhost/redeem/0123456789',
|
||||
},
|
||||
},
|
||||
})
|
||||
const transactionForm = wrapper.findComponent({ name: 'TransactionForm' })
|
||||
await transactionForm.findAll('input[type="radio"]').at(1).setChecked()
|
||||
|
||||
@ -41,7 +41,7 @@
|
||||
></transaction-result-send-error>
|
||||
</template>
|
||||
<template #transactionResultLink>
|
||||
<transaction-result-link :code="code" @on-reset="onReset"></transaction-result-link>
|
||||
<transaction-result-link :link="link" @on-reset="onReset"></transaction-result-link>
|
||||
</template>
|
||||
</gdd-send>
|
||||
<hr />
|
||||
@ -87,7 +87,7 @@ export default {
|
||||
errorResult: '',
|
||||
currentTransactionStep: TRANSACTION_STEPS.transactionForm,
|
||||
loading: false,
|
||||
code: null,
|
||||
link: null,
|
||||
}
|
||||
},
|
||||
props: {
|
||||
@ -144,7 +144,7 @@ export default {
|
||||
})
|
||||
.then((result) => {
|
||||
this.$emit('set-tunneled-email', null)
|
||||
this.code = result.data.createTransactionLink.code
|
||||
this.link = result.data.createTransactionLink.link
|
||||
this.transactionData = { ...EMPTY_TRANSACTION_DATA }
|
||||
this.currentTransactionStep = TRANSACTION_STEPS.transactionResultLink
|
||||
this.updateTransactions({})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user