diff --git a/backend/src/schema/resolvers/groups.js b/backend/src/schema/resolvers/groups.js index 4a13dcc88..5ec1700b9 100644 --- a/backend/src/schema/resolvers/groups.js +++ b/backend/src/schema/resolvers/groups.js @@ -16,6 +16,7 @@ export default { Group: async (_object, params, context, _resolveInfo) => { const { isMember, id, slug, first, offset } = params let pagination = '' + const orderBy = 'ORDER BY group.createdAt DESC' if (first !== undefined && offset !== undefined) pagination = `SKIP ${offset} LIMIT ${first}` const matchParams = { id, slug } removeUndefinedNullValuesFromObject(matchParams) @@ -29,6 +30,7 @@ export default { WITH group, membership WHERE (group.groupType IN ['public', 'closed']) OR (group.groupType = 'hidden' AND membership.role IN ['usual', 'admin', 'owner']) RETURN group {.*, myRole: membership.role} + ${orderBy} ${pagination} ` } else { @@ -39,6 +41,7 @@ export default { WITH group WHERE group.groupType IN ['public', 'closed'] RETURN group {.*, myRole: NULL} + ${orderBy} ${pagination} ` } else { @@ -48,6 +51,7 @@ export default { WITH group, membership WHERE (group.groupType IN ['public', 'closed']) OR (group.groupType = 'hidden' AND membership.role IN ['usual', 'admin', 'owner']) RETURN group {.*, myRole: membership.role} + ${orderBy} ${pagination} ` } diff --git a/webapp/components/FilterMenu/HeaderButton.vue b/webapp/components/FilterMenu/HeaderButton.vue new file mode 100644 index 000000000..780e29ade --- /dev/null +++ b/webapp/components/FilterMenu/HeaderButton.vue @@ -0,0 +1,57 @@ + + + diff --git a/webapp/components/features/ProfileList/FollowList.spec.js b/webapp/components/features/ProfileList/FollowList.spec.js index 07214ae38..3398b0993 100644 --- a/webapp/components/features/ProfileList/FollowList.spec.js +++ b/webapp/components/features/ProfileList/FollowList.spec.js @@ -74,7 +74,9 @@ describe('FollowList.vue', () => { expect(wrapper.vm.allConnectionsCount).toBe(user.followingCount) expect(wrapper.findAll('.user-teaser')).toHaveLength(user.following.length) - expect(wrapper.emitted('fetchAllConnections')).toEqual([['following']]) + expect(wrapper.emitted('fetchAllConnections')).toEqual([ + ['following', user.followingCount], + ]) }) }) @@ -85,7 +87,9 @@ describe('FollowList.vue', () => { expect(wrapper.vm.allConnectionsCount).toBe(user.followedByCount) expect(wrapper.findAll('.user-teaser')).toHaveLength(user.followedBy.length) - expect(wrapper.emitted('fetchAllConnections')).toEqual([['followedBy']]) + expect(wrapper.emitted('fetchAllConnections')).toEqual([ + ['followedBy', user.followedByCount], + ]) }) }) }) diff --git a/webapp/components/features/ProfileList/FollowList.vue b/webapp/components/features/ProfileList/FollowList.vue index 7e626308b..e04b4003e 100644 --- a/webapp/components/features/ProfileList/FollowList.vue +++ b/webapp/components/features/ProfileList/FollowList.vue @@ -6,7 +6,7 @@ :allProfilesCount="allConnectionsCount" :profiles="connections" :loading="loading" - @fetchAllProfiles="$emit('fetchAllConnections', type)" + @fetchAllProfiles="$emit('fetchAllConnections', type, allConnectionsCount)" /> diff --git a/webapp/pages/index.vue b/webapp/pages/index.vue index 508a09e93..bb6eff0f4 100644 --- a/webapp/pages/index.vue +++ b/webapp/pages/index.vue @@ -43,47 +43,30 @@   - - - {{ $t('contribution.filterMasonryGrid.myTopics') }} - - - - - - {{ $t('contribution.filterMasonryGrid.myFriends') }} - - - - - - {{ $t('contribution.filterMasonryGrid.myGroups') }} - - - + + + +
@@ -142,6 +125,7 @@ import HcEmpty from '~/components/Empty/Empty' import PostTeaser from '~/components/PostTeaser/PostTeaser.vue' import MasonryGrid from '~/components/MasonryGrid/MasonryGrid.vue' import MasonryGridItem from '~/components/MasonryGrid/MasonryGridItem.vue' +import HeaderButton from '~/components/FilterMenu/HeaderButton' import { mapGetters, mapMutations } from 'vuex' import { DonationsQuery } from '~/graphql/Donations' import { filterPosts } from '~/graphql/PostQuery.js' @@ -159,6 +143,7 @@ export default { MasonryGrid, MasonryGridItem, FilterMenuComponent, + HeaderButton, }, mixins: [postListActions], data() { @@ -225,6 +210,9 @@ export default { resetCategories: 'posts/RESET_CATEGORIES', toggleCategory: 'posts/TOGGLE_CATEGORY', }), + openFilterMenu() { + this.showFilter = !this.showFilter + }, showFilterMenu(e) { if (!e || (!e.target.closest('#my-filter') && !e.target.closest('.my-filter-button'))) { if (!this.showFilter) return @@ -354,13 +342,18 @@ export default { align-items: center; } .filterButtonMenu { + width: 95%; position: fixed; z-index: 6; margin-top: -35px; padding: 20px 10px 5px 10px; - border-radius: 7px; background-color: #f5f4f6; } +@media screen and (max-width: 656px) { + .filterButtonMenu { + margin-top: -50px; + } +} #my-filter { background-color: white; box-shadow: rgb(189 189 189) 1px 9px 15px 1px; diff --git a/webapp/pages/profile/_id/_slug.vue b/webapp/pages/profile/_id/_slug.vue index a2b959b6d..06e95abb4 100644 --- a/webapp/pages/profile/_id/_slug.vue +++ b/webapp/pages/profile/_id/_slug.vue @@ -384,9 +384,9 @@ export default { this.user.followedByCurrentUser = followedByCurrentUser this.user.followedBy = followedBy }, - fetchAllConnections(type) { - if (type === 'following') this.followingCount = Infinity - if (type === 'followedBy') this.followedByCount = Infinity + fetchAllConnections(type, count) { + if (type === 'following') this.followingCount = count + if (type === 'followedBy') this.followedByCount = count }, }, apollo: {