diff --git a/admin/src/components/Tables/SearchUserTable.vue b/admin/src/components/Tables/SearchUserTable.vue index 024001193..0be24a099 100644 --- a/admin/src/components/Tables/SearchUserTable.vue +++ b/admin/src/components/Tables/SearchUserTable.vue @@ -49,30 +49,40 @@ - - {{ $t('userIsDeleted') }} - - - - - + + + + + + + + + + + + + + + + + diff --git a/admin/src/components/TransactionLinkList.vue b/admin/src/components/TransactionLinkList.vue index fa67c8797..0289792a2 100644 --- a/admin/src/components/TransactionLinkList.vue +++ b/admin/src/components/TransactionLinkList.vue @@ -1,7 +1,7 @@ - {{ $t('transactionlink.form_header') }} + {{ $t('transactionlink.name') }} { senderEmail: 'bibi@bloxberg.de', amount: new Decimal(42.0), memo: 'Vielen herzlichen Dank für den neuen Hexenbesen!', + overviewURL: 'http://localhost/overview', }) }) @@ -32,7 +33,8 @@ describe('sendTransactionReceivedEmail', () => { expect.stringContaining('42,00 GDD') && expect.stringContaining('Bibi Bloxberg') && expect.stringContaining('(bibi@bloxberg.de)') && - expect.stringContaining('Vielen herzlichen Dank für den neuen Hexenbesen!'), + expect.stringContaining('Vielen herzlichen Dank für den neuen Hexenbesen!') && + expect.stringContaining('http://localhost/overview'), }) }) }) diff --git a/backend/src/mailer/sendTransactionReceivedEmail.ts b/backend/src/mailer/sendTransactionReceivedEmail.ts index 934783449..537c13d85 100644 --- a/backend/src/mailer/sendTransactionReceivedEmail.ts +++ b/backend/src/mailer/sendTransactionReceivedEmail.ts @@ -11,6 +11,7 @@ export const sendTransactionReceivedEmail = (data: { senderEmail: string amount: Decimal memo: string + overviewURL: string }): Promise => { return sendEMail({ to: `${data.recipientFirstName} ${data.recipientLastName} <${data.email}>`, diff --git a/backend/src/mailer/text/transactionReceived.ts b/backend/src/mailer/text/transactionReceived.ts index 520ee43bf..07d03ad45 100644 --- a/backend/src/mailer/text/transactionReceived.ts +++ b/backend/src/mailer/text/transactionReceived.ts @@ -12,6 +12,7 @@ export const transactionReceived = { senderEmail: string amount: Decimal memo: string + overviewURL: string }): string => `Hallo ${data.recipientFirstName} ${data.recipientLastName} @@ -25,6 +26,9 @@ ${data.memo} Bitte antworte nicht auf diese E-Mail! Mit freundlichen Grüßen, -dein Gradido-Team`, +dein Gradido-Team + + +Link zu deinem Konto: ${data.overviewURL}`, }, } diff --git a/deployment/bare_metal/.env.dist b/deployment/bare_metal/.env.dist index 8254fd9c2..4c6e956af 100644 --- a/deployment/bare_metal/.env.dist +++ b/deployment/bare_metal/.env.dist @@ -18,7 +18,7 @@ WEBHOOK_GITHUB_SECRET=secret WEBHOOK_GITHUB_BRANCH=master # backend -BACKEND_CONFIG_VERSION=v4.2022-04-05 +BACKEND_CONFIG_VERSION=v5.2022-04-12 JWT_EXPIRES_IN=30m GDT_API_URL=https://gdt.gradido.net @@ -44,6 +44,7 @@ EMAIL_SMTP_URL=smtp.lustig.de EMAIL_LINK_VERIFICATION=https://stage1.gradido.net/checkEmail/{optin}{code} EMAIL_LINK_SETPASSWORD=https://stage1.gradido.net/reset-password/{optin} EMAIL_LINK_FORGOTPASSWORD=https://stage1.gradido.net/forgot-password +EMAIL_LINK_OVERVIEW=https://stage1.gradido.net/overview EMAIL_CODE_VALID_TIME=1440 EMAIL_CODE_REQUEST_TIME=10 diff --git a/deployment/bare_metal/install.sh b/deployment/bare_metal/install.sh index 37a002794..0fcf6d847 100755 --- a/deployment/bare_metal/install.sh +++ b/deployment/bare_metal/install.sh @@ -81,6 +81,11 @@ sudo certbot > No names were found in your configuration files. Please enter in your domain > stage1.gradido.net # Note: this will throw an error regarding not beeing able to identify the nginx corresponding # config but produce the required certificate - thats perfectly fine this way +# Troubleshoot: to manually renew a certificate with running nginx use the following command: +# (this might be required once to properly have things setup for the cron to autorenew) +# sudo certbot --nginx -d example.com -d www.example.com +# Troubleshoot: to check ut if things working you can use +# sudo certbot renew --dry-run # Install logrotate sudo apt-get install -y logrotate diff --git a/frontend/src/components/GdtTransactionList.spec.js b/frontend/src/components/GdtTransactionList.spec.js index c1b9a7cc9..ed72b660e 100644 --- a/frontend/src/components/GdtTransactionList.spec.js +++ b/frontend/src/components/GdtTransactionList.spec.js @@ -1,24 +1,9 @@ import { mount } from '@vue/test-utils' -import { GdtEntryType } from '@/graphql/enums' import GdtTransactionList from './GdtTransactionList' - -import { toastErrorSpy } from '@test/testSetup' +import { GdtEntryType } from '@/graphql/enums' const localVue = global.localVue -const apolloMock = jest.fn().mockResolvedValue({ - data: { - listGDTEntries: { - count: 0, - gdtEntries: [], - }, - }, -}) - -const windowScrollToMock = jest.fn() - -window.scrollTo = windowScrollToMock - const state = { language: 'en', } @@ -37,16 +22,20 @@ describe('GdtTransactionList ', () => { $t: jest.fn((t) => t), $n: jest.fn((n) => n), $d: jest.fn((d) => d), - $apollo: { - query: apolloMock, - }, + } + + const propsData = { + transactionsGdt: [], + transactionGdtCount: 0, + pageSize: 25, + value: 1, } const Wrapper = () => { - return mount(GdtTransactionList, { localVue, mocks }) + return mount(GdtTransactionList, { localVue, mocks, propsData }) } - describe('mount - When no transactions are loaded', () => { + describe('transactionGdtCount is 0', () => { beforeEach(() => { wrapper = Wrapper() }) @@ -62,54 +51,50 @@ describe('GdtTransactionList ', () => { }) }) - describe('mount - When transactions are loaded', () => { - beforeEach(() => { - apolloMock.mockResolvedValue({ - data: { - listGDTEntries: { - count: 4, - gdtEntries: [ - { - id: 1, - amount: 100, - gdt: 1700, - factor: 17, - comment: '', - date: '2021-05-02T17:20:11+00:00', - gdtEntryType: GdtEntryType.FORM, - }, - { - id: 2, - amount: 1810, - gdt: 362, - factor: 0.2, - comment: 'Dezember 20', - date: '2020-12-31T12:00:00+00:00', - gdtEntryType: GdtEntryType.GLOBAL_MODIFICATOR, - }, - { - id: 3, - amount: 100, - gdt: 1700, - factor: 17, - comment: '', - date: '2020-05-07T17:00:00+00:00', - gdtEntryType: GdtEntryType.FORM, - }, - { - id: 4, - amount: 100, - gdt: 110, - factor: 22, - comment: '', - date: '2020-04-10T13:28:00+00:00', - gdtEntryType: GdtEntryType.ELOPAGE_PUBLISHER, - }, - ], - }, - }, - }) + describe('Transactions are loaded', () => { + beforeEach(async () => { wrapper = Wrapper() + await wrapper.setProps({ + transactionGdtCount: 42, + transactionsGdt: [ + { + id: 1, + amount: 100, + gdt: 1700, + factor: 17, + comment: '', + date: '2021-05-02T17:20:11+00:00', + gdtEntryType: GdtEntryType.FORM, + }, + { + id: 2, + amount: 1810, + gdt: 362, + factor: 0.2, + comment: 'Dezember 20', + date: '2020-12-31T12:00:00+00:00', + gdtEntryType: GdtEntryType.GLOBAL_MODIFICATOR, + }, + { + id: 3, + amount: 100, + gdt: 1700, + factor: 17, + comment: '', + date: '2020-05-07T17:00:00+00:00', + gdtEntryType: GdtEntryType.FORM, + }, + { + id: 4, + amount: 100, + gdt: 110, + factor: 22, + comment: '', + date: '2020-04-10T13:28:00+00:00', + gdtEntryType: GdtEntryType.ELOPAGE_PUBLISHER, + }, + ], + }) }) it('renders the component', () => { @@ -120,83 +105,25 @@ describe('GdtTransactionList ', () => { expect(wrapper.find('.gdt-funding').exists()).toBe(false) }) - describe('server returns valid data', () => { - it('calls the API', async () => { - await wrapper.vm.$nextTick() - expect(apolloMock).toBeCalledWith( - expect.objectContaining({ - variables: { - currentPage: 1, - pageSize: 25, - }, - }), - ) - }) - - it('scrolls to (0, 0) after API call', () => { - expect(windowScrollToMock).toBeCalledWith(0, 0) - }) - }) - - describe('server returns error', () => { - beforeEach(() => { - jest.resetAllMocks() - apolloMock.mockRejectedValue({ - message: 'Ouch!', - }) - wrapper = Wrapper() - }) - - it('toasts an error message', () => { - expect(toastErrorSpy).toBeCalledWith('Ouch!') - }) - }) - describe('change of currentPage', () => { it('calls the API after currentPage changes', async () => { jest.clearAllMocks() - await wrapper.setData({ transactionGdtCount: 42 }) await wrapper.findComponent({ name: 'BPagination' }).vm.$emit('input', 2) - expect(apolloMock).toBeCalledWith( - expect.objectContaining({ - variables: { - currentPage: 2, - pageSize: 25, - }, - }), - ) + expect(wrapper.emitted('input')).toEqual([[2]]) }) describe('pagination buttons', () => { describe('with transactionCount > pageSize', () => { - beforeEach(async () => { - apolloMock.mockResolvedValue({ - data: { - listGDTEntries: { - count: 42, - gdtEntries: [], - }, - }, - }) - wrapper = Wrapper() - }) - it('shows the pagination buttons', () => { expect(wrapper.find('ul.pagination').exists()).toBe(true) }) }) describe('with transactionCount < pageSize', () => { - beforeEach(async () => { - apolloMock.mockResolvedValue({ - data: { - listGDTEntries: { - count: 2, - gdtEntries: [], - }, - }, + beforeEach(() => { + wrapper.setProps({ + transactionGdtCount: 10, }) - wrapper = Wrapper() }) it('shows no pagination buttons', () => { @@ -205,5 +132,17 @@ describe('GdtTransactionList ', () => { }) }) }) + + describe('server not reachable', () => { + beforeEach(() => { + wrapper.setProps({ + transactionGdtCount: -1, + }) + }) + + it('renders the not-reachable text', () => { + expect(wrapper.text()).toBe('gdt.not-reachable') + }) + }) }) }) diff --git a/frontend/src/components/GdtTransactionList.vue b/frontend/src/components/GdtTransactionList.vue index 8944ea69b..4934f9fce 100644 --- a/frontend/src/components/GdtTransactionList.vue +++ b/frontend/src/components/GdtTransactionList.vue @@ -8,7 +8,7 @@ {{ $t('gdt.funding') }} - + {{ $t('gdt.not-reachable') }}