2184 Commits

Author SHA1 Message Date
roschaefer
afe47e84c0 Remove the organizations for now
We haven't implemented them at all, so I would prefer not to have
obscure data in the database.
2019-09-03 21:28:29 +02:00
roschaefer
784e1fd911 Fix one more cypress test, implement a factory 2019-09-03 21:28:29 +02:00
roschaefer
4d5769fbc6 Fix cypress tests and factories 2019-09-03 21:28:29 +02:00
roschaefer
76acebbb73 Notifications query filters for deleted resources
This should finally fix #1414
2019-09-03 21:28:29 +02:00
roschaefer
660e3434aa Implement delete of comments when post is deleted 2019-09-03 21:28:29 +02:00
roschaefer
1b5d91bfd2 Refactor post spec, implement soft delete, fix bug
I think the validation for categories was too complex and the graphql
query 'PostEmotionsByCurrentUser' was erroneously allowed for
unauthenticated users.
2019-09-03 21:28:29 +02:00
roschaefer
2033b1791c Fix posts resolver spec 2019-09-03 21:28:29 +02:00
roschaefer
3f5ac61b73 Fix users and report resolver specs
This time I did not refactor the whole tests suites because of time and
complexity of the PR review.
2019-09-03 21:28:29 +02:00
roschaefer
36ba4cc208 Refactor filterBubble spec 2019-09-03 21:28:29 +02:00
roschaefer
2d67c5f172 Refactored entire softDeleteMiddleware spec 2019-09-03 21:28:29 +02:00
roschaefer
0f64bbb71f Soft delete for comments implemented 2019-09-03 21:28:29 +02:00
roschaefer
4bfc0ff2bf Refactor comments.spec, refactor post factory 2019-09-03 21:28:29 +02:00
Alexander Friedland
41767cc27e
Merge branch 'master' into C-1187-terms-and-conditions-confirmed-function 2019-09-03 09:51:12 +02:00
ogerly
1b9303ceaf Jest tests for the Terms and Conditions in frontend and backend 2019-09-03 09:46:18 +02:00
Matt Rider
d1309d2b8f Merge branch 'master' of github.com:Human-Connection/Human-Connection into 1395-hashtags-imported-with-not-allowed-chars 2019-09-02 12:51:11 +02:00
roschaefer
98194ef54a Follow @mattwr18's suggestions 2019-08-30 16:00:32 +02:00
Matt Rider
fd9a355910 Fix incorrect id in seeds notification
- Jenny Rostok was being notified that someone had mentioned them in p2, when actually it was Peter Lustig who had been mentioned.
2019-08-30 16:00:32 +02:00
roschaefer
cbcba8f08d Follow @Tirokk's suggestion 2019-08-30 16:00:32 +02:00
roschaefer
c29ee5e3d3 Update notifications in place 2019-08-30 16:00:32 +02:00
roschaefer
994ab43950 Change the behaviour how notifications get created
I think it makes more sense to update an existing notification in place.
Ie. if there was already a notification, just mark it as unread so it
ends up in the recipient's notification list again.
2019-08-30 16:00:32 +02:00
roschaefer
bf6e7a8131 Implement fallback resolvers for Post and Comment 2019-08-30 16:00:32 +02:00
roschaefer
9b2c707aa3 DRY notifications resolver 2019-08-30 16:00:32 +02:00
roschaefer
733c2d5ce1 All backend tests pass 2019-08-30 16:00:32 +02:00
roschaefer
3f121c7c4d Refine notification behaviour:
If you mark a post or comment as read even though you already marked the
corresponding notification as read, then you receive `null`.
2019-08-30 16:00:32 +02:00
roschaefer
2846a6a8d3 Spec for notifications passing 2019-08-30 16:00:32 +02:00
roschaefer
cf8ead10f3 Start to refactor backend tests 2019-08-30 16:00:32 +02:00
roschaefer
4b96454b90 Notifications resolver capable of orderBy + filter 2019-08-30 16:00:32 +02:00
roschaefer
643d175ef6 Implement notifications resolver 2019-08-30 16:00:32 +02:00
Robert Schäfer
0a5052ba96
Merge pull request #1397 from Human-Connection/performance-improvement
Check there are ids in the badIds array
2019-08-30 14:08:13 +02:00
Matt Rider
cf60397477 Fix failing cypress test, add steps
- Added step to expose the search feature was completely broken after my latest commit.
- when a user blocks another user, the search functionality just stopped working.
- reverted changes to @roschaefer hacky fix of the search functionality
2019-08-30 07:47:57 +02:00
Matt Rider
42018f0bf4 Merge branch 'master' of github.com:Human-Connection/Human-Connection into performance-improvement 2019-08-30 07:17:19 +02:00
ogerly
f28ff69f3a Adaptation of Cypress tests, first attempt 2019-08-30 06:54:25 +02:00
Wolfgang Huß
c9c6605b3e Merge branch '1395-hashtags-imported-with-not-allowed-chars' of https://github.com/Human-Connection/Human-Connection into 1395-hashtags-imported-with-not-allowed-chars 2019-08-29 19:10:25 +02:00
Wolfgang Huß
327105da7a Refactor the extraction of hashtag out of a posts content
Co-Authored-By: mattwr18 <mattwr18@gmail.com>
2019-08-29 19:02:44 +02:00
Wolfgang Huß
0bc4c558ae Refactore the import and hashtags to all unicode characters
Co-Authored-By: mattwr18 <mattwr18@gmail.com>
2019-08-29 17:02:02 +02:00
ogerly
ee03f0e902 Merge branch 'master' of https://github.com/Human-Connection/Human-Connection into C-1187-terms-and-conditions-confirmed-function 2019-08-28 14:21:46 +02:00
roschaefer
e4d57f80aa Fix #1333
Ok, so here are multiple issues:
1. In cypher, `NOT NULL` will return `NULL` not `FALSE`. If we want
`FALSE` to be set in the database import, we should use `COAELESCE`
to find the first not-null value.
See:
https://neo4j.com/docs/cypher-manual/current/syntax/working-with-null/
https://markhneedham.com/blog/2017/02/22/neo4j-null-values-even-work/

2. I removed the `disabled` and `deleted` checks on the commented
counter. With `neo4j-graphql-js` it is not possible to filter on the
join models (at least not without a lot of complexity) for disabled or
deleted items. Let's live with the fact that the list of commented posts
will include those posts, where the user has deleted his comment or where
the user's comment was disabled. It's being displayed as "not available"
so I think this is OK for now.

3. De-couple the pagination counters from the "commented", "shouted"
etc. counters. It might be that the list of posts is different for
different users. E.g. if the user has blocked you, the "posts" list
will be empty. The "shouted" or "commented" list will not have the
posts of the author. If you are a moderator, the list will include
disabled posts. So the counters are not in sync with the actual list
coming from the backend. Therefore I implemented "fetch and check if
resultSet < pageSize" instead of a global counter.
2019-08-28 12:57:32 +02:00
Matt Rider
6de602fd58 Revert @roschaefer's hacky fix to Search.feature
- now that we are checking to see if there are any badIds, it was breaking the search functionality
2019-08-26 21:37:36 +02:00
Matt Rider
b990a1055b Fix search functionality
- remove unused line that allows for an empty array of author_not.id_in
2019-08-26 17:51:44 +02:00
roschaefer
9f6757f409 Use guard clauses if possible 2019-08-26 16:53:22 +02:00
Wolfgang Huß
af968461b6 Split handleNotificationsMiddleware in notificationsMiddleware and hashtagsMiddleware 2019-08-26 16:24:43 +02:00
Matt Rider
75d984073d Check there are ids in the badIds array
- if there are no ids, we shouldn't add an empty array since it adds unneccessarily to our auto-generated post query and affects greatly performance. see issue #1390
2019-08-26 16:19:42 +02:00
Wolfgang Huß
7498d88a44 Merge branch 'master' of https://github.com/Human-Connection/Human-Connection into 1062-notification-about-comment-on-post 2019-08-26 15:44:32 +02:00
Wolfgang Huß
2600c69185 Change code after @mattwr18 suggestions
Co-Authored-By: mattwr18 <mattwr18@gmail.com>
2019-08-23 15:57:31 +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
123c30b301 Fix "cannot read property id of null" in staging 2019-08-23 14:53:52 +02:00
Robert Schäfer
b82743463e
Merge pull request #1368 from Human-Connection/1352-fix-update-post-resolver
Fix UpdatePost resolver/validations
2019-08-23 13:37:16 +02:00
Matt Rider
79e6b56396 Use ES6 syntax to avoid repetition 2019-08-23 12:35:53 +02:00
Matt Rider
8555148e53 Merge branch 'master' of github.com:Human-Connection/Human-Connection into 1352-fix-update-post-resolver 2019-08-23 12:19:19 +02:00
Matt Rider
cd5e492569 Await relation be added 2019-08-23 12:18:53 +02:00