diff --git a/backend/src/models/User.js b/backend/src/models/User.js index b24148f00..fd6e88c27 100644 --- a/backend/src/models/User.js +++ b/backend/src/models/User.js @@ -127,6 +127,10 @@ module.exports = { type: 'boolean', default: false, }, + showShoutsPublicly: { + type: 'boolean', + default: false, + }, locale: { type: 'string', allow: [null], diff --git a/backend/src/schema/resolvers/users.js b/backend/src/schema/resolvers/users.js index e93c983c0..3024bf5a5 100644 --- a/backend/src/schema/resolvers/users.js +++ b/backend/src/schema/resolvers/users.js @@ -177,6 +177,7 @@ export default { 'termsAndConditionsAgreedVersion', 'termsAndConditionsAgreedAt', 'allowEmbedIframes', + 'showShoutsPublicly', 'locale', ], boolean: { diff --git a/backend/src/schema/types/type/User.gql b/backend/src/schema/types/type/User.gql index cce0df058..bf37cb610 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 + showShoutsPublicly: 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 + showShoutsPublicly: Boolean + locale: String ): User diff --git a/backend/src/seed/factories/users.js b/backend/src/seed/factories/users.js index 99e2681c9..d56c42d0a 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, + showShoutsPublicly: false, locale: 'en', } defaults.slug = slugify(defaults.name, { lower: true }) diff --git a/webapp/graphql/User.js b/webapp/graphql/User.js index fda023d06..4ed252261 100644 --- a/webapp/graphql/User.js +++ b/webapp/graphql/User.js @@ -27,6 +27,7 @@ export default i18n => { id url } + showShoutsPublicly } } ` @@ -148,6 +149,17 @@ export const allowEmbedIframesMutation = () => { ` } +export const showShoutsPubliclyMutation = () => { + return gql` + mutation($id: ID!, $showShoutsPublicly: Boolean) { + UpdateUser(id: $id, showShoutsPublicly: $showShoutsPublicly) { + id + showShoutsPublicly + } + } + ` +} + export const checkSlugAvailableQuery = gql` query($slug: String!) { User(slug: $slug) { diff --git a/webapp/locales/de.json b/webapp/locales/de.json index e17b57502..48681dbfe 100644 --- a/webapp/locales/de.json +++ b/webapp/locales/de.json @@ -256,6 +256,11 @@ "passwordStrength4": "Sehr sicheres Passwort" } }, + "privacy": { + "name": "Privatsphäre", + "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 f0bc1115d..0d46fc1b7 100644 --- a/webapp/locales/en.json +++ b/webapp/locales/en.json @@ -257,6 +257,11 @@ "passwordStrength4": "Very strong password" } }, + "privacy": { + "name": "Privacy", + "make-shouts-public": "Share articles I have shouted on my public profile", + "success-update": "Privacy settings saved" + }, "invites": { "name": "Invites" }, diff --git a/webapp/locales/pt.json b/webapp/locales/pt.json index 76560aba9..6e710cacf 100644 --- a/webapp/locales/pt.json +++ b/webapp/locales/pt.json @@ -259,6 +259,11 @@ "passwordStrength4": "Senha muito forte" } }, + "privacy": { + "name": "Privacidade", + "make-shouts-public": "Compartilhar postagens que eu recomendei no meu perfil público", + "success-update": "Configurações de privacidade salvas" + }, "invites": { "name": "Convites" }, diff --git a/webapp/pages/profile/_id/_slug.vue b/webapp/pages/profile/_id/_slug.vue index e0436753d..c04bdf4ca 100644 --- a/webapp/pages/profile/_id/_slug.vue +++ b/webapp/pages/profile/_id/_slug.vue @@ -197,7 +197,7 @@