2184 Commits

Author SHA1 Message Date
Matt Rider
ee93efd6d9 Localise categories 2019-08-14 13:57:39 +02:00
Wolfgang Huß
67f25104f4 Fixing lint 2019-08-14 13:22:01 +02:00
Wolfgang Huß
825a5f235a Merge branch 'master' of https://github.com/Human-Connection/Human-Connection into 1017-send-out-notifications-on-create-omment 2019-08-14 13:10:19 +02:00
roschaefer
d2a6d8c047 Avoid notifications if user was blocked
Otherwise you would follow a link and get a 404
2019-08-13 17:16:24 +02:00
roschaefer
6fb926e735 Fix Search.feature in a hacky way
Ok, we have no control what parameters are passed to the cypher query
generated by `neo4j-graphql-js`. So I'm re-using the `filter` param.
If the `$filter` param is `{}` then we can use COALESCE to turn that
into empty array. Ugh.
2019-08-13 16:46:52 +02:00
roschaefer
5103bdbc2a Fix tests 2019-08-13 11:50:33 +02:00
Robert Schäfer
bedbb21def Refactor notification spec
Wow this took me the entire day: If you run `createServer` multiple
times, more and more middlewares get added to the schema. That's why
the test would create 2^n notifications for n times you called
`createServer`. This is related to the following bug:

https://github.com/prisma/graphql-middleware/issues/63
2019-08-13 11:05:29 +02:00
Robert Schäfer
8de0195cf8 Keep existing filter params + same for text search 2019-08-13 11:05:29 +02:00
Robert Schäfer
5fb60d1132 Implement+test blocking a user on backend 2019-08-13 11:05:29 +02:00
Robert Schäfer
cc1f932803 Refactor tests with Post model 2019-08-13 11:05:29 +02:00
Robert Schäfer
7f509b3201 Implement block/unbock UI 2019-08-13 11:05:29 +02:00
Robert Schäfer
293054a05b Implement block+unblock basic features 2019-08-13 11:05:29 +02:00
Robert Schäfer
700bdcb8f1 Implement+test unblock mutation 2019-08-13 11:05:29 +02:00
Robert Schäfer
f5a59568ab Implement block except for the unfollow feature 2019-08-13 11:05:29 +02:00
Robert Schäfer
05aee24efd Implement+test User.blockedUsers resolver 2019-08-13 11:05:29 +02:00
Robert Schäfer
b63f6b0ba1 Setup blocked relationships in seeds 2019-08-13 11:05:29 +02:00
Robert Schäfer
f8b37b5c1e Remove obsolete relationship 'BLACKLISTED' 2019-08-13 11:05:29 +02:00
Robert Schäfer
6950068a12 Sketch test for #1054 2019-08-13 11:05:29 +02:00
Wolfgang Huß
bf92a88bf9
Merge pull request #1223 from Human-Connection/remove-mocks
Remove obsolete "MOCKS"
2019-08-09 10:31:42 +02:00
Robert Schäfer
2eaf66378a
Merge pull request #1133 from Human-Connection/384-emotions-on-posts
Emotions on posts
2019-08-09 00:37:38 +02:00
Robert Schäfer
963cbbef32 RemovePostEmotions should return deleted object
@mattwr18 I prefer (I believe it's even best practice) that a delete
mutation should return the deleted object. If you run the delete
mutation again, it should return `null` because there is no object like
that anymore. That way the client knows if a delete mutation has changed
any state in the database.

Also I fixed another bug in the resolver. If your graphql mutation looks
like this:

```gql
mutation {
  RemovePostEmotions(to:{ id:"p15"}, data:{emotion: angry}) {
    from {
      id
      name
    }
    to {
      id
      title
    }
    emotion
  }
}
```

Then you get errors because your resolver does not return the name for
the user or the title for the post anymore. Just use spread operator...
and it's fixed.
2019-08-08 23:51:26 +02:00
Robert Schäfer
f3e545a913 Fix bug: Only add emotions for authenticated user 2019-08-08 23:10:01 +02:00
Robert Schäfer
ff7143dcb1 Remove obsolete "MOCKS"
It's unused code after all and I think we can improve the code base by
removing confusing code.
2019-08-08 20:18:32 +02:00
Matt Rider
fd022c7992 Fix mentions in seeds 2019-08-08 10:19:38 +02:00
Matt Rider
b6975bde89 Add data-mention-id to seeds mentions 2019-08-08 10:07:57 +02:00
Matt Rider
21aa729edb Merge branch 'master' of github.com:Human-Connection/Human-Connection into 1017-send-out-notifications-on-create-omment 2019-08-08 09:10:18 +02:00
Matt Rider
39a94a8aac Refactor
- follow PR review by @roschaefer
2019-08-07 14:55:32 +02:00
Matt Rider
b8e1ae0a1c Update user ids 2019-08-06 18:57:27 +02:00
Matt Rider
53af29b5a2 Refactor backend tests
- to use neode and apollo-server-testing
2019-08-06 18:26:39 +02:00
Matt Rider
d795ee50a9 Add backend tests for custom queries 2019-08-06 10:58:30 +02:00
Matt Rider
1593eab9cf Merge branch 'master' of github.com:Human-Connection/Human-Connection into 384-emotions-on-posts 2019-08-06 08:07:39 +02:00
Matt Rider
cb7217f5a7 Fix bug
- apollo query fetchPolicy set to no-cache so that it will refetch a post's emotions count on page transition
2019-08-06 08:05:35 +02:00
Robert Schäfer
1aeb93f9fb Merge remote-tracking branch 'origin/master' into storybook 2019-08-05 12:47:46 +02:00
Wolfgang Huß
22b9bf77fa Merge branch 'master' of https://github.com/Human-Connection/Human-Connection into 1017-send-out-notifications-on-create-omment
# Conflicts:
#	backend/src/schema/resolvers/notifications.spec.js
2019-08-05 10:15:20 +02:00
Matt Rider
295b7e7769 Merge branch 'master' of github.com:Human-Connection/Human-Connection into 384-emotions-on-posts 2019-08-05 09:50:54 +02:00
Matt Rider
97ff2e9457 Make emotionsArray a const, fix lint 2019-08-05 09:50:25 +02:00
Robert Schäfer
26958f6641 Explicitly disallow User.name == null in model 2019-08-03 00:43:18 +02:00
Matt Rider
d1d82a0051 Merge branch 'master' of github.com:Human-Connection/Human-Connection into 384-emotions-on-posts 2019-08-02 16:55:54 +02:00
Robert Schäfer
a6aa974179 Merge remote-tracking branch 'origin/master' into storybook 2019-08-02 14:28:49 +02:00
Robert Schäfer
f1b28c83a0 Meld commits from master 2019-08-02 14:26:06 +02:00
Matt Rider
76a720caec Merge branch 'master' of github.com:Human-Connection/Human-Connection into 384-emotions-on-posts 2019-08-02 08:02:54 +02:00
Robert Schäfer
e1bb6ed74e Fix lint 2019-08-02 01:45:36 +02:00
Matt Rider
fb9a632d55 Query a currentUsers emotions for a post, translations 2019-08-01 15:11:41 +02:00
Robert Schäfer
fdef9db74f Update metascraper-youtube 2019-08-01 14:19:24 +02:00
Robert Schäfer
b6a59460bd Merge remote-tracking branch 'origin/master' into storybook 2019-08-01 12:22:09 +02:00
Robert Schäfer
c9e6d182ec Followed @mattwr18's suggestions here:
https://github.com/Human-Connection/Human-Connection/pull/952#pullrequestreview-269406016
2019-08-01 12:20:33 +02:00
Matt Rider
08899a4af9 Merge branch 'master' of github.com:Human-Connection/Human-Connection into 384-emotions-on-posts 2019-08-01 09:22:57 +02:00
Robert Schäfer
72edf78889 Meld a chaotic commit history into one commit
Some important commit messages:

```
    Fix youtu.be not being embedded

    And also try to maintain the old behaviour matching
    `provider.provider_url`.
```

```
    Remove confusing code comments and obsolete code

    I discovered that the behaviour of no duplicate notifications being send
    out is caused by the frontend: When the editor reads html from the
    backend, it will parse hashtags and mentions as ordinary links, not as
    their respective nodes during editing. Also, we don't have to worry
    about duplicate ids being found: The cypher statement will implicitly
    suppress duplicate notification nodes for the same user.

    So let's remove the code to avoid confusing the next developer.
```

```
    Test editor.getHTML()

    I do this because I'm not able to test the content of `this.editor` from
    a wrapper of `vue-test-utils`. If I call `this.editor.getHTML` directly
    and use it as a computed property `renderedContent` to populate a `<div
    v-html="renderedContent" />` this will not work for the embeds. So, my
    current best bet is to test the editor object isolated from a real
    component. ;(
```

```
    Add core-js as explicit dependency

    Because of build errors on Travis.

    See: https://stackoverflow.com/a/55313456

    Remove as soon as this issue is resolved:
    https://github.com/storybookjs/storybook/issues/7591

```

```
    Refactor: Keep Runtime-only builds

    See: https://vuejs.org/v2/guide/installation.html#Runtime-Compiler-vs-Runtime-only
```
2019-08-01 00:28:22 +02:00
Robert Schäfer
c65cc3e0e5 Implement+test SocialMedia.ownedBy resolver
Explicitly define `SocialMedia` graphql type and exclude it from
`neo4j-graphql-js`.
2019-07-31 18:07:48 +02:00
Robert Schäfer
448706ab18 Merge remote-tracking branch 'origin/master' into refactor-social-media-backend 2019-07-31 17:36:02 +02:00