change props from text to link in FigureQrCode

This commit is contained in:
ogerly 2022-04-22 12:43:27 +02:00
parent 3163acabee
commit d595c76d08
4 changed files with 6 additions and 11 deletions

View File

@ -3,10 +3,10 @@
<b-col> <b-col>
<b-card class="p-0 gradido-custom-background"> <b-card class="p-0 gradido-custom-background">
<div class="h3 mb-4">{{ $t('gdd_per_link.created') }}</div> <div class="h3 mb-4">{{ $t('gdd_per_link.created') }}</div>
<clipboard-copy :text="link" @show-qr-code-button="showQrCodeButton" /> <clipboard-copy :link="link" @show-qr-code-button="showQrCodeButton" />
<div class="text-center"> <div class="text-center">
<figure-qr-code v-if="showQrcode" :text="link" /> <figure-qr-code v-if="showQrcode" :link="link" />
<b-button variant="success" @click="$emit('on-reset')" class="mt-4"> <b-button variant="success" @click="$emit('on-reset')" class="mt-4">
{{ $t('form.close') }} {{ $t('form.close') }}
@ -42,10 +42,5 @@ export default {
this.showQrcode = !this.showQrcode this.showQrcode = !this.showQrcode
}, },
}, },
computed: {
link() {
return `${window.location.origin}/redeem/${this.code}`
},
},
} }
</script> </script>

View File

@ -4,7 +4,7 @@ import FigureQrCode from './FigureQrCode'
const localVue = global.localVue const localVue = global.localVue
const propsData = { const propsData = {
text: '', link: '',
} }
describe('FigureQrCode', () => { describe('FigureQrCode', () => {

View File

@ -14,14 +14,14 @@ export default {
QRCanvas, QRCanvas,
}, },
props: { props: {
text: { type: String, required: true }, link: { type: String, required: true },
}, },
data() { data() {
return { return {
options: { options: {
cellSize: 8, cellSize: 8,
correctLevel: 'H', correctLevel: 'H',
data: this.text, data: this.link,
}, },
} }
}, },

View File

@ -47,7 +47,7 @@
</b-row> </b-row>
<b-modal :id="'modalPopover-' + id" title="QR-Code" ok-only hide-header-close> <b-modal :id="'modalPopover-' + id" title="QR-Code" ok-only hide-header-close>
<div class="text-center"> <div class="text-center">
<figure-qr-code :text="link" /> <figure-qr-code :link="link" />
<p>{{ link }}</p> <p>{{ link }}</p>
</div> </div>
</b-modal> </b-modal>