mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
linkText as computed property
This commit is contained in:
parent
e0365b3ed5
commit
2d567fb46c
@ -23,7 +23,7 @@
|
||||
data-test="copyLinkWithText"
|
||||
@click="copyLinkWithText"
|
||||
>
|
||||
{{ text }}
|
||||
{{ linkText }}
|
||||
<div>
|
||||
<b-button class="p-4">
|
||||
<b-icon icon="link45deg"></b-icon>
|
||||
|
||||
@ -28,7 +28,6 @@ const propsData = {
|
||||
id: 12,
|
||||
memo: 'Katzenauge, Eulenschrei, was verschwunden komm herbei!',
|
||||
validUntil: '2022-03-30T14:22:40.000Z',
|
||||
text: '',
|
||||
}
|
||||
|
||||
describe('TransactionLink', () => {
|
||||
|
||||
@ -8,13 +8,6 @@ export const copyLinks = {
|
||||
data() {
|
||||
return {
|
||||
canCopyLink: true,
|
||||
text: `${this.link}
|
||||
${this.$store.state.firstName} ${this.$t('transaction-link.send_you')} ${this.amount} Gradido.
|
||||
"${this.memo}"
|
||||
${this.$t('gdd_per_link.credit-your-gradido')} ${this.$t('gdd_per_link.validUntilDate', {
|
||||
date: this.$d(new Date(this.validUntil), 'short'),
|
||||
})}
|
||||
${this.$t('gdd_per_link.link-hint')}`,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@ -31,7 +24,7 @@ ${this.$t('gdd_per_link.link-hint')}`,
|
||||
},
|
||||
copyLinkWithText() {
|
||||
navigator.clipboard
|
||||
.writeText(this.text)
|
||||
.writeText(this.linkText)
|
||||
.then(() => {
|
||||
this.toastSuccess(this.$t('gdd_per_link.link-and-text-copied'))
|
||||
})
|
||||
@ -41,4 +34,15 @@ ${this.$t('gdd_per_link.link-hint')}`,
|
||||
})
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
linkText() {
|
||||
return `${this.link}
|
||||
${this.$store.state.firstName} ${this.$t('transaction-link.send_you')} ${this.amount} Gradido.
|
||||
"${this.memo}"
|
||||
${this.$t('gdd_per_link.credit-your-gradido')} ${this.$t('gdd_per_link.validUntilDate', {
|
||||
date: this.$d(new Date(this.validUntil), 'short'),
|
||||
})}
|
||||
${this.$t('gdd_per_link.link-hint')}`
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user