From c8ce53d598fd54a521641472fa42129c68f7921e Mon Sep 17 00:00:00 2001 From: Joseph Ngugi Date: Thu, 31 Oct 2019 21:21:31 +0300 Subject: [PATCH 1/9] add allowShouts field --- backend/src/models/User.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backend/src/models/User.js b/backend/src/models/User.js index b24148f00..31c74bb2f 100644 --- a/backend/src/models/User.js +++ b/backend/src/models/User.js @@ -127,6 +127,10 @@ module.exports = { type: 'boolean', default: false, }, + allowShouts: { + type: 'boolean', + default: false, + }, locale: { type: 'string', allow: [null], From 96683512799fb68072e303c3a43b8bb3b1cf80e4 Mon Sep 17 00:00:00 2001 From: Joseph Ngugi Date: Thu, 31 Oct 2019 21:22:10 +0300 Subject: [PATCH 2/9] add allowShouts type --- backend/src/schema/types/type/User.gql | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/src/schema/types/type/User.gql b/backend/src/schema/types/type/User.gql index cce0df058..01ba3054a 100644 --- a/backend/src/schema/types/type/User.gql +++ b/backend/src/schema/types/type/User.gql @@ -28,6 +28,7 @@ type User { termsAndConditionsAgreedAt: String allowEmbedIframes: Boolean + allowShouts: Boolean locale: String friends: [User]! @relation(name: "FRIENDS", direction: "BOTH") friendsCount: Int! @cypher(statement: "MATCH (this)<-[: FRIENDS]->(r: User) RETURN COUNT(DISTINCT r)") @@ -170,6 +171,8 @@ type Mutation { termsAndConditionsAgreedVersion: String termsAndConditionsAgreedAt: String allowEmbedIframes: Boolean + allowShouts: Boolean + locale: String ): User From 044155a298f4698c41e41b59e71676d10b5ea51f Mon Sep 17 00:00:00 2001 From: Joseph Ngugi Date: Thu, 31 Oct 2019 21:22:44 +0300 Subject: [PATCH 3/9] add allowShouts mutation --- backend/src/seed/factories/users.js | 1 + webapp/graphql/User.js | 11 +++++++++++ webapp/store/auth.js | 1 + 3 files changed, 13 insertions(+) diff --git a/backend/src/seed/factories/users.js b/backend/src/seed/factories/users.js index 99e2681c9..f56f759f1 100644 --- a/backend/src/seed/factories/users.js +++ b/backend/src/seed/factories/users.js @@ -17,6 +17,7 @@ export default function create() { termsAndConditionsAgreedVersion: '0.0.1', termsAndConditionsAgreedAt: '2019-08-01T10:47:19.212Z', allowEmbedIframes: false, + allowShouts: false, locale: 'en', } defaults.slug = slugify(defaults.name, { lower: true }) diff --git a/webapp/graphql/User.js b/webapp/graphql/User.js index e82280689..7fbd513aa 100644 --- a/webapp/graphql/User.js +++ b/webapp/graphql/User.js @@ -146,6 +146,17 @@ export const allowEmbedIframesMutation = () => { ` } +export const allowShoutsMutation = () => { + return gql` + mutation($id: ID!, $allowShouts: Boolean) { + UpdateUser(id: $id, allowShouts: $allowShouts) { + id + allowShouts + } + } + ` +} + export const checkSlugAvailableQuery = gql` query($slug: String!) { User(slug: $slug) { diff --git a/webapp/store/auth.js b/webapp/store/auth.js index 90c59a8f5..026c8be64 100644 --- a/webapp/store/auth.js +++ b/webapp/store/auth.js @@ -87,6 +87,7 @@ export const actions = { contributionsCount commentedCount allowEmbedIframes + allowShouts termsAndConditionsAgreedVersion socialMedia { id From 6e3bd1926732c9671ce8585c861a0eb4c8e0f31a Mon Sep 17 00:00:00 2001 From: Alina Beck Date: Tue, 12 Nov 2019 19:13:56 +0300 Subject: [PATCH 4/9] set up privacy page in settings --- backend/src/schema/resolvers/users.js | 1 + webapp/locales/de.json | 8 +++++-- webapp/locales/en.json | 14 +++++++---- webapp/pages/settings.vue | 4 ++++ webapp/pages/settings/privacy.vue | 34 +++++++++++++++++++++++++++ 5 files changed, 54 insertions(+), 7 deletions(-) create mode 100644 webapp/pages/settings/privacy.vue diff --git a/backend/src/schema/resolvers/users.js b/backend/src/schema/resolvers/users.js index 06b25b4fa..b66c7b110 100644 --- a/backend/src/schema/resolvers/users.js +++ b/backend/src/schema/resolvers/users.js @@ -177,6 +177,7 @@ export default { 'termsAndConditionsAgreedVersion', 'termsAndConditionsAgreedAt', 'allowEmbedIframes', + 'allowShouts', ], boolean: { followedByCurrentUser: diff --git a/webapp/locales/de.json b/webapp/locales/de.json index 67d3b5bbd..d531ef64c 100644 --- a/webapp/locales/de.json +++ b/webapp/locales/de.json @@ -236,6 +236,10 @@ "passwordStrength4": "Sehr sicheres Passwort" } }, + "privacy": { + "name": "Privatsphäre", + "make-shouts-public": "Teile von mir empfohlene Artikel öffentlich auf meinem Profil" + }, "invites": { "name": "Einladungen" }, @@ -670,7 +674,7 @@ "terms-of-service": { "title": "Nutzungsbedingungen", "description": "Die folgenden Nutzungsbedingungen sind Basis für die Nutzung unseres Netzwerkes. Beim Registrieren musst Du sie anerkennen und wir werden Dich auch später über ggf. stattfindende Änderungen informieren. Das Human Connection Netzwerk wird in Deutschland betrieben und unterliegt daher deutschem Recht. Gerichtsstand ist Kirchheim / Teck. Zu Details schau in unser Impressum: https://human-connection.org/impressum " - }, + }, "use-and-license" : { "title": "Nutzung und Lizenz", "description": "Sind Inhalte, die Du bei uns einstellst, durch Rechte am geistigen Eigentum geschützt, erteilst Du uns eine nicht-exklusive, übertragbare, unterlizenzierbare und weltweite Lizenz für die Nutzung dieser Inhalte für die Bereitstellung in unserem Netzwerk. Diese Lizenz endet, sobald Du Deine Inhalte oder Deinen ganzen Account löscht. Bedenke, dass andere Deine Inhalte weiter teilen können und wir diese nicht löschen können." @@ -698,6 +702,6 @@ "addition" : { "title": "Zusätzliche machen wir regelmäßig Veranstaltungen, wo Du auch Eindrücke wiedergeben und Fragen stellen kannst. Du findest eine aktuelle Übersicht hier:", "description": " https://human-connection.org/veranstaltungen/ " - } + } } } diff --git a/webapp/locales/en.json b/webapp/locales/en.json index d9321b13b..b6fe4911b 100644 --- a/webapp/locales/en.json +++ b/webapp/locales/en.json @@ -237,6 +237,10 @@ "passwordStrength4": "Very strong password" } }, + "privacy": { + "name": "Privacy", + "make-shouts-public": "Share articles I have shouted on my public profile" + }, "invites": { "name": "Invites" }, @@ -671,7 +675,7 @@ "terms-of-service": { "title": "Terms of Service", "description": "The following terms of use form the basis for the use of our network. When you register, you must accept them and we will inform you later about any changes that may take place. The Human Connection Network is operated in Germany and is therefore subject to German law. Place of jurisdiction is Kirchheim / Teck. For details see our imprint: https://human-connection.org/imprint " - }, + }, "use-and-license" : { "title": "Use and License", "description": "If any content you post to us is protected by intellectual property rights, you grant us a non-exclusive, transferable, sublicensable, worldwide license to use such content for posting to our network. This license expires when you delete your content or your entire account. Remember that others may share your content and we cannot delete it." @@ -699,10 +703,10 @@ "addition" : { "title": "In addition, we regularly hold events where you can also share your impressions and ask questions. You can find a current overview here:", "description": " https://human-connection.org/events/ " - } + } } } - - - + + + diff --git a/webapp/pages/settings.vue b/webapp/pages/settings.vue index 2d8ba7237..ef236350f 100644 --- a/webapp/pages/settings.vue +++ b/webapp/pages/settings.vue @@ -31,6 +31,10 @@ export default { name: this.$t('settings.security.name'), path: `/settings/security`, }, + { + name: this.$t('settings.privacy.name'), + path: 'settings/privacy', + }, { name: this.$t('settings.social-media.name'), path: `/settings/my-social-media`, diff --git a/webapp/pages/settings/privacy.vue b/webapp/pages/settings/privacy.vue new file mode 100644 index 000000000..0c79df5a6 --- /dev/null +++ b/webapp/pages/settings/privacy.vue @@ -0,0 +1,34 @@ + + + From feb65a6c9cc958dd1e5f6c00f48c7996d3c8225d Mon Sep 17 00:00:00 2001 From: mattwr18 Date: Tue, 12 Nov 2019 21:19:52 +0100 Subject: [PATCH 5/9] Update property name to be more descriptive - I wanted to trigger a build, since we had issues with our build server today. I think this naming is more in the direction we want to go, though. Maybe it could be makeShoutsPublic as @alina-beck used for the translation keys... what do you think @kachulio --- backend/src/models/User.js | 2 +- backend/src/schema/resolvers/users.js | 2 +- backend/src/schema/types/type/User.gql | 4 ++-- backend/src/seed/factories/users.js | 2 +- webapp/graphql/User.js | 8 ++++---- webapp/store/auth.js | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/backend/src/models/User.js b/backend/src/models/User.js index 31c74bb2f..fd6e88c27 100644 --- a/backend/src/models/User.js +++ b/backend/src/models/User.js @@ -127,7 +127,7 @@ module.exports = { type: 'boolean', default: false, }, - allowShouts: { + showShoutsPublicly: { type: 'boolean', default: false, }, diff --git a/backend/src/schema/resolvers/users.js b/backend/src/schema/resolvers/users.js index b66c7b110..1a4acf0fc 100644 --- a/backend/src/schema/resolvers/users.js +++ b/backend/src/schema/resolvers/users.js @@ -177,7 +177,7 @@ export default { 'termsAndConditionsAgreedVersion', 'termsAndConditionsAgreedAt', 'allowEmbedIframes', - 'allowShouts', + 'showShoutsPublicly', ], boolean: { followedByCurrentUser: diff --git a/backend/src/schema/types/type/User.gql b/backend/src/schema/types/type/User.gql index 01ba3054a..bf37cb610 100644 --- a/backend/src/schema/types/type/User.gql +++ b/backend/src/schema/types/type/User.gql @@ -28,7 +28,7 @@ type User { termsAndConditionsAgreedAt: String allowEmbedIframes: Boolean - allowShouts: Boolean + showShoutsPublicly: Boolean locale: String friends: [User]! @relation(name: "FRIENDS", direction: "BOTH") friendsCount: Int! @cypher(statement: "MATCH (this)<-[: FRIENDS]->(r: User) RETURN COUNT(DISTINCT r)") @@ -171,7 +171,7 @@ type Mutation { termsAndConditionsAgreedVersion: String termsAndConditionsAgreedAt: String allowEmbedIframes: Boolean - allowShouts: Boolean + showShoutsPublicly: Boolean locale: String ): User diff --git a/backend/src/seed/factories/users.js b/backend/src/seed/factories/users.js index f56f759f1..d56c42d0a 100644 --- a/backend/src/seed/factories/users.js +++ b/backend/src/seed/factories/users.js @@ -17,7 +17,7 @@ export default function create() { termsAndConditionsAgreedVersion: '0.0.1', termsAndConditionsAgreedAt: '2019-08-01T10:47:19.212Z', allowEmbedIframes: false, - allowShouts: false, + showShoutsPublicly: false, locale: 'en', } defaults.slug = slugify(defaults.name, { lower: true }) diff --git a/webapp/graphql/User.js b/webapp/graphql/User.js index 7fbd513aa..8ceaeb5b7 100644 --- a/webapp/graphql/User.js +++ b/webapp/graphql/User.js @@ -146,12 +146,12 @@ export const allowEmbedIframesMutation = () => { ` } -export const allowShoutsMutation = () => { +export const showShoutsPubliclyMutation = () => { return gql` - mutation($id: ID!, $allowShouts: Boolean) { - UpdateUser(id: $id, allowShouts: $allowShouts) { + mutation($id: ID!, $showShoutsPublicly: Boolean) { + UpdateUser(id: $id, showShoutsPublicly: $showShoutsPublicly) { id - allowShouts + showShoutsPublicly } } ` diff --git a/webapp/store/auth.js b/webapp/store/auth.js index 026c8be64..69af65f30 100644 --- a/webapp/store/auth.js +++ b/webapp/store/auth.js @@ -87,7 +87,7 @@ export const actions = { contributionsCount commentedCount allowEmbedIframes - allowShouts + showShoutsPublicly termsAndConditionsAgreedVersion socialMedia { id From 1625e0705e50ce0c74e8612d9794bcf71bed2f84 Mon Sep 17 00:00:00 2001 From: Alina Beck Date: Wed, 13 Nov 2019 11:02:53 +0300 Subject: [PATCH 6/9] run update mutation when submitting shouts form --- webapp/locales/de.json | 3 ++- webapp/locales/en.json | 3 ++- webapp/pages/settings/privacy.vue | 45 ++++++++++++++++++++++++------- 3 files changed, 39 insertions(+), 12 deletions(-) diff --git a/webapp/locales/de.json b/webapp/locales/de.json index d531ef64c..a06aed797 100644 --- a/webapp/locales/de.json +++ b/webapp/locales/de.json @@ -238,7 +238,8 @@ }, "privacy": { "name": "Privatsphäre", - "make-shouts-public": "Teile von mir empfohlene Artikel öffentlich auf meinem Profil" + "make-shouts-public": "Teile von mir empfohlene Artikel öffentlich auf meinem Profil", + "success-update": "Privatsphäre-Einstellungen gespeichert" }, "invites": { "name": "Einladungen" diff --git a/webapp/locales/en.json b/webapp/locales/en.json index b6fe4911b..ca06c1313 100644 --- a/webapp/locales/en.json +++ b/webapp/locales/en.json @@ -239,7 +239,8 @@ }, "privacy": { "name": "Privacy", - "make-shouts-public": "Share articles I have shouted on my public profile" + "make-shouts-public": "Share articles I have shouted on my public profile", + "success-update": "Privacy settings saved" }, "invites": { "name": "Invites" diff --git a/webapp/pages/settings/privacy.vue b/webapp/pages/settings/privacy.vue index 0c79df5a6..54622cb16 100644 --- a/webapp/pages/settings/privacy.vue +++ b/webapp/pages/settings/privacy.vue @@ -4,30 +4,55 @@ - {{ $t('actions.save') }} + {{ $t('actions.save') }}