80 Commits

Author SHA1 Message Date
mattwr18
333b38d1b2 Merge branch 'master' of github.com:Human-Connection/Human-Connection into 1733-fix 2019-10-22 11:07:29 +02:00
roschaefer
16d07bd3ba refactor: lint, frontend tests, vuex store
This fixes the lint errors and failing frontend tests. Also, when the
user chooses another orderBy, the menu gets translated.

The refactoring moves code and complexity into the vuex store where it
can be tested separately.
2019-10-18 21:58:53 +02:00
Nimit Bhargava
7330987a69 fix - maintaining sorting after navigation 2019-10-18 16:03:14 +02:00
mattwr18
8b27250393 Fix vue warning webapp, try to find source of cypress failure
- clean up
2019-10-17 22:44:44 +02:00
mattwr18
973912fb87 Add tests for unpinPost, refactor
- following @roschaefer's PR review suggestions
- simplify UpdatePost by using pinPost/unpinPost
- did not remove filtering because attempting to have two queries caused
problems as well to do with duplicate records, etc... and it's working
now
2019-10-17 21:51:41 +02:00
roschaefer
3e04b26068 Add styling to pinned post 2019-10-17 17:56:16 +02:00
mattwr18
f871df02ae Start setting up frontend pinning/unpinning
- Add pin/unpin post to content menu
- Update apollo cache to reactively unpin
- Update apollo cache in root path to re-order Posts
- Order with pinned post first
- Start setting up filters, so that the pinned post is always the first
post visible
2019-10-17 17:56:16 +02:00
mattwr18
3e72660ed8
Keep images from distorting or getting cropped
Co-Authored-By: Alina Beck <alina.beck@mail.com>
2019-10-14 19:14:27 +02:00
mattwr18
c45f63ffd9 Follow @alina-beck PR suggestions 2019-10-14 16:42:11 +02:00
mattwr18
3b5e39c54d Update orderBy, remove >=, more realistic seed data 2019-10-04 11:42:55 +02:00
mattwr18
6f1c5e3efa Set hasMore to false when returned Posts are equal to pageSize
- this was causing bugs on User profile page, and saves a database call
2019-10-03 11:04:23 +02:00
Wolfgang Huß
714c658844 Add hint translation to plus icon for creating posts
- Position adjustment of the news feed plus icon in hight, because in desktop browsers it intersects the footer.
- Added shadow to plus icon on the user page.
2019-09-16 10:20:36 +02:00
mattwr18
0c83d276bb Merge branch 'master' of github.com:Human-Connection/Human-Connection into 1488-filter-posts-by-emotion 2019-09-10 09:32:45 +02:00
ogerly
e278fa4afc Padding remove 2019-09-09 16:45:11 +02:00
mattwr18
07c58fc03e Add emotions buttons, get it filtering 2019-09-07 12:37:03 +02:00
roschaefer
0fca14a29e Fix nullpointer issues
It seems that `this.$apollo.queries.Post` can be undefined sometimes.
Honestly I don't know why but I could imagine that it might happen on
subpages and when the cypress test triggers the infinite loader, we
face this bug.
2019-09-05 13:07:22 +02:00
roschaefer
da57e9391c Fix #1394
It seems that we weren't using the API of `vue-apollo` in the right way.
The `update` callback is to transform the results (e.g. to map between
the server response and a `data` attribute with a different name). For
pagination there is a dedicated procedure called `fetchMore`. See:

* https://vue-apollo.netlify.com/guide/apollo/pagination.html
* https://vue-apollo.netlify.com/guide/components/query.html#query-operations
2019-09-05 11:30:37 +02:00
roschaefer
aea9caee80 Remove slow sorting options
Sadly, I think this the only way for now. As I explained in
https://github.com/Human-Connection/Human-Connection/issues/1272#issuecomment-527864948
I think we cannot do anything about it on our side for now.
2019-09-04 23:46:18 +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
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
6976336ef0 Merge branch 'master' of github.com:Human-Connection/Human-Connection into fix-deprecation-warnings 2019-08-27 09:20:27 +02:00
Matt Rider
2af4151918 Update to use <client-only> instead of <no-ssr> 2019-08-26 17:09:24 +02:00
roschaefer
8b31cefebe If this commit fixes the build, docs are broken
The latest commit has some cypress tests failing when only a few posts
are visible on the index page. If this explicit default fixes the tests,
the documentation cannot be quite right in saying that it's the default.

FYI: @mattwr18
2019-08-26 16:58:11 +02:00
roschaefer
194665bf2e Remove explicit default, see if cypress tests fail 2019-08-26 13:56:32 +02:00
roschaefer
6e2ef65b99 Visual feedback if filters lead to 0 results
This is one of the bugs/improvements suggested by @ulfgebhardt.
2019-08-22 00:26:59 +02:00
mattwr18
8aa8be3152
Merge pull request #1314 from Human-Connection/1308-fix_broken_graphql_query
Fix #1308
2019-08-21 09:34:50 +02:00
roschaefer
ca24747550 Fix #1308 2019-08-20 23:53:10 +02:00
Alina Beck
b74c47a265
Merge branch 'master' into add-masonry-grid 2019-08-19 15:05:54 +01:00
Alina Beck
b0de4ec2b5 move calculation from grid to grid item 2019-08-19 10:16:44 +01:00
Alina Beck
76be960c03 move grid calculations to masonry grid components 2019-08-18 18:25:14 +01: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
Alina Beck
b05599de83 fix item height calculation 2019-08-15 21:44:22 +01:00
Alina Beck
da8491a559 style filter menu grid item 2019-08-15 21:29:37 +01:00
Alina Beck
8ad1ad3769 look at this new and shiny grid component 2019-08-15 21:06:26 +01:00
roschaefer
67bd1184aa Fine tune throttle delay 2019-08-15 17:09:08 +02:00
roschaefer
a052743e8b Bind infinite-scroll-* correctly 2019-08-15 11:39:09 +02:00
molda
2edf26ac0a implemented infinite-scroll to index page 2019-08-15 11:08:42 +02:00
Alina Beck
38100b2df7 add masonry grid 2019-08-15 11:04:30 +02:00
Robert Schäfer
9026157018 Better hasMore: Don't wait until length == 0
follow @Tirokk
2019-08-12 11:50:23 +02:00
Robert Schäfer
0b96b300d3 Implement hasMore feature on the index page 2019-08-10 03:50:24 +02:00
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
a8cfe96f60 Don't chane the filterPostsMenu with state
@mattwr18 state is the root of all evil
2019-08-09 17:11:55 +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
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
32796bfa0d Fix failing build 2019-08-05 19:08:53 +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
Matt Rider
ec7a5865f7 Update tests, showFilterPostsDropdown only on route 2019-08-02 15:41:19 +02:00