diff --git a/.travis.yml b/.travis.yml index eb0c6f89a..c266b5f0a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,6 +18,7 @@ install: - docker-compose -f docker-compose.yml -f docker-compose.travis.yml up --build -d # avoid "Database constraints have changed after this transaction started" - wait-on http://localhost:7474 + - docker-compose exec neo4j db_setup script: - export CYPRESS_RETRIES=1 diff --git a/backend/package.json b/backend/package.json index 294c61cf6..3c3f16096 100644 --- a/backend/package.json +++ b/backend/package.json @@ -50,7 +50,7 @@ "apollo-link-context": "~1.0.18", "apollo-link-http": "~1.5.15", "apollo-server": "~2.8.2", - "apollo-server-express": "^2.8.1", + "apollo-server-express": "^2.9.0", "babel-plugin-transform-runtime": "^6.23.0", "bcryptjs": "~2.4.3", "cheerio": "~1.0.0-rc.3", @@ -110,7 +110,7 @@ "@babel/plugin-proposal-throw-expressions": "^7.2.0", "@babel/preset-env": "~7.5.5", "@babel/register": "~7.5.5", - "apollo-server-testing": "~2.8.2", + "apollo-server-testing": "~2.9.0", "babel-core": "~7.0.0-0", "babel-eslint": "~10.0.2", "babel-jest": "~24.9.0", diff --git a/backend/src/middleware/sentryMiddleware.js b/backend/src/middleware/sentryMiddleware.js index b1130ad37..da8ef32d0 100644 --- a/backend/src/middleware/sentryMiddleware.js +++ b/backend/src/middleware/sentryMiddleware.js @@ -14,13 +14,16 @@ if (sentryConfigs.SENTRY_DSN_BACKEND) { }, withScope: (scope, error, context) => { scope.setUser({ - id: context.user.id, + id: context.user && context.user.id, }) scope.setExtra('body', context.req.body) scope.setExtra('origin', context.req.headers.origin) scope.setExtra('user-agent', context.req.headers['user-agent']) }, }) +} else { + // eslint-disable-next-line no-console + if (process.env.NODE_ENV !== 'test') console.log('Warning: Sentry middleware inactive.') } export default sentryMiddleware diff --git a/backend/yarn.lock b/backend/yarn.lock index 39a7a152c..288af0717 100644 --- a/backend/yarn.lock +++ b/backend/yarn.lock @@ -1702,6 +1702,33 @@ apollo-server-core@2.8.2: subscriptions-transport-ws "^0.9.11" ws "^6.0.0" +apollo-server-core@2.9.0: + version "2.9.0" + resolved "https://registry.yarnpkg.com/apollo-server-core/-/apollo-server-core-2.9.0.tgz#5db251093ee121a5f4d90a24d51aa4c21e421243" + integrity sha512-IvKIgqOqEEB8nszlpHWzlhAu4376So2PgNhFP6UrlfNTllt/WDti5YMOHnVimPWIDHmLPKFan0+wfzpsoRCRdg== + dependencies: + "@apollographql/apollo-tools" "^0.4.0" + "@apollographql/graphql-playground-html" "1.6.24" + "@types/graphql-upload" "^8.0.0" + "@types/ws" "^6.0.0" + apollo-cache-control "0.8.1" + apollo-datasource "0.6.1" + apollo-engine-reporting "1.4.3" + apollo-server-caching "0.5.0" + apollo-server-env "2.4.1" + apollo-server-errors "2.3.1" + apollo-server-plugin-base "0.6.1" + apollo-server-types "0.2.1" + apollo-tracing "0.8.1" + fast-json-stable-stringify "^2.0.0" + graphql-extensions "0.10.0" + graphql-tag "^2.9.2" + graphql-tools "^4.0.0" + graphql-upload "^8.0.2" + sha.js "^2.4.11" + subscriptions-transport-ws "^0.9.11" + ws "^6.0.0" + apollo-server-env@2.4.1: version "2.4.1" resolved "https://registry.yarnpkg.com/apollo-server-env/-/apollo-server-env-2.4.1.tgz#58264ecfeb151919e0f480320b4e3769be9f18f3" @@ -1715,7 +1742,7 @@ apollo-server-errors@2.3.1: resolved "https://registry.yarnpkg.com/apollo-server-errors/-/apollo-server-errors-2.3.1.tgz#033cf331463ebb99a563f8354180b41ac6714eb6" integrity sha512-errZvnh0vUQChecT7M4A/h94dnBSRL213dNxpM5ueMypaLYgnp4hiCTWIEaooo9E4yMGd1qA6WaNbLDG2+bjcg== -apollo-server-express@2.8.2, apollo-server-express@^2.8.1: +apollo-server-express@2.8.2: version "2.8.2" resolved "https://registry.yarnpkg.com/apollo-server-express/-/apollo-server-express-2.8.2.tgz#cd1c6994cf5adceea057a088aff52f289bb36377" integrity sha512-eA7IupNbx3PjIW4E0uMjQU9WvxcHznzgdFWRxJ4RqDiIwrrwROb7dgmPm3TJaatU/etjGq482pdfJIlMDNYPeA== @@ -1735,6 +1762,27 @@ apollo-server-express@2.8.2, apollo-server-express@^2.8.1: subscriptions-transport-ws "^0.9.16" type-is "^1.6.16" +apollo-server-express@^2.9.0: + version "2.9.0" + resolved "https://registry.yarnpkg.com/apollo-server-express/-/apollo-server-express-2.9.0.tgz#9d2a2d9823422ef26bca15931669d3153dc8a08b" + integrity sha512-+057V6Ui1BX69jUlV6YDQ7Xw9CCBfowN/GauvyF09KnsjYUJ+cB1xf4mkj/HAjaz4ReXQaALJNr2qPYPXS4R6w== + dependencies: + "@apollographql/graphql-playground-html" "1.6.24" + "@types/accepts" "^1.3.5" + "@types/body-parser" "1.17.1" + "@types/cors" "^2.8.4" + "@types/express" "4.17.1" + accepts "^1.3.5" + apollo-server-core "2.9.0" + apollo-server-types "0.2.1" + body-parser "^1.18.3" + cors "^2.8.4" + graphql-subscriptions "^1.0.0" + graphql-tools "^4.0.0" + parseurl "^1.3.2" + subscriptions-transport-ws "^0.9.16" + type-is "^1.6.16" + apollo-server-plugin-base@0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/apollo-server-plugin-base/-/apollo-server-plugin-base-0.6.1.tgz#b9c209aa2102a26c6134f51bfa1e4a8307b63b11" @@ -1742,12 +1790,12 @@ apollo-server-plugin-base@0.6.1: dependencies: apollo-server-types "0.2.1" -apollo-server-testing@~2.8.2: - version "2.8.2" - resolved "https://registry.yarnpkg.com/apollo-server-testing/-/apollo-server-testing-2.8.2.tgz#8faa8f1778fa4893f5bf705f7cea84a69477aa3f" - integrity sha512-ccp1DpmjdmLT98ww4NtSiDPbeIPlVZJ5Iy408ToyhAGwNXRHk5f8Czf+JAgSayvgt4cxCm1fzxnVe1OjO8oIvA== +apollo-server-testing@~2.9.0: + version "2.9.0" + resolved "https://registry.yarnpkg.com/apollo-server-testing/-/apollo-server-testing-2.9.0.tgz#fb5276e0761992ed493d84e998eaa4f696914519" + integrity sha512-N6c+wx5MaDZ0mWPzA11nKkkJjX+E3ubATY3G5ejprUsN8BiHENyEQ0EZh+dO0yL9+q/mUHix3p7Utax9odxBcw== dependencies: - apollo-server-core "2.8.2" + apollo-server-core "2.9.0" apollo-server-types@0.2.1: version "0.2.1" @@ -4079,6 +4127,15 @@ graphql-custom-directives@~0.2.14: moment "^2.22.2" numeral "^2.0.6" +graphql-extensions@0.10.0: + version "0.10.0" + resolved "https://registry.yarnpkg.com/graphql-extensions/-/graphql-extensions-0.10.0.tgz#ceafc42e16554930b0dc90f64d5727ee2a9e9cf9" + integrity sha512-qz9Ev0NgsRxdTYqYSCpYwBWS9r1imm+vCBt3PmHzqZlE7SEpUPGddn9oKcLRB/P8uXT6dsr60hDmDHukIxiVOw== + dependencies: + "@apollographql/apollo-tools" "^0.4.0" + apollo-server-env "2.4.1" + apollo-server-types "0.2.1" + graphql-extensions@0.8.1: version "0.8.1" resolved "https://registry.yarnpkg.com/graphql-extensions/-/graphql-extensions-0.8.1.tgz#f5f1fed5fe49620c4e70c5d08bdbd0039e91c402" @@ -6773,7 +6830,7 @@ parse5@^3.0.1: dependencies: "@types/node" "*" -parseurl@~1.3.3: +parseurl@^1.3.2, parseurl@~1.3.3: version "1.3.3" resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== diff --git a/neo4j/Dockerfile b/neo4j/Dockerfile index 56175e423..1cfa04507 100644 --- a/neo4j/Dockerfile +++ b/neo4j/Dockerfile @@ -5,7 +5,6 @@ ARG BUILD_COMMIT ENV BUILD_COMMIT=$BUILD_COMMIT COPY db_setup.sh /usr/local/bin/db_setup -COPY entrypoint.sh /docker-entrypoint-wrapper.sh -RUN apt-get update && apt-get -y install procps wget + +RUN apt-get update && apt-get -y install wget htop RUN wget https://github.com/neo4j-contrib/neo4j-apoc-procedures/releases/download/3.5.0.4/apoc-3.5.0.4-all.jar -P plugins/ -ENTRYPOINT ["/docker-entrypoint-wrapper.sh"] diff --git a/neo4j/README.md b/neo4j/README.md index 78c4bc62e..fe8825734 100644 --- a/neo4j/README.md +++ b/neo4j/README.md @@ -18,6 +18,16 @@ docker-compose up You can access Neo4J through [http://localhost:7474/](http://localhost:7474/) for an interactive cypher shell and a visualization of the graph. +### Database Indices and Constraints + +Database indices and constraints need to be created when the database is +running. So start the container with the command above and run: + +```bash +docker-compose exec neo4j db_setup +``` + + ## Installation without Docker Install the community edition of [Neo4j](https://neo4j.com/) along with the plugin @@ -35,6 +45,20 @@ Then make sure to allow Apoc procedures by adding the following line to your Neo ``` dbms.security.procedures.unrestricted=apoc.* ``` +### Database Indices and Constraints + +If you have `cypher-shell` available with your local installation of neo4j you +can run: + +```bash +# in folder neo4j/ +$ cp .env.template .env +$ ./db_setup.sh +``` + +Otherwise, if you don't have `cypher-shell` available, copy the cypher +statements [from the `db_setup.sh` script](https://github.com/Human-Connection/Human-Connection/blob/master/neo4j/db_setup.sh) and paste the scripts into your +[database browser frontend](http://localhost:7474). ### Alternatives @@ -50,21 +74,3 @@ in `backend/.env`. Start Neo4J and confirm the database is running at [http://localhost:7474](http://localhost:7474). -## Database Indices and Constraints - -If you are not running our dedicated Neo4J [docker image](https://hub.docker.com/r/humanconnection/neo4j), -which is the case if you setup Neo4J locally without docker, then you have to -setup unique indices and database constraints manually. - -If you have `cypher-shell` available with your local installation of neo4j you -can run: - -```bash -# in folder neo4j/ -$ cp .env.template .env -$ ./db_setup.sh -``` - -Otherwise, if you don't have `cypher-shell` available, copy the cypher -statements [from the `db_setup.sh` script](https://github.com/Human-Connection/Human-Connection/blob/master/neo4j/db_setup.sh) and paste the scripts into your -[database browser frontend](http://localhost:7474). diff --git a/neo4j/entrypoint.sh b/neo4j/entrypoint.sh deleted file mode 100755 index f9c1afbe1..000000000 --- a/neo4j/entrypoint.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -# credits: https://github.com/javamonkey79 -# https://github.com/neo4j/docker-neo4j/issues/166 - -# turn on bash's job control -set -m - -# Start the primary process and put it in the background -/docker-entrypoint.sh neo4j & - -# Start the helper process -db_setup - -# the my_helper_process might need to know how to wait on the -# primary process to start before it does its work and returns - - -# now we bring the primary process back into the foreground -# and leave it there -fg %1 diff --git a/webapp/components/Registration/Signup.vue b/webapp/components/Registration/Signup.vue index 175db1fd6..dcf4f0e88 100644 --- a/webapp/components/Registration/Signup.vue +++ b/webapp/components/Registration/Signup.vue @@ -9,17 +9,21 @@ :schema="formSchema" @submit="handleSubmit" > -

{{ $t('registration.signup.title') }}

+

{{ invitation ? $t('profile.invites.title') : $t('registration.signup.title') }}

- {{ $t('registration.signup.form.description') }} + {{ + invitation + ? $t('profile.invites.description') + : $t('registration.signup.form.description') + }} @@ -73,11 +75,13 @@ export const SignupByInvitationMutation = gql` } ` export default { + name: 'Signup', components: { SweetalertIcon, }, props: { token: { type: String, default: null }, + invitation: { type: Boolean, default: false }, }, data() { return { diff --git a/webapp/locales/de.json b/webapp/locales/de.json index 253c27664..bb70ed36e 100644 --- a/webapp/locales/de.json +++ b/webapp/locales/de.json @@ -122,8 +122,12 @@ "followingNobody": "folgt niemandem.", "followedBy": "wird gefolgt von:", "followedByNobody": "wird von niemandem gefolgt.", - "and": "und", - "more": "weitere" + "andMore": "und {number} weitere …" + }, + "invites": { + "title": "Lade jemanden zu Human Connection ein!", + "description": "Für die Einladung trage seine E-Mail-Adresse hier ein.", + "emailPlaceholder": "E-Mail-Adresse für die Einladung" } }, "notifications": { @@ -273,8 +277,8 @@ }, "invites": { "name": "Benutzer einladen", - "title": "Benutzer als Admin anmelden", - "description": "Dieses Anmeldeformular ist zu sehen sobald die Anmeldung öffentlich zugänglich ist." + "title": "Leute einladen", + "description": "Einladungen sind ein wunderbarer Weg, deine Freund in deinem Netzwerk zu haben …" } }, "post": { diff --git a/webapp/locales/en.json b/webapp/locales/en.json index b32691418..94451fa88 100644 --- a/webapp/locales/en.json +++ b/webapp/locales/en.json @@ -122,8 +122,12 @@ "followingNobody": "follows nobody.", "followedBy": "is followed by:", "followedByNobody": "is not followed by anyone.", - "and": "and", - "more": "more" + "andMore": "and {number} more …" + }, + "invites": { + "title": "Invite somebody to Human Connection!", + "description": "Enter thier email address for invitation.", + "emailPlaceholder": "Email to invite" } }, "notifications": { @@ -273,8 +277,8 @@ }, "invites": { "name": "Invite users", - "title": "Signup users as admin", - "description": "This registration form will be visible as soon as the registration is open to the public." + "title": "Invite people", + "description": "Invitations are a wonderful way to have your friends in your network …" } }, "post": { diff --git a/webapp/package.json b/webapp/package.json index be7960fdb..2958a5f5a 100644 --- a/webapp/package.json +++ b/webapp/package.json @@ -63,7 +63,7 @@ "cross-env": "~5.2.0", "date-fns": "2.0.0", "express": "~4.17.1", - "graphql": "~14.5.0", + "graphql": "~14.5.3", "isemail": "^3.2.0", "jsonwebtoken": "~8.5.1", "linkify-it": "~2.2.0", @@ -95,7 +95,7 @@ "@vue/server-test-utils": "~1.0.0-beta.29", "@vue/test-utils": "~1.0.0-beta.29", "babel-core": "~7.0.0-bridge.0", - "babel-eslint": "~10.0.2", + "babel-eslint": "~10.0.3", "babel-jest": "~24.9.0", "babel-loader": "~8.0.6", "babel-preset-vue": "~2.0.2", diff --git a/webapp/pages/admin/invite.vue b/webapp/pages/admin/invite.vue index 36e679112..3f9b4d831 100644 --- a/webapp/pages/admin/invite.vue +++ b/webapp/pages/admin/invite.vue @@ -1,14 +1,11 @@ diff --git a/webapp/pages/profile/_id/_slug.vue b/webapp/pages/profile/_id/_slug.vue index bc712e6e0..b33d88bda 100644 --- a/webapp/pages/profile/_id/_slug.vue +++ b/webapp/pages/profile/_id/_slug.vue @@ -95,8 +95,11 @@ - {{ $t('profile.network.and') }} {{ user.followingCount - user.following.length }} - {{ $t('profile.network.more') }} + {{ + $t('profile.network.andMore', { + number: user.followingCount - user.following.length, + }) + }} @@ -122,8 +125,11 @@ - {{ $t('profile.network.and') }} {{ user.followedByCount - user.followedBy.length }} - {{ $t('profile.network.more') }} + {{ + $t('profile.network.andMore', { + number: user.followedByCount - user.followedBy.length, + }) + }} @@ -195,16 +201,22 @@ - - + + + +