diff --git a/backend/package.json b/backend/package.json index 853ef25b6..1c74d3faa 100644 --- a/backend/package.json +++ b/backend/package.json @@ -42,7 +42,7 @@ ] }, "dependencies": { - "@hapi/joi": "^15.1.0", + "@hapi/joi": "^15.1.1", "activitystrea.ms": "~2.1.3", "apollo-cache-inmemory": "~1.6.3", "apollo-client": "~2.6.4", @@ -63,7 +63,7 @@ "graphql": "~14.4.2", "graphql-custom-directives": "~0.2.14", "graphql-iso-date": "~3.6.1", - "graphql-middleware": "~3.0.3", + "graphql-middleware": "~3.0.5", "graphql-shield": "~6.0.4", "graphql-tag": "~2.10.1", "helmet": "~3.20.0", diff --git a/backend/src/middleware/handleHtmlContent/handleContentData.spec.js b/backend/src/middleware/handleHtmlContent/handleContentData.spec.js index 4b0640804..7d7a688f7 100644 --- a/backend/src/middleware/handleHtmlContent/handleContentData.spec.js +++ b/backend/src/middleware/handleHtmlContent/handleContentData.spec.js @@ -303,7 +303,6 @@ describe('Hashtags', () => { Post(id: $id) { tags { id - name } } } @@ -339,16 +338,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, @@ -391,16 +381,7 @@ describe('Hashtags', () => { }, }) - const expected = [ - { - id: 'Elections', - name: 'Elections', - }, - { - id: 'Liberty', - name: 'Liberty', - }, - ] + const expected = [{ id: 'Elections' }, { id: 'Liberty' }] await expect( query({ query: postWithHastagsQuery, 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/backend/yarn.lock b/backend/yarn.lock index 2a4ba2d1a..186520186 100644 --- a/backend/yarn.lock +++ b/backend/yarn.lock @@ -768,31 +768,26 @@ resolved "https://registry.yarnpkg.com/@hapi/address/-/address-2.0.0.tgz#9f05469c88cb2fd3dcd624776b54ee95c312126a" integrity sha512-mV6T0IYqb0xL1UALPFplXYQmR0twnXG0M6jUswpquqT2sD12BOiCiLy3EvMp/Fy7s3DZElC4/aPjEjo2jeZpvw== -"@hapi/hoek@6.x.x": - version "6.2.4" - resolved "https://registry.yarnpkg.com/@hapi/hoek/-/hoek-6.2.4.tgz#4b95fbaccbfba90185690890bdf1a2fbbda10595" - integrity sha512-HOJ20Kc93DkDVvjwHyHawPwPkX44sIrbXazAUDiUXaY2R9JwQGo2PhFfnQtdrsIe4igjG2fPgMra7NYw7qhy0A== +"@hapi/bourne@1.x.x": + version "1.3.2" + resolved "https://registry.yarnpkg.com/@hapi/bourne/-/bourne-1.3.2.tgz#0a7095adea067243ce3283e1b56b8a8f453b242a" + integrity sha512-1dVNHT76Uu5N3eJNTYcvxee+jzX4Z9lfciqRRHCU27ihbUcYi+iSc2iml5Ke1LXe1SyJCLA0+14Jh4tXJgOppA== "@hapi/hoek@8.x.x": version "8.0.1" resolved "https://registry.yarnpkg.com/@hapi/hoek/-/hoek-8.0.1.tgz#9712fa2ad124ac64668ab06ba847b1eaf83a03fd" integrity sha512-cctMYH5RLbElaUpZn3IJaUj9QNQD8iXDnl7xNY6KB1aFD2ciJrwpo3kvZowIT75uA+silJFDnSR2kGakALUymg== -"@hapi/joi@^15.0.3", "@hapi/joi@^15.1.0": - version "15.1.0" - resolved "https://registry.yarnpkg.com/@hapi/joi/-/joi-15.1.0.tgz#940cb749b5c55c26ab3b34ce362e82b6162c8e7a" - integrity sha512-n6kaRQO8S+kepUTbXL9O/UOL788Odqs38/VOfoCrATDtTvyfiO3fgjlSRaNkHabpTLgM7qru9ifqXlXbXk8SeQ== +"@hapi/joi@^15.0.3", "@hapi/joi@^15.1.0", "@hapi/joi@^15.1.1": + version "15.1.1" + resolved "https://registry.yarnpkg.com/@hapi/joi/-/joi-15.1.1.tgz#c675b8a71296f02833f8d6d243b34c57b8ce19d7" + integrity sha512-entf8ZMOK8sc+8YfeOlM8pCfg3b5+WZIKBfUaaJT8UsjAAPjartzxIYm3TIbjvA4u+u++KbcXD38k682nVHDAQ== dependencies: "@hapi/address" "2.x.x" - "@hapi/hoek" "6.x.x" - "@hapi/marker" "1.x.x" + "@hapi/bourne" "1.x.x" + "@hapi/hoek" "8.x.x" "@hapi/topo" "3.x.x" -"@hapi/marker@1.x.x": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@hapi/marker/-/marker-1.0.0.tgz#65b0b2b01d1be06304886ce9b4b77b1bfb21a769" - integrity sha512-JOfdekTXnJexfE8PyhZFyHvHjt81rBFSAbTIRAhF2vv/2Y1JzoKsGqxH/GpZJoF7aEfYok8JVcAHmSz1gkBieA== - "@hapi/topo@3.x.x": version "3.1.2" resolved "https://registry.yarnpkg.com/@hapi/topo/-/topo-3.1.2.tgz#57cc1317be1a8c5f47c124f9b0e3c49cd78424d2" @@ -4062,10 +4057,10 @@ graphql-iso-date@~3.6.1: resolved "https://registry.yarnpkg.com/graphql-iso-date/-/graphql-iso-date-3.6.1.tgz#bd2d0dc886e0f954cbbbc496bbf1d480b57ffa96" integrity sha512-AwFGIuYMJQXOEAgRlJlFL4H1ncFM8n8XmoVDTNypNOZyQ8LFDG2ppMFlsS862BSTCDcSUfHp8PD3/uJhv7t59Q== -graphql-middleware@~3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/graphql-middleware/-/graphql-middleware-3.0.3.tgz#58cbce80892fb933d72794447f33f978fc743aa5" - integrity sha512-Os8Vt25MqqwIPJUCCcHznzs6EqarGmM0kkNPUiDnMEkX6vqjA+HugCWatinP+7+fqBqecFUsJmoL4ZypdqZZkg== +graphql-middleware@~3.0.5: + version "3.0.5" + resolved "https://registry.yarnpkg.com/graphql-middleware/-/graphql-middleware-3.0.5.tgz#8cbce45ce4be95bd4600ffe5332e1936ec721e10" + integrity sha512-84HBmvJlMKxgavbygbRgn2i1fOSrZ7KhxWToWDpe4xOgnWxGb5WY1rwRIkyK25ajh4qRwLtGPbBxtClzwGngCQ== dependencies: graphql-tools "^4.0.5" diff --git a/cypress/integration/common/steps.js b/cypress/integration/common/steps.js index 42e075403..25c87d600 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/deployment/legacy-migration/maintenance-worker/migration/mongo/export.sh b/deployment/legacy-migration/maintenance-worker/migration/mongo/export.sh index 8d16f42fa..f80ea8b8b 100755 --- a/deployment/legacy-migration/maintenance-worker/migration/mongo/export.sh +++ b/deployment/legacy-migration/maintenance-worker/migration/mongo/export.sh @@ -38,14 +38,12 @@ export_collection "emotions" export_collection_query "follows" "{'foreignService': 'organizations'}" "organizations" export_collection_query "follows" "{'foreignService': 'users'}" "users" export_collection "invites" -export_collection "notifications" export_collection "organizations" export_collection "pages" export_collection "projects" export_collection "settings" export_collection "shouts" export_collection "status" -export_collection "systemnotifications" export_collection "users" export_collection "userscandos" export_collection "usersettings" diff --git a/deployment/legacy-migration/maintenance-worker/migration/neo4j/contributions/contributions.cql b/deployment/legacy-migration/maintenance-worker/migration/neo4j/contributions/contributions.cql index a0f1418aa..af81528f2 100644 --- a/deployment/legacy-migration/maintenance-worker/migration/neo4j/contributions/contributions.cql +++ b/deployment/legacy-migration/maintenance-worker/migration/neo4j/contributions/contributions.cql @@ -148,6 +148,6 @@ MATCH (c:Category {id: categoryId}) MERGE (p)-[:CATEGORIZED]->(c) WITH p, post.tags AS tags UNWIND tags AS tag -MERGE (t:Tag {id: tag, name: tag}) +MERGE (t:Tag {id: apoc.text.clean(tag), disabled: false, deleted: false}) MERGE (p)-[:TAGGED]->(t) ; diff --git a/deployment/legacy-migration/maintenance-worker/migration/neo4j/users/delete.cql b/deployment/legacy-migration/maintenance-worker/migration/neo4j/users/delete.cql index 23935b3e0..32679f6c8 100644 --- a/deployment/legacy-migration/maintenance-worker/migration/neo4j/users/delete.cql +++ b/deployment/legacy-migration/maintenance-worker/migration/neo4j/users/delete.cql @@ -1 +1,2 @@ -MATCH (n:User) DETACH DELETE n; \ No newline at end of file +MATCH (n:User) DETACH DELETE n; +MATCH (e:EmailAddress) DETACH DELETE e; diff --git a/deployment/legacy-migration/maintenance-worker/migration/neo4j/users/users.cql b/deployment/legacy-migration/maintenance-worker/migration/neo4j/users/users.cql index a1045bdeb..02dff089f 100644 --- a/deployment/legacy-migration/maintenance-worker/migration/neo4j/users/users.cql +++ b/deployment/legacy-migration/maintenance-worker/migration/neo4j/users/users.cql @@ -94,12 +94,11 @@ } } */ - CALL apoc.load.json("file:${IMPORT_CHUNK_PATH_CQL_FILE}") YIELD value as user MERGE(u:User {id: user._id["$oid"]}) ON CREATE SET u.name = user.name, -u.slug = user.slug, +u.slug = COALESCE(user.slug, apoc.text.random(20, "[A-Za-z]")), u.email = user.email, u.encryptedPassword = user.password, u.avatar = replace(user.avatar, 'https://api-alpha.human-connection.org', ''), 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/CountTo.vue b/webapp/components/CountTo.vue index ee0e3e082..65ad84b56 100644 --- a/webapp/components/CountTo.vue +++ b/webapp/components/CountTo.vue @@ -2,7 +2,7 @@ { - this.isReady = true - }, 500) - }, } diff --git a/webapp/components/Editor/Editor.vue b/webapp/components/Editor/Editor.vue index d0a434ef0..7791facb6 100644 --- a/webapp/components/Editor/Editor.vue +++ b/webapp/components/Editor/Editor.vue @@ -12,15 +12,13 @@ @click="selectItem(item)" >
@{{ item.slug }}
-
#{{ item.name }}
+
#{{ item.id }}
-
+
{{ $t('editor.hashtag.addHashtag') }}
-
- #{{ query }} -
+
#{{ query }}
@@ -40,9 +38,7 @@
{{ $t('editor.hashtag.addHashtag') }}
-
- #{{ query }} -
+
#{{ query }}
@@ -469,7 +465,7 @@ export default { // For hashtags handles pressing of space. spaceHandler() { if (this.suggestionType === this.hashtagSuggestionType && this.query !== '') { - this.selectItem({ name: this.query }) + this.selectItem({ id: this.query }) } }, // we have to replace our suggestion text with a mention @@ -481,8 +477,8 @@ export default { label: item.slug, }, hashtag: { - id: item.name, - label: item.name, + id: item.id, + label: item.id, }, } this.insertMentionOrHashtag({ diff --git a/webapp/components/Tag/index.vue b/webapp/components/Tag/index.vue index 9337c02a6..1895d4fcf 100644 --- a/webapp/components/Tag/index.vue +++ b/webapp/components/Tag/index.vue @@ -1,7 +1,7 @@ @@ -9,7 +9,7 @@ export default { name: 'HcTag', props: { - name: { type: String, required: true }, + id: { type: String, required: true }, }, } diff --git a/webapp/components/Tag/spec.js b/webapp/components/Tag/spec.js index 6a82ce641..4824c65fc 100644 --- a/webapp/components/Tag/spec.js +++ b/webapp/components/Tag/spec.js @@ -6,20 +6,20 @@ const localVue = createLocalVue() localVue.use(Styleguide) describe('Tag', () => { - let name + let id let Wrapper = () => { return shallowMount(Tag, { localVue, propsData: { - name, + id, }, }) } describe('given a String for Name', () => { beforeEach(() => { - name = 'Liebe' + id = 'Liebe' }) it('shows Name', () => { diff --git a/webapp/graphql/PostQuery.js b/webapp/graphql/PostQuery.js index 9d54a5d2b..f5da8dc56 100644 --- a/webapp/graphql/PostQuery.js +++ b/webapp/graphql/PostQuery.js @@ -34,7 +34,7 @@ export default i18n => { } } tags { - name + id } commentsCount comments(orderBy: createdAt_desc) { diff --git a/webapp/nuxt.config.js b/webapp/nuxt.config.js index dee049d92..49da8dc21 100644 --- a/webapp/nuxt.config.js +++ b/webapp/nuxt.config.js @@ -115,6 +115,7 @@ module.exports = { { src: '~/plugins/v-tooltip.js', ssr: false }, { src: '~/plugins/izi-toast.js', ssr: false }, { src: '~/plugins/vue-filters.js' }, + { src: '~/plugins/vue-infinite-scroll.js', ssr: false }, ], router: { diff --git a/webapp/package.json b/webapp/package.json index f3fa36012..d30c97cfe 100644 --- a/webapp/package.json +++ b/webapp/package.json @@ -50,7 +50,7 @@ ] }, "dependencies": { - "@human-connection/styleguide": "0.5.17", + "@human-connection/styleguide": "0.5.19", "@nuxtjs/apollo": "^4.0.0-rc10", "@nuxtjs/axios": "~5.5.4", "@nuxtjs/dotenv": "~1.4.0", @@ -76,6 +76,7 @@ "tiptap-extensions": "~1.26.2", "v-tooltip": "~2.0.2", "vue-count-to": "~1.0.13", + "vue-infinite-scroll": "^2.0.2", "vue-izitoast": "roschaefer/vue-izitoast#patch-1", "vuex-i18n": "~1.13.1", "vue-sweetalert-icons": "~4.2.0", diff --git a/webapp/pages/admin/index.vue b/webapp/pages/admin/index.vue index 7790ed849..39dd4800e 100644 --- a/webapp/pages/admin/index.vue +++ b/webapp/pages/admin/index.vue @@ -7,7 +7,7 @@ - + @@ -16,7 +16,7 @@ - + @@ -30,7 +30,7 @@ uppercase > - + @@ -44,7 +44,7 @@ uppercase > - + @@ -58,7 +58,7 @@ uppercase > - + @@ -72,7 +72,7 @@ uppercase > - + @@ -81,7 +81,7 @@ - + @@ -90,7 +90,7 @@ - + @@ -99,7 +99,7 @@ - + @@ -128,9 +128,6 @@ export default { return process.client }, }, - mounted() { - this.$apollo.queries.statistics.startPolling(5000) - }, apollo: { statistics: { query: gql` diff --git a/webapp/pages/admin/tags.vue b/webapp/pages/admin/tags.vue index c5a28dc11..9ede1d502 100644 --- a/webapp/pages/admin/tags.vue +++ b/webapp/pages/admin/tags.vue @@ -1,12 +1,12 @@