94 Commits

Author SHA1 Message Date
roschaefer
c129c3fbae Admin page handles loading and error state 2019-09-05 17:22:04 +02:00
roschaefer
5f14b4c45f Fix lint 2019-09-03 23:19:55 +02:00
roschaefer
99dd6ea20a Centralize fragments, fix @mattwr18's bugs
Most of those bugs weren't even introduced in this PR, e.g. the missing
`this.$i18n` for the comments mutations.
2019-09-03 21:28:29 +02:00
roschaefer
bb3f419532 Refactor graphql queries and fix bug
It's sometimes unbelievable how many bugs you find when doing
refactoring. This time there was some apparent confusion about
`commentsCount` and `commentedCount`. The counters on the post card were
never showing the correct number.
2019-09-03 21:28:29 +02:00
roschaefer
491a626031 Replace deleteComment with a more KISS solution 2019-09-03 21:28:29 +02:00
roschaefer
c585b23d7a Fix notification queries in webapp 2019-08-30 16:00:32 +02:00
Robert Schäfer
079ced0593
Merge pull request #1400 from Human-Connection/1391-fix-bug-where-apollo-cache-not-updated-on-comment-deletion
Update the apollo cache
2019-08-28 19:37:59 +02:00
Matt Rider
ba1e62da21 Update the apollo cache 2019-08-26 18:54:21 +02:00
Wolfgang Huß
df4f0627b5 Merge branch 'master' of https://github.com/Human-Connection/Human-Connection into 1062-notification-about-comment-on-post
# Conflicts:
#	backend/src/middleware/index.js
2019-08-23 15:31:48 +02:00
roschaefer
37c12f6681 Fix post count always showing 0 2019-08-23 00:36:47 +02:00
Wolfgang Huß
793485c0fc Write frontend tests 2019-08-22 15:20:40 +02:00
Wolfgang Huß
04fe6b0a8c Merge branch 'master' of https://github.com/Human-Connection/Human-Connection into 1062-notification-about-comment-on-post
# Conflicts:
#	backend/src/middleware/handleNotifications/handleNotificationsMiddleware.spec.js

Refactored there tests a little
2019-08-22 11:02:10 +02:00
Wolfgang Huß
9a799657e9 Merge branch 'master' of https://github.com/Human-Connection/Human-Connection into 1062-notification-about-comment-on-post
# Conflicts:
#	backend/src/middleware/handleHtmlContent/handleContentData.js
2019-08-21 14:42:19 +02:00
Matt Rider
8735045d11 Update cypress tests, post query 2019-08-20 20:13:29 +02:00
Matt Rider
053d8bcf7b Fix UserQuery 2019-08-19 11:41:23 +02:00
Matt Rider
caff74e58b Merge branch 'master' of github.com:Human-Connection/Human-Connection into 1017-send-out-notifications-on-create-omment 2019-08-19 10:50:46 +02:00
Robert Schäfer
87461c21ca
Merge pull request #1280 from Human-Connection/refactor-graphql-queries
Refactor graphql queries
2019-08-19 09:58:38 +02:00
Wolfgang Huß
f653bac9e1 Merge branch 'master' of https://github.com/Human-Connection/Human-Connection into 1017-send-out-notifications-on-create-omment
# Conflicts:
#	backend/src/middleware/handleHtmlContent/handleContentData.spec.js
2019-08-16 18:22:36 +02:00
Wolfgang Huß
efb5c75c24 Refactor after Roberts suggestions, number I
Start writing tests
2019-08-16 16:56:14 +02:00
Matt Rider
fdc0d808f6 Fix search query 2019-08-16 14:18:18 +02:00
Matt Rider
dbaa8e687f Fix vue warnings, fix tests, refactor
- was throwing an error when trying to update commentsCount because of new implementation by @roschaefer which uses countResolver, but there was no related for commentsCount, it was r... also commentsCount is no longer needed anywhere in the code base, it is commentedCount now
2019-08-16 13:28:55 +02:00
Matt Rider
d511d6aa78 Refactor graphql queries
- Remove duplicate queries
- Use smart query in pages/post/_id/_slug/index.vue to avoid multiple db requests for a post and its comments.
We cannot update the apollo cache with asyncData and smart queries have a prefetch policy set to true by default, which
means that they will resolve in a similar timeframe. https://stackoverflow.com/questions/55885337/in-nuxt-should-i-use-asyncdata-or-default-apollo-queries
https://vue-apollo.netlify.com/api/smart-query.html#options
https://vue-apollo.netlify.com/guide/ssr.html#vue-cli-plugin
2019-08-16 11:25:53 +02:00
roschaefer
51b734275a The name of the hashtag is now it's ID
`name` was just a redundant attribute
2019-08-16 01:49:29 +02:00
Matt Rider
569ace137b Merge branch 'master' of github.com:Human-Connection/Human-Connection into 1017-send-out-notifications-on-create-omment 2019-08-15 10:14:47 +02:00
Robert Schäfer
b6c96b7a57
Merge pull request #1261 from Human-Connection/1201-localise-categories
Localise categories
2019-08-14 17:44:21 +02:00
Matt Rider
ee93efd6d9 Localise categories 2019-08-14 13:57:39 +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
Robert Schäfer
7f509b3201 Implement block/unbock UI 2019-08-13 11:05:29 +02:00
Robert Schäfer
824b2a5561 Implement page for blocked users 2019-08-13 11:05:29 +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
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
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
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
3da986518e Write component tests, refactor 2019-08-02 10:52:36 +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
Matt Rider
5423412958 Set up UI 2019-07-31 14:58:05 +02:00
Matt Rider
69de04f1eb Remove extra parantheses 2019-07-22 05:52:01 -03:00
Alexander Friedland
4fe3c08402
Merge branch 'master' into 375-Sorting-II 2019-07-19 11:53:01 +02:00
ogerly
47324d4905 example II - lint ok, test local ok 2019-07-17 09:57:08 +02:00
Wolfgang Huß
cd0c509c81 Merge branch 'master' of https://github.com/Human-Connection/Human-Connection into 1017-send-out-notifications-on-create-omment 2019-07-16 16:10:36 +02:00
Wolfgang Huß
3b88c47206 Update the contentExcerpt
Co-Authored-By: mattwr18 <mattwr18@gmail.com>
2019-07-16 15:48:38 +02:00
Wolfgang Huß
ff234eeed5 Preparing for Mentions of users in Comments
Co-Authored-By: mattwr18 <mattwr18@gmail.com>
2019-07-16 08:12:40 +02:00
Matt Rider
2dca04523d Remove key request in badge queries
- clean up from `PR` which uses id, not key
2019-07-15 15:04:19 -03:00
Matt Rider
cf6ace59aa Merge branch 'master' of github.com:Human-Connection/Human-Connection into 967-filter-post-by-category 2019-07-15 11:34:42 -03:00
Robert Schäfer
99740e6ad6 Follow @Tirokk's suggestion and rename key=>id 2019-07-13 14:27:19 +02:00
Robert Schäfer
95a06a8344 Refactor all badges resolvers to use neode
FYI: @Tirokk I think we'll never remove or add new badges through
graphql. Instead, we will seed them manually with direct access to the
database. Therefore I removed the respective mutations and also your
tests regarding permissions.
2019-07-10 14:36:42 +02:00