From 62d0ed1858cf2646b2d896b7b08aadba77689870 Mon Sep 17 00:00:00 2001 From: Alina Beck Date: Tue, 5 Nov 2019 17:34:19 +0300 Subject: [PATCH 01/51] update contribution guidelines --- CONTRIBUTING.md | 140 +++++++++++++++++++++++++++--------------------- 1 file changed, 80 insertions(+), 60 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1475df0de..afc5215b3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,79 +1,99 @@ # CONTRIBUTING -Thanks so much for thinking of contributing to the Human Connection project, we really appreciate it! :-\) +Thank you so much for thinking of contributing to the Human Connection project! It's awesome you're here, we really appreciate it. :-\) ## Getting Set Up -Instructions for how to install all the necessary software can be found in our [documentation](https://docs.human-connection.org/human-connection/). +Instructions for how to install all the necessary software and some code guidelines can be found in our [documentation](https://docs.human-connection.org/human-connection/). -We recommend that new folks should ideally work together with an existing developer. Please join our [discord](https://discord.gg/6ub73U3) instance to chat with developers or just ask them in tickets in [Zenhub](https://app.zenhub.com/workspaces/human-connection-nitro-5c0154ecc699f60fc92cf11f/boards?repos=152252353): +To get you started we recommend that you join forces with a regular contributor. Please join [our discord instance](https://discord.gg/6ub73U3) to chat with developers or just get in touch directly on an issue on either [Github](https://github.com/Human-Connection/Human-Connection/issues) or [Zenhub](https://app.zenhub.com/workspaces/human-connection-nitro-5c0154ecc699f60fc92cf11f/boards?repos=152252353): ![](https://dl.dropbox.com/s/vbmcihkduy9dhko/Screenshot%202019-01-03%2015.50.11.png?dl=0) -Here are some general notes on our development flow: +We also have regular pair programming sessions that you are very welcome to join! We feel this is often the best way to get to know both the project and the team. Most developers are also available for spontaneous sessions if the times listed below don't work for you – just ping us on discord. -## Development +## Development Flow -* Currently operating in two week sprints -* We are using ZenHub to coordinate - * estimating time per issue is the crucial feature of [Zenhub](https://app.zenhub.com/workspaces/human-connection-nitro-5c0154ecc699f60fc92cf11f) that Github does not have - * "up-for-grabs" links to [Github project](https://github.com/Human-Connection/Human-Connection/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22) - * ordering on ZenHub not necessarily reflected on github projects -* AgileVentures run open pairing sessions at 10:30am UTC each week on Tuesdays and Thursdays -* Core team - * all the people who are hired by HC non-profit corporation - * you can Meet-the-team [every two weeks in German](https://human-connection.org/veranstaltungen/) and [every month in English](https://human-connection.org/en/events/). - * 9 people - * 2 core developers \(Robert [@roschaefer](https://github.com/roschaefer) and Greg [@appinteractive](https://github.com/appinteractive)\) - * 3 marketeers Jasi, Dennis and Sensi - * Hardy doing business development - * Martin head of IT and previously data protection officer - * Victor doing accounting and controlling - * Nicolas is the community manager \(reviews content in the network\) reflects community opinion back to the core team -* when can folks pair with Robert - * 10am UTC until 5pm UTC every working day +We operate in two week sprints that are planned, estimated and prioritised on [Zenhub](https://app.zenhub.com/workspaces/human-connection-nitro-5c0154ecc699f60fc92cf11f). All issues are also linked to and synced with [Github](https://github.com/Human-Connection/Human-Connection/issues). Look for the `good first issue` label if you're not sure where to start! + +We try to discuss all questions directly related to a feature or bug in the respective issue, in order to preserve it for the future and for other developers. We use discord for real-time communication. + +This is how we solve bugs and implement features, step by step: +1. We find an issue we want to work on, usually during the sprint planning but as an open source contributor this can happen at any time. +2. We communicate with the team to see if the issue is still available. (When you comment on an issue but don't get an answer there within 1-2 days try to mention @Human-Connection/hc-dev-team to make sure we check in.) +3. We make sure we understand the issue in detail – what problem is it solving and how should it be implemented? +4. We assign ourselves to the issue and move it to `In Progress` on [Zenhub](https://app.zenhub.com/workspaces/human-connection-nitro-5c0154ecc699f60fc92cf11f). +5. We start working on it in a `new branch` and open a `pull request` prefixed with `[WIP]` (work in progress) to which we regularly push our changes. +6. When questions come up we clarify them with the team (directly in the issue on Github). +7. When we are happy with our work and our PR is passing all tests we remove the `[WIP]` from the PR description and ask for reviews (if you're not sure who to ask there is @Human-Connection/hc-dev-team which pings all core developers). +8. We then incorporate the suggestions from the reviews into our work and once it has been approved it can be merged into master! + +Every pull request needs to: +* fix an issue (if there is something you want to work on but there is no issue for it, create on first and discuss it with the team) +* include tests for the code that is added or changed +* pass all tests (linter, backend, frontend, end-to-end) +* be approved by at least 1 developer who is not the owner of the PR (when more than 10 files were changed it needs 2 approvals) + +## The Team + +There are many volunteers all around the world helping us build this network and without their contributions we wouldn't be where we are today. Big thank you to all of you! + +You can see the core team behind Human Connection [on our website](https://human-connection.org/en/the-team/). On Github you will mostly run into our developers: +* Robert (@roschaefer) +* Matt (@mattwr18) +* Wolle (@Tirokk) +* Alex (@ogerly) +* Alina (@alina-beck) +* Martin (@datenbrei), our head of IT +* and sometimes Dennis (@DennisHack), the founder of Human Connection + +## Meetings and Pair Programming Sessions + +Daily standup +* every Monday–Friday 10:45 UTC +* in the discord `Conference Room` +* all contributors welcome! +* everybody shares what they are working on and asks for help if they are blocked + +Regular pair programming sessions +* every Monday, Wednesday and Thursday 14:00 UTC +* the link will be posted in the [discord chat](https://discord.gg/6ub73U3) and on the [Agile Ventures website](https://www.agileventures.org/events?utf8=%E2%9C%93&project_id=220&commit=Filter+by+Project) +* all contributors welcome! +* we team up and work on an issue together (often using Visual Studio live sharing sessions) + +Developer's Community Meeting +* every Thursday 12:00 UTC +* the link will be posted in the [discord chat](https://discord.gg/6ub73U3) and on the [Agile Ventures website](https://www.agileventures.org/events?utf8=%E2%9C%93&project_id=220&commit=Filter+by+Project) +* all contributors welcome! +* ??? + +Meet the team +* every Monday 20:00 UTC (at the moment only in German) +* via this [zoom link](https://zoom.us/j/936943532) +* all contributors and users of the network welcome! +* users of the network chat with the Human Connection team and discuss current questions and issues + +Sprint planning +* bi-weekly on Tuesday 12:00 UTC +* via this [zoom link](https://zoom.us/j/7743582385) +* all contributors welcome (recommended for those who want to work on an issue in this sprint) +* we select and prioritise the issues we will work on in the following two weeks + +Sprint retrospective +* bi-weekly on Monday 12:00 UTC +* via this [zoom link](https://zoom.us/j/7743582385) +* all contributors welcome (most interesting for those who participated in the sprint) +* we review the past sprint and talk about what went well and what we could improve ## Philosophy We practise [collective code ownership](http://www.extremeprogramming.org/rules/collective.html) rather than strong code ownership, which means that: - -* anyone can start working on anyone elses code -* we avoid blocking because someone else isn't working on something -* however it's sometimes good to leave something in order to create successful education experience +* developers can make contributions to other people's PRs (after checking in with them) +* we avoid blocking because someone else isn't working, so we sometimes take over PRs from other developers * everyone should always push their code to branches so others can see it -Everyone feel free to request merges or answers to issues from the project managers +We believe in open source contributions as a learning experience – everyone is welcome to join our team of volunteers and to contribute to the project, no matter their background or level of experience. -But what do we do when waiting for merge into master \(wanting to keep PRs small\) --> Robert recommends creating a pull request for each step +We use pair programming sessions as a tool for knowledge sharing. We can learn a lot from each other and only by sharing what we know and overcoming challenges together can we grow as a team and truly own this project collectively. -* programming is also about thinking about other people - empathy for your co-workers - * but what about when you are waiting for merge? - * solutions - * 1\) put 2nd PR into branch that the first PR is hitting - but requires update after merging - * 2\) prefer to leave existing PR until it can be reviewed, and instead go and work on some other part of the codebase that is not impacted by the first PR - -### Code Review -* Github setting in place - at least one review is required to merge - - in principle anyone (who is not the PR owner) can review - - but often it will be the core developers (Robert, Wolfgang, Matt, Alina, Alex) - - once there is a review, and presuming no requested changes, PR opener can merge - -* CI/tests - - the CI needs to pass - - linting (yarn lint --fix) - - tests (unit, feature) (backend, frontend) - - codecoverage - -## Notes - -question: when you want to pick a task - \(find out priority\) - is it in discord? is it in AV slack? --> Robert says you can always ask in discord - group channels are the best - -Robert shares: [Zenhub board](https://app.zenhub.com/workspaces/nitro-embed-5c0154ecc699f60fc92cf11f/boards?repos=112590397,152252353,152252578,157710732,163305928) Robert says the order of tickets are preserved in ZenHub and reflect their priority \(most important at the top\) and so check out the current milestones - -Matt - question about who can work on [ticket 100](https://app.zenhub.com/workspaces/nitro-embed-5c0154ecc699f60fc92cf11f/issues/human-connection/human-connection/100) --> Robert - in rare occasions it might be exclusive to someone with admin permissions Robert: notes greg just pushed this today: [https://github.com/Human-Connection/Nitro-Deployment](https://github.com/Human-Connection/Nitro-Deployment) - -Matt makes point that new stories will have to be taken off the "New Issues" and Robert says that's fine, if you don't like the first one, then you can take the next one. Volunteeers have no commitment except their own self development and their awesomeness by contributing to free and open-source software projects. - -Robert notes that everyone is invited to join the kickoff meetings - -Robert - difference between "important" \(creates a lot of value\) and "beginner friendly" \(easy to implement\) +As a volunteeer you have no commitment except your own self development and your awesomeness by contributing to this free and open-source software project. Cheers to you! From 719c9786031547f7722b4602983c1c387d2f2bbe Mon Sep 17 00:00:00 2001 From: Alina Beck Date: Mon, 11 Nov 2019 10:13:10 +0300 Subject: [PATCH 02/51] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Robert Schäfer --- CONTRIBUTING.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index afc5215b3..148b74d8c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,7 +6,7 @@ Thank you so much for thinking of contributing to the Human Connection project! Instructions for how to install all the necessary software and some code guidelines can be found in our [documentation](https://docs.human-connection.org/human-connection/). -To get you started we recommend that you join forces with a regular contributor. Please join [our discord instance](https://discord.gg/6ub73U3) to chat with developers or just get in touch directly on an issue on either [Github](https://github.com/Human-Connection/Human-Connection/issues) or [Zenhub](https://app.zenhub.com/workspaces/human-connection-nitro-5c0154ecc699f60fc92cf11f/boards?repos=152252353): +To get you started we recommend that you join forces with a regular contributor. Please join [our discord instance](https://human-connection.org/discord) to chat with developers or just get in touch directly on an issue on either [Github](https://github.com/Human-Connection/Human-Connection/issues) or [Zenhub](https://app.zenhub.com/workspaces/human-connection-nitro-5c0154ecc699f60fc92cf11f/boards?repos=152252353): ![](https://dl.dropbox.com/s/vbmcihkduy9dhko/Screenshot%202019-01-03%2015.50.11.png?dl=0) @@ -29,7 +29,7 @@ This is how we solve bugs and implement features, step by step: 8. We then incorporate the suggestions from the reviews into our work and once it has been approved it can be merged into master! Every pull request needs to: -* fix an issue (if there is something you want to work on but there is no issue for it, create on first and discuss it with the team) +* fix an issue (if there is something you want to work on but there is no issue for it, create one first and discuss it with the team) * include tests for the code that is added or changed * pass all tests (linter, backend, frontend, end-to-end) * be approved by at least 1 developer who is not the owner of the PR (when more than 10 files were changed it needs 2 approvals) @@ -61,14 +61,14 @@ Regular pair programming sessions * all contributors welcome! * we team up and work on an issue together (often using Visual Studio live sharing sessions) -Developer's Community Meeting +Open-Source Community Meeting * every Thursday 12:00 UTC * the link will be posted in the [discord chat](https://discord.gg/6ub73U3) and on the [Agile Ventures website](https://www.agileventures.org/events?utf8=%E2%9C%93&project_id=220&commit=Filter+by+Project) * all contributors welcome! -* ??? Meet the team * every Monday 20:00 UTC (at the moment only in German) +* details here https://human-connection.org/veranstaltungen/ * via this [zoom link](https://zoom.us/j/936943532) * all contributors and users of the network welcome! * users of the network chat with the Human Connection team and discuss current questions and issues From ab762c9b51334add6c013b5928de6a8a9c85ac0c Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 11 Nov 2019 07:57:14 +0000 Subject: [PATCH 03/51] build(deps-dev): bump cypress from 3.6.0 to 3.6.1 Bumps [cypress](https://github.com/cypress-io/cypress) from 3.6.0 to 3.6.1. - [Release notes](https://github.com/cypress-io/cypress/releases) - [Commits](https://github.com/cypress-io/cypress/compare/v3.6.0...v3.6.1) Signed-off-by: dependabot-preview[bot] --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index ad3777616..842321382 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "bcryptjs": "^2.4.3", "codecov": "^3.6.1", "cross-env": "^6.0.3", - "cypress": "^3.6.0", + "cypress": "^3.6.1", "cypress-cucumber-preprocessor": "^1.16.2", "cypress-file-upload": "^3.4.0", "cypress-plugin-retries": "^1.4.0", diff --git a/yarn.lock b/yarn.lock index fbbb89f5d..f6aeafce0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1934,10 +1934,10 @@ cypress-plugin-retries@^1.4.0: resolved "https://registry.yarnpkg.com/cypress-plugin-retries/-/cypress-plugin-retries-1.4.0.tgz#30477294a22e368c874d50dc282e657906080955" integrity sha512-Pudna9+dn0wp3flUVWt1ttn6hKTnD1MIBUSznYkw+uRv3JPNJhxHIv9cfxrZmig49/R1fIyGBVNORchtnFedEw== -cypress@^3.6.0: - version "3.6.0" - resolved "https://registry.yarnpkg.com/cypress/-/cypress-3.6.0.tgz#b7c88c169970aeb74a00182a1e8dc43a355d9eea" - integrity sha512-ODhbOrH1XZx0DUoYmJSvOSbEQjycNOpFYe7jOnHkT1+sdsn2+uqwAjZ1x982q3H4R/5iZjpSd50gd/iw2bofzg== +cypress@^3.6.1: + version "3.6.1" + resolved "https://registry.yarnpkg.com/cypress/-/cypress-3.6.1.tgz#4420957923879f60b7a5146ccbf81841a149b653" + integrity sha512-6n0oqENdz/oQ7EJ6IgESNb2M7Bo/70qX9jSJsAziJTC3kICfEMmJUlrAnP9bn+ut24MlXQST5nRXhUP5nRIx6A== dependencies: "@cypress/listr-verbose-renderer" "0.4.1" "@cypress/xvfb" "1.2.4" From 98a60168c1fcb1ea1739d697bc5ba04315daf109 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 11 Nov 2019 07:58:17 +0000 Subject: [PATCH 04/51] build(deps): bump date-fns from 2.6.0 to 2.7.0 in /webapp Bumps [date-fns](https://github.com/date-fns/date-fns) from 2.6.0 to 2.7.0. - [Release notes](https://github.com/date-fns/date-fns/releases) - [Changelog](https://github.com/date-fns/date-fns/blob/master/CHANGELOG.md) - [Commits](https://github.com/date-fns/date-fns/compare/v2.6.0...v2.7.0) Signed-off-by: dependabot-preview[bot] --- webapp/package.json | 2 +- webapp/yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/webapp/package.json b/webapp/package.json index 99ffadb68..1434e47bb 100644 --- a/webapp/package.json +++ b/webapp/package.json @@ -65,7 +65,7 @@ "cookie-universal-nuxt": "~2.0.18", "cropperjs": "^1.5.5", "cross-env": "~6.0.3", - "date-fns": "2.6.0", + "date-fns": "2.7.0", "express": "~4.17.1", "graphql": "~14.5.8", "jsonwebtoken": "~8.5.1", diff --git a/webapp/yarn.lock b/webapp/yarn.lock index ba26fb974..981b3775e 100644 --- a/webapp/yarn.lock +++ b/webapp/yarn.lock @@ -6379,10 +6379,10 @@ data-urls@^1.0.0: whatwg-mimetype "^2.2.0" whatwg-url "^7.0.0" -date-fns@2.6.0: - version "2.6.0" - resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.6.0.tgz#a5bc82e6a4c3995ae124b0ba1a71aec7b8cbd666" - integrity sha512-F55YxqRdEfP/eYQmQjLN798v0AwLjmZ8nMBjdQvNwEE3N/zWVrlkkqT+9seBlPlsbkybG4JmWg3Ee3dIV9BcGQ== +date-fns@2.7.0: + version "2.7.0" + resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.7.0.tgz#8271d943cc4636a1f27698f1b8d6a9f1ceb74026" + integrity sha512-wxYp2PGoUDN5ZEACc61aOtYFvSsJUylIvCjpjDOqM1UDaKIIuMJ9fAnMYFHV3TQaDpfTVxhwNK/GiCaHKuemTA== date-fns@^1.27.2: version "1.30.1" From 88436c3cf7cfdfbc9e9b61dfee7e393297eeef36 Mon Sep 17 00:00:00 2001 From: Alina Beck Date: Mon, 11 Nov 2019 12:05:09 +0300 Subject: [PATCH 05/51] add donation info with hardcoded values --- webapp/pages/index.vue | 65 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 62 insertions(+), 3 deletions(-) diff --git a/webapp/pages/index.vue b/webapp/pages/index.vue index 91e2de55f..cdc95933c 100644 --- a/webapp/pages/index.vue +++ b/webapp/pages/index.vue @@ -4,7 +4,18 @@ - + +
+
+

Donations for November

+
+
+ 500 of 15.000 € +
+ + Donate now + +
From 768f5f66315783eaaca16de03bf93dd456c8ac07 Mon Sep 17 00:00:00 2001 From: Alina Beck Date: Mon, 11 Nov 2019 12:31:10 +0300 Subject: [PATCH 06/51] extract progress bar into separate component --- webapp/components/ProgressBar/ProgressBar.vue | 76 +++++++++++++++++++ webapp/pages/index.vue | 53 +++---------- 2 files changed, 85 insertions(+), 44 deletions(-) create mode 100644 webapp/components/ProgressBar/ProgressBar.vue diff --git a/webapp/components/ProgressBar/ProgressBar.vue b/webapp/components/ProgressBar/ProgressBar.vue new file mode 100644 index 000000000..93030c47b --- /dev/null +++ b/webapp/components/ProgressBar/ProgressBar.vue @@ -0,0 +1,76 @@ + + + + + diff --git a/webapp/pages/index.vue b/webapp/pages/index.vue index cdc95933c..d9944a5dd 100644 --- a/webapp/pages/index.vue +++ b/webapp/pages/index.vue @@ -6,12 +6,13 @@
-
-

Donations for November

-
-
- 500 of 15.000 € -
+ + Donate now @@ -74,6 +75,7 @@ import HcPostCard from '~/components/PostCard/PostCard.vue' import HcLoadMore from '~/components/LoadMore.vue' import MasonryGrid from '~/components/MasonryGrid/MasonryGrid.vue' import MasonryGridItem from '~/components/MasonryGrid/MasonryGridItem.vue' +import ProgressBar from '~/components/ProgressBar/ProgressBar.vue' import { mapGetters, mapMutations } from 'vuex' import { filterPosts } from '~/graphql/PostQuery.js' import PostMutations from '~/graphql/PostMutations' @@ -86,6 +88,7 @@ export default { HcEmpty, MasonryGrid, MasonryGridItem, + ProgressBar, }, data() { const { hashtag = null } = this.$route.query @@ -286,42 +289,4 @@ export default { align-items: flex-end; height: 100%; } - -.progress-bar { - position: relative; - height: 100%; - width: 240px; - margin-right: $space-x-small; -} - -.progress-bar__title { - position: absolute; - top: -2px; - left: $space-xx-small; - margin: 0; -} - -.progress-bar__goal { - position: absolute; - bottom: 0; - left: 0; - height: 37.5px; // styleguide-button-size - background-color: $color-neutral-100; - border-radius: $border-radius-base; -} - -.progress-bar__progress { - position: absolute; - bottom: 1px; - left: 0; - height: 35.5px; // styleguide-button-size - background-color: $color-yellow; - border-radius: $border-radius-base; -} - -.progress-bar__label { - position: absolute; - top: 50%; - left: $space-xx-small; -} From f6de44b337a0395ecb345092a4506cbc0045303a Mon Sep 17 00:00:00 2001 From: Alina Beck Date: Mon, 11 Nov 2019 13:06:09 +0300 Subject: [PATCH 07/51] place donation info in separate component compute title and label according to selected locale and donation values --- .../components/DonationInfo/DonationInfo.vue | 50 +++++++++++++++++++ webapp/locales/de.json | 9 +++- webapp/locales/en.json | 15 ++++-- webapp/pages/index.vue | 23 ++------- 4 files changed, 70 insertions(+), 27 deletions(-) create mode 100644 webapp/components/DonationInfo/DonationInfo.vue diff --git a/webapp/components/DonationInfo/DonationInfo.vue b/webapp/components/DonationInfo/DonationInfo.vue new file mode 100644 index 000000000..cbcc0571e --- /dev/null +++ b/webapp/components/DonationInfo/DonationInfo.vue @@ -0,0 +1,50 @@ + + + + + diff --git a/webapp/locales/de.json b/webapp/locales/de.json index 34cd948ed..3aaab5544 100644 --- a/webapp/locales/de.json +++ b/webapp/locales/de.json @@ -62,6 +62,11 @@ } } }, + "donations": { + "donations-for": "Spenden für", + "donate-now": "Jetzt spenden", + "amount-of-total": "{amount} von {total} € erreicht" + }, "maintenance": { "title": "Human Connection befindet sich in der Wartung", "explanation": "Zurzeit führen wir einige geplante Wartungsarbeiten durch, bitte versuch es später erneut.", @@ -674,7 +679,7 @@ "terms-of-service": { "title": "Nutzungsbedingungen", "description": "Die folgenden Nutzungsbedingungen sind Basis für die Nutzung unseres Netzwerkes. Beim Registrieren musst Du sie anerkennen und wir werden Dich auch später über ggf. stattfindende Änderungen informieren. Das Human Connection Netzwerk wird in Deutschland betrieben und unterliegt daher deutschem Recht. Gerichtsstand ist Kirchheim / Teck. Zu Details schau in unser Impressum: https://human-connection.org/impressum " - }, + }, "use-and-license" : { "title": "Nutzung und Lizenz", "description": "Sind Inhalte, die Du bei uns einstellst, durch Rechte am geistigen Eigentum geschützt, erteilst Du uns eine nicht-exklusive, übertragbare, unterlizenzierbare und weltweite Lizenz für die Nutzung dieser Inhalte für die Bereitstellung in unserem Netzwerk. Diese Lizenz endet, sobald Du Deine Inhalte oder Deinen ganzen Account löscht. Bedenke, dass andere Deine Inhalte weiter teilen können und wir diese nicht löschen können." @@ -702,6 +707,6 @@ "addition" : { "title": "Zusätzliche machen wir regelmäßig Veranstaltungen, wo Du auch Eindrücke wiedergeben und Fragen stellen kannst. Du findest eine aktuelle Übersicht hier:", "description": " https://human-connection.org/veranstaltungen/ " - } + } } } diff --git a/webapp/locales/en.json b/webapp/locales/en.json index d3b4e8edc..7c8ddbe4c 100644 --- a/webapp/locales/en.json +++ b/webapp/locales/en.json @@ -63,6 +63,11 @@ } } }, + "donations": { + "donations-for": "Donations for", + "donate-now": "Donate now", + "amount-of-total": "{amount} of {total} € collected" + }, "maintenance": { "title": "Human Connection is under maintenance", "explanation": "At the moment we are doing some scheduled maintenance, please try again later.", @@ -675,7 +680,7 @@ "terms-of-service": { "title": "Terms of Service", "description": "The following terms of use form the basis for the use of our network. When you register, you must accept them and we will inform you later about any changes that may take place. The Human Connection Network is operated in Germany and is therefore subject to German law. Place of jurisdiction is Kirchheim / Teck. For details see our imprint: https://human-connection.org/imprint " - }, + }, "use-and-license" : { "title": "Use and License", "description": "If any content you post to us is protected by intellectual property rights, you grant us a non-exclusive, transferable, sublicensable, worldwide license to use such content for posting to our network. This license expires when you delete your content or your entire account. Remember that others may share your content and we cannot delete it." @@ -703,10 +708,10 @@ "addition" : { "title": "In addition, we regularly hold events where you can also share your impressions and ask questions. You can find a current overview here:", "description": " https://human-connection.org/events/ " - } + } } } - - - + + + diff --git a/webapp/pages/index.vue b/webapp/pages/index.vue index d9944a5dd..7105d8c74 100644 --- a/webapp/pages/index.vue +++ b/webapp/pages/index.vue @@ -5,18 +5,7 @@ - +
From d15a1a8105f178cd77bc58168ee90320e7a92db2 Mon Sep 17 00:00:00 2001 From: Alina Beck Date: Mon, 11 Nov 2019 15:57:29 +0300 Subject: [PATCH 13/51] style donations info for mobile --- webapp/components/DonationInfo/DonationInfo.vue | 7 +++++++ webapp/components/ProgressBar/ProgressBar.vue | 15 ++++++++++++++- webapp/pages/index.vue | 9 +++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/webapp/components/DonationInfo/DonationInfo.vue b/webapp/components/DonationInfo/DonationInfo.vue index cbcc0571e..f05258341 100644 --- a/webapp/components/DonationInfo/DonationInfo.vue +++ b/webapp/components/DonationInfo/DonationInfo.vue @@ -46,5 +46,12 @@ export default { display: flex; align-items: flex-end; height: 100%; + + @media (max-width: 546px) { + width: 100%; + height: 50%; + justify-content: flex-end; + margin-bottom: $space-x-small; + } } diff --git a/webapp/components/ProgressBar/ProgressBar.vue b/webapp/components/ProgressBar/ProgressBar.vue index 93030c47b..6041bd359 100644 --- a/webapp/components/ProgressBar/ProgressBar.vue +++ b/webapp/components/ProgressBar/ProgressBar.vue @@ -1,8 +1,8 @@ @@ -39,6 +39,15 @@ export default { height: 100%; width: 240px; margin-right: $space-x-small; + + @media (max-width: 680px) { + width: 180px; + } + + @media (max-width: 546px) { + flex-basis: 50%; + flex-grow: 1; + } } .progress-bar__title { @@ -46,6 +55,10 @@ export default { top: -2px; left: $space-xx-small; margin: 0; + + @media (max-width: 546px) { + top: $space-xx-small; + } } .progress-bar__goal { diff --git a/webapp/pages/index.vue b/webapp/pages/index.vue index 7105d8c74..d1ff9a2ad 100644 --- a/webapp/pages/index.vue +++ b/webapp/pages/index.vue @@ -265,11 +265,20 @@ export default { .sorting-dropdown { width: 250px; position: relative; + + @media (max-width: 680px) { + width: 180px; + } } .top-info-bar { display: flex; justify-content: space-between; align-items: flex-end; + + @media (max-width: 546px) { + grid-row-end: span 3 !important; + flex-direction: column; + } } From 61cb7dd7c2cc230f99eb4d8ebacc131acbf5d262 Mon Sep 17 00:00:00 2001 From: Alina Beck Date: Mon, 11 Nov 2019 16:28:39 +0300 Subject: [PATCH 14/51] add ProgressBar tests --- .../ProgressBar/ProgressBar.spec.js | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 webapp/components/ProgressBar/ProgressBar.spec.js diff --git a/webapp/components/ProgressBar/ProgressBar.spec.js b/webapp/components/ProgressBar/ProgressBar.spec.js new file mode 100644 index 000000000..6fb6f1666 --- /dev/null +++ b/webapp/components/ProgressBar/ProgressBar.spec.js @@ -0,0 +1,65 @@ +import { mount } from '@vue/test-utils' +import ProgressBar from './ProgressBar' + +describe('ProgessBar.vue', () => { + let propsData + + beforeEach(() => { + propsData = { + goal: 50000, + progress: 10000, + } + }) + + const Wrapper = () => mount(ProgressBar, { propsData }) + + describe('given only goal and progress', () => { + it('renders no title', () => { + expect( + Wrapper() + .find('.progress-bar__title') + .exists(), + ).toBe(false) + }) + + it('renders no label', () => { + expect( + Wrapper() + .find('.progress-bar__label') + .exists(), + ).toBe(false) + }) + + it('calculates the progress bar width as a percentage of the goal', () => { + expect(Wrapper().vm.progressBarWidth).toBe('width: 20%;') + }) + }) + + describe('given a title', () => { + beforeEach(() => { + propsData.title = 'This is progress' + }) + + it('renders the title', () => { + expect( + Wrapper() + .find('.progress-bar__title') + .text(), + ).toBe('This is progress') + }) + }) + + describe('given a label', () => { + beforeEach(() => { + propsData.label = 'Going well' + }) + + it('renders the label', () => { + expect( + Wrapper() + .find('.progress-bar__label') + .text(), + ).toBe('Going well') + }) + }) +}) From b8e428bf29976cce8f73de2469069142ae759a88 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 11 Nov 2019 13:32:26 +0000 Subject: [PATCH 15/51] build(deps-dev): bump @storybook/addon-a11y in /webapp Bumps [@storybook/addon-a11y](https://github.com/storybookjs/storybook/tree/HEAD/addons/a11y) from 5.2.5 to 5.2.6. - [Release notes](https://github.com/storybookjs/storybook/releases) - [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md) - [Commits](https://github.com/storybookjs/storybook/commits/v5.2.6/addons/a11y) Signed-off-by: dependabot-preview[bot] --- webapp/package.json | 2 +- webapp/yarn.lock | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/webapp/package.json b/webapp/package.json index 613e9f9d0..07117485e 100644 --- a/webapp/package.json +++ b/webapp/package.json @@ -95,7 +95,7 @@ "@babel/core": "~7.7.2", "@babel/plugin-syntax-dynamic-import": "^7.2.0", "@babel/preset-env": "~7.7.1", - "@storybook/addon-a11y": "^5.2.5", + "@storybook/addon-a11y": "^5.2.6", "@storybook/addon-actions": "^5.2.5", "@storybook/addon-notes": "^5.2.5", "@storybook/vue": "~5.2.5", diff --git a/webapp/yarn.lock b/webapp/yarn.lock index 2df6e7237..0bcaf53ca 100644 --- a/webapp/yarn.lock +++ b/webapp/yarn.lock @@ -2070,17 +2070,17 @@ source-map-support "^0.5.7" tslib "^1.9.3" -"@storybook/addon-a11y@^5.2.5": - version "5.2.5" - resolved "https://registry.yarnpkg.com/@storybook/addon-a11y/-/addon-a11y-5.2.5.tgz#e593b2b15573eb7d8ca9bb15130622af5fa82475" - integrity sha512-T7uK5B4Cp+bkC5BGVxSeSzXB8/AZA5uYPi8xqf6KQYizhrTsXZBrNwx2Lkbq1QP4Pcs8T2y3EG5/GikMIGoCPw== +"@storybook/addon-a11y@^5.2.6": + version "5.2.6" + resolved "https://registry.yarnpkg.com/@storybook/addon-a11y/-/addon-a11y-5.2.6.tgz#8aa603cac1eaa92ef53c51b842e502101dc5d074" + integrity sha512-LlY5TaZNDxl5MP8u2qCJmg8GhvbtYGXmWJv0GMof0cw1fuLMEBHKAa5vK2oWQdPjGpoSAYN80dqn3TyCqsoGnQ== dependencies: - "@storybook/addons" "5.2.5" - "@storybook/api" "5.2.5" - "@storybook/client-logger" "5.2.5" - "@storybook/components" "5.2.5" - "@storybook/core-events" "5.2.5" - "@storybook/theming" "5.2.5" + "@storybook/addons" "5.2.6" + "@storybook/api" "5.2.6" + "@storybook/client-logger" "5.2.6" + "@storybook/components" "5.2.6" + "@storybook/core-events" "5.2.6" + "@storybook/theming" "5.2.6" axe-core "^3.3.2" common-tags "^1.8.0" core-js "^3.0.1" From 64ff54729e78ae1e6d6af3383b8fe678950b2d8e Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 11 Nov 2019 13:32:46 +0000 Subject: [PATCH 16/51] build(deps-dev): bump @storybook/vue from 5.2.5 to 5.2.6 in /webapp Bumps [@storybook/vue](https://github.com/storybookjs/storybook/tree/HEAD/app/vue) from 5.2.5 to 5.2.6. - [Release notes](https://github.com/storybookjs/storybook/releases) - [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md) - [Commits](https://github.com/storybookjs/storybook/commits/v5.2.6/app/vue) Signed-off-by: dependabot-preview[bot] --- webapp/package.json | 2 +- webapp/yarn.lock | 133 ++++++++++++++++++++++---------------------- 2 files changed, 69 insertions(+), 66 deletions(-) diff --git a/webapp/package.json b/webapp/package.json index 613e9f9d0..424d78616 100644 --- a/webapp/package.json +++ b/webapp/package.json @@ -98,7 +98,7 @@ "@storybook/addon-a11y": "^5.2.5", "@storybook/addon-actions": "^5.2.5", "@storybook/addon-notes": "^5.2.5", - "@storybook/vue": "~5.2.5", + "@storybook/vue": "~5.2.6", "@vue/cli-shared-utils": "~4.0.5", "@vue/eslint-config-prettier": "~5.0.0", "@vue/server-test-utils": "~1.0.0-beta.29", diff --git a/webapp/yarn.lock b/webapp/yarn.lock index 2df6e7237..dfb56d91e 100644 --- a/webapp/yarn.lock +++ b/webapp/yarn.lock @@ -2250,6 +2250,17 @@ global "^4.3.2" telejson "^3.0.2" +"@storybook/channel-postmessage@5.2.6": + version "5.2.6" + resolved "https://registry.yarnpkg.com/@storybook/channel-postmessage/-/channel-postmessage-5.2.6.tgz#60aaef0e80300c9812a571ca3ce0f28e2c404f04" + integrity sha512-y+63wWiEc/Q4s4MZ3KJ//5A8j5VLufxuLvPxwv9FuS4z8lmN0fqeGJn857qIlFGbZhzsQaoRdmfsCQpBBgUneg== + dependencies: + "@storybook/channels" "5.2.6" + "@storybook/client-logger" "5.2.6" + core-js "^3.0.1" + global "^4.3.2" + telejson "^3.0.2" + "@storybook/channels@5.1.9": version "5.1.9" resolved "https://registry.yarnpkg.com/@storybook/channels/-/channels-5.1.9.tgz#003cfca0b9f1ba6cf47ce68304aedd71bdb55e74" @@ -2292,6 +2303,27 @@ qs "^6.6.0" util-deprecate "^1.0.2" +"@storybook/client-api@5.2.6": + version "5.2.6" + resolved "https://registry.yarnpkg.com/@storybook/client-api/-/client-api-5.2.6.tgz#5760cb4302d82ce9210a63f3f55b1e05f04759c1" + integrity sha512-upynf4ER2fkThNnE+mBlfRFFJxTiOh60fho1ODFcBun9BbvRD2wOHLvw7+WigIhb99HM20vk8f2dhv3I5Udzlg== + dependencies: + "@storybook/addons" "5.2.6" + "@storybook/channel-postmessage" "5.2.6" + "@storybook/channels" "5.2.6" + "@storybook/client-logger" "5.2.6" + "@storybook/core-events" "5.2.6" + "@storybook/router" "5.2.6" + common-tags "^1.8.0" + core-js "^3.0.1" + eventemitter3 "^4.0.0" + global "^4.3.2" + is-plain-object "^3.0.0" + lodash "^4.17.15" + memoizerific "^1.11.3" + qs "^6.6.0" + util-deprecate "^1.0.2" + "@storybook/client-logger@5.1.9": version "5.1.9" resolved "https://registry.yarnpkg.com/@storybook/client-logger/-/client-logger-5.1.9.tgz#87e2f7578416269adeccd407584010bc353f14d3" @@ -2408,25 +2440,25 @@ dependencies: core-js "^3.0.1" -"@storybook/core@5.2.5": - version "5.2.5" - resolved "https://registry.yarnpkg.com/@storybook/core/-/core-5.2.5.tgz#cc04313480a1847aa6881420c675517cc400dc2e" - integrity sha512-R6A6VzSh++pB1a+9DsywW5Mlp0/eauQz1A8m2DrllWcTHTjbn0ZovlG5HBrKjpknFXpCWxkUKE4eTAE2tWsryA== +"@storybook/core@5.2.6": + version "5.2.6" + resolved "https://registry.yarnpkg.com/@storybook/core/-/core-5.2.6.tgz#60c092607158d7d28db59f7e67da4f7e12703fb2" + integrity sha512-q7Ful7TCm9nmjgLsJFqIwVv395NlaOXgGajyaQCQlCKB2V+jgs7GDmdCNNdWAOue4eAsFU6wQSP9lWtq0yzK4w== dependencies: "@babel/plugin-proposal-class-properties" "^7.3.3" "@babel/plugin-proposal-object-rest-spread" "^7.3.2" "@babel/plugin-syntax-dynamic-import" "^7.2.0" "@babel/plugin-transform-react-constant-elements" "^7.2.0" "@babel/preset-env" "^7.4.5" - "@storybook/addons" "5.2.5" - "@storybook/channel-postmessage" "5.2.5" - "@storybook/client-api" "5.2.5" - "@storybook/client-logger" "5.2.5" - "@storybook/core-events" "5.2.5" - "@storybook/node-logger" "5.2.5" - "@storybook/router" "5.2.5" - "@storybook/theming" "5.2.5" - "@storybook/ui" "5.2.5" + "@storybook/addons" "5.2.6" + "@storybook/channel-postmessage" "5.2.6" + "@storybook/client-api" "5.2.6" + "@storybook/client-logger" "5.2.6" + "@storybook/core-events" "5.2.6" + "@storybook/node-logger" "5.2.6" + "@storybook/router" "5.2.6" + "@storybook/theming" "5.2.6" + "@storybook/ui" "5.2.6" airbnb-js-shims "^1 || ^2" ansi-to-html "^0.6.11" autoprefixer "^9.4.9" @@ -2482,10 +2514,10 @@ webpack-dev-middleware "^3.7.0" webpack-hot-middleware "^2.25.0" -"@storybook/node-logger@5.2.5": - version "5.2.5" - resolved "https://registry.yarnpkg.com/@storybook/node-logger/-/node-logger-5.2.5.tgz#87f53de795db6eed912b54d3cca82fd7b7857771" - integrity sha512-UNyXGOhOr4Bn9wKwBTZABTBXQzrgvGxPLSmvAFZuMx9ZhqoT/EXAuLUl0/wiJtkyuYpoOOskNwIdKxLBdTKS2w== +"@storybook/node-logger@5.2.6": + version "5.2.6" + resolved "https://registry.yarnpkg.com/@storybook/node-logger/-/node-logger-5.2.6.tgz#e353aff14375bef9e922c217a0afb50f93e2ceb1" + integrity sha512-Z3mn9CUSiG7kR2OBoz4lNeoeBS094h5d9wufZSp5S+M47L6KEXmTgNcuePKj+t8Z8KT/Ph8B63bjChseKp3DNw== dependencies: chalk "^2.4.2" core-js "^3.0.1" @@ -2584,19 +2616,19 @@ prop-types "^15.7.2" resolve-from "^5.0.0" -"@storybook/ui@5.2.5": - version "5.2.5" - resolved "https://registry.yarnpkg.com/@storybook/ui/-/ui-5.2.5.tgz#0c2c67216e4c808e39cdb48301cafde81b77d074" - integrity sha512-C+5KmeTtdG6xkGXPmFDHPxTcSvVohuFD1399fnzjYhfLlRJ04ix3g16rcyDTxRtrFgFidOyGHdzCypgkdaN8dQ== +"@storybook/ui@5.2.6": + version "5.2.6" + resolved "https://registry.yarnpkg.com/@storybook/ui/-/ui-5.2.6.tgz#33df2f2e03d9cf81dc52928a0dc4db280ee8f56a" + integrity sha512-jT3PtpEsTqnESO0U8BotC+5P971Xqy0s2leSZcgU9PNe4Eb7NaxypSULOulPgPAx1JOmMipUBdK54PP/nyudkA== dependencies: - "@storybook/addons" "5.2.5" - "@storybook/api" "5.2.5" - "@storybook/channels" "5.2.5" - "@storybook/client-logger" "5.2.5" - "@storybook/components" "5.2.5" - "@storybook/core-events" "5.2.5" - "@storybook/router" "5.2.5" - "@storybook/theming" "5.2.5" + "@storybook/addons" "5.2.6" + "@storybook/api" "5.2.6" + "@storybook/channels" "5.2.6" + "@storybook/client-logger" "5.2.6" + "@storybook/components" "5.2.6" + "@storybook/core-events" "5.2.6" + "@storybook/router" "5.2.6" + "@storybook/theming" "5.2.6" copy-to-clipboard "^3.0.8" core-js "^3.0.1" core-js-pure "^3.0.1" @@ -2623,13 +2655,13 @@ telejson "^3.0.2" util-deprecate "^1.0.2" -"@storybook/vue@~5.2.5": - version "5.2.5" - resolved "https://registry.yarnpkg.com/@storybook/vue/-/vue-5.2.5.tgz#7c8d89aa7e5d5e747b1bcf52a42fb727ba00542a" - integrity sha512-Zml08pITm/2dFfOS0ToxMZdNrA4YoJNDuKqlSUfA7gsQsD5gJDCH8EiPbPNXOZM6/h30uGSqybYVz30c7py0dg== +"@storybook/vue@~5.2.6": + version "5.2.6" + resolved "https://registry.yarnpkg.com/@storybook/vue/-/vue-5.2.6.tgz#1d79880c7e1a14e4deb66c5e438ed3326a3c7c47" + integrity sha512-jYoe+rHT1mKCJp8tcbE6ZPIhLidi5nD9z4XKzfHCZ4HsIWSl7dD+Q7QX1JeZYCCMf6VA27G40l4hUJHWEUyWxA== dependencies: - "@storybook/addons" "5.2.5" - "@storybook/core" "5.2.5" + "@storybook/addons" "5.2.6" + "@storybook/core" "5.2.6" "@types/webpack-env" "^1.13.9" common-tags "^1.8.0" core-js "^3.0.1" @@ -16728,36 +16760,7 @@ webpack-sources@^1.4.3: source-list-map "^2.0.0" source-map "~0.6.1" -webpack@^4.33.0, webpack@^4.38.0: - version "4.41.0" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-4.41.0.tgz#db6a254bde671769f7c14e90a1a55e73602fc70b" - integrity sha512-yNV98U4r7wX1VJAj5kyMsu36T8RPPQntcb5fJLOsMz/pt/WrKC0Vp1bAlqPLkA1LegSwQwf6P+kAbyhRKVQ72g== - dependencies: - "@webassemblyjs/ast" "1.8.5" - "@webassemblyjs/helper-module-context" "1.8.5" - "@webassemblyjs/wasm-edit" "1.8.5" - "@webassemblyjs/wasm-parser" "1.8.5" - acorn "^6.2.1" - ajv "^6.10.2" - ajv-keywords "^3.4.1" - chrome-trace-event "^1.0.2" - enhanced-resolve "^4.1.0" - eslint-scope "^4.0.3" - json-parse-better-errors "^1.0.2" - loader-runner "^2.4.0" - loader-utils "^1.2.3" - memory-fs "^0.4.1" - micromatch "^3.1.10" - mkdirp "^0.5.1" - neo-async "^2.6.1" - node-libs-browser "^2.2.1" - schema-utils "^1.0.0" - tapable "^1.1.3" - terser-webpack-plugin "^1.4.1" - watchpack "^1.6.0" - webpack-sources "^1.4.1" - -webpack@^4.41.2: +webpack@^4.33.0, webpack@^4.38.0, webpack@^4.41.2: version "4.41.2" resolved "https://registry.yarnpkg.com/webpack/-/webpack-4.41.2.tgz#c34ec76daa3a8468c9b61a50336d8e3303dce74e" integrity sha512-Zhw69edTGfbz9/8JJoyRQ/pq8FYUoY0diOXqW0T6yhgdhCv6wr0hra5DwwWexNRns2Z2+gsnrNcbe9hbGBgk/A== From 202de180a22e3eacf8dcdd6b373db0c872e3af1e Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 11 Nov 2019 13:32:48 +0000 Subject: [PATCH 17/51] build(deps-dev): bump style-resources-loader in /webapp Bumps [style-resources-loader](https://github.com/yenshih/style-resources-loader) from 1.2.1 to 1.3.2. - [Release notes](https://github.com/yenshih/style-resources-loader/releases) - [Changelog](https://github.com/yenshih/style-resources-loader/blob/master/CHANGELOG.md) - [Commits](https://github.com/yenshih/style-resources-loader/commits) Signed-off-by: dependabot-preview[bot] --- webapp/package.json | 2 +- webapp/yarn.lock | 41 ++++++++++++----------------------------- 2 files changed, 13 insertions(+), 30 deletions(-) diff --git a/webapp/package.json b/webapp/package.json index 613e9f9d0..4c6977fc5 100644 --- a/webapp/package.json +++ b/webapp/package.json @@ -134,7 +134,7 @@ "storybook-design-token": "^0.4.1", "storybook-vue-router": "^1.0.7", "style-loader": "~0.23.1", - "style-resources-loader": "~1.2.1", + "style-resources-loader": "~1.3.2", "vue-jest": "~3.0.5", "vue-loader": "~15.7.2", "vue-svg-loader": "~0.14.0", diff --git a/webapp/yarn.lock b/webapp/yarn.lock index 2df6e7237..ce9c4c19c 100644 --- a/webapp/yarn.lock +++ b/webapp/yarn.lock @@ -8258,10 +8258,10 @@ glob@7.1.4: once "^1.3.0" path-is-absolute "^1.0.0" -glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, glob@^7.1.5, glob@~7.1.1: - version "7.1.5" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.5.tgz#6714c69bee20f3c3e64c4dd905553e532b40cdc0" - integrity sha512-J9dlskqUXK1OeTOYBEn5s8aMukWMwWfs+rPTn/jn50Ux4MNXVhubL1wu/j2t+H4NVI+cXEcCaYellqaPVGXNqQ== +glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, glob@^7.1.5, glob@^7.1.6, glob@~7.1.1: + version "7.1.6" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" + integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== dependencies: fs.realpath "^1.0.0" inflight "^1.0.4" @@ -14269,15 +14269,7 @@ schema-utils@^1.0.0: ajv-errors "^1.0.0" ajv-keywords "^3.1.0" -schema-utils@^2.0.0, schema-utils@^2.1.0, schema-utils@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-2.2.0.tgz#48a065ce219e0cacf4631473159037b2c1ae82da" - integrity sha512-5EwsCNhfFTZvUreQhx/4vVQpJ/lnCAkgoIHLhSpp4ZirE+4hzFvdJi0FMub6hxbFVBJYSpeVVmon+2e7uEGRrA== - dependencies: - ajv "^6.10.2" - ajv-keywords "^3.4.1" - -schema-utils@^2.0.1: +schema-utils@^2.0.0, schema-utils@^2.0.1, schema-utils@^2.1.0, schema-utils@^2.2.0, schema-utils@^2.4.1, schema-utils@^2.5.0: version "2.5.0" resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-2.5.0.tgz#8f254f618d402cc80257486213c8970edfd7c22f" integrity sha512-32ISrwW2scPXHUSusP8qMg5dLUawKkyV+/qIEV9JdXKx+rsM6mi8vZY8khg2M69Qom16rtroWXD3Ybtiws38gQ== @@ -14285,14 +14277,6 @@ schema-utils@^2.0.1: ajv "^6.10.2" ajv-keywords "^3.4.1" -schema-utils@^2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-2.4.1.tgz#e89ade5d056dc8bcaca377574bb4a9c4e1b8be56" - integrity sha512-RqYLpkPZX5Oc3fw/kHHHyP56fg5Y+XBpIpV8nCg0znIALfq3OH+Ea9Hfeac9BAMwG5IICltiZ0vxFvJQONfA5w== - dependencies: - ajv "^6.10.2" - ajv-keywords "^3.4.1" - scriptjs@^2.5.9: version "2.5.9" resolved "https://registry.yarnpkg.com/scriptjs/-/scriptjs-2.5.9.tgz#343915cd2ec2ed9bfdde2b9875cd28f59394b35f" @@ -15296,16 +15280,15 @@ style-loader@^0.23.1, style-loader@~0.23.1: loader-utils "^1.1.0" schema-utils "^1.0.0" -style-resources-loader@^1.2.1, style-resources-loader@~1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/style-resources-loader/-/style-resources-loader-1.2.1.tgz#7679d5dc2f27046b2fc2b83c1d5b6c1b8a9b820c" - integrity sha512-ekId7AwZRW429UjQo02CJTt0Y8GwoT9zidvJLq4lRTJbu0cghv9XNRmt9mS4MR41+gZwMRT0EpFzP68HDWLbXQ== +style-resources-loader@^1.2.1, style-resources-loader@~1.3.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/style-resources-loader/-/style-resources-loader-1.3.2.tgz#dee034e33e84060ded0b1980f866453e98589873" + integrity sha512-UIwyrl/OZGO+ptyeNyeDnNE+2RqD0AKqjAuxBxhce0YlHMx2DbZ48g0Mx9buKuiNSgBUXYQtbwilKcYeJlVsog== dependencies: - glob "^7.1.2" - is-callable "^1.1.4" - is-plain-object "^2.0.4" + glob "^7.1.6" is-promise "^2.1.0" - loader-utils "^1.1.0" + loader-utils "^1.2.3" + schema-utils "^2.5.0" stylehacks@^4.0.0: version "4.0.3" From ffb3ff896e9649cdde7b96430b921be29529a791 Mon Sep 17 00:00:00 2001 From: Alina Beck Date: Mon, 11 Nov 2019 17:36:04 +0300 Subject: [PATCH 18/51] add tests for DonationInfo component (wip) --- .../DonationInfo/DonationInfo.spec.js | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 webapp/components/DonationInfo/DonationInfo.spec.js diff --git a/webapp/components/DonationInfo/DonationInfo.spec.js b/webapp/components/DonationInfo/DonationInfo.spec.js new file mode 100644 index 000000000..64fd432e8 --- /dev/null +++ b/webapp/components/DonationInfo/DonationInfo.spec.js @@ -0,0 +1,55 @@ +import { mount, createLocalVue } from '@vue/test-utils' +import Styleguide from '@human-connection/styleguide' +import DonationInfo from './DonationInfo.vue' + +const localVue = createLocalVue() +localVue.use(Styleguide) + +const mockDate = new Date(2019, 11, 6) +global.Date = jest.fn(() => mockDate) + +describe('DonationInfo.vue', () => { + const mocks = { + $t: jest.fn(string => string), + $i18n: { + locale: () => 'de', + }, + } + + const propsData = { + goal: 50000, + progress: 10000, + } + + const Wrapper = () => mount(DonationInfo, { propsData, mocks, localVue }) + + it('includes a link to the Human Connection donations website', () => { + expect( + Wrapper() + .find('a') + .attributes('href'), + ).toBe('https://human-connection.org/spenden/') + }) + + it('displays a call to action button', () => { + expect( + Wrapper() + .find('.ds-button') + .text(), + ).toBe('donations.donate-now') + }) + + it('creates a title from the current month and a translation string', () => { + mocks.$t = jest.fn(() => 'Spenden für') + expect(Wrapper().vm.title).toBe('Spenden für Dezember') + }) + + it('creates a label from the given amounts and a translation string', () => { + Wrapper() + expect(mocks.$t.mock.calls[1][0]).toBe('donations.amount-of-total') + expect(mocks.$t.mock.calls[1][1]).toBe({ + amount: '10.000', + total: '50.000', + }) + }) +}) From 835a098731fba4d40a741f08a9ca4681c412d436 Mon Sep 17 00:00:00 2001 From: mattwr18 Date: Mon, 11 Nov 2019 18:14:33 +0100 Subject: [PATCH 19/51] Set up backend for DonationsInfo Co-authored-by: Mike Aono --- .../src/middleware/permissionsMiddleware.js | 2 + backend/src/models/Donations.js | 14 ++ backend/src/models/index.js | 1 + backend/src/schema/index.js | 2 + backend/src/schema/resolvers/donations.js | 31 ++++ .../src/schema/resolvers/donations.spec.js | 172 ++++++++++++++++++ backend/src/schema/types/type/Donations.gql | 14 ++ backend/src/seed/factories/donations.js | 18 ++ backend/src/seed/factories/index.js | 2 + 9 files changed, 256 insertions(+) create mode 100644 backend/src/models/Donations.js create mode 100644 backend/src/schema/resolvers/donations.js create mode 100644 backend/src/schema/resolvers/donations.spec.js create mode 100644 backend/src/schema/types/type/Donations.gql create mode 100644 backend/src/seed/factories/donations.js diff --git a/backend/src/middleware/permissionsMiddleware.js b/backend/src/middleware/permissionsMiddleware.js index a0116a439..d312bc112 100644 --- a/backend/src/middleware/permissionsMiddleware.js +++ b/backend/src/middleware/permissionsMiddleware.js @@ -135,6 +135,7 @@ const permissions = shield( blockedUsers: isAuthenticated, notifications: isAuthenticated, profilePagePosts: or(onlyEnabledContent, isModerator), + Donations: isAuthenticated, }, Mutation: { '*': deny, @@ -177,6 +178,7 @@ const permissions = shield( VerifyEmailAddress: isAuthenticated, pinPost: isAdmin, unpinPost: isAdmin, + UpdateDonations: isAdmin, }, User: { email: or(isMyOwn, isAdmin), diff --git a/backend/src/models/Donations.js b/backend/src/models/Donations.js new file mode 100644 index 000000000..45e06e1d4 --- /dev/null +++ b/backend/src/models/Donations.js @@ -0,0 +1,14 @@ +import uuid from 'uuid/v4' + +module.exports = { + id: { type: 'string', primary: true, default: uuid }, + goal: { type: 'number' }, + progress: { type: 'number' }, + createdAt: { type: 'string', isoDate: true, default: () => new Date().toISOString() }, + updatedAt: { + type: 'string', + isoDate: true, + required: true, + default: () => new Date().toISOString(), + }, +} diff --git a/backend/src/models/index.js b/backend/src/models/index.js index 08362b69f..bd89ddc51 100644 --- a/backend/src/models/index.js +++ b/backend/src/models/index.js @@ -12,4 +12,5 @@ export default { Category: require('./Category.js'), Tag: require('./Tag.js'), Location: require('./Location.js'), + Donations: require('./Donations.js'), } diff --git a/backend/src/schema/index.js b/backend/src/schema/index.js index 95fa9ef61..b1bd36451 100644 --- a/backend/src/schema/index.js +++ b/backend/src/schema/index.js @@ -24,6 +24,7 @@ export default applyScalars( 'SocialMedia', 'NOTIFIED', 'REPORTED', + 'Donations', ], // add 'User' here as soon as possible }, @@ -44,6 +45,7 @@ export default applyScalars( 'EMOTED', 'NOTIFIED', 'REPORTED', + 'Donations', ], // add 'User' here as soon as possible }, diff --git a/backend/src/schema/resolvers/donations.js b/backend/src/schema/resolvers/donations.js new file mode 100644 index 000000000..1c7aee8d4 --- /dev/null +++ b/backend/src/schema/resolvers/donations.js @@ -0,0 +1,31 @@ +export default { + Mutation: { + UpdateDonations: async (_parent, params, context, _resolveInfo) => { + const { driver } = context + const session = driver.session() + let donations + const writeTxResultPromise = session.writeTransaction(async txc => { + const updateDonationsTransactionResponse = await txc.run( + ` + MATCH (donations:Donations {id: $params.id}) + SET donations += $params + SET donations.updatedAt = toString(datetime()) + RETURN donations + `, + { params }, + ) + return updateDonationsTransactionResponse.records.map( + record => record.get('donations').properties, + ) + }) + try { + const txResult = await writeTxResultPromise + if (!txResult[0]) return null + donations = txResult[0] + } finally { + session.close() + } + return donations + }, + }, +} diff --git a/backend/src/schema/resolvers/donations.spec.js b/backend/src/schema/resolvers/donations.spec.js new file mode 100644 index 000000000..a5264ee3a --- /dev/null +++ b/backend/src/schema/resolvers/donations.spec.js @@ -0,0 +1,172 @@ +import { createTestClient } from 'apollo-server-testing' +import Factory from '../../seed/factories' +import { gql } from '../../jest/helpers' +import { neode as getNeode, getDriver } from '../../bootstrap/neo4j' +import createServer from '../../server' + +let mutate, query, authenticatedUser, variables +const factory = Factory() +const instance = getNeode() +const driver = getDriver() + +const updateDonationsMutation = gql` + mutation($id: ID!, $goal: Int, $progress: Int) { + UpdateDonations(id: $id, goal: $goal, progress: $progress) { + goal + progress + createdAt + updatedAt + } + } +` +const donationsQuery = gql` + query { + Donations { + goal + progress + } + } +` + +describe('donations', () => { + let currentUser, newlyCreatedDonations + beforeAll(async () => { + await factory.cleanDatabase() + authenticatedUser = undefined + const { server } = createServer({ + context: () => { + return { + driver, + neode: instance, + user: authenticatedUser, + } + }, + }) + mutate = createTestClient(server).mutate + query = createTestClient(server).query + }) + + beforeEach(async () => { + variables = {} + newlyCreatedDonations = await factory.create('Donations', { id: 'total-donations' }) + }) + + afterEach(async () => { + await factory.cleanDatabase() + }) + + describe('query for donations', () => { + describe('unauthenticated', () => { + it('throws authorization error', async () => { + authenticatedUser = undefined + await expect(query({ query: donationsQuery, variables })).resolves.toMatchObject({ + errors: [{ message: 'Not Authorised!' }], + }) + }) + + describe('authenticated', () => { + beforeEach(async () => { + currentUser = await factory.create('User', { + id: 'normal-user', + role: 'user', + }) + authenticatedUser = await currentUser.toJson() + }) + + it('returns the current Donations info', async () => { + await expect(query({ query: donationsQuery, variables })).resolves.toMatchObject({ + data: { Donations: [{ goal: 15000, progress: 0 }] }, + }) + }) + }) + }) + }) + + describe('update donations', () => { + beforeEach(() => { + variables = { id: 'total-donations', goal: 20000, progress: 3000 } + }) + + describe('unauthenticated', () => { + it('throws authorization error', async () => { + authenticatedUser = undefined + await expect( + mutate({ mutation: updateDonationsMutation, variables }), + ).resolves.toMatchObject({ + errors: [{ message: 'Not Authorised!' }], + }) + }) + + describe('authenticated', () => { + describe('as a normal user', () => { + beforeEach(async () => { + currentUser = await factory.create('User', { + id: 'normal-user', + role: 'user', + }) + authenticatedUser = await currentUser.toJson() + }) + + it('throws authorization error', async () => { + await expect( + mutate({ mutation: updateDonationsMutation, variables }), + ).resolves.toMatchObject({ + data: { UpdateDonations: null }, + errors: [{ message: 'Not Authorised!' }], + }) + }) + }) + + describe('as a moderator', () => { + beforeEach(async () => { + currentUser = await factory.create('User', { + id: 'moderator', + role: 'moderator', + }) + authenticatedUser = await currentUser.toJson() + }) + + it('throws authorization error', async () => { + await expect( + mutate({ mutation: updateDonationsMutation, variables }), + ).resolves.toMatchObject({ + data: { UpdateDonations: null }, + errors: [{ message: 'Not Authorised!' }], + }) + }) + }) + + describe('as an admin', () => { + beforeEach(async () => { + currentUser = await factory.create('User', { + id: 'admin', + role: 'admin', + }) + authenticatedUser = await currentUser.toJson() + }) + + it('updates Donations info', async () => { + await expect( + mutate({ mutation: updateDonationsMutation, variables }), + ).resolves.toMatchObject({ + data: { UpdateDonations: { goal: 20000, progress: 3000 } }, + errors: undefined, + }) + }) + + it('updates the updatedAt attribute', async () => { + newlyCreatedDonations = await newlyCreatedDonations.toJson() + const { + data: { UpdateDonations }, + } = await mutate({ mutation: updateDonationsMutation, variables }) + expect(newlyCreatedDonations.updatedAt).toBeTruthy() + expect(Date.parse(newlyCreatedDonations.updatedAt)).toEqual(expect.any(Number)) + expect(UpdateDonations.updatedAt).toBeTruthy() + expect(Date.parse(UpdateDonations.updatedAt)).toEqual(expect.any(Number)) + expect(newlyCreatedDonations.updatedAt).not.toEqual(UpdateDonations.updatedAt) + }) + }) + }) + }) + }) +}) diff --git a/backend/src/schema/types/type/Donations.gql b/backend/src/schema/types/type/Donations.gql new file mode 100644 index 000000000..88e5edd2d --- /dev/null +++ b/backend/src/schema/types/type/Donations.gql @@ -0,0 +1,14 @@ +type Donations { + goal: Int! + progress: Int! + createdAt: String + updatedAt: String +} + +type Query { + Donations: [Donations] +} + +type Mutation { + UpdateDonations(id: ID!, goal: Int, progress: Int): Donations +} \ No newline at end of file diff --git a/backend/src/seed/factories/donations.js b/backend/src/seed/factories/donations.js new file mode 100644 index 000000000..e22cdb6d7 --- /dev/null +++ b/backend/src/seed/factories/donations.js @@ -0,0 +1,18 @@ +import uuid from 'uuid/v4' + +export default function create() { + return { + factory: async ({ args, neodeInstance }) => { + const defaults = { + id: uuid(), + goal: 15000, + progress: 0, + } + args = { + ...defaults, + ...args, + } + return neodeInstance.create('Donations', args) + }, + } +} diff --git a/backend/src/seed/factories/index.js b/backend/src/seed/factories/index.js index 2c96c8698..5054155fc 100644 --- a/backend/src/seed/factories/index.js +++ b/backend/src/seed/factories/index.js @@ -8,6 +8,7 @@ import createTag from './tags.js' import createSocialMedia from './socialMedia.js' import createLocation from './locations.js' import createEmailAddress from './emailAddresses.js' +import createDonations from './donations.js' import createUnverifiedEmailAddresss from './unverifiedEmailAddresses.js' const factories = { @@ -21,6 +22,7 @@ const factories = { Location: createLocation, EmailAddress: createEmailAddress, UnverifiedEmailAddress: createUnverifiedEmailAddresss, + Donations: createDonations, } export const cleanDatabase = async (options = {}) => { From afb443ac0df3ccd2b037e2a98f2e282cd1138384 Mon Sep 17 00:00:00 2001 From: mattwr18 Date: Mon, 11 Nov 2019 19:14:06 +0100 Subject: [PATCH 20/51] Update resolver to match one Donations node - there should only ever be one Donations node to start off with, if that changes in the future for some reason, then we'd need to look into changing the match to something that makes more sense. --- backend/src/schema/resolvers/donations.js | 7 ++++++- backend/src/schema/resolvers/donations.spec.js | 8 ++++---- backend/src/schema/types/type/Donations.gql | 3 ++- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/backend/src/schema/resolvers/donations.js b/backend/src/schema/resolvers/donations.js index 1c7aee8d4..4057748e0 100644 --- a/backend/src/schema/resolvers/donations.js +++ b/backend/src/schema/resolvers/donations.js @@ -1,13 +1,18 @@ +import uuid from 'uuid/v4' + export default { Mutation: { UpdateDonations: async (_parent, params, context, _resolveInfo) => { const { driver } = context const session = driver.session() let donations + params.id = params.id || uuid() + const writeTxResultPromise = session.writeTransaction(async txc => { const updateDonationsTransactionResponse = await txc.run( ` - MATCH (donations:Donations {id: $params.id}) + MATCH (donations:Donations) + WITH donations LIMIT 1 SET donations += $params SET donations.updatedAt = toString(datetime()) RETURN donations diff --git a/backend/src/schema/resolvers/donations.spec.js b/backend/src/schema/resolvers/donations.spec.js index a5264ee3a..9c62a7dda 100644 --- a/backend/src/schema/resolvers/donations.spec.js +++ b/backend/src/schema/resolvers/donations.spec.js @@ -10,8 +10,8 @@ const instance = getNeode() const driver = getDriver() const updateDonationsMutation = gql` - mutation($id: ID!, $goal: Int, $progress: Int) { - UpdateDonations(id: $id, goal: $goal, progress: $progress) { + mutation($goal: Int, $progress: Int) { + UpdateDonations(goal: $goal, progress: $progress) { goal progress createdAt @@ -48,7 +48,7 @@ describe('donations', () => { beforeEach(async () => { variables = {} - newlyCreatedDonations = await factory.create('Donations', { id: 'total-donations' }) + newlyCreatedDonations = await factory.create('Donations') }) afterEach(async () => { @@ -84,7 +84,7 @@ describe('donations', () => { describe('update donations', () => { beforeEach(() => { - variables = { id: 'total-donations', goal: 20000, progress: 3000 } + variables = { goal: 20000, progress: 3000 } }) describe('unauthenticated', () => { diff --git a/backend/src/schema/types/type/Donations.gql b/backend/src/schema/types/type/Donations.gql index 88e5edd2d..39cfe9b71 100644 --- a/backend/src/schema/types/type/Donations.gql +++ b/backend/src/schema/types/type/Donations.gql @@ -1,4 +1,5 @@ type Donations { + id: ID! goal: Int! progress: Int! createdAt: String @@ -10,5 +11,5 @@ type Query { } type Mutation { - UpdateDonations(id: ID!, goal: Int, progress: Int): Donations + UpdateDonations(goal: Int, progress: Int): Donations } \ No newline at end of file From 7d95809f6eacb0974eb4950b541f84a50491b862 Mon Sep 17 00:00:00 2001 From: mattwr18 Date: Mon, 11 Nov 2019 19:15:39 +0100 Subject: [PATCH 21/51] Update test to ensure currency is shown by locale --- .../DonationInfo/DonationInfo.spec.js | 50 ++++++++++++------- 1 file changed, 33 insertions(+), 17 deletions(-) diff --git a/webapp/components/DonationInfo/DonationInfo.spec.js b/webapp/components/DonationInfo/DonationInfo.spec.js index 64fd432e8..34be14836 100644 --- a/webapp/components/DonationInfo/DonationInfo.spec.js +++ b/webapp/components/DonationInfo/DonationInfo.spec.js @@ -9,17 +9,19 @@ const mockDate = new Date(2019, 11, 6) global.Date = jest.fn(() => mockDate) describe('DonationInfo.vue', () => { - const mocks = { - $t: jest.fn(string => string), - $i18n: { - locale: () => 'de', - }, - } - - const propsData = { - goal: 50000, - progress: 10000, - } + let mocks, propsData + beforeEach(() => { + mocks = { + $t: jest.fn(string => string), + $i18n: { + locale: () => 'de', + }, + } + propsData = { + goal: 50000, + progress: 10000, + } + }) const Wrapper = () => mount(DonationInfo, { propsData, mocks, localVue }) @@ -44,12 +46,26 @@ describe('DonationInfo.vue', () => { expect(Wrapper().vm.title).toBe('Spenden für Dezember') }) - it('creates a label from the given amounts and a translation string', () => { - Wrapper() - expect(mocks.$t.mock.calls[1][0]).toBe('donations.amount-of-total') - expect(mocks.$t.mock.calls[1][1]).toBe({ - amount: '10.000', - total: '50.000', + describe('given german locale', () => { + it('creates a label from the given amounts and a translation string', () => { + Wrapper() + expect(mocks.$t.mock.calls[1][0]).toBe('donations.amount-of-total') + expect(mocks.$t.mock.calls[1][1]).toStrictEqual({ + amount: '10.000', + total: '50.000', + }) + }) + }) + + describe('given english locale', () => { + it('creates a label from the given amounts and a translation string', () => { + mocks.$i18n.locale = () => 'en' + Wrapper() + expect(mocks.$t.mock.calls[1][0]).toBe('donations.amount-of-total') + expect(mocks.$t.mock.calls[1][1]).toStrictEqual({ + amount: '10,000', + total: '50,000', + }) }) }) }) From f51ad1131b68c2ef97f8a9c7889061ae5fc83807 Mon Sep 17 00:00:00 2001 From: mattwr18 Date: Mon, 11 Nov 2019 19:16:07 +0100 Subject: [PATCH 22/51] UpdateDonations from admin/donations @alina-beck I'm not 100% satisfied with this at the moment. I think that the admin could have the goal and progress initialized from a query for the Donations, and be able to update if one of them changed... what do you think? --- webapp/graphql/Donations.js | 14 ++++++++++++++ webapp/pages/admin/donations.vue | 21 +++++++++++++++++---- 2 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 webapp/graphql/Donations.js diff --git a/webapp/graphql/Donations.js b/webapp/graphql/Donations.js new file mode 100644 index 000000000..472218458 --- /dev/null +++ b/webapp/graphql/Donations.js @@ -0,0 +1,14 @@ +import gql from 'graphql-tag' + +export const UpdateDonations = () => { + return gql` + mutation($goal: Int, $progress: Int) { + UpdateDonations(goal: $goal, progress: $progress) { + id + goal + progress + updatedAt + } + } + ` +} diff --git a/webapp/pages/admin/donations.vue b/webapp/pages/admin/donations.vue index 5043ceaec..2eb7b92f9 100644 --- a/webapp/pages/admin/donations.vue +++ b/webapp/pages/admin/donations.vue @@ -16,19 +16,32 @@ From 12e2682c500fca98e5fa4248cec83b98901c1019 Mon Sep 17 00:00:00 2001 From: mattwr18 Date: Tue, 12 Nov 2019 10:46:40 +0100 Subject: [PATCH 34/51] Update deployment names in deploy script --- scripts/deploy.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/deploy.sh b/scripts/deploy.sh index cfde8008d..146d342c9 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash sed -i "s//${TRAVIS_COMMIT}/g" $TRAVIS_BUILD_DIR/scripts/patches/patch-deployment.yaml sed -i "s//${TRAVIS_COMMIT}/g" $TRAVIS_BUILD_DIR/scripts/patches/patch-configmap.yaml -kubectl --namespace=human-connection patch configmap configmap -p "$(cat $TRAVIS_BUILD_DIR/scripts/patches/patch-configmap.yaml)" -kubectl --namespace=human-connection patch deployment nitro-backend -p "$(cat $TRAVIS_BUILD_DIR/scripts/patches/patch-deployment.yaml)" -kubectl --namespace=human-connection patch deployment nitro-web -p "$(cat $TRAVIS_BUILD_DIR/scripts/patches/patch-deployment.yaml)" +kubectl --namespace=human-connection patch configmap configmap -p "$(cat $TRAVIS_BUILD_DIR/scripts/patches/patch-configmap.yaml)" +kubectl --namespace=human-connection patch deployment backend -p "$(cat $TRAVIS_BUILD_DIR/scripts/patches/patch-deployment.yaml)" +kubectl --namespace=human-connection patch deployment web -p "$(cat $TRAVIS_BUILD_DIR/scripts/patches/patch-deployment.yaml)" From d7397f5e463962443b3882ccdca242f840df3d06 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Tue, 12 Nov 2019 11:20:56 +0100 Subject: [PATCH 35/51] posts/currentPosts now return empty array --- webapp/pages/index.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/pages/index.spec.js b/webapp/pages/index.spec.js index 8ffa8fac1..aeb033cb9 100644 --- a/webapp/pages/index.spec.js +++ b/webapp/pages/index.spec.js @@ -54,7 +54,7 @@ describe('PostIndex', () => { 'auth/user': () => { return { id: 'u23' } }, - 'posts/currentPosts': () => jest.fn(), + 'posts/currentPosts': () => [], }, mutations, }) From 6a98e5759fee9cb7d1460133cff4c443af16f35f Mon Sep 17 00:00:00 2001 From: Alina Beck Date: Tue, 12 Nov 2019 13:50:45 +0300 Subject: [PATCH 36/51] fix lint errors in backend --- backend/src/seed/seed-db.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/seed/seed-db.js b/backend/src/seed/seed-db.js index 8ce08ff12..e3f6eea66 100644 --- a/backend/src/seed/seed-db.js +++ b/backend/src/seed/seed-db.js @@ -923,7 +923,7 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl'] }) }), ) - + await factory.create('Donations') /* eslint-disable-next-line no-console */ console.log('Seeded Data...') From 71bcf814db90336363aa2020b5a0e636defce433 Mon Sep 17 00:00:00 2001 From: mattwr18 Date: Tue, 12 Nov 2019 12:08:19 +0100 Subject: [PATCH 37/51] Fix incorrect destructuring, parseInt - graphql schema expects an integer --- webapp/pages/admin/donations.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/webapp/pages/admin/donations.vue b/webapp/pages/admin/donations.vue index 9bc1279f4..22bd43e81 100644 --- a/webapp/pages/admin/donations.vue +++ b/webapp/pages/admin/donations.vue @@ -29,13 +29,13 @@ export default { }, methods: { submit() { - const { goal, progress } = this + const { goal, progress } = this.formData this.$apollo .mutate({ mutation: UpdateDonations(), variables: { - goal, - progress, + goal: parseInt(goal), + progress: parseInt(progress), }, }) .then(() => { From 982a02fc4f9ee163741da78dc3fb52b48981fde2 Mon Sep 17 00:00:00 2001 From: Alina Beck Date: Tue, 12 Nov 2019 14:24:32 +0300 Subject: [PATCH 38/51] query donations data in donation info component --- .../DonationInfo/DonationInfo.spec.js | 53 +++++++++++-------- .../components/DonationInfo/DonationInfo.vue | 28 ++++++---- 2 files changed, 49 insertions(+), 32 deletions(-) diff --git a/webapp/components/DonationInfo/DonationInfo.spec.js b/webapp/components/DonationInfo/DonationInfo.spec.js index 34be14836..ca719c19a 100644 --- a/webapp/components/DonationInfo/DonationInfo.spec.js +++ b/webapp/components/DonationInfo/DonationInfo.spec.js @@ -9,7 +9,8 @@ const mockDate = new Date(2019, 11, 6) global.Date = jest.fn(() => mockDate) describe('DonationInfo.vue', () => { - let mocks, propsData + let mocks, wrapper + beforeEach(() => { mocks = { $t: jest.fn(string => string), @@ -17,13 +18,9 @@ describe('DonationInfo.vue', () => { locale: () => 'de', }, } - propsData = { - goal: 50000, - progress: 10000, - } }) - const Wrapper = () => mount(DonationInfo, { propsData, mocks, localVue }) + const Wrapper = () => mount(DonationInfo, { mocks, localVue }) it('includes a link to the Human Connection donations website', () => { expect( @@ -46,25 +43,37 @@ describe('DonationInfo.vue', () => { expect(Wrapper().vm.title).toBe('Spenden für Dezember') }) - describe('given german locale', () => { - it('creates a label from the given amounts and a translation string', () => { - Wrapper() - expect(mocks.$t.mock.calls[1][0]).toBe('donations.amount-of-total') - expect(mocks.$t.mock.calls[1][1]).toStrictEqual({ - amount: '10.000', - total: '50.000', + describe('mount with data', () => { + beforeEach(() => { + wrapper = Wrapper() + wrapper.setData({ goal: 50000, progress: 10000 }) + }) + + describe('given german locale', () => { + it('creates a label from the given amounts and a translation string', () => { + expect(mocks.$t).toBeCalledWith( + 'donations.amount-of-total', + expect.objectContaining({ + amount: '10.000', + total: '50.000', + }), + ) }) }) - }) - describe('given english locale', () => { - it('creates a label from the given amounts and a translation string', () => { - mocks.$i18n.locale = () => 'en' - Wrapper() - expect(mocks.$t.mock.calls[1][0]).toBe('donations.amount-of-total') - expect(mocks.$t.mock.calls[1][1]).toStrictEqual({ - amount: '10,000', - total: '50,000', + describe('given english locale', () => { + beforeEach(() => { + mocks.$i18n.locale = () => 'en' + }) + + it('creates a label from the given amounts and a translation string', () => { + expect(mocks.$t).toBeCalledWith( + 'donations.amount-of-total', + expect.objectContaining({ + amount: '10,000', + total: '50,000', + }), + ) }) }) }) diff --git a/webapp/components/DonationInfo/DonationInfo.vue b/webapp/components/DonationInfo/DonationInfo.vue index f05258341..947f4bdbc 100644 --- a/webapp/components/DonationInfo/DonationInfo.vue +++ b/webapp/components/DonationInfo/DonationInfo.vue @@ -8,22 +8,18 @@ From a215093bc3d55f3d0b8b762e70fd64664c89b0f6 Mon Sep 17 00:00:00 2001 From: mattwr18 Date: Tue, 12 Nov 2019 13:26:30 +0100 Subject: [PATCH 39/51] Make Donations reactive Co-authored-by: @alina-beck --- backend/src/schema/resolvers/donations.js | 4 ---- backend/src/schema/resolvers/donations.spec.js | 2 ++ webapp/graphql/Donations.js | 1 + webapp/pages/admin/donations.vue | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/backend/src/schema/resolvers/donations.js b/backend/src/schema/resolvers/donations.js index 4057748e0..88149077d 100644 --- a/backend/src/schema/resolvers/donations.js +++ b/backend/src/schema/resolvers/donations.js @@ -1,13 +1,9 @@ -import uuid from 'uuid/v4' - export default { Mutation: { UpdateDonations: async (_parent, params, context, _resolveInfo) => { const { driver } = context const session = driver.session() let donations - params.id = params.id || uuid() - const writeTxResultPromise = session.writeTransaction(async txc => { const updateDonationsTransactionResponse = await txc.run( ` diff --git a/backend/src/schema/resolvers/donations.spec.js b/backend/src/schema/resolvers/donations.spec.js index 9c62a7dda..327688d3a 100644 --- a/backend/src/schema/resolvers/donations.spec.js +++ b/backend/src/schema/resolvers/donations.spec.js @@ -12,6 +12,7 @@ const driver = getDriver() const updateDonationsMutation = gql` mutation($goal: Int, $progress: Int) { UpdateDonations(goal: $goal, progress: $progress) { + id goal progress createdAt @@ -22,6 +23,7 @@ const updateDonationsMutation = gql` const donationsQuery = gql` query { Donations { + id goal progress } diff --git a/webapp/graphql/Donations.js b/webapp/graphql/Donations.js index 41d7cb87e..cc2a6a783 100644 --- a/webapp/graphql/Donations.js +++ b/webapp/graphql/Donations.js @@ -3,6 +3,7 @@ import gql from 'graphql-tag' export const DonationsQuery = () => gql` query { Donations { + id goal progress } diff --git a/webapp/pages/admin/donations.vue b/webapp/pages/admin/donations.vue index 22bd43e81..9ce2eb76f 100644 --- a/webapp/pages/admin/donations.vue +++ b/webapp/pages/admin/donations.vue @@ -49,7 +49,7 @@ export default { query() { return DonationsQuery() }, - result({ data: { Donations } }) { + update({ Donations }) { const { goal, progress } = Donations[0] this.formData = { goal, From e19990a58b3ca87b984db1ef2982834db5072231 Mon Sep 17 00:00:00 2001 From: mattwr18 Date: Tue, 12 Nov 2019 13:43:51 +0100 Subject: [PATCH 40/51] Fix lint --- webapp/pages/index.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/pages/index.spec.js b/webapp/pages/index.spec.js index aeb033cb9..d8587aaf4 100644 --- a/webapp/pages/index.spec.js +++ b/webapp/pages/index.spec.js @@ -54,7 +54,7 @@ describe('PostIndex', () => { 'auth/user': () => { return { id: 'u23' } }, - 'posts/currentPosts': () => [], + 'posts/currentPosts': () => [], }, mutations, }) From 8b5cd48d3c3e9093f089ae85000e32fbbe6f620a Mon Sep 17 00:00:00 2001 From: mattwr18 Date: Tue, 12 Nov 2019 15:33:21 +0100 Subject: [PATCH 41/51] Translate success message, guard clause for no Donations --- webapp/components/DonationInfo/DonationInfo.vue | 5 +++-- webapp/locales/de.json | 3 ++- webapp/locales/en.json | 3 ++- webapp/locales/pt.json | 6 ++++++ webapp/pages/admin/donations.vue | 3 ++- 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/webapp/components/DonationInfo/DonationInfo.vue b/webapp/components/DonationInfo/DonationInfo.vue index 947f4bdbc..c7d42252b 100644 --- a/webapp/components/DonationInfo/DonationInfo.vue +++ b/webapp/components/DonationInfo/DonationInfo.vue @@ -17,7 +17,7 @@ export default { }, data() { return { - goal: 0, + goal: 15000, progress: 0, } }, @@ -39,7 +39,8 @@ export default { query() { return DonationsQuery() }, - result({ data: { Donations } }) { + update({ Donations }) { + if (!Donations[0]) return const { goal, progress } = Donations[0] this.goal = goal this.progress = progress diff --git a/webapp/locales/de.json b/webapp/locales/de.json index e70fd025a..a9cf7ce2c 100644 --- a/webapp/locales/de.json +++ b/webapp/locales/de.json @@ -384,7 +384,8 @@ "donations": { "name": "Spendeninfo", "goal": "Monatlich benötigte Spenden", - "progress": "Bereits gesammelte Spenden" + "progress": "Bereits gesammelte Spenden", + "successfulUpdate": "Spenden-Info erfolgreich aktualisiert!" } }, "post": { diff --git a/webapp/locales/en.json b/webapp/locales/en.json index 958025370..15ef63a95 100644 --- a/webapp/locales/en.json +++ b/webapp/locales/en.json @@ -385,7 +385,8 @@ "donations": { "name": "Donations info", "goal": "Monthly donations needed", - "progress": "Donations collected so far" + "progress": "Donations collected so far", + "successfulUpdate": "Donations info updated successfully!" } }, "post": { diff --git a/webapp/locales/pt.json b/webapp/locales/pt.json index 900b65f67..76560aba9 100644 --- a/webapp/locales/pt.json +++ b/webapp/locales/pt.json @@ -380,6 +380,12 @@ "name": "Convidar usuários", "title": "Convidar pessoas", "description": "Convites são uma maneira maravilhosa de ter seus amigos em sua rede …" + }, + "donations": { + "name": "Informações sobre Doações", + "goal": "Doações mensais necessárias", + "progress": "Doações arrecadadas até o momento", + "successfulUpdate": "Informações sobre doações atualizadas com sucesso!" } }, "post": { diff --git a/webapp/pages/admin/donations.vue b/webapp/pages/admin/donations.vue index 9ce2eb76f..7f0205be5 100644 --- a/webapp/pages/admin/donations.vue +++ b/webapp/pages/admin/donations.vue @@ -39,7 +39,7 @@ export default { }, }) .then(() => { - this.$toast.success('yay!!') + this.$toast.success(this.$t('admin.donations.successfulUpdate')) }) .catch(error => this.$toast.error(error.message)) }, @@ -50,6 +50,7 @@ export default { return DonationsQuery() }, update({ Donations }) { + if (!Donations[0]) return const { goal, progress } = Donations[0] this.formData = { goal, From f8b16b35aa3cf26d6144e0ed087dd83948efd78c Mon Sep 17 00:00:00 2001 From: Alina Beck Date: Tue, 12 Nov 2019 18:12:25 +0300 Subject: [PATCH 42/51] change times to german time --- CONTRIBUTING.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 148b74d8c..0b2e66b9f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -49,38 +49,40 @@ You can see the core team behind Human Connection [on our website](https://human ## Meetings and Pair Programming Sessions +Times below refer to **German Time** – that's CET (GMT+1) in winter and CEST (GMT+2) in summer – because most Human Connection core team members are living in Germany. + Daily standup -* every Monday–Friday 10:45 UTC +* every Monday–Friday 11:45 * in the discord `Conference Room` * all contributors welcome! * everybody shares what they are working on and asks for help if they are blocked Regular pair programming sessions -* every Monday, Wednesday and Thursday 14:00 UTC +* every Monday, Wednesday and Thursday 15:00 * the link will be posted in the [discord chat](https://discord.gg/6ub73U3) and on the [Agile Ventures website](https://www.agileventures.org/events?utf8=%E2%9C%93&project_id=220&commit=Filter+by+Project) * all contributors welcome! * we team up and work on an issue together (often using Visual Studio live sharing sessions) Open-Source Community Meeting -* every Thursday 12:00 UTC +* every Thursday 13:00 * the link will be posted in the [discord chat](https://discord.gg/6ub73U3) and on the [Agile Ventures website](https://www.agileventures.org/events?utf8=%E2%9C%93&project_id=220&commit=Filter+by+Project) * all contributors welcome! Meet the team -* every Monday 20:00 UTC (at the moment only in German) +* every Monday 21:00 (at the moment only in German) * details here https://human-connection.org/veranstaltungen/ * via this [zoom link](https://zoom.us/j/936943532) * all contributors and users of the network welcome! * users of the network chat with the Human Connection team and discuss current questions and issues Sprint planning -* bi-weekly on Tuesday 12:00 UTC +* bi-weekly on Tuesday 13:00 * via this [zoom link](https://zoom.us/j/7743582385) * all contributors welcome (recommended for those who want to work on an issue in this sprint) * we select and prioritise the issues we will work on in the following two weeks Sprint retrospective -* bi-weekly on Monday 12:00 UTC +* bi-weekly on Monday 13:00 * via this [zoom link](https://zoom.us/j/7743582385) * all contributors welcome (most interesting for those who participated in the sprint) * we review the past sprint and talk about what went well and what we could improve From 63d223e368273156ae9e173b29a54eb4f75605b0 Mon Sep 17 00:00:00 2001 From: Alina Beck Date: Tue, 12 Nov 2019 18:52:38 +0300 Subject: [PATCH 43/51] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Robert Schäfer --- webapp/components/DonationInfo/DonationInfo.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/components/DonationInfo/DonationInfo.vue b/webapp/components/DonationInfo/DonationInfo.vue index c7d42252b..10f42e880 100644 --- a/webapp/components/DonationInfo/DonationInfo.vue +++ b/webapp/components/DonationInfo/DonationInfo.vue @@ -1,7 +1,7 @@