diff --git a/CHANGELOG.md b/CHANGELOG.md index 53aa4a9e1..8eb3dab66 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,8 +4,26 @@ All notable changes to this project will be documented in this file. Dates are d Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). +#### [1.10.0](https://github.com/gradido/gradido/compare/1.9.0...1.10.0) + +- frontend redeem contribution link [`#1988`](https://github.com/gradido/gradido/pull/1988) +- change new start picture [`#1990`](https://github.com/gradido/gradido/pull/1990) +- feat: Redeem Contribution Link [`#1987`](https://github.com/gradido/gradido/pull/1987) +- fix: Max Amount on Slider for Edit Contribution [`#1986`](https://github.com/gradido/gradido/pull/1986) +- CRUD contribution link admin interface [`#1981`](https://github.com/gradido/gradido/pull/1981) +- fix: `.env` log level for apollo and backend category [`#1967`](https://github.com/gradido/gradido/pull/1967) +- refactor: Admin Pending Creations Table to Contributions Table [`#1949`](https://github.com/gradido/gradido/pull/1949) +- devops: Update Browser List for Unit Tests as Recomended [`#1984`](https://github.com/gradido/gradido/pull/1984) +- feat: CRUD for Contribution Links in Admin Resolver [`#1979`](https://github.com/gradido/gradido/pull/1979) +- 1920 feature create contribution link table [`#1957`](https://github.com/gradido/gradido/pull/1957) +- refactor: 🍰 Delete `user_setting` Table From DB [`#1960`](https://github.com/gradido/gradido/pull/1960) +- locales link german, english navbar [`#1969`](https://github.com/gradido/gradido/pull/1969) + #### [1.9.0](https://github.com/gradido/gradido/compare/1.8.3...1.9.0) +> 2 June 2022 + +- devops: Release Version 1.9.0 [`#1968`](https://github.com/gradido/gradido/pull/1968) - refactor: 🍰 Refactor To `filters` Object And Rename Filters Properties [`#1914`](https://github.com/gradido/gradido/pull/1914) - refactor register button position [`#1964`](https://github.com/gradido/gradido/pull/1964) - fixed redeem link is mobile start false [`#1958`](https://github.com/gradido/gradido/pull/1958) diff --git a/admin/package.json b/admin/package.json index cbbce5a2a..73d8dd879 100644 --- a/admin/package.json +++ b/admin/package.json @@ -3,7 +3,7 @@ "description": "Administraion Interface for Gradido", "main": "index.js", "author": "Moriz Wahl", - "version": "1.9.0", + "version": "1.10.0", "license": "Apache-2.0", "private": false, "scripts": { diff --git a/admin/src/components/ContributionLinkForm.vue b/admin/src/components/ContributionLinkForm.vue index 6fb9ee594..a159d33d3 100644 --- a/admin/src/components/ContributionLinkForm.vue +++ b/admin/src/components/ContributionLinkForm.vue @@ -181,6 +181,7 @@ export default { .then((result) => { this.link = result.data.createContributionLink.link this.toastSuccess(this.link) + this.onReset() }) .catch((error) => { this.toastError(error.message) diff --git a/backend/package.json b/backend/package.json index bd5388632..3675a5eb0 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "gradido-backend", - "version": "1.9.0", + "version": "1.10.0", "description": "Gradido unified backend providing an API-Service for Gradido Transactions", "main": "src/index.ts", "repository": "https://github.com/gradido/gradido/backend", diff --git a/backend/src/graphql/resolver/TransactionLinkResolver.ts b/backend/src/graphql/resolver/TransactionLinkResolver.ts index ddc1d3094..c607247b9 100644 --- a/backend/src/graphql/resolver/TransactionLinkResolver.ts +++ b/backend/src/graphql/resolver/TransactionLinkResolver.ts @@ -276,8 +276,8 @@ export class TransactionLinkResolver { logger.info('creation from contribution link commited successfuly.') } catch (e) { await queryRunner.rollbackTransaction() - logger.error(`Creation from contribution link was not successful: ${e}`) - throw new Error(`Creation from contribution link was not successful. ${e}`) + logger.error(`Creation from contribution link was not successful: ${e}`) + throw new Error(`Creation from contribution link was not successful. ${e}`) } finally { await queryRunner.release() } diff --git a/database/package.json b/database/package.json index 50e3bdd78..88885b9fc 100644 --- a/database/package.json +++ b/database/package.json @@ -1,6 +1,6 @@ { "name": "gradido-database", - "version": "1.9.0", + "version": "1.10.0", "description": "Gradido Database Tool to execute database migrations", "main": "src/index.ts", "repository": "https://github.com/gradido/gradido/database", diff --git a/frontend/package.json b/frontend/package.json index e59ec8140..0aeb7c353 100755 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,6 +1,6 @@ { "name": "bootstrap-vue-gradido-wallet", - "version": "1.9.0", + "version": "1.10.0", "private": true, "scripts": { "start": "node run/server.js", diff --git a/frontend/src/components/LanguageSwitch2.spec.js b/frontend/src/components/LanguageSwitch2.spec.js new file mode 100644 index 000000000..600e2513e --- /dev/null +++ b/frontend/src/components/LanguageSwitch2.spec.js @@ -0,0 +1,133 @@ +import { mount } from '@vue/test-utils' +import LanguageSwitch from './LanguageSwitch2' + +const localVue = global.localVue + +const updateUserInfosMutationMock = jest.fn().mockResolvedValue({ + data: { + updateUserInfos: { + validValues: 1, + }, + }, +}) + +describe('LanguageSwitch', () => { + let wrapper + + const state = { + email: 'he@ho.he', + language: null, + } + + const mocks = { + $store: { + state, + commit: jest.fn(), + }, + $i18n: { + locale: 'en', + }, + $t: jest.fn((t) => t), + $apollo: { + mutate: updateUserInfosMutationMock, + }, + } + + const Wrapper = () => { + return mount(LanguageSwitch, { localVue, mocks }) + } + + describe('mount', () => { + beforeEach(() => { + wrapper = Wrapper() + }) + + it('renders the component', () => { + expect(wrapper.find('div.language-switch').exists()).toBe(true) + }) + + describe('with locales en and de', () => { + describe('empty store', () => { + describe('navigator language is "en-US"', () => { + const languageGetter = jest.spyOn(navigator, 'language', 'get') + it('shows English as default navigator langauge', async () => { + languageGetter.mockReturnValue('en-US') + wrapper.vm.setCurrentLanguage() + await wrapper.vm.$nextTick() + expect(wrapper.findAll('span.locales').at(0).text()).toBe('English') + }) + }) + describe('navigator language is "de-DE"', () => { + const languageGetter = jest.spyOn(navigator, 'language', 'get') + it('shows Deutsch as language ', async () => { + languageGetter.mockReturnValue('de-DE') + wrapper.vm.setCurrentLanguage() + await wrapper.vm.$nextTick() + expect(wrapper.findAll('span.locales').at(1).text()).toBe('Deutsch') + }) + }) + describe('navigator language is "es-ES" (not supported)', () => { + const languageGetter = jest.spyOn(navigator, 'language', 'get') + it('shows English as language ', async () => { + languageGetter.mockReturnValue('es-ES') + wrapper.vm.setCurrentLanguage() + await wrapper.vm.$nextTick() + expect(wrapper.findAll('span.locales').at(0).text()).toBe('English') + }) + }) + describe('no navigator langauge', () => { + const languageGetter = jest.spyOn(navigator, 'language', 'get') + it('shows English as language ', async () => { + languageGetter.mockReturnValue(null) + wrapper.vm.setCurrentLanguage() + await wrapper.vm.$nextTick() + expect(wrapper.findAll('span.locales').at(0).text()).toBe('English') + }) + }) + }) + describe('language "de" in store', () => { + it('shows Deutsch as language', async () => { + wrapper.vm.$store.state.language = 'de' + wrapper.vm.setCurrentLanguage() + await wrapper.vm.$nextTick() + expect(wrapper.findAll('span.locales').at(1).text()).toBe('Deutsch') + }) + }) + describe('language menu', () => { + it('has English and German as languages to choose', () => { + expect(wrapper.findAll('span.locales')).toHaveLength(2) + }) + it('has English as first language to choose', () => { + expect(wrapper.findAll('span.locales').at(0).text()).toBe('English') + }) + it('has German as second language to choose', () => { + expect(wrapper.findAll('span.locales').at(1).text()).toBe('Deutsch') + }) + }) + }) + + describe('calls the API', () => { + it("with locale 'de'", () => { + wrapper.findAll('span.locales').at(1).trigger('click') + expect(updateUserInfosMutationMock).toBeCalledWith( + expect.objectContaining({ + variables: { + locale: 'de', + }, + }), + ) + }) + + // it("with locale 'en'", () => { + // wrapper.findAll('span.locales').at(0).trigger('click') + // expect(updateUserInfosMutationMock).toBeCalledWith( + // expect.objectContaining({ + // variables: { + // locale: 'en', + // }, + // }), + // ) + // }) + }) + }) +}) diff --git a/frontend/src/components/LanguageSwitch2.vue b/frontend/src/components/LanguageSwitch2.vue index 90026f6f6..b78154e0a 100644 --- a/frontend/src/components/LanguageSwitch2.vue +++ b/frontend/src/components/LanguageSwitch2.vue @@ -7,8 +7,8 @@ class="pointer pr-2" :class="$store.state.language === lang.code ? 'c-blau' : 'c-grey'" > - {{ lang.name }} - {{ locales.length - 1 > index ? $t('math.pipe') : '' }} + {{ lang.name }} + {{ locales.length - 1 > index ? $t('math.pipe') : '' }} diff --git a/frontend/src/components/LinkInformations/RedeemInformation.vue b/frontend/src/components/LinkInformations/RedeemInformation.vue index bdc17db9a..d287605a4 100644 --- a/frontend/src/components/LinkInformations/RedeemInformation.vue +++ b/frontend/src/components/LinkInformations/RedeemInformation.vue @@ -1,8 +1,12 @@ diff --git a/frontend/src/components/LinkInformations/RedeemLoggedOut.vue b/frontend/src/components/LinkInformations/RedeemLoggedOut.vue index a5cb97955..982bfdf08 100644 --- a/frontend/src/components/LinkInformations/RedeemLoggedOut.vue +++ b/frontend/src/components/LinkInformations/RedeemLoggedOut.vue @@ -1,6 +1,6 @@