diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
index 595c9d584..1fe27f6c6 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.md
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -1,8 +1,10 @@
---
-name: 🐛 Bug Report
+name: "\U0001F41B Bug Report"
about: Create a report to help us to improve.
+title: "\U0001F41B [Bug] XXX"
labels: bug
-title: 🐛 [Bug]
+assignees: ''
+
---
## :bug: Bug Report
diff --git a/.github/ISSUE_TEMPLATE/devops_ticket.md b/.github/ISSUE_TEMPLATE/devops_ticket.md
index 115664911..17533cd54 100644
--- a/.github/ISSUE_TEMPLATE/devops_ticket.md
+++ b/.github/ISSUE_TEMPLATE/devops_ticket.md
@@ -1,8 +1,10 @@
---
-name: 💥 DevOps Ticket
+name: "\U0001F4A5 DevOps Ticket"
about: Help us manage our deployed app.
+title: "\U0001F4A5 [DevOps] XXX"
labels: devops
-title: 💥 [DevOps]
+assignees: ''
+
---
## 💥 DevOps Ticket
diff --git a/.github/ISSUE_TEMPLATE/epic.md b/.github/ISSUE_TEMPLATE/epic.md
index cf72cd673..57eca6dfe 100644
--- a/.github/ISSUE_TEMPLATE/epic.md
+++ b/.github/ISSUE_TEMPLATE/epic.md
@@ -1,9 +1,12 @@
---
-name: 🌟 Epic
+name: "\U0001F31F Epic"
about: Define a big development step.
+title: "\U0001F31F [EPIC] XXX"
labels: epic
-title: 🌟 [EPIC]
+assignees: ''
+
---
+
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
index beae80901..22cd5045e 100644
--- a/.github/ISSUE_TEMPLATE/feature_request.md
+++ b/.github/ISSUE_TEMPLATE/feature_request.md
@@ -1,8 +1,10 @@
---
-name: 🚀 Feature Request
+name: "\U0001F680 Feature Request"
about: Suggest an idea for this project.
+title: "\U0001F680 [Feature] XXX"
labels: feature
-title: 🚀 [Feature]
+assignees: ''
+
---
## :rocket: Feature Request
diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md
index 40e6e381b..f2328dcc7 100644
--- a/.github/ISSUE_TEMPLATE/question.md
+++ b/.github/ISSUE_TEMPLATE/question.md
@@ -1,9 +1,12 @@
---
-name: 💬 Question
+name: "\U0001F4AC Question"
about: If you need help understanding ocelot.social.
+title: "\U0001F4AC [Question] XXX"
labels: question
-title: 💬 [Question]
+assignees: ''
+
---
+
diff --git a/.github/ISSUE_TEMPLATE/refactor_tickets.md b/.github/ISSUE_TEMPLATE/refactor_tickets.md
index d1841e35e..867c809ae 100644
--- a/.github/ISSUE_TEMPLATE/refactor_tickets.md
+++ b/.github/ISSUE_TEMPLATE/refactor_tickets.md
@@ -1,10 +1,11 @@
---
-name: 🔧 Refactor
+name: "\U0001F527 Refactor"
about: Help us improve our code by refactoring it.
+title: "\U0001F527 [Refactor] XXX"
labels: refactor
-title: 🔧 [Refactor]
+assignees: ''
+
---
## 🔧 Refactor
-
diff --git a/backend/src/schema/resolvers/posts.js b/backend/src/schema/resolvers/posts.js
index d199b6f09..b09bb3edd 100644
--- a/backend/src/schema/resolvers/posts.js
+++ b/backend/src/schema/resolvers/posts.js
@@ -5,6 +5,7 @@ import { UserInputError } from 'apollo-server'
import { mergeImage, deleteImage } from './images/images'
import Resolver from './helpers/Resolver'
import { filterForMutedUsers } from './helpers/filterForMutedUsers'
+import CONFIG from '../../config'
const maintainPinnedPosts = (params) => {
const pinnedPostFilter = { pinned: true }
@@ -76,12 +77,20 @@ export default {
},
Mutation: {
CreatePost: async (_parent, params, context, _resolveInfo) => {
+ const { categoryIds } = params
const { image: imageInput } = params
delete params.categoryIds
delete params.image
params.id = params.id || uuid()
const session = context.driver.session()
const writeTxResultPromise = session.writeTransaction(async (transaction) => {
+ const categoriesCypher =
+ CONFIG.CATEGORIES_ACTIVE && categoryIds
+ ? `WITH post
+ UNWIND $categoryIds AS categoryId
+ MATCH (category:Category {id: categoryId})
+ MERGE (post)-[:CATEGORIZED]->(category)`
+ : ''
const createPostTransactionResponse = await transaction.run(
`
CREATE (post:Post)
@@ -93,9 +102,10 @@ export default {
WITH post
MATCH (author:User {id: $userId})
MERGE (post)<-[:WROTE]-(author)
+ ${categoriesCypher}
RETURN post {.*}
`,
- { userId: context.user.id, params },
+ { userId: context.user.id, params, categoryIds },
)
const [post] = createPostTransactionResponse.records.map((record) => record.get('post'))
if (imageInput) {
@@ -127,7 +137,7 @@ export default {
WITH post
`
- if (categoryIds && categoryIds.length) {
+ if (CONFIG.CATEGORIES_ACTIVE && categoryIds && categoryIds.length) {
const cypherDeletePreviousRelations = `
MATCH (post:Post { id: $params.id })-[previousRelations:CATEGORIZED]->(category:Category)
DELETE previousRelations
diff --git a/webapp/components/ContributionForm/ContributionForm.spec.js b/webapp/components/ContributionForm/ContributionForm.spec.js
index cce187a63..ce432fc42 100644
--- a/webapp/components/ContributionForm/ContributionForm.spec.js
+++ b/webapp/components/ContributionForm/ContributionForm.spec.js
@@ -58,6 +58,9 @@ describe('ContributionForm.vue', () => {
back: jest.fn(),
push: jest.fn(),
},
+ $env: {
+ CATEGORIES_ACTIVE: false,
+ },
}
propsData = {}
})
@@ -132,6 +135,7 @@ describe('ContributionForm.vue', () => {
variables: {
title: postTitle,
content: postContent,
+ categoryIds: [],
id: null,
image: null,
},
@@ -254,6 +258,7 @@ describe('ContributionForm.vue', () => {
variables: {
title: propsData.contribution.title,
content: propsData.contribution.content,
+ categoryIds: [],
id: propsData.contribution.id,
image: {
sensitive: false,
diff --git a/webapp/components/ContributionForm/ContributionForm.vue b/webapp/components/ContributionForm/ContributionForm.vue
index a06679149..3d4bb8e7c 100644
--- a/webapp/components/ContributionForm/ContributionForm.vue
+++ b/webapp/components/ContributionForm/ContributionForm.vue
@@ -51,6 +51,19 @@
{{ contentLength }}