Merge branch 'master' of https://github.com/Human-Connection/Human-Connection into 1062-notification-about-comment-on-post

This commit is contained in:
Wolfgang Huß 2019-08-26 15:44:32 +02:00
commit 7498d88a44
14 changed files with 165 additions and 118 deletions

View File

@ -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

View File

@ -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",

View File

@ -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

View File

@ -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==

View File

@ -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"]

View File

@ -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).

View File

@ -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

View File

@ -9,17 +9,21 @@
:schema="formSchema"
@submit="handleSubmit"
>
<h1>{{ $t('registration.signup.title') }}</h1>
<h1>{{ invitation ? $t('profile.invites.title') : $t('registration.signup.title') }}</h1>
<ds-space v-if="token" margin-botton="large">
<ds-text v-html="$t('registration.signup.form.invitation-code', { code: token })" />
</ds-space>
<ds-space margin-botton="large">
<ds-text>
{{ $t('registration.signup.form.description') }}
{{
invitation
? $t('profile.invites.description')
: $t('registration.signup.form.description')
}}
</ds-text>
</ds-space>
<ds-input
:placeholder="$t('login.email')"
:placeholder="invitation ? $t('profile.invites.emailPlaceholder') : $t('login.email')"
type="email"
id="email"
model="email"
@ -45,9 +49,7 @@
</template>
<template v-else>
<sweetalert-icon icon="error" />
<ds-text align="center">
{{ error.message }}
</ds-text>
<ds-text align="center">{{ error.message }}</ds-text>
</template>
</div>
</ds-space>
@ -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 {

View File

@ -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": {

View File

@ -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": {

View File

@ -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",

View File

@ -1,14 +1,11 @@
<template>
<!-- This registration form will be visible to the public as soon as the registration is open to the public. -->
<ds-section>
<ds-space>
<ds-heading size="h3">
{{ $t('admin.invites.title') }}
</ds-heading>
<ds-text>
{{ $t('admin.invites.description') }}
</ds-text>
<ds-heading size="h3">{{ $t('admin.invites.title') }}</ds-heading>
<ds-text>{{ $t('admin.invites.description') }}</ds-text>
</ds-space>
<signup />
<signup :invitation="true" />
</ds-section>
</template>

View File

@ -95,8 +95,11 @@
</ds-space>
<ds-space v-if="user.followingCount - user.following.length" margin="small">
<ds-text size="small" color="softer">
{{ $t('profile.network.and') }} {{ user.followingCount - user.following.length }}
{{ $t('profile.network.more') }}
{{
$t('profile.network.andMore', {
number: user.followingCount - user.following.length,
})
}}
</ds-text>
</ds-space>
</template>
@ -122,8 +125,11 @@
</ds-space>
<ds-space v-if="user.followedByCount - user.followedBy.length" margin="small">
<ds-text size="small" color="softer">
{{ $t('profile.network.and') }} {{ user.followedByCount - user.followedBy.length }}
{{ $t('profile.network.more') }}
{{
$t('profile.network.andMore', {
number: user.followedByCount - user.followedBy.length,
})
}}
</ds-text>
</ds-space>
</template>
@ -195,16 +201,22 @@
</ds-card>
</ds-grid-item>
<ds-grid-item :row-span="2" column-span="fullWidth" class="create-button">
<ds-button
v-if="myProfile"
v-tooltip="{ content: 'Create a new Post', placement: 'left', delay: { show: 500 } }"
:path="{ name: 'post-create' }"
class="profile-post-add-button"
icon="plus"
size="large"
primary
/>
<ds-grid-item :row-span="2" column-span="fullWidth">
<ds-space centered>
<ds-button
v-if="myProfile"
v-tooltip="{
content: 'Create a new Post',
placement: 'left',
delay: { show: 500 },
}"
:path="{ name: 'post-create' }"
class="profile-post-add-button"
icon="plus"
size="large"
primary
/>
</ds-space>
</ds-grid-item>
<template v-if="activePosts.length">
@ -429,10 +441,6 @@ export default {
.pointer {
cursor: pointer;
}
.create-button {
text-align: center;
margin: auto;
}
.Tab {
border-collapse: collapse;
padding-bottom: 5px;

View File

@ -3597,17 +3597,17 @@ babel-core@~7.0.0-bridge.0:
resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-7.0.0-bridge.0.tgz#95a492ddd90f9b4e9a4a1da14eb335b87b634ece"
integrity sha512-poPX9mZH/5CSanm50Q+1toVci6pv5KSRv/5TWCwtzQS5XEwn40BcCrgIeMFWP9CKKIniKXNxoIOnOq4VVlGXhg==
babel-eslint@~10.0.2:
version "10.0.2"
resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-10.0.2.tgz#182d5ac204579ff0881684b040560fdcc1558456"
integrity sha512-UdsurWPtgiPgpJ06ryUnuaSXC2s0WoSZnQmEpbAH65XZSdwowgN5MvyP7e88nW07FYXv72erVtpBkxyDVKhH1Q==
babel-eslint@~10.0.3:
version "10.0.3"
resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-10.0.3.tgz#81a2c669be0f205e19462fed2482d33e4687a88a"
integrity sha512-z3U7eMY6r/3f3/JB9mTsLjyxrv0Yb1zb8PCWCLpguxfCzBIZUwy23R1t/XKewP+8mEN2Ck8Dtr4q20z6ce6SoA==
dependencies:
"@babel/code-frame" "^7.0.0"
"@babel/parser" "^7.0.0"
"@babel/traverse" "^7.0.0"
"@babel/types" "^7.0.0"
eslint-scope "3.7.1"
eslint-visitor-keys "^1.0.0"
resolve "^1.12.0"
babel-helper-evaluate-path@^0.5.0:
version "0.5.0"
@ -6438,14 +6438,6 @@ eslint-plugin-vue@~5.2.3:
dependencies:
vue-eslint-parser "^5.0.0"
eslint-scope@3.7.1:
version "3.7.1"
resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.1.tgz#3d63c3edfda02e06e01a452ad88caacc7cdcb6e8"
integrity sha1-PWPD7f2gLgbgGkUq2IyqzHzctug=
dependencies:
esrecurse "^4.1.0"
estraverse "^4.1.1"
eslint-scope@^4.0.0, eslint-scope@^4.0.3:
version "4.0.3"
resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-4.0.3.tgz#ca03833310f6889a3264781aa82e63eb9cfe7848"
@ -7624,10 +7616,10 @@ graphql-upload@^8.0.2:
http-errors "^1.7.2"
object-path "^0.11.4"
"graphql@14.0.2 - 14.2.0 || ^14.3.1", graphql@^14.4.0, graphql@~14.5.0:
version "14.5.0"
resolved "https://registry.yarnpkg.com/graphql/-/graphql-14.5.0.tgz#4801e6460942c9c591944617f6dd224a9e531520"
integrity sha512-wnGcTD181L2xPnIwHHjx/moV4ulxA2Kms9zcUY+B/SIrK+2N+iOC6WNgnR2zVTmg1Z8P+CZq5KXibTnatg3WUw==
"graphql@14.0.2 - 14.2.0 || ^14.3.1", graphql@^14.4.0, graphql@~14.5.3:
version "14.5.3"
resolved "https://registry.yarnpkg.com/graphql/-/graphql-14.5.3.tgz#e025851cc413e153220f4edbbb25d49f55104fa0"
integrity sha512-W8A8nt9BsMg0ZK2qA3DJIVU6muWhxZRYLTmc+5XGwzWzVdUdPVlAAg5hTBjiTISEnzsKL/onasu6vl3kgGTbYg==
dependencies:
iterall "^1.2.2"
@ -13182,20 +13174,13 @@ resolve@1.1.7:
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b"
integrity sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=
resolve@^1.1.6:
resolve@^1.1.6, resolve@^1.1.7, resolve@^1.10.0, resolve@^1.10.1, resolve@^1.11.0, resolve@^1.12.0, resolve@^1.2.0, resolve@^1.3.2, resolve@^1.5.0, resolve@^1.8.1:
version "1.12.0"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.12.0.tgz#3fc644a35c84a48554609ff26ec52b66fa577df6"
integrity sha512-B/dOmuoAik5bKcD6s6nXDCjzUKnaDvdkRyAk6rsmsKLipWj4797iothd7jmmUhWTfinVMU+wc56rYKsit2Qy4w==
dependencies:
path-parse "^1.0.6"
resolve@^1.1.7, resolve@^1.10.0, resolve@^1.10.1, resolve@^1.11.0, resolve@^1.2.0, resolve@^1.3.2, resolve@^1.5.0, resolve@^1.8.1:
version "1.11.0"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.11.0.tgz#4014870ba296176b86343d50b60f3b50609ce232"
integrity sha512-WL2pBDjqT6pGUNSUzMw00o4T7If+z4H2x3Gz893WoUQ5KW8Vr9txp00ykiP16VBaZF5+j/OcXJHZ9+PCvdiDKw==
dependencies:
path-parse "^1.0.6"
responselike@1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/responselike/-/responselike-1.0.2.tgz#918720ef3b631c5642be068f15ade5a46f4ba1e7"