From 12a924764c3a0b42caea7925965a855ef3884b81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Thu, 15 Sep 2022 07:49:25 +0200 Subject: [PATCH 01/43] Add comments for several elements on the group profile --- webapp/pages/group/_id/_slug.vue | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/webapp/pages/group/_id/_slug.vue b/webapp/pages/group/_id/_slug.vue index 82f8f270e..05b05ef28 100644 --- a/webapp/pages/group/_id/_slug.vue +++ b/webapp/pages/group/_id/_slug.vue @@ -31,21 +31,26 @@ /> --> + {{ groupName }} + {{ groupSlug }} + + {{ $t('group.foundation') }} {{ group.createdAt | date('MMMM yyyy') }} + @@ -90,6 +95,7 @@ @optimistic="optimisticFollow" @update="updateFollow" /> --> +
+ + {{ $t('group.type') }}
{{ $t('group.types.' + group.groupType) }}
+ {{ $t('group.actionRadius') }} @@ -127,6 +136,7 @@
@@ -127,7 +127,7 @@
- {{ group ? $t('group.types.' + group.groupType) : '' }} + {{ group && group.groupType ? $t('group.types.' + group.groupType) : '' }}
@@ -136,22 +136,46 @@
- {{ group ? $t('group.actionRadii.' + group.actionRadius) : '' }} + {{ + group && group.actionRadius ? $t('group.actionRadii.' + group.actionRadius) : '' + }}
- + + + @@ -327,6 +351,7 @@ export default { data() { // const filter = tabToFilterMapping({ tab: 'post', id: this.$route.params.id }) return { + categoriesActive: this.$env.CATEGORIES_ACTIVE, Group: [], GroupMembers: [], posts: [], From 5f0f3fc5819caf54af6b4ccc5019dc1bc33da223 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Fri, 16 Sep 2022 07:03:54 +0200 Subject: [PATCH 09/43] Refine group categories in seeding --- backend/src/db/seed.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/src/db/seed.js b/backend/src/db/seed.js index 4e95bf3a6..be0a9263e 100644 --- a/backend/src/db/seed.js +++ b/backend/src/db/seed.js @@ -313,7 +313,7 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl'] description: `

English:

This group is hidden.

What is our group for?

This group was created to allow investigative journalists to share and collaborate.

How does it work?

Here you can internally share posts and comments about them.


Deutsch:

Diese Gruppe ist verborgen.

Wofür ist unsere Gruppe?

Diese Gruppe wurde geschaffen, um investigativen Journalisten den Austausch und die Zusammenarbeit zu ermöglichen.

Wie funktioniert das?

Hier könnt ihr euch intern über Beiträge und Kommentare zu ihnen austauschen.

`, groupType: 'hidden', actionRadius: 'global', - categoryIds: ['cat6', 'cat9', 'cat14'], + categoryIds: ['cat6', 'cat12', 'cat16'], }, }), ]) @@ -370,7 +370,7 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl'] description: `

English

Our goal

Only those who enjoy learning and do not lose their curiosity can obtain a good education for life and continue to learn with joy throughout their lives.

Curiosity

For this we need a school that takes up the curiosity of the children, the people, and satisfies it through a lot of experience.


Deutsch

Unser Ziel

Nur wer Spaß am Lernen hat und seine Neugier nicht verliert, kann gute Bildung für's Leben erlangen und sein ganzes Leben mit Freude weiter lernen.

Neugier

Dazu benötigen wir eine Schule, die die Neugier der Kinder, der Menschen, aufnimmt und durch viel Erfahrung befriedigt.

`, groupType: 'closed', actionRadius: 'national', - categoryIds: ['cat7', 'cat9', 'cat16'], + categoryIds: ['cat8', 'cat14'], }, }), ]) @@ -449,7 +449,7 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl'] description: `

What Is yoga?

Yoga is not just about practicing asanas. It's about how we do it.

And practicing asanas doesn't have to be yoga, it can be more athletic than yogic.

What makes practicing asanas yogic?

The important thing is:

  • Use the exercises (consciously) for your personal development.

`, groupType: 'public', actionRadius: 'interplanetary', - categoryIds: ['cat3', 'cat13', 'cat16'], + categoryIds: ['cat4', 'cat5', 'cat17'], }, }), ]) From 7f397b4669fc11693ebca437a63b1673eca218f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Fri, 16 Sep 2022 07:05:21 +0200 Subject: [PATCH 10/43] Set Vue tooltip delay to 1500 ms and remove unneeded properties --- webapp/components/Group/GroupTeaser.vue | 1 - webapp/components/PostTeaser/PostTeaser.vue | 1 - webapp/pages/index.vue | 1 - webapp/pages/profile/_id/_slug.vue | 1 - webapp/plugins/v-tooltip.js | 2 +- 5 files changed, 1 insertion(+), 5 deletions(-) diff --git a/webapp/components/Group/GroupTeaser.vue b/webapp/components/Group/GroupTeaser.vue index 33a50dca7..13836c82b 100644 --- a/webapp/components/Group/GroupTeaser.vue +++ b/webapp/components/Group/GroupTeaser.vue @@ -7,7 +7,6 @@ v-tooltip="{ content: $t('group.newGroup'), placement: 'left', - delay: { show: 500 }, }" :path="{ name: 'group-create' }" class="profile-post-add-button" diff --git a/webapp/components/PostTeaser/PostTeaser.vue b/webapp/components/PostTeaser/PostTeaser.vue index a973ca31f..78a60f1cf 100644 --- a/webapp/components/PostTeaser/PostTeaser.vue +++ b/webapp/components/PostTeaser/PostTeaser.vue @@ -33,7 +33,6 @@ v-tooltip="{ content: $t(`contribution.category.name.${category.slug}`), placement: 'bottom-start', - delay: { show: 500 }, }" :icon="category.icon" /> diff --git a/webapp/pages/index.vue b/webapp/pages/index.vue index 729edc415..2b142648e 100644 --- a/webapp/pages/index.vue +++ b/webapp/pages/index.vue @@ -38,7 +38,6 @@ v-tooltip="{ content: $t('contribution.newPost'), placement: 'left', - delay: { show: 500 }, }" class="post-add-button" icon="plus" diff --git a/webapp/pages/profile/_id/_slug.vue b/webapp/pages/profile/_id/_slug.vue index b4ed11e79..1bbc31eca 100644 --- a/webapp/pages/profile/_id/_slug.vue +++ b/webapp/pages/profile/_id/_slug.vue @@ -120,7 +120,6 @@ v-tooltip="{ content: $t('contribution.newPost'), placement: 'left', - delay: { show: 500 }, }" :path="{ name: 'post-create' }" class="profile-post-add-button" diff --git a/webapp/plugins/v-tooltip.js b/webapp/plugins/v-tooltip.js index 77d0ac1b8..73681e9b3 100644 --- a/webapp/plugins/v-tooltip.js +++ b/webapp/plugins/v-tooltip.js @@ -3,7 +3,7 @@ import VTooltip from 'v-tooltip' Vue.use(VTooltip, { defaultDelay: { - show: 500, + show: 1500, hide: 50, }, defaultOffset: 2, From 1d3fc9b88a113e52d298b2aff34826557d381ec6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Fri, 16 Sep 2022 07:08:32 +0200 Subject: [PATCH 11/43] Set tooltip on post page categories --- webapp/pages/post/_id/_slug/index.vue | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/webapp/pages/post/_id/_slug/index.vue b/webapp/pages/post/_id/_slug/index.vue index 8fb5f837e..c5f7d26c2 100644 --- a/webapp/pages/post/_id/_slug/index.vue +++ b/webapp/pages/post/_id/_slug/index.vue @@ -53,6 +53,10 @@ :key="category.id" :icon="category.icon" :name="$t(`contribution.category.name.${category.slug}`)" + v-tooltip="{ + content: $t(`contribution.category.name.${category.slug}`), + placement: 'bottom-start', + }" /> From b26c500bd03005160cd561dafbf3bce30a96898f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Fri, 16 Sep 2022 07:14:56 +0200 Subject: [PATCH 12/43] Implement 'categories' on group profile, next step --- webapp/pages/group/_id/_slug.vue | 56 ++++++++++++++++++-------------- 1 file changed, 31 insertions(+), 25 deletions(-) diff --git a/webapp/pages/group/_id/_slug.vue b/webapp/pages/group/_id/_slug.vue index 6a921e7cb..6887808bc 100644 --- a/webapp/pages/group/_id/_slug.vue +++ b/webapp/pages/group/_id/_slug.vue @@ -142,19 +142,10 @@ -
- - - - - + + @@ -226,7 +232,6 @@ ghost @click="isDescriptionCollapsed = !isDescriptionCollapsed" > - {{ isDescriptionCollapsed ? $t('comment.show.more') : $t('comment.show.less') }} @@ -237,7 +242,6 @@ v-tooltip="{ content: $t('contribution.newPost'), placement: 'left', - delay: { show: 500 }, }" :path="{ name: 'post-create' }" class="profile-post-add-button" @@ -297,6 +301,7 @@ import { updateGroupMutation, groupQuery, groupMembersQuery } from '~/graphql/gr // import UpdateQuery from '~/components/utils/UpdateQuery' import postListActions from '~/mixins/postListActions' import AvatarUploader from '~/components/Uploader/AvatarUploader' +import Category from '~/components/Category' // import ContentMenu from '~/components/ContentMenu/ContentMenu' import ContentViewer from '~/components/Editor/ContentViewer' import CountTo from '~/components/CountTo.vue' @@ -323,6 +328,7 @@ import ProfileList from '~/components/features/ProfileList/ProfileList' export default { components: { AvatarUploader, + Category, // ContentMenu, ContentViewer, CountTo, From bece00c1bcb097ec6ceced41375c670ff40bec81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Fri, 16 Sep 2022 07:22:44 +0200 Subject: [PATCH 13/43] Set Vue tooltip delay to 1500 ms and remove unneeded properties --- webapp/components/CategoriesSelect/CategoriesSelect.vue | 1 - webapp/components/FilterMenu/CategoriesFilter.vue | 1 - 2 files changed, 2 deletions(-) diff --git a/webapp/components/CategoriesSelect/CategoriesSelect.vue b/webapp/components/CategoriesSelect/CategoriesSelect.vue index ae8b179a6..7fc9bcf1c 100644 --- a/webapp/components/CategoriesSelect/CategoriesSelect.vue +++ b/webapp/components/CategoriesSelect/CategoriesSelect.vue @@ -12,7 +12,6 @@ v-tooltip="{ content: $t(`contribution.category.description.${category.slug}`), placement: 'bottom-start', - delay: { show: 1500 }, }" > {{ $t(`contribution.category.name.${category.slug}`) }} diff --git a/webapp/components/FilterMenu/CategoriesFilter.vue b/webapp/components/FilterMenu/CategoriesFilter.vue index 552aa26a0..fcbb68266 100644 --- a/webapp/components/FilterMenu/CategoriesFilter.vue +++ b/webapp/components/FilterMenu/CategoriesFilter.vue @@ -20,7 +20,6 @@ v-tooltip="{ content: $t(`contribution.category.description.${category.slug}`), placement: 'bottom-start', - delay: { show: 1500 }, }" /> From 9396a61ec021c6092ba204034bb95ab7c2128847 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Fri, 16 Sep 2022 07:23:40 +0200 Subject: [PATCH 14/43] Implement 'categories' on group profile --- webapp/pages/group/_id/_slug.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/pages/group/_id/_slug.vue b/webapp/pages/group/_id/_slug.vue index 6887808bc..331b25648 100644 --- a/webapp/pages/group/_id/_slug.vue +++ b/webapp/pages/group/_id/_slug.vue @@ -161,7 +161,7 @@ :icon="category.icon" :name="$t(`contribution.category.name.${category.slug}`)" v-tooltip="{ - content: $t(`contribution.category.name.${category.slug}`), + content: $t(`contribution.category.description.${category.slug}`), placement: 'bottom-start', }" /> From d32c137cff5d6b030dcb713bb2c4e4f2ec02ebbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Fri, 16 Sep 2022 07:40:33 +0200 Subject: [PATCH 15/43] Implement 'locationName', 'location' in 'CreateGroup', 'UpdateGroup', and 'Group' resolvers --- backend/src/schema/resolvers/groups.js | 11 +++++++++-- webapp/graphql/groups.js | 6 +++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/backend/src/schema/resolvers/groups.js b/backend/src/schema/resolvers/groups.js index babef1d51..2f7ed4588 100644 --- a/backend/src/schema/resolvers/groups.js +++ b/backend/src/schema/resolvers/groups.js @@ -9,6 +9,7 @@ import Resolver, { convertObjectToCypherMapLiteral, } from './helpers/Resolver' import { mergeImage } from './images/images' +import createOrUpdateLocations from './users/location' export default { Query: { @@ -135,7 +136,9 @@ export default { return group }) try { - return await writeTxResultPromise + const group = await writeTxResultPromise + await createOrUpdateLocations(params.id, params.locationName, session) + return group } catch (error) { if (error.code === 'Neo.ClientError.Schema.ConstraintValidationFailed') throw new UserInputError('Group with this slug already exists!') @@ -206,7 +209,9 @@ export default { return group }) try { - return await writeTxResultPromise + const group = await writeTxResultPromise + await createOrUpdateLocations(params.id, params.locationName, session) + return group } catch (error) { if (error.code === 'Neo.ClientError.Schema.ConstraintValidationFailed') throw new UserInputError('Group with this slug already exists!') @@ -300,11 +305,13 @@ export default { }, Group: { ...Resolver('Group', { + undefinedToNull: ['deleted', 'disabled', 'locationName', 'about'], hasMany: { categories: '-[:CATEGORIZED]->(related:Category)', }, hasOne: { avatar: '-[:AVATAR_IMAGE]->(related:Image)', + location: '-[:IS_IN]->(related:Location)', }, }), }, diff --git a/webapp/graphql/groups.js b/webapp/graphql/groups.js index ddb944dde..5295b834d 100644 --- a/webapp/graphql/groups.js +++ b/webapp/graphql/groups.js @@ -42,7 +42,7 @@ export const createGroupMutation = gql` name icon } - # locationName # test this as result + locationName # test this as result myRole } } @@ -90,7 +90,7 @@ export const updateGroupMutation = gql` icon } # avatar # test this as result - # locationName # test this as result + locationName # test this as result myRole } } @@ -155,7 +155,7 @@ export const groupQuery = gql` avatar { url } - # locationName # test this as result + locationName # test this as result myRole } } From 1195be11ac166dfe0c4ffae1e85f94264dec1067 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Fri, 16 Sep 2022 21:06:53 +0200 Subject: [PATCH 16/43] Fix, refactor, and partly implement generation of a location relation in Neo4j for users and groups --- backend/src/schema/resolvers/groups.js | 4 ++-- backend/src/schema/resolvers/users.js | 2 +- .../src/schema/resolvers/users/location.js | 21 ++++++++++--------- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/backend/src/schema/resolvers/groups.js b/backend/src/schema/resolvers/groups.js index 2f7ed4588..a0787a9cb 100644 --- a/backend/src/schema/resolvers/groups.js +++ b/backend/src/schema/resolvers/groups.js @@ -137,7 +137,7 @@ export default { }) try { const group = await writeTxResultPromise - await createOrUpdateLocations(params.id, params.locationName, session) + await createOrUpdateLocations(params.id, 'Group', params.locationName, session) return group } catch (error) { if (error.code === 'Neo.ClientError.Schema.ConstraintValidationFailed') @@ -210,7 +210,7 @@ export default { }) try { const group = await writeTxResultPromise - await createOrUpdateLocations(params.id, params.locationName, session) + await createOrUpdateLocations(params.id, 'Group', params.locationName, session) return group } catch (error) { if (error.code === 'Neo.ClientError.Schema.ConstraintValidationFailed') diff --git a/backend/src/schema/resolvers/users.js b/backend/src/schema/resolvers/users.js index 12f00ffb6..bbb407229 100644 --- a/backend/src/schema/resolvers/users.js +++ b/backend/src/schema/resolvers/users.js @@ -169,7 +169,7 @@ export default { }) try { const user = await writeTxResultPromise - await createOrUpdateLocations(params.id, params.locationName, session) + await createOrUpdateLocations(params.id, 'User', params.locationName, session) return user } catch (error) { throw new UserInputError(error.message) diff --git a/backend/src/schema/resolvers/users/location.js b/backend/src/schema/resolvers/users/location.js index affd3267e..b6ae798f4 100644 --- a/backend/src/schema/resolvers/users/location.js +++ b/backend/src/schema/resolvers/users/location.js @@ -62,7 +62,7 @@ const createLocation = async (session, mapboxData) => { }) } -const createOrUpdateLocations = async (userId, locationName, session) => { +const createOrUpdateLocations = async (nodeId, nodeLabel, locationName, session) => { if (isEmpty(locationName)) { return } @@ -121,18 +121,19 @@ const createOrUpdateLocations = async (userId, locationName, session) => { parent = ctx }) } - // delete all current locations from user and add new location + // delete all current locations from node and add new location await session.writeTransaction((transaction) => { return transaction.run( ` - MATCH (user:User {id: $userId})-[relationship:IS_IN]->(location:Location) - DETACH DELETE relationship - WITH user - MATCH (location:Location {id: $locationId}) - MERGE (user)-[:IS_IN]->(location) - RETURN location.id, user.id - `, - { userId: userId, locationId: data.id }, + MATCH (node:${nodeLabel} {id: $nodeId}) + OPTIONAL MATCH (node)-[relationship:IS_IN]->(:Location) + DELETE relationship + WITH node + MATCH (location:Location {id: $locationId}) + MERGE (node)-[:IS_IN]->(location) + RETURN location.id, node.id + `, + { nodeId, locationId: data.id }, ) }) } From a52c3b488edf2bfb127e30e02015287000e16846 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Fri, 16 Sep 2022 21:08:27 +0200 Subject: [PATCH 17/43] Add location to group seeding --- backend/src/db/seed.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backend/src/db/seed.js b/backend/src/db/seed.js index be0a9263e..0cb3deb03 100644 --- a/backend/src/db/seed.js +++ b/backend/src/db/seed.js @@ -314,6 +314,7 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl'] groupType: 'hidden', actionRadius: 'global', categoryIds: ['cat6', 'cat12', 'cat16'], + locationName: 'Hamburg, Germany', }, }), ]) @@ -371,6 +372,7 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl'] groupType: 'closed', actionRadius: 'national', categoryIds: ['cat8', 'cat14'], + locationName: 'France', }, }), ]) From 57f7a43d095d8ff8afbb4cfefce7a93e5e0246a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Fri, 16 Sep 2022 21:09:45 +0200 Subject: [PATCH 18/43] Test locations in group resolvers --- backend/src/db/graphql/groups.js | 21 ++++++++++++++--- backend/src/schema/resolvers/groups.spec.js | 25 ++++++++++++++++++--- webapp/graphql/Fragments.js | 1 + 3 files changed, 41 insertions(+), 6 deletions(-) diff --git a/backend/src/db/graphql/groups.js b/backend/src/db/graphql/groups.js index 788b889a3..bd6f5e721 100644 --- a/backend/src/db/graphql/groups.js +++ b/backend/src/db/graphql/groups.js @@ -42,7 +42,12 @@ export const createGroupMutation = gql` name icon } - # locationName # test this as result + locationName + location { + name + nameDE + nameEN + } myRole } } @@ -89,7 +94,12 @@ export const updateGroupMutation = gql` icon } # avatar # test this as result - # locationName # test this as result + locationName + location { + name + nameDE + nameEN + } myRole } } @@ -154,7 +164,12 @@ export const groupQuery = gql` avatar { url } - # locationName # test this as result + locationName + location { + name + nameDE + nameEN + } myRole } } diff --git a/backend/src/schema/resolvers/groups.spec.js b/backend/src/schema/resolvers/groups.spec.js index b4653edaf..3d94ffd93 100644 --- a/backend/src/schema/resolvers/groups.spec.js +++ b/backend/src/schema/resolvers/groups.spec.js @@ -277,7 +277,7 @@ describe('in mode', () => { groupType: 'public', actionRadius: 'regional', categoryIds, - // locationName, // test this as result + locationName: 'Hamburg, Germany', } }) @@ -304,6 +304,12 @@ describe('in mode', () => { description: 'Some description' + descriptionAdditional100, groupType: 'public', actionRadius: 'regional', + locationName: 'Hamburg, Germany', + location: expect.objectContaining({ + name: 'Hamburg', + nameDE: 'Hamburg', + nameEN: 'Hamburg', + }), }, }, errors: undefined, @@ -539,6 +545,7 @@ describe('in mode', () => { groupType: 'public', actionRadius: 'regional', categoryIds, + locationName: 'Hamburg, Germany', }, }) }) @@ -554,6 +561,12 @@ describe('in mode', () => { expect.objectContaining({ id: 'my-group', slug: 'the-best-group', + locationName: 'Hamburg, Germany', + location: expect.objectContaining({ + name: 'Hamburg', + nameDE: 'Hamburg', + nameEN: 'Hamburg', + }), myRole: 'owner', }), expect.objectContaining({ @@ -2642,6 +2655,7 @@ describe('in mode', () => { groupType: 'public', actionRadius: 'regional', categoryIds, + locationName: 'Hamburg, Germany', }, }) }) @@ -2663,7 +2677,7 @@ describe('in mode', () => { description: 'Some country relevant description' + descriptionAdditional100, actionRadius: 'national', // avatar, // test this as result - // locationName, // test this as result + locationName: 'Berlin, Germany', }, }), ).resolves.toMatchObject({ @@ -2676,7 +2690,12 @@ describe('in mode', () => { description: 'Some country relevant description' + descriptionAdditional100, actionRadius: 'national', // avatar, // test this as result - // locationName, // test this as result + locationName: 'Berlin, Germany', + location: expect.objectContaining({ + name: 'Berlin', + nameDE: 'Berlin', + nameEN: 'Berlin', + }), myRole: 'owner', }, }, diff --git a/webapp/graphql/Fragments.js b/webapp/graphql/Fragments.js index b67851873..68cd02c6a 100644 --- a/webapp/graphql/Fragments.js +++ b/webapp/graphql/Fragments.js @@ -12,6 +12,7 @@ export const userFragment = gql` deleted } ` + export const locationAndBadgesFragment = (lang) => gql` fragment locationAndBadges on User { location { From 58bdb33e95765459f06a087165e0653ce1c706f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Sat, 17 Sep 2022 00:47:26 +0200 Subject: [PATCH 19/43] Exclude 'Group' resolver from 'makeAugmentedSchema' --- backend/src/schema/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/src/schema/index.js b/backend/src/schema/index.js index 612487147..06e150c86 100644 --- a/backend/src/schema/index.js +++ b/backend/src/schema/index.js @@ -20,6 +20,7 @@ export default makeAugmentedSchema({ 'FILED', 'REVIEWED', 'Report', + 'Group', ], }, mutation: false, From a4575f3ad04171e03e392974749fad00b6451910 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Sat, 17 Sep 2022 01:00:50 +0200 Subject: [PATCH 20/43] Implement 'location' on group profile --- webapp/graphql/groups.js | 56 ++++++++++++++++++-------------- webapp/pages/group/_id/_slug.vue | 20 ++++++++---- webapp/pages/group/edit/_id.vue | 2 +- webapp/pages/my-groups.vue | 2 +- 4 files changed, 46 insertions(+), 34 deletions(-) diff --git a/webapp/graphql/groups.js b/webapp/graphql/groups.js index 5295b834d..bc9855560 100644 --- a/webapp/graphql/groups.js +++ b/webapp/graphql/groups.js @@ -131,35 +131,41 @@ export const changeGroupMemberRoleMutation = gql` // ------ queries -export const groupQuery = gql` - query ($isMember: Boolean, $id: ID, $slug: String) { - Group(isMember: $isMember, id: $id, slug: $slug) { - id - name - slug - createdAt - updatedAt - disabled - deleted - about - description - descriptionExcerpt - groupType - actionRadius - categories { +export const groupQuery = (i18n) => { + const lang = i18n.locale().toUpperCase() + return gql` + query ($isMember: Boolean, $id: ID, $slug: String) { + Group(isMember: $isMember, id: $id, slug: $slug) { id - slug name - icon + slug + createdAt + updatedAt + disabled + deleted + about + description + descriptionExcerpt + groupType + actionRadius + categories { + id + slug + name + icon + } + avatar { + url + } + locationName + location { + name: name${lang} + } + myRole } - avatar { - url - } - locationName # test this as result - myRole } - } -` + ` +} export const groupMembersQuery = gql` query ($id: ID!) { diff --git a/webapp/pages/group/_id/_slug.vue b/webapp/pages/group/_id/_slug.vue index 331b25648..77a106936 100644 --- a/webapp/pages/group/_id/_slug.vue +++ b/webapp/pages/group/_id/_slug.vue @@ -40,10 +40,10 @@ {{ groupSlug }} - + {{ group && group.location ? group.location.name : '' }} + {{ $t('group.foundation') }} {{ group.createdAt | date('MMMM yyyy') }} @@ -141,6 +141,7 @@ }} + - From a20d66b1bc88da49b90b3d57e52d369a01dc717b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Wed, 21 Sep 2022 08:01:47 +0200 Subject: [PATCH 42/43] Fix type validation error in BaseButton --- webapp/components/_new/generic/BaseButton/BaseButton.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/components/_new/generic/BaseButton/BaseButton.vue b/webapp/components/_new/generic/BaseButton/BaseButton.vue index a90ef4ffb..b9211afad 100644 --- a/webapp/components/_new/generic/BaseButton/BaseButton.vue +++ b/webapp/components/_new/generic/BaseButton/BaseButton.vue @@ -57,7 +57,7 @@ export default { }, }, disabled: { - type: Boolean, + // type: Boolean, // makes some errors that an Object was passed instead a Boolean and could not find how to solve in a acceptable time default: false, }, }, From c47aef09f5b98f33f1e29f488a8dc86256984062 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Wed, 21 Sep 2022 08:02:58 +0200 Subject: [PATCH 43/43] Cleanup --- webapp/pages/group/_id/_slug.spec.js | 3 --- webapp/pages/group/_id/_slug.vue | 1 - 2 files changed, 4 deletions(-) diff --git a/webapp/pages/group/_id/_slug.spec.js b/webapp/pages/group/_id/_slug.spec.js index f63fdd374..0cca122b3 100644 --- a/webapp/pages/group/_id/_slug.spec.js +++ b/webapp/pages/group/_id/_slug.spec.js @@ -67,7 +67,6 @@ describe('GroupProfileSlug', () => { descriptionExcerpt: `

What Is yoga?

Yoga is not just about practicing asanas. It's about how we do it.

And practicing asanas doesn't have to be yoga, it can be more athletic than yogic.

What makes practicing asanas yogic?

The important thing is:

  • Use the exercises …

`, groupType: 'public', actionRadius: 'interplanetary', - // Wolle: categoryIds: ['cat4', 'cat5', 'cat17'], categories: [ { id: 'cat4', @@ -104,7 +103,6 @@ describe('GroupProfileSlug', () => { descriptionExcerpt: `

English

Our goal

Only those who enjoy learning and do not lose their curiosity can obtain a good education for life and continue to learn with joy throughout their lives.

Curiosity

For this we need a school that takes up the curiosity of the children, …

`, groupType: 'closed', actionRadius: 'national', - // Wolle: categoryIds: ['cat8', 'cat14'], categories: [ { id: 'cat8', @@ -139,7 +137,6 @@ describe('GroupProfileSlug', () => { '

English:

This group is hidden.

What is our group for?

This group was created to allow investigative journalists to share and collaborate.

How does it work?

Here you can internally share posts and comments about them.


Deutsch:

Diese Gruppe ist verborgen.

', groupType: 'hidden', actionRadius: 'global', - // Wolle: categoryIds: ['cat6', 'cat12', 'cat16'], categories: [ { id: 'cat6', diff --git a/webapp/pages/group/_id/_slug.vue b/webapp/pages/group/_id/_slug.vue index 39e97003e..120c79cbd 100644 --- a/webapp/pages/group/_id/_slug.vue +++ b/webapp/pages/group/_id/_slug.vue @@ -404,7 +404,6 @@ export default { return slug && `@${slug}` }, groupDescriptionExcerpt() { - // Wolle: console.log('groupDescriptionExcerpt: ', this.group ? this.$filters.removeLinks(this.group.descriptionExcerpt) : '') return this.group ? this.$filters.removeLinks(this.group.descriptionExcerpt) : '' }, isGroupOwner() {