diff --git a/backend/src/db/graphql/groups.js b/backend/src/db/graphql/groups.js
index e388b2cd9..97c1eabfc 100644
--- a/backend/src/db/graphql/groups.js
+++ b/backend/src/db/graphql/groups.js
@@ -9,7 +9,7 @@ export const createGroupMutation = () => {
$name: String!
$slug: String
$about: String
- $description: String!
+ $groupDescription: String!
$groupType: GroupType!
$actionRadius: GroupActionRadius!
$categoryIds: [ID]
@@ -20,7 +20,7 @@ export const createGroupMutation = () => {
name: $name
slug: $slug
about: $about
- description: $description
+ groupDescription: $groupDescription
groupType: $groupType
actionRadius: $actionRadius
categoryIds: $categoryIds
@@ -34,8 +34,8 @@ export const createGroupMutation = () => {
disabled
deleted
about
- description
- descriptionExcerpt
+ groupDescription
+ groupDescriptionExcerpt
groupType
actionRadius
categories {
@@ -63,7 +63,7 @@ export const updateGroupMutation = () => {
$name: String
$slug: String
$about: String
- $description: String
+ $groupDescription: String
$actionRadius: GroupActionRadius
$categoryIds: [ID]
$avatar: ImageInput
@@ -74,7 +74,7 @@ export const updateGroupMutation = () => {
name: $name
slug: $slug
about: $about
- description: $description
+ groupDescription: $groupDescription
actionRadius: $actionRadius
categoryIds: $categoryIds
avatar: $avatar
@@ -88,8 +88,8 @@ export const updateGroupMutation = () => {
disabled
deleted
about
- description
- descriptionExcerpt
+ groupDescription
+ groupDescriptionExcerpt
groupType
actionRadius
categories {
@@ -164,8 +164,8 @@ export const groupQuery = () => {
disabled
deleted
about
- description
- descriptionExcerpt
+ groupDescription
+ groupDescriptionExcerpt
groupType
actionRadius
categories {
diff --git a/backend/src/db/seed.js b/backend/src/db/seed.js
index dd8bb59cb..c703a287c 100644
--- a/backend/src/db/seed.js
+++ b/backend/src/db/seed.js
@@ -310,7 +310,7 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl']
id: 'g0',
name: 'Investigative Journalism',
about: 'Investigative journalists share ideas and insights and can collaborate.',
- 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.
`,
+ groupDescription: `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', 'cat12', 'cat16'],
@@ -395,7 +395,7 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl']
id: 'g1',
name: 'School For Citizens',
about: 'Our children shall receive education for life.',
- 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.
`,
+ groupDescription: `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: ['cat8', 'cat14'],
@@ -501,7 +501,7 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl']
id: 'g2',
name: 'Yoga Practice',
about: 'We do yoga around the clock.',
- 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:
`,
+ groupDescription: `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:
`,
groupType: 'public',
actionRadius: 'interplanetary',
categoryIds: ['cat4', 'cat5', 'cat17'],
diff --git a/backend/src/middleware/excerptMiddleware.js b/backend/src/middleware/excerptMiddleware.js
index a5600796a..c4fe184d8 100644
--- a/backend/src/middleware/excerptMiddleware.js
+++ b/backend/src/middleware/excerptMiddleware.js
@@ -4,12 +4,18 @@ import { GROUPDESCRIPTION_EXCERPT_HTML_LENGTH } from '../constants/groups'
export default {
Mutation: {
CreateGroup: async (resolve, root, args, context, info) => {
- args.descriptionExcerpt = trunc(args.description, GROUPDESCRIPTION_EXCERPT_HTML_LENGTH).html
+ args.groupDescriptionExcerpt = trunc(
+ args.groupDescription,
+ GROUPDESCRIPTION_EXCERPT_HTML_LENGTH,
+ ).html
return resolve(root, args, context, info)
},
UpdateGroup: async (resolve, root, args, context, info) => {
- if (args.description)
- args.descriptionExcerpt = trunc(args.description, GROUPDESCRIPTION_EXCERPT_HTML_LENGTH).html
+ if (args.groupDescription)
+ args.groupDescriptionExcerpt = trunc(
+ args.groupDescription,
+ GROUPDESCRIPTION_EXCERPT_HTML_LENGTH,
+ ).html
return resolve(root, args, context, info)
},
CreatePost: async (resolve, root, args, context, info) => {
diff --git a/backend/src/middleware/slugifyMiddleware.spec.js b/backend/src/middleware/slugifyMiddleware.spec.js
index 1fdfb7364..ef2cc4572 100644
--- a/backend/src/middleware/slugifyMiddleware.spec.js
+++ b/backend/src/middleware/slugifyMiddleware.spec.js
@@ -12,7 +12,7 @@ const categoryIds = ['cat9']
const driver = getDriver()
const neode = getNeode()
-const descriptionAdditional100 =
+const groupDescriptionAdditional100 =
' 123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789'
const { server } = createServer({
@@ -69,7 +69,7 @@ describe('slugifyMiddleware', () => {
...variables,
name: 'The Best Group',
about: 'Some about',
- description: 'Some description' + descriptionAdditional100,
+ groupDescription: 'Some description' + groupDescriptionAdditional100,
groupType: 'closed',
actionRadius: 'national',
categoryIds,
@@ -89,7 +89,7 @@ describe('slugifyMiddleware', () => {
name: 'The Best Group',
slug: 'the-best-group',
about: 'Some about',
- description: 'Some description' + descriptionAdditional100,
+ groupDescription: 'Some description' + groupDescriptionAdditional100,
groupType: 'closed',
actionRadius: 'national',
},
@@ -203,7 +203,7 @@ describe('slugifyMiddleware', () => {
name: 'The Best Group',
slug: 'the-best-group',
about: 'Some about',
- description: 'Some description' + descriptionAdditional100,
+ groupDescription: 'Some description' + groupDescriptionAdditional100,
groupType: 'closed',
actionRadius: 'national',
categoryIds,
@@ -229,7 +229,7 @@ describe('slugifyMiddleware', () => {
name: 'The Best Group',
slug: 'my-best-group',
about: 'Some about',
- description: 'Some description' + descriptionAdditional100,
+ groupDescription: 'Some description' + groupDescriptionAdditional100,
groupType: 'closed',
actionRadius: 'national',
myRole: 'owner',
@@ -249,7 +249,7 @@ describe('slugifyMiddleware', () => {
name: 'Pre-Existing Group',
slug: 'pre-existing-group',
about: 'Some about',
- description: 'Some description' + descriptionAdditional100,
+ groupDescription: 'Some description' + groupDescriptionAdditional100,
groupType: 'closed',
actionRadius: 'national',
categoryIds,
diff --git a/backend/src/middleware/validation/validationMiddleware.js b/backend/src/middleware/validation/validationMiddleware.js
index 20933a777..f67a2c941 100644
--- a/backend/src/middleware/validation/validationMiddleware.js
+++ b/backend/src/middleware/validation/validationMiddleware.js
@@ -1,14 +1,18 @@
import { UserInputError } from 'apollo-server'
+import { GROUPNAME_MIN_LENGTH, GROUPNAME_MAX_LENGTH } from '../../constants/groups'
+// TODO: put this in a constants file
const COMMENT_MIN_LENGTH = 1
-const NO_POST_ERR_MESSAGE = 'Comment cannot be created without a post!'
+// TODO: put this in a constants file
+// TODO: should there be a max length? I guess yes
const USERNAME_MIN_LENGTH = 3
+
const validateCreateComment = async (resolve, root, args, context, info) => {
const content = args.content.replace(/<(?:.|\n)*?>/gm, '').trim()
const { postId } = args
if (!args.content || content.length < COMMENT_MIN_LENGTH) {
- throw new UserInputError(`Comment must be at least ${COMMENT_MIN_LENGTH} character long!`)
+ throw new UserInputError(`Comment must be at least ${COMMENT_MIN_LENGTH} characters long!`)
}
const session = context.driver.session()
try {
@@ -26,7 +30,7 @@ const validateCreateComment = async (resolve, root, args, context, info) => {
})
if (!post) {
- throw new UserInputError(NO_POST_ERR_MESSAGE)
+ throw new UserInputError('Comment cannot be created without a post!')
} else {
return resolve(root, args, context, info)
}
@@ -35,10 +39,25 @@ const validateCreateComment = async (resolve, root, args, context, info) => {
}
}
+const validateGroup = async (resolve, root, params, context, info) => {
+ const { name } = params
+ // Wolle: TODO: write tests for it in 'backend/src/schema/resolvers/groups.spec.js'
+ if (typeof name === 'string' && name.trim().length < GROUPNAME_MIN_LENGTH) {
+ throw new UserInputError(`Group name must be at least ${GROUPNAME_MIN_LENGTH} characters long!`)
+ }
+ // Wolle: TODO: write tests for it in 'backend/src/schema/resolvers/groups.spec.js'
+ if (typeof name === 'string' && name.trim().length > GROUPNAME_MAX_LENGTH) {
+ throw new UserInputError(
+ `Group name must be not longer then ${GROUPNAME_MAX_LENGTH} characters!`,
+ )
+ }
+ return resolve(root, params, context, info)
+}
+
const validateUpdateComment = async (resolve, root, args, context, info) => {
const content = args.content.replace(/<(?:.|\n)*?>/gm, '').trim()
if (!args.content || content.length < COMMENT_MIN_LENGTH) {
- throw new UserInputError(`Comment must be at least ${COMMENT_MIN_LENGTH} character long!`)
+ throw new UserInputError(`Comment must be at least ${COMMENT_MIN_LENGTH} characters long!`)
}
return resolve(root, args, context, info)
@@ -114,15 +133,17 @@ export const validateNotifyUsers = async (label, reason) => {
const validateUpdateUser = async (resolve, root, params, context, info) => {
const { name } = params
if (typeof name === 'string' && name.trim().length < USERNAME_MIN_LENGTH)
- throw new UserInputError(`Username must be at least ${USERNAME_MIN_LENGTH} character long!`)
+ throw new UserInputError(`Username must be at least ${USERNAME_MIN_LENGTH} characters long!`)
return resolve(root, params, context, info)
}
export default {
Mutation: {
+ UpdateUser: validateUpdateUser,
+ CreateGroup: validateGroup,
+ UpdateGroup: validateGroup,
CreateComment: validateCreateComment,
UpdateComment: validateUpdateComment,
- UpdateUser: validateUpdateUser,
fileReport: validateReport,
review: validateReview,
},
diff --git a/backend/src/middleware/validation/validationMiddleware.spec.js b/backend/src/middleware/validation/validationMiddleware.spec.js
index b6bcafa9b..14a2603e8 100644
--- a/backend/src/middleware/validation/validationMiddleware.spec.js
+++ b/backend/src/middleware/validation/validationMiddleware.spec.js
@@ -147,7 +147,7 @@ describe('validateCreateComment', () => {
mutate({ mutation: createCommentMutation, variables: createCommentVariables }),
).resolves.toMatchObject({
data: { CreateComment: null },
- errors: [{ message: 'Comment must be at least 1 character long!' }],
+ errors: [{ message: 'Comment must be at least 1 characters long!' }],
})
})
@@ -157,7 +157,7 @@ describe('validateCreateComment', () => {
mutate({ mutation: createCommentMutation, variables: createCommentVariables }),
).resolves.toMatchObject({
data: { CreateComment: null },
- errors: [{ message: 'Comment must be at least 1 character long!' }],
+ errors: [{ message: 'Comment must be at least 1 characters long!' }],
})
})
@@ -200,7 +200,7 @@ describe('validateCreateComment', () => {
mutate({ mutation: updateCommentMutation, variables: updateCommentVariables }),
).resolves.toMatchObject({
data: { UpdateComment: null },
- errors: [{ message: 'Comment must be at least 1 character long!' }],
+ errors: [{ message: 'Comment must be at least 1 characters long!' }],
})
})
@@ -210,7 +210,7 @@ describe('validateCreateComment', () => {
mutate({ mutation: updateCommentMutation, variables: updateCommentVariables }),
).resolves.toMatchObject({
data: { UpdateComment: null },
- errors: [{ message: 'Comment must be at least 1 character long!' }],
+ errors: [{ message: 'Comment must be at least 1 characters long!' }],
})
})
})
@@ -333,7 +333,7 @@ describe('validateReview', () => {
}
await expect(mutate({ mutation: updateUserMutation, variables })).resolves.toMatchObject({
data: { UpdateUser: null },
- errors: [{ message: 'Username must be at least 3 character long!' }],
+ errors: [{ message: 'Username must be at least 3 characters long!' }],
})
})
})
diff --git a/backend/src/middleware/xssMiddleware.js b/backend/src/middleware/xssMiddleware.js
index 9c528b589..cb7f4a43b 100644
--- a/backend/src/middleware/xssMiddleware.js
+++ b/backend/src/middleware/xssMiddleware.js
@@ -1,7 +1,13 @@
import walkRecursive from '../helpers/walkRecursive'
import { cleanHtml } from '../middleware/helpers/cleanHtml.js'
-const fields = ['content', 'contentExcerpt', 'reasonDescription']
+const fields = [
+ 'content',
+ 'contentExcerpt',
+ 'groupDescription', // Wolle: TODO: test this
+ 'groupDescriptionExcerpt', // Wolle: TODO: test this
+ 'reasonDescription',
+]
export default {
Mutation: async (resolve, root, args, context, info) => {
diff --git a/backend/src/models/Group.js b/backend/src/models/Group.js
index a75ad518f..b076d82aa 100644
--- a/backend/src/models/Group.js
+++ b/backend/src/models/Group.js
@@ -28,8 +28,8 @@ export default {
},
about: { type: 'string', allow: [null, ''] },
- description: { type: 'string', disallow: [null], min: 100 },
- descriptionExcerpt: { type: 'string', allow: [null] },
+ groupDescription: { type: 'string', disallow: [null], min: 100 },
+ groupDescriptionExcerpt: { type: 'string', allow: [null] },
groupType: { type: 'string', default: 'public' },
actionRadius: { type: 'string', default: 'regional' },
diff --git a/backend/src/schema/resolvers/groups.js b/backend/src/schema/resolvers/groups.js
index cdb953933..59b7d1cc4 100644
--- a/backend/src/schema/resolvers/groups.js
+++ b/backend/src/schema/resolvers/groups.js
@@ -125,16 +125,19 @@ export default {
const { categoryIds } = params
delete params.categoryIds
params.locationName = params.locationName === '' ? null : params.locationName
+ // TODO: move to 'backend/src/middleware/validation/validationMiddleware.js'
if (CONFIG.CATEGORIES_ACTIVE && (!categoryIds || categoryIds.length < CATEGORIES_MIN)) {
throw new UserInputError('Too view categories!')
}
+ // TODO: move to 'backend/src/middleware/validation/validationMiddleware.js'
if (CONFIG.CATEGORIES_ACTIVE && categoryIds && categoryIds.length > CATEGORIES_MAX) {
throw new UserInputError('Too many categories!')
}
+ // TODO: move to 'backend/src/middleware/validation/validationMiddleware.js'
if (
- params.description === undefined ||
- params.description === null ||
- removeHtmlTags(params.description).length < GROUPDESCRIPTION_WITHOUT_HTML_LENGTH_MIN
+ params.groupDescription === undefined ||
+ params.groupDescription === null ||
+ removeHtmlTags(params.groupDescription).length < GROUPDESCRIPTION_WITHOUT_HTML_LENGTH_MIN
) {
throw new UserInputError('Description too short!')
}
@@ -194,6 +197,7 @@ export default {
delete params.avatar
params.locationName = params.locationName === '' ? null : params.locationName
+ // TODO: move to 'backend/src/middleware/validation/validationMiddleware.js'
if (CONFIG.CATEGORIES_ACTIVE && categoryIds) {
if (categoryIds.length < CATEGORIES_MIN) {
throw new UserInputError('Too view categories!')
@@ -202,13 +206,15 @@ export default {
throw new UserInputError('Too many categories!')
}
}
+ // TODO: move to 'backend/src/middleware/validation/validationMiddleware.js'
if (
- params.description &&
- removeHtmlTags(params.description).length < GROUPDESCRIPTION_WITHOUT_HTML_LENGTH_MIN
+ params.groupDescription &&
+ removeHtmlTags(params.groupDescription).length < GROUPDESCRIPTION_WITHOUT_HTML_LENGTH_MIN
) {
throw new UserInputError('Description too short!')
}
const session = context.driver.session()
+ // TODO: move to 'backend/src/middleware/validation/validationMiddleware.js'
if (CONFIG.CATEGORIES_ACTIVE && categoryIds && categoryIds.length) {
const cypherDeletePreviousRelations = `
MATCH (group:Group {id: $groupId})-[previousRelations:CATEGORIZED]->(category:Category)
diff --git a/backend/src/schema/resolvers/groups.spec.js b/backend/src/schema/resolvers/groups.spec.js
index 3be8c0f90..b94bb4d34 100644
--- a/backend/src/schema/resolvers/groups.spec.js
+++ b/backend/src/schema/resolvers/groups.spec.js
@@ -26,7 +26,7 @@ let ownerMemberUser
let secondOwnerMemberUser
const categoryIds = ['cat9', 'cat4', 'cat15']
-const descriptionAdditional100 =
+const groupDescriptionAdditional100 =
' 123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789'
let variables = {}
@@ -161,7 +161,7 @@ const seedComplexScenarioAndClearAuthentication = async () => {
id: 'public-group',
name: 'The Best Group',
about: 'We will change the world!',
- description: 'Some description' + descriptionAdditional100,
+ groupDescription: 'Some description' + groupDescriptionAdditional100,
groupType: 'public',
actionRadius: 'regional',
categoryIds,
@@ -189,7 +189,7 @@ const seedComplexScenarioAndClearAuthentication = async () => {
id: 'closed-group',
name: 'Uninteresting Group',
about: 'We will change nothing!',
- description: 'We love it like it is!?' + descriptionAdditional100,
+ groupDescription: 'We love it like it is!?' + groupDescriptionAdditional100,
groupType: 'closed',
actionRadius: 'national',
categoryIds,
@@ -203,7 +203,7 @@ const seedComplexScenarioAndClearAuthentication = async () => {
id: 'hidden-group',
name: 'Investigative Journalism Group',
about: 'We will change all.',
- description: 'We research …' + descriptionAdditional100,
+ groupDescription: 'We research …' + groupDescriptionAdditional100,
groupType: 'hidden',
actionRadius: 'global',
categoryIds,
@@ -273,7 +273,7 @@ describe('in mode', () => {
name: 'The Best Group',
slug: 'the-group',
about: 'We will change the world!',
- description: 'Some description' + descriptionAdditional100,
+ groupDescription: 'Some description' + groupDescriptionAdditional100,
groupType: 'public',
actionRadius: 'regional',
categoryIds,
@@ -302,8 +302,8 @@ describe('in mode', () => {
name: 'The Best Group',
slug: 'the-group',
about: 'We will change the world!',
- description: 'Some description' + descriptionAdditional100,
- descriptionExcerpt: 'Some description' + descriptionAdditional100,
+ groupDescription: 'Some description' + groupDescriptionAdditional100,
+ groupDescriptionExcerpt: 'Some description' + groupDescriptionAdditional100,
groupType: 'public',
actionRadius: 'regional',
locationName: 'Hamburg, Germany',
@@ -348,7 +348,7 @@ describe('in mode', () => {
mutation: createGroupMutation(),
variables: {
...variables,
- description:
+ groupDescription:
'0123456789' +
'0123456789',
},
@@ -476,7 +476,7 @@ describe('in mode', () => {
id: 'others-group',
name: 'Uninteresting Group',
about: 'We will change nothing!',
- description: 'We love it like it is!?' + descriptionAdditional100,
+ groupDescription: 'We love it like it is!?' + groupDescriptionAdditional100,
groupType: 'closed',
actionRadius: 'global',
categoryIds,
@@ -489,7 +489,7 @@ describe('in mode', () => {
id: 'hidden-group',
name: 'Investigative Journalism Group',
about: 'We will change all.',
- description: 'We research …' + descriptionAdditional100,
+ groupDescription: 'We research …' + groupDescriptionAdditional100,
groupType: 'hidden',
actionRadius: 'global',
categoryIds,
@@ -501,7 +501,7 @@ describe('in mode', () => {
id: 'second-hidden-group',
name: 'Second Investigative Journalism Group',
about: 'We will change all.',
- description: 'We research …' + descriptionAdditional100,
+ groupDescription: 'We research …' + groupDescriptionAdditional100,
groupType: 'hidden',
actionRadius: 'global',
categoryIds,
@@ -521,7 +521,7 @@ describe('in mode', () => {
id: 'third-hidden-group',
name: 'Third Investigative Journalism Group',
about: 'We will change all.',
- description: 'We research …' + descriptionAdditional100,
+ groupDescription: 'We research …' + groupDescriptionAdditional100,
groupType: 'hidden',
actionRadius: 'global',
categoryIds,
@@ -542,7 +542,7 @@ describe('in mode', () => {
id: 'my-group',
name: 'The Best Group',
about: 'We will change the world!',
- description: 'Some description' + descriptionAdditional100,
+ groupDescription: 'Some description' + groupDescriptionAdditional100,
groupType: 'public',
actionRadius: 'regional',
categoryIds,
@@ -562,7 +562,7 @@ describe('in mode', () => {
expect.objectContaining({
id: 'my-group',
slug: 'the-best-group',
- descriptionExcerpt: 'Some description' + descriptionAdditional100,
+ groupDescriptionExcerpt: 'Some description' + groupDescriptionAdditional100,
locationName: 'Hamburg, Germany',
location: expect.objectContaining({
name: 'Hamburg',
@@ -574,7 +574,8 @@ describe('in mode', () => {
expect.objectContaining({
id: 'others-group',
slug: 'uninteresting-group',
- descriptionExcerpt: 'We love it like it is!?' + descriptionAdditional100,
+ groupDescriptionExcerpt:
+ 'We love it like it is!?' + groupDescriptionAdditional100,
locationName: null,
location: null,
myRole: null,
@@ -582,7 +583,7 @@ describe('in mode', () => {
expect.objectContaining({
id: 'third-hidden-group',
slug: 'third-investigative-journalism-group',
- descriptionExcerpt: 'We research …' + descriptionAdditional100,
+ groupDescriptionExcerpt: 'We research …' + groupDescriptionAdditional100,
myRole: 'usual',
locationName: null,
location: null,
@@ -868,7 +869,7 @@ describe('in mode', () => {
id: 'closed-group',
name: 'Uninteresting Group',
about: 'We will change nothing!',
- description: 'We love it like it is!?' + descriptionAdditional100,
+ groupDescription: 'We love it like it is!?' + groupDescriptionAdditional100,
groupType: 'closed',
actionRadius: 'national',
categoryIds,
@@ -881,7 +882,7 @@ describe('in mode', () => {
id: 'hidden-group',
name: 'Investigative Journalism Group',
about: 'We will change all.',
- description: 'We research …' + descriptionAdditional100,
+ groupDescription: 'We research …' + groupDescriptionAdditional100,
groupType: 'hidden',
actionRadius: 'global',
categoryIds,
@@ -894,7 +895,7 @@ describe('in mode', () => {
id: 'public-group',
name: 'The Best Group',
about: 'We will change the world!',
- description: 'Some description' + descriptionAdditional100,
+ groupDescription: 'Some description' + groupDescriptionAdditional100,
groupType: 'public',
actionRadius: 'regional',
categoryIds,
@@ -1119,7 +1120,7 @@ describe('in mode', () => {
id: 'public-group',
name: 'The Best Group',
about: 'We will change the world!',
- description: 'Some description' + descriptionAdditional100,
+ groupDescription: 'Some description' + groupDescriptionAdditional100,
groupType: 'public',
actionRadius: 'regional',
categoryIds,
@@ -1147,7 +1148,7 @@ describe('in mode', () => {
id: 'closed-group',
name: 'Uninteresting Group',
about: 'We will change nothing!',
- description: 'We love it like it is!?' + descriptionAdditional100,
+ groupDescription: 'We love it like it is!?' + groupDescriptionAdditional100,
groupType: 'closed',
actionRadius: 'national',
categoryIds,
@@ -1176,7 +1177,7 @@ describe('in mode', () => {
id: 'hidden-group',
name: 'Investigative Journalism Group',
about: 'We will change all.',
- description: 'We research …' + descriptionAdditional100,
+ groupDescription: 'We research …' + groupDescriptionAdditional100,
groupType: 'hidden',
actionRadius: 'global',
categoryIds,
@@ -2659,7 +2660,7 @@ describe('in mode', () => {
id: 'others-group',
name: 'Uninteresting Group',
about: 'We will change nothing!',
- description: 'We love it like it is!?' + descriptionAdditional100,
+ groupDescription: 'We love it like it is!?' + groupDescriptionAdditional100,
groupType: 'closed',
actionRadius: 'global',
categoryIds,
@@ -2672,7 +2673,7 @@ describe('in mode', () => {
id: 'my-group',
name: 'The Best Group',
about: 'We will change the world!',
- description: 'Some description' + descriptionAdditional100,
+ groupDescription: 'Some description' + groupDescriptionAdditional100,
groupType: 'public',
actionRadius: 'regional',
categoryIds,
@@ -2704,7 +2705,8 @@ describe('in mode', () => {
id: 'my-group',
name: 'The New Group For Our Country',
about: 'We will change the land!',
- description: 'Some country relevant description' + descriptionAdditional100,
+ groupDescription:
+ 'Some country relevant description' + groupDescriptionAdditional100,
actionRadius: 'national',
// avatar, // test this as result
},
@@ -2716,9 +2718,10 @@ describe('in mode', () => {
name: 'The New Group For Our Country',
slug: 'the-best-group', // changing the slug is tested in the slugifyMiddleware
about: 'We will change the land!',
- description: 'Some country relevant description' + descriptionAdditional100,
- descriptionExcerpt:
- 'Some country relevant description' + descriptionAdditional100,
+ groupDescription:
+ 'Some country relevant description' + groupDescriptionAdditional100,
+ groupDescriptionExcerpt:
+ 'Some country relevant description' + groupDescriptionAdditional100,
actionRadius: 'national',
// avatar, // test this as result
myRole: 'owner',
@@ -2870,7 +2873,7 @@ describe('in mode', () => {
mutation: updateGroupMutation(),
variables: {
id: 'my-group',
- description:
+ groupDescription:
'0123456789' +
'0123456789',
},
@@ -2951,7 +2954,8 @@ describe('in mode', () => {
id: 'my-group',
name: 'The New Group For Our Country',
about: 'We will change the land!',
- description: 'Some country relevant description' + descriptionAdditional100,
+ groupDescription:
+ 'Some country relevant description' + groupDescriptionAdditional100,
actionRadius: 'national',
categoryIds: ['cat4', 'cat27'],
},
@@ -2969,7 +2973,8 @@ describe('in mode', () => {
id: 'my-group',
name: 'The New Group For Our Country',
about: 'We will change the land!',
- description: 'Some country relevant description' + descriptionAdditional100,
+ groupDescription:
+ 'Some country relevant description' + groupDescriptionAdditional100,
actionRadius: 'national',
categoryIds: ['cat4', 'cat27'],
},
diff --git a/backend/src/schema/resolvers/postsInGroups.spec.js b/backend/src/schema/resolvers/postsInGroups.spec.js
index f4cbb9d9d..43e061938 100644
--- a/backend/src/schema/resolvers/postsInGroups.spec.js
+++ b/backend/src/schema/resolvers/postsInGroups.spec.js
@@ -106,7 +106,7 @@ describe('Posts in Groups', () => {
id: 'public-group',
name: 'The Public Group',
about: 'The public group!',
- description: 'Anyone can see the posts of this group.',
+ groupDescription: 'Anyone can see the posts of this group.',
groupType: 'public',
actionRadius: 'regional',
},
@@ -134,7 +134,7 @@ describe('Posts in Groups', () => {
id: 'closed-group',
name: 'The Closed Group',
about: 'The closed group!',
- description: 'Only members of this group can see the posts of this group.',
+ groupDescription: 'Only members of this group can see the posts of this group.',
groupType: 'closed',
actionRadius: 'regional',
},
@@ -162,7 +162,7 @@ describe('Posts in Groups', () => {
id: 'hidden-group',
name: 'The Hidden Group',
about: 'The hidden group!',
- description: 'Only members of this group can see the posts of this group.',
+ groupDescription: 'Only members of this group can see the posts of this group.',
groupType: 'hidden',
actionRadius: 'regional',
},
diff --git a/backend/src/schema/types/type/Group.gql b/backend/src/schema/types/type/Group.gql
index ce90fad1d..94c5101f2 100644
--- a/backend/src/schema/types/type/Group.gql
+++ b/backend/src/schema/types/type/Group.gql
@@ -28,8 +28,8 @@ type Group {
avatar: Image @relation(name: "AVATAR_IMAGE", direction: "OUT")
about: String # goal
- description: String!
- descriptionExcerpt: String!
+ groupDescription: String!
+ groupDescriptionExcerpt: String!
groupType: GroupType!
actionRadius: GroupActionRadius!
@@ -50,7 +50,7 @@ input _GroupFilter {
name_contains: String
slug_contains: String
about_contains: String
- description_contains: String
+ groupDescription_contains: String
groupType_in: [GroupType!]
actionRadius_in: [GroupActionRadius!]
myRole_in: [GroupMemberRole!]
@@ -94,7 +94,7 @@ type Mutation {
name: String!
slug: String
about: String
- description: String!
+ groupDescription: String!
groupType: GroupType!
actionRadius: GroupActionRadius!
categoryIds: [ID]
@@ -107,7 +107,7 @@ type Mutation {
name: String
slug: String
about: String
- description: String
+ groupDescription: String
# groupType: GroupType # is not possible at the moment and has to be discussed. may be in the stronger direction: public → closed → hidden
actionRadius: GroupActionRadius
categoryIds: [ID]
diff --git a/webapp/components/Group/GroupForm.vue b/webapp/components/Group/GroupForm.vue
index e1ddc67a2..e52b6ebb2 100644
--- a/webapp/components/Group/GroupForm.vue
+++ b/webapp/components/Group/GroupForm.vue
@@ -73,21 +73,21 @@
-
+
- {{ $t('group.description') }}
+ {{ $t('group.groupDescription') }}
-
- {{ `${descriptionLength} / ${formSchema.description.min}` }}
-
+
+ {{ `${groupDescriptionLength} / ${formSchema.groupDescription.min}` }}
+
@@ -207,8 +207,16 @@ export default {
},
},
data() {
- const { name, slug, groupType, about, description, actionRadius, locationName, categories } =
- this.group
+ const {
+ name,
+ slug,
+ groupType,
+ about,
+ groupDescription,
+ actionRadius,
+ locationName,
+ categories,
+ } = this.group
return {
categoriesActive: this.$env.CATEGORIES_ACTIVE,
disabled: false,
@@ -221,7 +229,7 @@ export default {
slug: slug || '',
groupType: groupType || '',
about: about || '',
- description: description || '',
+ groupDescription: groupDescription || '',
// from database 'locationName' comes as "string | null"
// 'formData.locationName':
// see 'created': tries to set it to a "requestGeoData" object and fills the menu if possible
@@ -237,12 +245,12 @@ export default {
slug: { required: false, min: GROUPNAME_LENGTH_MIN },
groupType: { required: true, min: 1 },
about: { required: false },
- description: {
+ groupDescription: {
type: 'string',
required: true,
min: GROUPDESCRIPTION_WITHOUT_HTML_LENGTH_MIN,
validator: (_, value = '') => {
- if (this.$filters.removeHtml(value).length < this.formSchema.description.min) {
+ if (this.$filters.removeHtml(value).length < this.formSchema.groupDescription.min) {
return [new Error()]
}
return []
@@ -286,8 +294,8 @@ export default {
locationNameLabelAddOnOldName() {
return this.formLocationName !== '' ? ' — ' + this.formLocationName : ''
},
- descriptionLength() {
- return this.$filters.removeHtml(this.formData.description).length
+ groupDescriptionLength() {
+ return this.$filters.removeHtml(this.formData.groupDescription).length
},
sameLocation() {
const dbLocationName = this.group.locationName || ''
@@ -310,7 +318,7 @@ export default {
this.group.name === this.formData.name &&
this.group.slug === this.formData.slug &&
this.group.about === this.formData.about &&
- this.group.description === this.formData.description &&
+ this.group.groupDescription === this.formData.groupDescription &&
this.group.actionRadius === this.formData.actionRadius &&
this.sameLocation &&
this.sameCategories
@@ -330,15 +338,16 @@ export default {
this.formData.actionRadius = event.target.value
},
updateEditorDescription(value) {
- this.$refs.groupForm.update('description', value)
+ this.$refs.groupForm.update('groupDescription', value)
},
submit() {
- const { name, slug, about, description, groupType, actionRadius, categoryIds } = this.formData
+ const { name, slug, about, groupDescription, groupType, actionRadius, categoryIds } =
+ this.formData
const variables = {
name,
slug,
about,
- description,
+ groupDescription,
groupType,
actionRadius,
locationName: this.formLocationName,
diff --git a/webapp/components/Group/GroupTeaser.vue b/webapp/components/Group/GroupTeaser.vue
index 791845c75..3143022e0 100644
--- a/webapp/components/Group/GroupTeaser.vue
+++ b/webapp/components/Group/GroupTeaser.vue
@@ -27,7 +27,7 @@
-
+