merge 1763-remove-qr-code-from-profile-remove-unused-libraries

This commit is contained in:
ogerly 2022-04-13 09:22:01 +02:00
parent 3f7a0d901e
commit 644369e367
5 changed files with 27 additions and 49 deletions

View File

@ -1,7 +1,7 @@
<template>
<div class="clipboard-copy">
<b-input-group size="lg" class="mb-3" prepend="Link">
<b-form-input v-model="url" type="text" readonly></b-form-input>
<b-form-input :value="text" 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,7 @@
export default {
name: 'ClipboardCopy',
props: {
code: { type: String, required: true },
},
data() {
return {
url: `${window.location.origin}/redeem/${this.code}`,
}
text: { type: String, required: true },
},
methods: {
CopyLink() {

View File

@ -1,27 +1,21 @@
<template>
<b-container>
<b-row>
<b-col>
<b-card class="p-0 gradido-custom-background">
<div class="p-4">
<div class="h3">{{ $t('gdd_per_link.created') }}</div>
</div>
<b-row>
<b-col class="text-center">
<figure-qr-code :text="link" />
</b-col>
</b-row>
<div class="p-4">
<clipboard-copy :code="code" />
</div>
<b-row>
<b-col>
<b-card class="p-0 gradido-custom-background">
<div class="h3 mb-4">{{ $t('gdd_per_link.created') }}</div>
<p class="text-center mt-3">
<b-button variant="success" @click="$emit('on-reset')">{{ $t('form.close') }}</b-button>
</p>
</b-card>
</b-col>
</b-row>
</b-container>
<clipboard-copy :text="link" />
<div class="text-center">
<figure-qr-code :text="link" />
<b-button variant="success" @click="$emit('on-reset')" class="mt-4">
{{ $t('form.close') }}
</b-button>
</div>
</b-card>
</b-col>
</b-row>
</template>
<script>
import ClipboardCopy from '../ClipboardCopy.vue'

View File

@ -27,7 +27,7 @@ export default {
},
created() {
const image = new Image()
image.src = 'img/gdd-coin.png'
image.src = 'img/gdd-coin-sw.png'
image.onload = () => {
this.options = {
...this.options,
@ -46,6 +46,6 @@ export default {
}
.canvas {
width: 90%;
max-width: 350px;
max-width: 300px;
}
</style>

View File

@ -27,7 +27,6 @@ const propsData = {
id: 12,
memo: 'Katzenauge, Eulenschrei, was verschwunden komm herbei!',
validUntil: '2022-03-30T14:22:40.000Z',
writeText: '',
}
describe('TransactionLink', () => {
@ -69,17 +68,6 @@ describe('TransactionLink', () => {
expect(toastSuccessSpy).toBeCalledWith('gdd_per_link.link-copied')
})
})
describe.skip('copy with error', () => {
beforeEach(async () => {
navigatorClipboardMock.mockRejectedValue()
await wrapper.find('.test-copy-link').trigger('click')
})
it('toasts error message', () => {
expect(toastErrorSpy).toBeCalledWith('gdd_per_link.not-copied')
})
})
})
describe('qr code modal', () => {
@ -160,7 +148,7 @@ describe('TransactionLink', () => {
spy = jest.spyOn(wrapper.vm.$bvModal, 'msgBoxConfirm')
spy.mockImplementation(() => Promise.resolve(false))
mockAPIcall.mockResolvedValue()
await wrapper.findAll('button').at(2).trigger('click')
await wrapper.find('.test-delete-link').trigger('click')
})
it('does not call the API', () => {

View File

@ -17,9 +17,8 @@
@click="$bvModal.show('modalPopover-' + id)"
class="p-2 test-qr-code"
size="sm"
variant="outline-success"
>
<b-img src="img/svg/qr-code.svg" width="60"></b-img>
<b-img src="img/svg/qr-code.svg" width="60" class="filter"></b-img>
</b-button>
</b-col>
</b-row>
@ -28,7 +27,7 @@
<b-col lg="1" md="1" class="text-center text-lg-right">
<b-button
class="p-2 test-copy-link"
size="sm"
size="lg"
variant="outline-primary"
@click="copy"
:title="$t('gdd_per_link.copy')"
@ -37,9 +36,8 @@
</b-button>
<br />
<b-button
class="p-2 test-delete-link"
class="p-2 mt-3 test-delete-link"
size="sm"
variant="outline-danger"
@click="deleteLink()"
:title="$t('delete')"
>
@ -128,4 +126,7 @@ export default {
position: relative;
right: 20px;
}
.filter {
filter: opacity(0.6);
}
</style>