475 Commits

Author SHA1 Message Date
Robert Schäfer
0e707cdd4c Massive refactoring
Fix #1231 the filter menu once and for all...
2019-08-10 03:41:38 +02:00
Robert Schäfer
cea206d118
Merge pull request #1225 from Human-Connection/dependabot/npm_and_yarn/webapp/vue-sweetalert-icons-4.2.0
Bump vue-sweetalert-icons from 4.1.0 to 4.2.0 in /webapp
2019-08-09 14:13:55 +02:00
Robert Schäfer
5d57f7b376 No global import - Thank you @JorgenVatle! ❤️
In version `v4.2.0` of `vue-sweetalert-icons` the local import is back, see:
https://github.com/JorgenVatle/vue-sweetalert-icons/issues/3#issuecomment-519497796
2019-08-09 13:21:54 +02:00
Robert Schäfer
3261237b48
Merge pull request #1169 from Human-Connection/964-filter-posts-by-followers
Move filter by followers functionality to filter dropdown
2019-08-09 11:57:17 +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
Matt Rider
0cee0ecccb Fix bug, maintain filters across page changes
- filter was a bit off for categories, clear the filter if there are no categories
- a user should maintain their filter until they clear it
2019-08-08 08:32:43 +02:00
Matt Rider
c00ab4450b Merge branch 'master' of github.com:Human-Connection/Human-Connection into 964-filter-posts-by-followers 2019-08-08 07:24:13 +02:00
Matt Rider
faa4148858 Stub sweetalert-icon in tests which use 2019-08-07 15:20:36 +02:00
Matt Rider
39a94a8aac Refactor
- follow PR review by @roschaefer
2019-08-07 14:55:32 +02:00
Robert Schäfer
3eab519760 Reduce the size of the emotion buttons
In my browser, the icons are so large that they overlap with the texts
below. I think a less intrusive size does the job equally well.
2019-08-06 22:37:36 +02:00
Matt Rider
1c0112e9d8 Merge branch 'master' of github.com:Human-Connection/Human-Connection into 384-emotions-on-posts 2019-08-06 19:00:14 +02:00
Robert Schäfer
27163b8d79 Install vue-sweetalert-icon globally
Updating the package to `v4.0.0` still gives me this warning:
```
 WARN  Compiled with 1 warnings
 WARN  in ./components/PasswordReset/ChangePassword.vue?vue&type=script&lang=js&
"export 'SweetalertIcon' was not found in 'vue-sweetalert-icons'
```

According to this thread https://github.com/JorgenVatle/vue-sweetalert-icons/issues/3
I copy+pasted the example configuration:
https://github.com/JorgenVatle/vue-sweetalert-icons-preview/blob/master/nuxt.config.js
https://github.com/JorgenVatle/vue-sweetalert-icons-preview/blob/master/plugins/vue-sweetalert-icons.js

And now the compile warnings are gone. I'm going to ask the maintainer if the
local import is not possible with `v4.0.0` anymore.
2019-08-06 11:03:12 +02:00
Matt Rider
f3dc5c6a68 Merge branch 'master' of github.com:Human-Connection/Human-Connection into 964-filter-posts-by-followers 2019-08-06 10:31:29 +02:00
Matt Rider
e08e150742 Fix bug with lost filter when sorting
- add filtered state to vuex, so as to maintain filter
- filter is reset when visiting other pages, so reset the active buttons in the filter posts dropdown
- maybe we want to maintain the filters between page transitions and only clear when the user requests to?
2019-08-06 10:29:16 +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
Matt Rider
32796bfa0d Fix failing build 2019-08-05 19:08:53 +02:00
Robert Schäfer
52e0361087 Fixing pasteRules for Embeds
Apparently the default pasteRules of tiptap interfere with the
pasteRules of a Link (in our case an Embed node). Consider this example:

https://de.wikipedia.org/wiki/Yin_und_Yang

Depending on some random conditions, tiptap might parse the `_und_` to be
italic because it's wrapped with underscores (markdown syntax). The
result is:

https://de.wikipedia.org/wiki/Yin # link
_und_                             # italic
Yang                              # plain text

So let's remove the default pasteRules of `Bold`, `Strike` and `Italic`
marks respectively to prefer our Embeds. Who is copy+pasting from one
tiptap editor to another tiptap editor anyways?
2019-08-05 17:26:50 +02:00
Matt Rider
1cd3ba907b Set vuex state to reset active button
- when a user clicks on the logo or changes pages, the filter is reset, but the active button didn't update
- still a bug with the active categoryIds since it's not so easy to set the state of an array in vuex
- dry out code for toggleFilters
- fix bug where user clicks on filter by users followed, then filters for categories of those users, then clicks to remove category filter
2019-08-05 14:39:45 +02:00
Robert Schäfer
8093fece00 Update URL regex taking e.g. "?" into account 2019-08-05 13:25:50 +02:00
Robert Schäfer
1aeb93f9fb Merge remote-tracking branch 'origin/master' into storybook 2019-08-05 12:47:46 +02:00
Robert Schäfer
b797ce4b15 Follow @Tirokk's suggestions:
* Add target="_blank" (on embeds only!)
* When pasting a link, the cursor position is moved after the paste
* Can't reproduce a link slipping into the embed in front of it

@Tirokk it is an unpleasant side efffect that mentions + hastags appear
differently on Edit+View. That's because they don't get parsed from
HTML, it's a one way, they are write only. So, when viewing content,
hashtags and mentions appear as plain links. I don't think I can do
anything about it.

Regarding some links not being embedded: Only those links that have an
oembed provider in this file:
f44d0f1f96/backend/src/schema/resolvers/embeds/providers.json
...will be embedded. Your example `http://backreaction.blogspot.com` and `https://de.wikipedia.org/wiki/Yin_und_Yang`
have no embed provider and won't be embedded.

We would have to add oembed providers to this list if we wanted to embed those
links, too.
2019-08-02 23:18:10 +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
Matt Rider
751bbbf889 Make mobile responsive 2019-08-02 16:10:19 +02:00
Matt Rider
ec7a5865f7 Update tests, showFilterPostsDropdown only on route 2019-08-02 15:41:19 +02:00
Robert Schäfer
ffe6dc7736 Add MutationObserver to fix tests
Our build server failed because of frontend tests. However, all our
fullstack tests are passing... So maybe an issue in our test setup, not
reproducible in a real browser?

This commit:
ee4f132b0f (diff-0806c5f3fdae5e139222967601c7faca)
adds MutationObserver to their test setup. Adding it to our test suites
that touch the `editor` directly fixes our tests, too!

From what I can tell is that prosemirror is calling
`this.observer.takeRecords()`. Probably `tiptap` updated its
dependencies at some point and that's where `this.observer` was
introduced? Hard to tell. It really looks just like an issue only
present in test environments, so I think it's safe not to investigate
any further.
2019-08-02 14:32:06 +02:00
Matt Rider
afb9dbe241 Move filter by followers functionality to filter dropdown 2019-08-02 13:02:12 +02:00
Matt Rider
3da986518e Write component tests, refactor 2019-08-02 10:52: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
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
34f86c95a0 Merge remote-tracking branch 'origin/master' into storybook 2019-08-01 00:08:15 +02:00
Matt Rider
5423412958 Set up UI 2019-07-31 14:58:05 +02:00
Wolfgang Huß
6a6f1c5556 Removed submit function at the form
Co-Authored-By: mattwr18 <mattwr18@gmail.com>
2019-07-31 14:09:04 +02:00
Wolfgang Huß
49f5851d2c Merge branch 'master' of https://github.com/Human-Connection/Human-Connection into 806-HcContributionForm-submit-is-not-disabled-by-default 2019-07-31 13:14:43 +02:00
Wolfgang Huß
c9ad86c863 Fixed jest tests 2019-07-31 13:11:31 +02:00
Wolfgang Huß
51321df931 In the middle of refactoring the tests 2019-07-31 12:19:47 +02:00
Robert Schäfer
c24452c8a0 Fix console.errors during yarn run test
@mattwr18 you added `currentUser` in 19b2b7a49 without running the tests,
didn't you?
2019-07-30 21:13:44 +02:00
Wolfgang Huß
1a1ab418a3 Fix tests and change variable names 2019-07-29 11:01:15 +02:00
Matt Rider
19b2b7a491 Reset branch to master, copy changes to ContributionForm in 2019-07-29 08:45:58 +02:00
ogerly
0c75d6e089 Fix commit 2019-07-24 16:03:10 +02:00
ogerly
77f45c1508 esoolved comments @tirokk 2019-07-24 15:35:08 +02:00
Robert Schäfer
455eac1031 Merge remote-tracking branch 'origin/master' into storybook 2019-07-22 13:27:32 +02:00
ogerly
063479610e fix lint 2019-07-19 10:28:13 +02:00
ogerly
6e5b277afa commentar delete 2019-07-18 21:19:15 +02:00
ogerly
18fcfb0fd0 Change of css and variables, lint and test ok 2019-07-18 21:06:01 +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ß
e4fd7f4cf7 Merge branch '552-update_comment' of https://github.com/Human-Connection/Human-Connection into 552-update_comment 2019-07-16 15:11:41 +02:00