diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c64df990..40685fd4a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,8 +4,83 @@ 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.7.0](https://github.com/gradido/gradido/compare/1.6.6...1.7.0) + +- folder for new style images [`#1694`](https://github.com/gradido/gradido/pull/1694) +- fix: No Email Exposed on Forgot Password [`#1696`](https://github.com/gradido/gradido/pull/1696) +- fix: No Decay Calculation in Frontend [`#1692`](https://github.com/gradido/gradido/pull/1692) +- fix: Wrong Balance on Decay Transaction [`#1691`](https://github.com/gradido/gradido/pull/1691) +- fix: No Plus Before Zero Decay [`#1689`](https://github.com/gradido/gradido/pull/1689) +- fix: Update Deployment env.dist [`#1688`](https://github.com/gradido/gradido/pull/1688) +- 1684 when generating a link form does not reset [`#1687`](https://github.com/gradido/gradido/pull/1687) +- Refactor: Multicreation - do not show unactivated emails [`#1679`](https://github.com/gradido/gradido/pull/1679) +- feat: Show Link Duration in Emails [`#1663`](https://github.com/gradido/gradido/pull/1663) +- refactor: Balance Resolver [`#1665`](https://github.com/gradido/gradido/pull/1665) +- refactor: Set Email Optin Valid Time to 24 hours [`#1662`](https://github.com/gradido/gradido/pull/1662) +- Fix: Fixes found on Stage1 [`#1683`](https://github.com/gradido/gradido/pull/1683) +- 1555 admin see user generated link [`#1656`](https://github.com/gradido/gradido/pull/1656) +- 1594 show transaction was created by link [`#1680`](https://github.com/gradido/gradido/pull/1680) +- refactor: Memo Text Length to 255 Characters [`#1675`](https://github.com/gradido/gradido/pull/1675) +- adminarea: fetchPolicy on searchUser deleted User [`#1678`](https://github.com/gradido/gradido/pull/1678) +- 1223 community communication concept [`#1313`](https://github.com/gradido/gradido/pull/1313) +- clear form.email if click send per link, tests if clicked [`#1660`](https://github.com/gradido/gradido/pull/1660) +- feat: User in Transaction Clickable to Send Directly [`#1658`](https://github.com/gradido/gradido/pull/1658) +- feat: Add Sender Email to Transaction Received Mail [`#1664`](https://github.com/gradido/gradido/pull/1664) +- Feature: Enforce config versions [`#1627`](https://github.com/gradido/gradido/pull/1627) +- 1559 frontend transport redeem link through register [`#1647`](https://github.com/gradido/gradido/pull/1647) +- update-balance if link succesfully generated [`#1655`](https://github.com/gradido/gradido/pull/1655) +- feat: Add Referrer ID to Users [`#1654`](https://github.com/gradido/gradido/pull/1654) +- 1558 - show tranaction link information page [`#1625`](https://github.com/gradido/gradido/pull/1625) +- refactor: No Float Ids [`#1624`](https://github.com/gradido/gradido/pull/1624) +- Change the text if the account is not activated yet and changed the b… [`#1336`](https://github.com/gradido/gradido/pull/1336) +- Refactor: Corrected name of transaction link summary [`#1628`](https://github.com/gradido/gradido/pull/1628) +- fix: Query for Only Creations Transaction List [`#1623`](https://github.com/gradido/gradido/pull/1623) +- Fix: build for development and production links external modules properly [`#1626`](https://github.com/gradido/gradido/pull/1626) +- feat: Seed Transaction Links [`#1622`](https://github.com/gradido/gradido/pull/1622) +- 1588 frontend expendable paginated link list [`#1620`](https://github.com/gradido/gradido/pull/1620) +- feat: Seed Creation Transactions in Backend [`#1621`](https://github.com/gradido/gradido/pull/1621) +- Feature: Eslint i18n validation [`#1618`](https://github.com/gradido/gradido/pull/1618) +- refactor: Seed in Backend [`#1619`](https://github.com/gradido/gradido/pull/1619) +- 1554 frontend transaction link summary [`#1613`](https://github.com/gradido/gradido/pull/1613) +- Frontend generate link for send gdd [`#1579`](https://github.com/gradido/gradido/pull/1579) +- feat: Test Logout in User Resolver [`#1617`](https://github.com/gradido/gradido/pull/1617) +- Fix: Logrotate & Log Dates & Save Update Log & Correct tag Checkout [`#1612`](https://github.com/gradido/gradido/pull/1612) +- refactor: No Reset DB in Backend Unit Tests [`#1616`](https://github.com/gradido/gradido/pull/1616) +- Test: Require 53% backend coverage [`#1611`](https://github.com/gradido/gradido/pull/1611) +- 1599 components for transactionlist types [`#1600`](https://github.com/gradido/gradido/pull/1600) +- feat: Link Transaction to Transaction Link on Redeem [`#1610`](https://github.com/gradido/gradido/pull/1610) +- feat: Redeem Transaction Link Mutation [`#1607`](https://github.com/gradido/gradido/pull/1607) +- feat: List Transaction Links Query [`#1606`](https://github.com/gradido/gradido/pull/1606) +- feat: Virtual Transaction for Transaction Links [`#1603`](https://github.com/gradido/gradido/pull/1603) +- refactor: Transaction Link Query [`#1605`](https://github.com/gradido/gradido/pull/1605) +- 1216 seo vorschau links [`#1426`](https://github.com/gradido/gradido/pull/1426) +- Feature: Eslint style rules & Stylelint for SCSS [`#1598`](https://github.com/gradido/gradido/pull/1598) +- refactor: Remove showEmail from Transaction Links [`#1602`](https://github.com/gradido/gradido/pull/1602) +- feat: Delete Transaction Link Mutation [`#1597`](https://github.com/gradido/gradido/pull/1597) +- Query-transaction-link [`#1586`](https://github.com/gradido/gradido/pull/1586) +- feat: Create Transaction Link Mutation [`#1585`](https://github.com/gradido/gradido/pull/1585) +- feat: Model Transaction Link [`#1584`](https://github.com/gradido/gradido/pull/1584) +- feat: Test Login in User Resolver [`#1538`](https://github.com/gradido/gradido/pull/1538) +- add style in App.vue, set class .pointer on transaction-list-item [`#1583`](https://github.com/gradido/gradido/pull/1583) +- feat: Use Vue Filter to Display Gradido Amounts [`#1576`](https://github.com/gradido/gradido/pull/1576) +- refactor: Resolve Relative Paths in Backend [`#1572`](https://github.com/gradido/gradido/pull/1572) +- refactor: Frontend Directory Structure and Routes [`#1571`](https://github.com/gradido/gradido/pull/1571) +- community name in creation transaction is displayed cleanly [`#1578`](https://github.com/gradido/gradido/pull/1578) +- Planning: send new users gradido [`#1567`](https://github.com/gradido/gradido/pull/1567) +- Refactor arithmetic merge [`#1548`](https://github.com/gradido/gradido/pull/1548) +- Adminarea creation transactionlist show [`#1550`](https://github.com/gradido/gradido/pull/1550) +- Fix: Validate password on UpdateUserInfos [`#1568`](https://github.com/gradido/gradido/pull/1568) +- Fix: Allow sending to user without transactions [`#1549`](https://github.com/gradido/gradido/pull/1549) +- Fix: Balance type [`#1569`](https://github.com/gradido/gradido/pull/1569) +- Refactor: arithmetic and data types [`#1539`](https://github.com/gradido/gradido/pull/1539) +- refactor: Bootstrap Vue Toast in Admin interface [`#1547`](https://github.com/gradido/gradido/pull/1547) +- Refactor: Combine transaction tables and restructure transaction design [`#1531`](https://github.com/gradido/gradido/pull/1531) + #### [1.6.6](https://github.com/gradido/gradido/compare/1.6.5...1.6.6) +> 28 February 2022 + +- v1.6.6 [`#1541`](https://github.com/gradido/gradido/pull/1541) - Fix: Upper case email on register breaks account [`#1542`](https://github.com/gradido/gradido/pull/1542) - 1106 first transaction cannot be expanded [`#1432`](https://github.com/gradido/gradido/pull/1432) - added missing bootstrap scss. bootstrap/scss/bootstrap, plus more mis… [`#1540`](https://github.com/gradido/gradido/pull/1540) diff --git a/admin/package.json b/admin/package.json index 2b4be2851..cc4702b4c 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.6.6", + "version": "1.7.0", "license": "MIT", "private": false, "scripts": { diff --git a/backend/.env.dist b/backend/.env.dist index 447608533..0a95eda6c 100644 --- a/backend/.env.dist +++ b/backend/.env.dist @@ -41,7 +41,7 @@ EMAIL_PASSWORD=xxx EMAIL_SMTP_URL=gmail.com EMAIL_SMTP_PORT=587 EMAIL_LINK_VERIFICATION=http://localhost/checkEmail/{optin}{code} -EMAIL_LINK_SETPASSWORD=http://localhost/reset/{code} +EMAIL_LINK_SETPASSWORD=http://localhost/reset/{optin} EMAIL_LINK_FORGOTPASSWORD=http://localhost/forgot-password EMAIL_CODE_VALID_TIME=1440 EMAIL_CODE_REQUEST_TIME=10 diff --git a/backend/.env.template b/backend/.env.template index 454b25d3c..66cac7a7c 100644 --- a/backend/.env.template +++ b/backend/.env.template @@ -33,7 +33,6 @@ LOGIN_APP_SECRET=21ffbbc616fe LOGIN_SERVER_KEY=a51ef8ac7ef1abf162fb7a65261acd7a # EMail -RESEND_TIME=10 EMAIL=$EMAIL EMAIL_USERNAME=$EMAIL_USERNAME EMAIL_SENDER=$EMAIL_SENDER @@ -42,7 +41,8 @@ EMAIL_SMTP_URL=$EMAIL_SMTP_URL EMAIL_SMTP_PORT=587 EMAIL_LINK_VERIFICATION=$EMAIL_LINK_VERIFICATION EMAIL_LINK_SETPASSWORD=$EMAIL_LINK_SETPASSWORD -RESEND_TIME=10 +EMAIL_CODE_VALID_TIME=$EMAIL_CODE_VALID_TIME +EMAIL_CODE_REQUEST_TIME=$EMAIL_CODE_REQUEST_TIME # Webhook WEBHOOK_ELOPAGE_SECRET=$WEBHOOK_ELOPAGE_SECRET \ No newline at end of file diff --git a/backend/package.json b/backend/package.json index 3ce04bded..b2086c8d7 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "gradido-backend", - "version": "1.6.6", + "version": "1.7.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/TransactionResolver.ts b/backend/src/graphql/resolver/TransactionResolver.ts index 310ea37d1..461a70a00 100644 --- a/backend/src/graphql/resolver/TransactionResolver.ts +++ b/backend/src/graphql/resolver/TransactionResolver.ts @@ -199,7 +199,12 @@ export class TransactionResolver { // decay & link transactions if (currentPage === 1 && order === Order.DESC) { transactions.push( - virtualDecayTransaction(lastTransaction.balance, lastTransaction.balanceDate, now, self), + virtualDecayTransaction( + lastTransaction.balance.minus(sumHoldAvailableAmount.toString()), + lastTransaction.balanceDate, + now, + self, + ), ) // virtual transaction for pending transaction-links sum if (sumHoldAvailableAmount.greaterThan(0)) { diff --git a/backend/src/graphql/resolver/UserResolver.ts b/backend/src/graphql/resolver/UserResolver.ts index 49959e3e7..cacee6fc8 100644 --- a/backend/src/graphql/resolver/UserResolver.ts +++ b/backend/src/graphql/resolver/UserResolver.ts @@ -391,10 +391,11 @@ export class UserResolver { } @Authorized([RIGHTS.SEND_RESET_PASSWORD_EMAIL]) - @Query(() => Boolean) - async sendResetPasswordEmail(@Arg('email') email: string): Promise { + @Mutation(() => Boolean) + async forgotPassword(@Arg('email') email: string): Promise { email = email.trim().toLowerCase() - const user = await DbUser.findOneOrFail({ email }) + const user = await DbUser.findOne({ email }) + if (!user) return true // can be both types: REGISTER and RESET_PASSWORD let optInCode = await LoginEmailOptIn.findOne({ diff --git a/database/package.json b/database/package.json index d4b247082..0ee937774 100644 --- a/database/package.json +++ b/database/package.json @@ -1,6 +1,6 @@ { "name": "gradido-database", - "version": "1.6.6", + "version": "1.7.0", "description": "Gradido Database Tool to execute database migrations", "main": "src/index.ts", "repository": "https://github.com/gradido/gradido/database", diff --git a/deployment/bare_metal/.env.dist b/deployment/bare_metal/.env.dist index e46ee1d90..f2b0bcbb3 100644 --- a/deployment/bare_metal/.env.dist +++ b/deployment/bare_metal/.env.dist @@ -25,8 +25,11 @@ EMAIL_USERNAME=peter@lustig.de EMAIL_SENDER=peter@lustig.de EMAIL_PASSWORD=1234 EMAIL_SMTP_URL=smtp.lustig.de -EMAIL_LINK_VERIFICATION=https://stage1.gradido.net/checkEmail/{code} -EMAIL_LINK_SETPASSWORD=https://stage1.gradido.net/reset/{code} +EMAIL_LINK_VERIFICATION=https://stage1.gradido.net/checkEmail/{optin}{code} +EMAIL_LINK_SETPASSWORD=https://stage1.gradido.net/reset/{optin} +EMAIL_LINK_FORGOTPASSWORD=https://stage1.gradido.net/forgot-password +EMAIL_CODE_VALID_TIME=1440 +EMAIL_CODE_REQUEST_TIME=10 TYPEORM_LOGGING_RELATIVE_PATH=../deployment/bare_metal/log/typeorm.backend.log @@ -54,6 +57,8 @@ FRONTEND_CONFIG_VERSION=v1.2022-03-18 GRAPHQL_URI=https://stage1.gradido.net/graphql ADMIN_AUTH_URL=https://stage1.gradido.net/admin/authenticate?token={token} +DEFAULT_PUBLISHER_ID=2896 + META_URL=http://localhost META_TITLE_DE="Gradido – Dein Dankbarkeitskonto" META_TITLE_EN="Gradido - Your gratitude account" diff --git a/docu/Style/Images/Blaetter.png b/docu/Style/Images/Blaetter.png new file mode 100644 index 000000000..6b4a78df6 Binary files /dev/null and b/docu/Style/Images/Blaetter.png differ diff --git a/frontend/.env.template b/frontend/.env.template index 4e4a86d08..10c42daa9 100644 --- a/frontend/.env.template +++ b/frontend/.env.template @@ -9,5 +9,5 @@ META_KEYWORDS_DE=$META_KEYWORDS_DE META_KEYWORDS_EN=$META_KEYWORDS_EN META_AUTHOR=$META_AUTHOR GRAPHQL_URI=$GRAPHQL_URI -DEFAULT_PUBLISHER_ID=2896 +DEFAULT_PUBLISHER_ID=$DEFAULT_PUBLISHER_ID ADMIN_AUTH_URL=$ADMIN_AUTH_URL \ No newline at end of file diff --git a/frontend/package.json b/frontend/package.json index 6ccf37d09..28ac5bd95 100755 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,6 +1,6 @@ { "name": "bootstrap-vue-gradido-wallet", - "version": "1.6.6", + "version": "1.7.0", "private": true, "scripts": { "start": "node run/server.js", diff --git a/frontend/src/components/DecayInformations/DecayInformation-Decay.vue b/frontend/src/components/DecayInformations/DecayInformation-Decay.vue index 6abacd2b8..d8ba13738 100644 --- a/frontend/src/components/DecayInformations/DecayInformation-Decay.vue +++ b/frontend/src/components/DecayInformations/DecayInformation-Decay.vue @@ -13,7 +13,7 @@
- {{ (Number(balance) - Number(decay)) | GDD }} + {{ previousBookedBalance | GDD }} {{ decay | GDD }} {{ $t('math.equal') }} {{ balance | GDD }}
@@ -33,6 +33,10 @@ export default { type: String, required: true, }, + previousBookedBalance: { + type: String, + required: true, + }, }, } diff --git a/frontend/src/components/GddTransactionList.spec.js b/frontend/src/components/GddTransactionList.spec.js index 4205ca304..062523323 100644 --- a/frontend/src/components/GddTransactionList.spec.js +++ b/frontend/src/components/GddTransactionList.spec.js @@ -405,14 +405,22 @@ describe('GddTransactionList', () => { }) }) - describe.only('pagination buttons', () => { - it('shows the pagination buttons if transactionCount > pageSize', () => { - beforeEach(async () => { - await wrapper.setProps({ - transactionCount: 42, - }) - }) - expect(wrapper.find('div.pagination').exists()).toBe(true) + describe('pagination buttons', () => { + const transactions = Array.from({ length: 42 }, (_, idx) => { + return { + amount: '3.14', + balanceDate: '2021-04-29T17:26:40+00:00', + decay: {}, + memo: 'Kreiszahl PI', + linkedUser: { + firstName: 'Bibi', + lastName: 'Bloxberg', + __typename: 'User', + }, + id: idx + 1, + typeId: 'RECEIVE', + balance: '33.33', + } }) it('shows no pagination buttons if transactionCount < pageSize', () => { diff --git a/frontend/src/components/GddTransactionList.vue b/frontend/src/components/GddTransactionList.vue index 9e5cc8e8d..5908aa849 100644 --- a/frontend/src/components/GddTransactionList.vue +++ b/frontend/src/components/GddTransactionList.vue @@ -15,7 +15,11 @@
@@ -32,6 +37,7 @@ class="list-group-item" v-bind="transactions[index]" :decayStartBlock="decayStartBlock" + :previousBookedBalance="previousBookedBalance(index)" v-on="$listeners" /> @@ -41,6 +47,7 @@ class="list-group-item" v-bind="transactions[index]" :decayStartBlock="decayStartBlock" + :previousBookedBalance="previousBookedBalance(index)" v-on="$listeners" /> @@ -113,6 +120,10 @@ export default { }) window.scrollTo(0, 0) }, + previousBookedBalance(idx) { + if (this.transactions[idx + 1]) return this.transactions[idx + 1].balance + return '0' + }, }, watch: { currentPage() { diff --git a/frontend/src/components/Transactions/TransactionCreation.spec.js b/frontend/src/components/Transactions/TransactionCreation.spec.js index e1ea9e0b0..be0713ecf 100644 --- a/frontend/src/components/Transactions/TransactionCreation.spec.js +++ b/frontend/src/components/Transactions/TransactionCreation.spec.js @@ -31,6 +31,7 @@ const propsData = { memo: 'sadasd asdasdasdasdadadd da dad aad', typeId: 'DECAY', decayStartBlock: new Date('2021-05-13T17:46:31.000Z'), + previousBookedBalance: '43.56', } describe('TransactionCreation', () => { diff --git a/frontend/src/components/Transactions/TransactionCreation.vue b/frontend/src/components/Transactions/TransactionCreation.vue index f343a92ac..dce11307b 100644 --- a/frontend/src/components/Transactions/TransactionCreation.vue +++ b/frontend/src/components/Transactions/TransactionCreation.vue @@ -47,7 +47,7 @@ import DecayRow from '../TransactionRows/DecayRow' import DecayInformation from '../DecayInformations/DecayInformation' export default { - name: 'slot-creation', + name: 'TransactionCreation', components: { CollapseIcon, TypeIcon, @@ -86,6 +86,10 @@ export default { type: Date, required: true, }, + previousBookedBalance: { + type: String, + required: true, + }, }, data() { return { diff --git a/frontend/src/components/Transactions/TransactionDecay.spec.js b/frontend/src/components/Transactions/TransactionDecay.spec.js index 232e7f85a..8c5236b6e 100644 --- a/frontend/src/components/Transactions/TransactionDecay.spec.js +++ b/frontend/src/components/Transactions/TransactionDecay.spec.js @@ -31,6 +31,7 @@ const propsData = { memo: 'sadasd asdasdasdasdadadd da dad aad', typeId: 'DECAY', decayStartBlock: new Date('2021-05-13T17:46:31.000Z'), + previousBookedBalance: '43.56', } describe('TransactionDecay', () => { diff --git a/frontend/src/components/Transactions/TransactionDecay.vue b/frontend/src/components/Transactions/TransactionDecay.vue index 2f235502a..372705a4c 100644 --- a/frontend/src/components/Transactions/TransactionDecay.vue +++ b/frontend/src/components/Transactions/TransactionDecay.vue @@ -21,7 +21,11 @@
- + @@ -33,7 +37,7 @@ import AmountAndNameRow from '../TransactionRows/AmountAndNameRow' import DecayInformationDecay from '../DecayInformations/DecayInformation-Decay' export default { - name: 'slot-decay', + name: 'TransactionDecay', components: { CollapseIcon, TypeIcon, @@ -53,6 +57,10 @@ export default { type: Object, required: true, }, + previousBookedBalance: { + type: String, + required: true, + }, }, data() { return { diff --git a/frontend/src/components/Transactions/TransactionReceive.spec.js b/frontend/src/components/Transactions/TransactionReceive.spec.js index f5b27cf47..46cb57e06 100644 --- a/frontend/src/components/Transactions/TransactionReceive.spec.js +++ b/frontend/src/components/Transactions/TransactionReceive.spec.js @@ -31,6 +31,7 @@ const propsData = { memo: 'sadasd asdasdasdasdadadd da dad aad', typeId: 'RECEIVE', decayStartBlock: new Date('2021-05-13T17:46:31.000Z'), + previousBookedBalance: '43.56', } describe('TransactionReceive', () => { diff --git a/frontend/src/components/Transactions/TransactionReceive.vue b/frontend/src/components/Transactions/TransactionReceive.vue index f83c84e53..32e40f71e 100644 --- a/frontend/src/components/Transactions/TransactionReceive.vue +++ b/frontend/src/components/Transactions/TransactionReceive.vue @@ -53,7 +53,7 @@ import DecayRow from '../TransactionRows/DecayRow' import DecayInformation from '../DecayInformations/DecayInformation' export default { - name: 'slot-receive', + name: 'TransactionReceive', components: { CollapseIcon, TypeIcon, @@ -95,6 +95,10 @@ export default { type: Number, required: false, }, + previousBookedBalance: { + type: String, + required: true, + }, }, data() { return { diff --git a/frontend/src/components/Transactions/TransactionSend.spec.js b/frontend/src/components/Transactions/TransactionSend.spec.js index 632c0857a..410fcc733 100644 --- a/frontend/src/components/Transactions/TransactionSend.spec.js +++ b/frontend/src/components/Transactions/TransactionSend.spec.js @@ -31,6 +31,7 @@ const propsData = { memo: 'sadasd asdasdasdasdadadd da dad aad', typeId: 'SEND', decayStartBlock: new Date('2021-05-13T17:46:31.000Z'), + previousBookedBalance: '43.56', } describe('TransactionSend', () => { diff --git a/frontend/src/components/Transactions/TransactionSend.vue b/frontend/src/components/Transactions/TransactionSend.vue index 2f9ef54d2..a1ea3c88e 100644 --- a/frontend/src/components/Transactions/TransactionSend.vue +++ b/frontend/src/components/Transactions/TransactionSend.vue @@ -53,7 +53,7 @@ import DecayRow from '../TransactionRows/DecayRow' import DecayInformation from '../DecayInformations/DecayInformation' export default { - name: 'slot-send', + name: 'TransactionSend', components: { CollapseIcon, TypeIcon, @@ -96,6 +96,10 @@ export default { type: Number, required: false, }, + previousBookedBalance: { + type: String, + required: true, + }, }, data() { return { diff --git a/frontend/src/filters/amount.js b/frontend/src/filters/amount.js index ded1cceb7..97340117d 100644 --- a/frontend/src/filters/amount.js +++ b/frontend/src/filters/amount.js @@ -13,6 +13,6 @@ const amount = (value) => { const GDD = (value) => { value = amount(value) if (value === '') return '' - if (!value.match(/^− /)) value = '+ ' + value + if (!value.match(/^− /) && !value.match(/^0[.,]00$/)) value = '+ ' + value return value + ' GDD' } diff --git a/frontend/src/graphql/mutations.js b/frontend/src/graphql/mutations.js index 95c811f8d..3dbd8888e 100644 --- a/frontend/src/graphql/mutations.js +++ b/frontend/src/graphql/mutations.js @@ -18,6 +18,12 @@ export const setPassword = gql` } ` +export const forgotPassword = gql` + mutation($email: String!) { + forgotPassword(email: $email) + } +` + export const updateUserInfos = gql` mutation( $firstName: String diff --git a/frontend/src/graphql/queries.js b/frontend/src/graphql/queries.js index ecd8208b5..b8622ef2d 100644 --- a/frontend/src/graphql/queries.js +++ b/frontend/src/graphql/queries.js @@ -81,12 +81,6 @@ export const transactionsQuery = gql` } ` -export const sendResetPasswordEmail = gql` - query($email: String!) { - sendResetPasswordEmail(email: $email) - } -` - export const listGDTEntriesQuery = gql` query($currentPage: Int!, $pageSize: Int!) { listGDTEntries(currentPage: $currentPage, pageSize: $pageSize) { diff --git a/frontend/src/locales/de.json b/frontend/src/locales/de.json index e8994a2e9..d204688db 100644 --- a/frontend/src/locales/de.json +++ b/frontend/src/locales/de.json @@ -30,6 +30,7 @@ "delete": "Löschen", "em-dash": "—", "error": { + "email-already-sent": "Wir haben dir bereits eine E-Mail vor weniger als 10 Minuten geschickt.", "empty-transactionlist": "Es gab einen Fehler mit der Übermittlung der Anzahl deiner Transaktionen.", "error": "Fehler!", "no-account": "Leider konnten wir keinen Account mit diesen Daten finden.", diff --git a/frontend/src/locales/en.json b/frontend/src/locales/en.json index c586bbe46..dfe1c6d2b 100644 --- a/frontend/src/locales/en.json +++ b/frontend/src/locales/en.json @@ -30,6 +30,7 @@ "delete": "Delete", "em-dash": "—", "error": { + "email-already-sent": "We already sent you an email less than 10 minutes ago.", "empty-transactionlist": "There was an error with the transmission of the number of your transactions.", "error": "Error!", "no-account": "Unfortunately we could not find an account to the given data!", diff --git a/frontend/src/pages/ForgotPassword.spec.js b/frontend/src/pages/ForgotPassword.spec.js index a547f9cc1..dd703d7fc 100644 --- a/frontend/src/pages/ForgotPassword.spec.js +++ b/frontend/src/pages/ForgotPassword.spec.js @@ -2,6 +2,8 @@ import { mount, RouterLinkStub } from '@vue/test-utils' import flushPromises from 'flush-promises' import ForgotPassword from './ForgotPassword' +import { toastErrorSpy } from '@test/testSetup' + const mockAPIcall = jest.fn() const localVue = global.localVue @@ -21,7 +23,7 @@ const createMockObject = (comingFrom) => { push: mockRouterPush, }, $apollo: { - query: mockAPIcall, + mutate: mockAPIcall, }, $route: { params: { @@ -116,6 +118,10 @@ describe('ForgotPassword', () => { await flushPromises() }) + it('toasts a standard error message', () => { + expect(toastErrorSpy).toBeCalledWith('error.email-already-sent') + }) + it('pushes to "/thx/forgotPassword"', () => { expect(mockAPIcall).toBeCalledWith( expect.objectContaining({ diff --git a/frontend/src/pages/ForgotPassword.vue b/frontend/src/pages/ForgotPassword.vue index 81121fbe7..580a0ed97 100644 --- a/frontend/src/pages/ForgotPassword.vue +++ b/frontend/src/pages/ForgotPassword.vue @@ -39,7 +39,7 @@