2193 Commits

Author SHA1 Message Date
ALau2088
3fe8e9a288 552-update_comment 2019-05-18 23:42:17 -07:00
ALau2088
7ddbab83e9 552-update_comment 2019-05-18 23:32:24 -07:00
ALau2088
f7ef09acbf add UpdateComment mutation 2019-05-18 18:20:43 -07:00
Robert Schäfer
2d1daee23a Don't document that we can set IDs in mutations 2019-05-13 12:44:47 +02:00
Robert Schäfer
81a26e14ff Fix test case, move spec to the right location
@ulfgebhardt: The reason why the test case was failing is pretty
obvious. You forgot to create a user that you want to update. If there
is no user to update, then you get an empty response.

@ulfgebhardt: I moved the spec also in the right directory. You're
testing resolvers, so that's where I moved the `.spec` file.
2019-05-10 17:34:05 +02:00
Robert Schäfer
47d7c615a5 Refactoring: Put all data validations in one place
@ulfgebhardt @mattwr18 @tirokk

Here's how I imagined the data validation middleware. If we roll our own
input validations I would suggest to put them all in one place.

@ulfgebhardt this commit is a great example of how tests can speed you
up: Since I can rely on existing tests, I don't have to check the validations
manually. With tests you can refactor with confidence! 👍
2019-05-10 17:13:54 +02:00
82570bef7f
Merge pull request #478 from Human-Connection/2019/kw15/User_can_change_its_username_to_emptystring
2019/kw15/user can change its username to emptystring
2019-05-09 15:01:54 +02:00
2cb8d793fb
removed failing test 2019-05-09 14:37:42 +02:00
Wolfgang Huß
0ffbe567c7 Merge branch 'master' of https://github.com/Human-Connection/Human-Connection into 463-delete-socialMedia 2019-05-08 08:54:11 +02:00
Robert Schäfer
287a55db9f Remove test case entirely
@ulfgebhardt when I write "Remove test case" I mean indeed removing all
the lines of code of that test case, not only disabling it. Commenting
out code *and pushing it to version control* is a strong anti-pattern. Why?
First, code comments get out of date quickly. "Never trust code comments".
Second: In our example here, it creates anxiety because other contributors might
believe there was a reason why the commented code exists.

Read:
* https://blog.codinghorror.com/coding-without-comments/
* https://www.nayuki.io/page/dont-share-commented-out-code
* https://softwareengineering.stackexchange.com/questions/1/comments-are-a-code-smell
2019-05-07 14:10:12 +02:00
Robert Schäfer
0637d97648 Merge remote-tracking branch 'origin/master' into 2019/kw15/User_can_change_its_username_to_emptystring 2019-05-07 14:09:10 +02:00
3d2ce3960c
added url of conversation 2019-05-07 14:01:43 +02:00
140ba848c7
removed testcase, added todo 2019-05-07 14:00:02 +02:00
Robert Schäfer
ad111f5701 Double-check changed expectations, fix tests
See:
https://github.com/Human-Connection/Human-Connection/pull/478/files#r281267486

> We found the reason for it: If you have an exclamation mark in the schema e.g.
> email! and the response would e.g. expect the email for each User object, and
> the server does not have an email for the client, then the entire User object
> gets nullified.
2019-05-06 19:26:53 +02:00
Wolfgang Huß
41711c316a Get delete SocialMedia to work, refactored Frontend Jest tests, written Cypress tests
Optimised tests and Vue for add Social Media a bit.
Added localisation.

Finished this commit together with @mattwr18 !!!
Thank you so much dude! You did great stuff …
2019-05-06 17:31:02 +02:00
9004e923af
removed unnecessary comment block 2019-05-06 13:02:09 +02:00
a71b421933
removed console log 2019-05-06 12:39:53 +02:00
Matt Rider
4c09268f49 Update tests after backend validations
- Now a comment cannot be created without a post to associate it with
2019-05-05 13:57:12 -03:00
Matt Rider
4d631c452d Add more unit tests, add back postId deletion 2019-05-04 17:42:42 -03:00
Matt Rider
31c8b6e35d Use single cypher query in CreateComments
- to create relation between post, comment, author
- fix test to create a post so said cypher query doesn't silently fail
2019-05-03 13:41:20 -03:00
Matt Rider
346158da7f Update to use autogenerated Comment Query
- using the custom CommentByPost Query was not returning the author of the Post, therefore the users avatar was not showing up
- there are some weird bugs with the comments, if you dblclick on the button, two comments with the same content are created
- sometimes the comments appear as the bottom of the list, sometimes they appear three comments from the bottom(?)
2019-05-02 19:59:35 -03:00
Matt Rider
154082a251 Add authorship to commments at creation
- Co-authored-by: Mike Aono <aonomike@gmail.com>
2019-05-02 15:54:44 -03:00
ad05dcf735
frontend tests, backend tests 2019-05-02 17:47:34 +02:00
Wolfgang Huß
b03cbb212a First Vue design of delete SocialMedia, custom mutation DeleteSocialMedia
Backend Jest tests for DeleteSocialMedia
New backend Jest tests for CreateSocialMedia
2019-05-02 17:41:54 +02:00
0be2891858
make email a required field for user, tests for front- & backend 2019-05-02 16:17:16 +02:00
10ef0ab1c4
started backend test, fixed uniqueSlug 2019-04-30 19:05:03 +02:00
Matt Rider
1b84ccbdfa Update to allow single character comments or greater 2019-04-29 12:19:27 -03:00
Matt Rider
5891129662 Ordered comments like alpha, move HcCommentForm, mobile responsive
- in the first instance, we will be importing posts/comments from the alpha, so to maintain consistency, we've ordered them alike. In the future, we could support user choice of order.
- Gives more space for HcCommentForm, user can see comments added to list, helps with mobile responsiveness

Co-authored-by: Tirokk <wolle.huss@pjannto.com>
Co-authored-by: Mike Aono <aonomike@gmail.com>
2019-04-26 08:57:29 -03:00
Matt Rider
0078b743fe Validate comments length, presence/test
- Co-authored-by: Wolfgang Huss <wolle.huss@pjannto.com>
- Co-authored-by: Mike Aono <aonomike@gmail.com>
2019-04-24 09:11:33 -03:00
Matt Rider
43d6254f3e Add custom CommentByPost query 2019-04-23 12:23:21 -03:00
6de253fd32
Merge branch 'master' into 2019/kw15/User_can_change_its_username_to_emptystring
# Conflicts:
#	webapp/components/_mixins/seo.js
#	webapp/components/mixins/seo.js
#	webapp/layouts/blank.vue
#	webapp/layouts/default.vue
#	webapp/mixins/seo.js
2019-04-19 12:09:24 +02:00
Matt Rider
3d2a982d3f Attempt to updated comments
- by pushing to the post.comments array, which updates the array, but doesn't rerender the comments component
- by updating the apollo store as seen here https://akryum.github.io/vue-apollo/guide/apollo/mutations.html#server-side-example and https://github.com/Akryum/vue-apollo-todos
2019-04-18 22:14:23 -03:00
Matt Rider
fc496aec51 Merge github.com:Human-Connection/Human-Connection into 260-add-comment-form 2019-04-18 19:00:05 -03:00
Robert Schäfer
57a53a44b2 Fix seeded notifications 2019-04-18 16:43:06 +02:00
Robert Schäfer
0811ca8248 Massive refactoring of factories
cc @mattwr18 @tirokk @ulfgebhardt @appinteractive

The factories don't use string interpolation now but they use variables.
This resolves some errors of escaping strings when you send html along
with `post.content`. It is much cleaner, too.
2019-04-18 16:41:34 +02:00
Matt Rider
0149f30f5f Fix failing tests, refactor
- due to changes made to comments factories, which caused failures
- to use new custom CreateComment resolver syntax to relate a comment to post by passing in the postId
2019-04-17 20:27:35 -03:00
Matt Rider
f4744fa513 Remove unused import, variables, set debug to false 2019-04-17 18:37:44 -03:00
Robert Schäfer
91e11eb14d Merge remote-tracking branch 'origin/master' into 347-display_notifications 2019-04-17 20:23:24 +02:00
Matt Rider
4dc39a97a8 Fix seeds 2019-04-17 12:51:30 -03:00
Matt Rider
f46e5ee58c Use custom resolver
- add postId to type Comment
- remove it from params to create node without postId
- fix tests

Co-authored-by: Robert Schäfer <roschaefer@users.noreply.github.com>
Co-Authored-By: Tirokk <wolle.huss@pjannto.com>
Co-Authored-By: Mike Aono <aonomike@gmail.com>
2019-04-17 11:27:26 -03:00
2efc77097f
match specification of Dennis - minimum 3 characters for username, no hint for user to change the username to "Anonymous", Toast error if userdata cannot be changed due to username restrictions, display "Anonymous" if no username is found in database (even tho this is against implemented rules) 2019-04-17 14:49:03 +02:00
e5f98f2cee
Merge branch 'master' into 2019/kw15/User_can_change_its_username_to_emptystring
# Conflicts:
#	webapp/locales/de.json
#	webapp/locales/en.json
#	webapp/pages/profile/_id/_slug.vue
2019-04-17 13:59:30 +02:00
Matt Rider
0bcfefe210 Merge branch 'master' of github.com:Human-Connection/Human-Connection into 260-add-comment-form 2019-04-17 08:00:07 -03:00
Robert Schäfer
2d85e5496d
Merge pull request #449 from Human-Connection/219-refactor-follow-shout-mutations
refactor follow, unfollow, shout, unshout to custom mutations, but don't add date-time to relation yet
2019-04-17 11:35:47 +02:00
Matt Rider
c519bff743 Fix lint 2019-04-16 23:37:11 -03:00
Matt Rider
dd9383ef40 Create two custom resolvers, get working with front end
- Had difficulty adding a relationship with one custom resolver, if id for comment was not passed in, the comment was not created, hard coding it in also wasn't a good solution
2019-04-16 23:12:13 -03:00
Matt Rider
9bc0c0f92c Add tests, create comments only when authenticated 2019-04-16 20:31:34 -03:00
Matt Rider
dfef4fe05f Add custom resolver, update factories 2019-04-16 19:48:59 -03:00
Robert Schäfer
fe551ece47 Create notifications on UpdatePost, too
Note that we don't create duplicate notifications. I made use of the behaviour
of XSS-middleware: It removes all css classes from `<a>` anchors. Because
notifications rely on a css class `mention` which gets removed in a later
middleware, this gives us a nice behaviour for re-notifications without creating
duplicates. The downside is that it creates dependencies between middlewares and
it's not that obvious at all.

cc @mattwr18 @ulfgebhardt @appinteractive @Tirokk
2019-04-17 00:08:21 +02:00
Robert Schäfer
f86e98b32e Implement right order of notifications middleware 2019-04-17 00:08:21 +02:00