diff --git a/backend/src/middleware/handleHtmlContent/handleContentData.spec.js b/backend/src/middleware/handleHtmlContent/handleContentData.spec.js index 40d8a2481..fb088e428 100644 --- a/backend/src/middleware/handleHtmlContent/handleContentData.spec.js +++ b/backend/src/middleware/handleHtmlContent/handleContentData.spec.js @@ -198,7 +198,6 @@ describe('Hashtags', () => { Post(id: $id) { tags { id - name } } } @@ -234,10 +233,7 @@ describe('Hashtags', () => { }) it('both Hashtags are created with the "id" set to their "name"', async () => { - const expected = [ - { id: 'Democracy', name: 'Democracy' }, - { id: 'Liberty', name: 'Liberty' }, - ] + const expected = [{ id: 'Democracy' }, { id: 'Liberty' }] await expect( query({ query: postWithHastagsQuery, variables: postWithHastagsVariables }), ).resolves.toEqual( @@ -277,10 +273,7 @@ describe('Hashtags', () => { }, }) - const expected = [ - { id: 'Elections', name: 'Elections' }, - { id: 'Liberty', name: 'Liberty' }, - ] + const expected = [{ id: 'Elections' }, { id: 'Liberty' }] await expect( query({ query: postWithHastagsQuery, variables: postWithHastagsVariables }), ).resolves.toEqual( diff --git a/backend/src/schema/types/type/Tag.gql b/backend/src/schema/types/type/Tag.gql index 47021bf82..c9c36343a 100644 --- a/backend/src/schema/types/type/Tag.gql +++ b/backend/src/schema/types/type/Tag.gql @@ -1,6 +1,5 @@ type Tag { id: ID! - name: String! taggedPosts: [Post]! @relation(name: "TAGGED", direction: "IN") taggedOrganizations: [Organization]! @relation(name: "TAGGED", direction: "IN") taggedCount: Int! @cypher(statement: "MATCH (this)<-[:TAGGED]-(p) RETURN COUNT(DISTINCT p)") diff --git a/backend/src/seed/factories/tags.js b/backend/src/seed/factories/tags.js index 15ded1986..4a135e051 100644 --- a/backend/src/seed/factories/tags.js +++ b/backend/src/seed/factories/tags.js @@ -5,9 +5,9 @@ export default function(params) { return { mutation: ` - mutation($id: ID!, $name: String!) { - CreateTag(id: $id, name: $name) { - name + mutation($id: ID!) { + CreateTag(id: $id) { + id } } `, diff --git a/cypress/integration/common/steps.js b/cypress/integration/common/steps.js index e1eab98c1..4abade0fa 100644 --- a/cypress/integration/common/steps.js +++ b/cypress/integration/common/steps.js @@ -42,9 +42,9 @@ Given("we have a selection of tags and categories as well as posts", () => { slug: "health-wellbeing", icon: "medkit" }) - .create("Tag", { id: "t1", name: "Ecology" }) - .create("Tag", { id: "t2", name: "Nature" }) - .create("Tag", { id: "t3", name: "Democracy" }); + .create("Tag", { id: "Ecology" }) + .create("Tag", { id: "Nature" }) + .create("Tag", { id: "Democracy" }); const someAuthor = { id: "authorId", @@ -71,14 +71,14 @@ Given("we have a selection of tags and categories as well as posts", () => { .relate("Post", "Categories", { from: "p0", to: "cat1" }) .relate("Post", "Categories", { from: "p1", to: "cat2" }) .relate("Post", "Categories", { from: "p2", to: "cat1" }) - .relate("Post", "Tags", { from: "p0", to: "t1" }) - .relate("Post", "Tags", { from: "p0", to: "t2" }) - .relate("Post", "Tags", { from: "p0", to: "t3" }) - .relate("Post", "Tags", { from: "p1", to: "t2" }) - .relate("Post", "Tags", { from: "p1", to: "t3" }) - .relate("Post", "Tags", { from: "p2", to: "t2" }) - .relate("Post", "Tags", { from: "p2", to: "t3" }) - .relate("Post", "Tags", { from: "p3", to: "t3" }); + .relate("Post", "Tags", { from: "p0", to: "Ecology" }) + .relate("Post", "Tags", { from: "p0", to: "Nature" }) + .relate("Post", "Tags", { from: "p0", to: "Democracy" }) + .relate("Post", "Tags", { from: "p1", to: "Nature" }) + .relate("Post", "Tags", { from: "p1", to: "Democracy" }) + .relate("Post", "Tags", { from: "p2", to: "Nature" }) + .relate("Post", "Tags", { from: "p2", to: "Democracy" }) + .relate("Post", "Tags", { from: "p3", to: "Democracy" }); }); Given("we have the following user accounts:", table => { diff --git a/neo4j/db_setup.sh b/neo4j/db_setup.sh index d4c7b9af8..51276cf39 100755 --- a/neo4j/db_setup.sh +++ b/neo4j/db_setup.sh @@ -29,7 +29,6 @@ CREATE CONSTRAINT ON (u:User) ASSERT u.id IS UNIQUE; CREATE CONSTRAINT ON (o:Organization) ASSERT o.id IS UNIQUE; CREATE CONSTRAINT ON (t:Tag) ASSERT t.id IS UNIQUE; - CREATE CONSTRAINT ON (p:Post) ASSERT p.slug IS UNIQUE; CREATE CONSTRAINT ON (c:Category) ASSERT c.slug IS UNIQUE; CREATE CONSTRAINT ON (u:User) ASSERT u.slug IS UNIQUE; diff --git a/webapp/components/ContributionForm/ContributionForm.vue b/webapp/components/ContributionForm/ContributionForm.vue index dca23a882..9d1c92cc9 100644 --- a/webapp/components/ContributionForm/ContributionForm.vue +++ b/webapp/components/ContributionForm/ContributionForm.vue @@ -244,9 +244,8 @@ export default { query() { return gql` { - Tag(orderBy: name_asc) { + Tag(orderBy: id_asc) { id - name } } ` diff --git a/webapp/components/Editor/Editor.vue b/webapp/components/Editor/Editor.vue index 4a4880eeb..fce3889d2 100644 --- a/webapp/components/Editor/Editor.vue +++ b/webapp/components/Editor/Editor.vue @@ -12,15 +12,13 @@ @click="selectItem(item)" >