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"
|
data-test="copyLinkWithText"
|
||||||
@click="copyLinkWithText"
|
@click="copyLinkWithText"
|
||||||
>
|
>
|
||||||
{{ text }}
|
{{ linkText }}
|
||||||
<div>
|
<div>
|
||||||
<b-button class="p-4">
|
<b-button class="p-4">
|
||||||
<b-icon icon="link45deg"></b-icon>
|
<b-icon icon="link45deg"></b-icon>
|
||||||
|
|||||||
@ -28,7 +28,6 @@ const propsData = {
|
|||||||
id: 12,
|
id: 12,
|
||||||
memo: 'Katzenauge, Eulenschrei, was verschwunden komm herbei!',
|
memo: 'Katzenauge, Eulenschrei, was verschwunden komm herbei!',
|
||||||
validUntil: '2022-03-30T14:22:40.000Z',
|
validUntil: '2022-03-30T14:22:40.000Z',
|
||||||
text: '',
|
|
||||||
}
|
}
|
||||||
|
|
||||||
describe('TransactionLink', () => {
|
describe('TransactionLink', () => {
|
||||||
|
|||||||
@ -8,13 +8,6 @@ export const copyLinks = {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
canCopyLink: true,
|
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: {
|
methods: {
|
||||||
@ -31,7 +24,7 @@ ${this.$t('gdd_per_link.link-hint')}`,
|
|||||||
},
|
},
|
||||||
copyLinkWithText() {
|
copyLinkWithText() {
|
||||||
navigator.clipboard
|
navigator.clipboard
|
||||||
.writeText(this.text)
|
.writeText(this.linkText)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.toastSuccess(this.$t('gdd_per_link.link-and-text-copied'))
|
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