From 8cd62078f2cf90313a82ab0c245ff271bad65958 Mon Sep 17 00:00:00 2001 From: Matt Rider Date: Tue, 4 Jun 2019 21:24:02 -0300 Subject: [PATCH 01/23] Start DeleteAccount functionality --- .../DeleteAccount/DeleteAccount.vue | 71 +++++++++++++++++++ webapp/locales/en.json | 2 +- webapp/pages/settings.vue | 12 ++-- webapp/pages/settings/delete-account.vue | 8 +-- 4 files changed, 80 insertions(+), 13 deletions(-) create mode 100644 webapp/components/DeleteAccount/DeleteAccount.vue diff --git a/webapp/components/DeleteAccount/DeleteAccount.vue b/webapp/components/DeleteAccount/DeleteAccount.vue new file mode 100644 index 000000000..b73142a52 --- /dev/null +++ b/webapp/components/DeleteAccount/DeleteAccount.vue @@ -0,0 +1,71 @@ + + + diff --git a/webapp/locales/en.json b/webapp/locales/en.json index 8330f97b2..3520f0d56 100644 --- a/webapp/locales/en.json +++ b/webapp/locales/en.json @@ -71,7 +71,7 @@ "name": "Download Data" }, "delete": { - "name": "Delete Account" + "name": "Delete my User Account" }, "organizations": { "name": "My Organizations" diff --git a/webapp/pages/settings.vue b/webapp/pages/settings.vue index f6745cdf3..a273b8b63 100644 --- a/webapp/pages/settings.vue +++ b/webapp/pages/settings.vue @@ -1,8 +1,6 @@ From d15857d240e89917b4ecb616e5a56378da43e4a3 Mon Sep 17 00:00:00 2001 From: Matt Rider Date: Wed, 12 Jun 2019 15:27:57 -0300 Subject: [PATCH 18/23] Set user's posts/comments' delete attribute to true - favor over actually deleting the node so that the comments will appear as anonymous and not lose the context of the conversation - the post will not appear, but for admin it will be accessible - follow @roschaefer `PR` review --- backend/src/schema/resolvers/users.js | 2 +- backend/src/schema/resolvers/users.spec.js | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/backend/src/schema/resolvers/users.js b/backend/src/schema/resolvers/users.js index f1cfffd65..c5c3701b5 100644 --- a/backend/src/schema/resolvers/users.js +++ b/backend/src/schema/resolvers/users.js @@ -21,7 +21,7 @@ export default { await session.run( ` MATCH (resource:${node})<-[:WROTE]-(author:User {id: $userId}) - DETACH DELETE resource + SET resource.deleted = true RETURN author`, { userId: context.user.id, diff --git a/backend/src/schema/resolvers/users.spec.js b/backend/src/schema/resolvers/users.spec.js index c91fdf08e..95dbfdc3b 100644 --- a/backend/src/schema/resolvers/users.spec.js +++ b/backend/src/schema/resolvers/users.spec.js @@ -93,9 +93,11 @@ describe('users', () => { id contributions { id + deleted } comments { id + deleted } } } @@ -161,8 +163,8 @@ describe('users', () => { expectedResponse = { DeleteUser: { id: 'u343', - contributions: [{ id: 'p139' }], - comments: [{ id: 'c155' }], + contributions: [{ id: 'p139', deleted: false }], + comments: [{ id: 'c155', deleted: false }], }, } }) @@ -178,8 +180,8 @@ describe('users', () => { expectedResponse = { DeleteUser: { id: 'u343', - contributions: [], - comments: [{ id: 'c155' }], + contributions: [{ id: 'p139', deleted: true }], + comments: [{ id: 'c155', deleted: false }], }, } await expect(client.request(deleteUserMutation, deleteUserVariables)).resolves.toEqual( @@ -192,8 +194,8 @@ describe('users', () => { expectedResponse = { DeleteUser: { id: 'u343', - contributions: [{ id: 'p139' }], - comments: [], + contributions: [{ id: 'p139', deleted: false }], + comments: [{ id: 'c155', deleted: true }], }, } await expect(client.request(deleteUserMutation, deleteUserVariables)).resolves.toEqual( @@ -206,8 +208,8 @@ describe('users', () => { expectedResponse = { DeleteUser: { id: 'u343', - contributions: [], - comments: [], + contributions: [{ id: 'p139', deleted: true }], + comments: [{ id: 'c155', deleted: true }], }, } await expect(client.request(deleteUserMutation, deleteUserVariables)).resolves.toEqual( From aa6551e35d32148a727b5f84dea0670babb004e4 Mon Sep 17 00:00:00 2001 From: Matt Rider Date: Wed, 12 Jun 2019 15:59:33 -0300 Subject: [PATCH 19/23] Remove comments --- webapp/components/DeleteData/DeleteData.vue | 4 ---- 1 file changed, 4 deletions(-) diff --git a/webapp/components/DeleteData/DeleteData.vue b/webapp/components/DeleteData/DeleteData.vue index 5f0e781d7..cac548fa4 100644 --- a/webapp/components/DeleteData/DeleteData.vue +++ b/webapp/components/DeleteData/DeleteData.vue @@ -170,24 +170,20 @@ export default { background-color: $background-color-softest; } -/* When the checkbox is checked, add a blue background */ .checkbox-container input:checked ~ .checkmark { background-color: $background-color-danger-active; } -/* Create the checkmark/indicator (hidden when not checked) */ .checkmark:after { content: ''; position: absolute; display: none; } -/* Show the checkmark when checked */ .checkbox-container input:checked ~ .checkmark:after { display: block; } -/* Style the checkmark/indicator */ .checkbox-container .checkmark:after { left: 6px; top: 3px; From 6e6407b2653a1af340859fc01eabd3eb6a84eb27 Mon Sep 17 00:00:00 2001 From: Matt Rider Date: Wed, 12 Jun 2019 17:06:37 -0300 Subject: [PATCH 20/23] Upgrade apollo-cache-inmemory --- backend/package.json | 2 +- backend/yarn.lock | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/backend/package.json b/backend/package.json index 4bfeea9a3..f6cb0de6b 100644 --- a/backend/package.json +++ b/backend/package.json @@ -43,7 +43,7 @@ }, "dependencies": { "activitystrea.ms": "~2.1.3", - "apollo-cache-inmemory": "~1.6.1", + "apollo-cache-inmemory": "~1.6.2", "apollo-client": "~2.6.2", "apollo-link-context": "~1.0.14", "apollo-link-http": "~1.5.14", diff --git a/backend/yarn.lock b/backend/yarn.lock index ed9e98649..e92070fe9 100644 --- a/backend/yarn.lock +++ b/backend/yarn.lock @@ -1303,18 +1303,18 @@ apollo-cache-control@^0.1.0: dependencies: graphql-extensions "^0.0.x" -apollo-cache-inmemory@~1.6.1: - version "1.6.1" - resolved "https://registry.yarnpkg.com/apollo-cache-inmemory/-/apollo-cache-inmemory-1.6.1.tgz#536b6f366461f6264250041f9146363e2faa1d4c" - integrity sha512-c/WJjh9MTWcdussCTjLKufpPjTx3qOFkBPHIDOOpQ+U0B7K1PczPl9N0LaC4ir3wAWL7s4A0t2EKtoR+6UP92g== +apollo-cache-inmemory@~1.6.2: + version "1.6.2" + resolved "https://registry.yarnpkg.com/apollo-cache-inmemory/-/apollo-cache-inmemory-1.6.2.tgz#bbf2e4e1eacdf82b2d526f5c2f3b37e5acee3c5e" + integrity sha512-AyCl3PGFv5Qv1w4N9vlg63GBPHXgMCekZy5mhlS042ji0GW84uTySX+r3F61ZX3+KM1vA4m9hQyctrEGiv5XjQ== dependencies: - apollo-cache "^1.3.1" - apollo-utilities "^1.3.1" + apollo-cache "^1.3.2" + apollo-utilities "^1.3.2" optimism "^0.9.0" ts-invariant "^0.4.0" tslib "^1.9.3" -apollo-cache@1.3.2, apollo-cache@^1.3.1: +apollo-cache@1.3.2, apollo-cache@^1.3.2: version "1.3.2" resolved "https://registry.yarnpkg.com/apollo-cache/-/apollo-cache-1.3.2.tgz#df4dce56240d6c95c613510d7e409f7214e6d26a" integrity sha512-+KA685AV5ETEJfjZuviRTEImGA11uNBp/MJGnaCvkgr+BYRrGLruVKBv6WvyFod27WEB2sp7SsG8cNBKANhGLg== @@ -1566,7 +1566,7 @@ apollo-upload-server@^7.0.0: http-errors "^1.7.0" object-path "^0.11.4" -apollo-utilities@1.3.2, apollo-utilities@^1.0.1, apollo-utilities@^1.2.1, apollo-utilities@^1.3.1, apollo-utilities@^1.3.2: +apollo-utilities@1.3.2, apollo-utilities@^1.0.1, apollo-utilities@^1.2.1, apollo-utilities@^1.3.2: version "1.3.2" resolved "https://registry.yarnpkg.com/apollo-utilities/-/apollo-utilities-1.3.2.tgz#8cbdcf8b012f664cd6cb5767f6130f5aed9115c9" integrity sha512-JWNHj8XChz7S4OZghV6yc9FNnzEXj285QYp/nLNh943iObycI5GTDO3NGR9Dth12LRrSFMeDOConPfPln+WGfg== From 3c3db87c1bb2044a6f67c3a8f25f7fc231132872 Mon Sep 17 00:00:00 2001 From: Matt Rider Date: Thu, 13 Jun 2019 15:34:45 -0300 Subject: [PATCH 21/23] Add back deleted translations - mistakenly deleted when working through merge conflict --- webapp/locales/de.json | 11 ++++++++++- webapp/locales/en.json | 11 ++++++++++- webapp/pages/profile/_id/_slug.vue | 2 +- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/webapp/locales/de.json b/webapp/locales/de.json index 4c158c2eb..1ccfe88c2 100644 --- a/webapp/locales/de.json +++ b/webapp/locales/de.json @@ -25,7 +25,16 @@ "shouted": "Empfohlen", "commented": "Kommentiert", "userAnonym": "Anonymus", - "socialMedia": "Wo sonst finde ich" + "socialMedia": "Wo sonst finde ich", + "network": { + "title": "Netzwerk", + "following": "folgt:", + "followingNobody": "folgt niemandem.", + "followedBy": "wird gefolgt von:", + "followedByNobody": "wird von niemandem gefolgt.", + "and": "und", + "more": "weitere" + } }, "notifications": { "menu": { diff --git a/webapp/locales/en.json b/webapp/locales/en.json index 8027ce091..22202ebde 100644 --- a/webapp/locales/en.json +++ b/webapp/locales/en.json @@ -25,7 +25,16 @@ "shouted": "Shouted", "commented": "Commented", "userAnonym": "Anonymous", - "socialMedia": "Where else can I find" + "socialMedia": "Where else can I find", + "network": { + "title": "Network", + "following": "is following:", + "followingNobody": "follows nobody.", + "followedBy": "is followed by:", + "followedByNobody": "is not followed by anyone.", + "and": "and", + "more": "more" + } }, "notifications": { "menu": { diff --git a/webapp/pages/profile/_id/_slug.vue b/webapp/pages/profile/_id/_slug.vue index 493fa916b..c79a14317 100644 --- a/webapp/pages/profile/_id/_slug.vue +++ b/webapp/pages/profile/_id/_slug.vue @@ -69,7 +69,7 @@ - Netzwerk + {{ $t('profile.network.title') }} From 306da8a4e310c2d422060f5eacbecf391212da0c Mon Sep 17 00:00:00 2001 From: Matt Rider Date: Thu, 13 Jun 2019 16:05:20 -0300 Subject: [PATCH 22/23] Revert _slug.vue to master --- webapp/pages/profile/_id/_slug.vue | 33 +++++++++++++++--------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/webapp/pages/profile/_id/_slug.vue b/webapp/pages/profile/_id/_slug.vue index c79a14317..b9b462454 100644 --- a/webapp/pages/profile/_id/_slug.vue +++ b/webapp/pages/profile/_id/_slug.vue @@ -73,7 +73,9 @@ - Wem folgt {{ userName | truncate(15) }}? + + {{ userName | truncate(15) }} {{ $t('profile.network.following') }} + - Wer folgt {{ userName | truncate(15) }}? + + {{ userName | truncate(15) }} {{ $t('profile.network.followedBy') }} + @@ -218,7 +228,6 @@