From c70e6227bae8fecbdbe430b886bd72ae58cf1762 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Wed, 10 Apr 2019 13:35:24 +0200 Subject: [PATCH 01/92] first implementation - unclear if specifications are correct --- backend/src/middleware/userMiddleware.js | 3 +- webapp/locales/de.json | 6 +- webapp/locales/en.json | 6 +- webapp/locales/it.json | 4 +- webapp/locales/pl.json | 4 +- webapp/locales/pt.json | 4 +- webapp/pages/profile/_id/_slug.vue | 199 ++++++----------------- webapp/pages/settings/index.vue | 2 +- 8 files changed, 67 insertions(+), 161 deletions(-) diff --git a/backend/src/middleware/userMiddleware.js b/backend/src/middleware/userMiddleware.js index 2979fdadf..b3fc1bf2c 100644 --- a/backend/src/middleware/userMiddleware.js +++ b/backend/src/middleware/userMiddleware.js @@ -1,6 +1,7 @@ -import createOrUpdateLocations from './nodes/locations' import dotenv from 'dotenv' +import createOrUpdateLocations from './nodes/locations' + dotenv.config() export default { diff --git a/webapp/locales/de.json b/webapp/locales/de.json index 6e47d7122..801b01e27 100644 --- a/webapp/locales/de.json +++ b/webapp/locales/de.json @@ -15,7 +15,8 @@ "followers": "Folgen", "following": "Folgt", "shouted": "Empfohlen", - "commented": "Kommentiert" + "commented": "Kommentiert", + "userAnonym": "Anonymus" }, "search": { "placeholder": "Suchen", @@ -27,6 +28,7 @@ "data": { "name": "Deine Daten", "labelName": "Dein Name", + "namePlaceholder": "Anonymus", "labelCity": "Deine Stadt oder Region", "labelBio": "Über dich" }, @@ -202,4 +204,4 @@ "shoutButton": { "shouted": "empfohlen" } -} +} \ No newline at end of file diff --git a/webapp/locales/en.json b/webapp/locales/en.json index 62c8f3e19..1e46664f1 100644 --- a/webapp/locales/en.json +++ b/webapp/locales/en.json @@ -15,7 +15,8 @@ "followers": "Followers", "following": "Following", "shouted": "Shouted", - "commented": "Commented" + "commented": "Commented", + "userAnonym": "Anonymous" }, "search": { "placeholder": "Search", @@ -27,6 +28,7 @@ "data": { "name": "Your data", "labelName": "Your Name", + "namePlaceholder": "Anonymous", "labelCity": "Your City or Region", "labelBio": "About You" }, @@ -202,4 +204,4 @@ "shoutButton": { "shouted": "shouted" } -} +} \ No newline at end of file diff --git a/webapp/locales/it.json b/webapp/locales/it.json index 0225babad..25005a07a 100644 --- a/webapp/locales/it.json +++ b/webapp/locales/it.json @@ -15,13 +15,15 @@ "followers": "Seguenti", "following": "Seguendo", "shouted": "Gridato", - "commented": "Commentato" + "commented": "Commentato", + "userAnonym": "Anonymous" }, "settings": { "name": "Impostazioni", "data": { "name": "I tuoi dati", "labelName": "Nome", + "namePlaceholder": "Anonymous", "labelCity": "La tua città o regione", "labelBio": "Su di te" }, diff --git a/webapp/locales/pl.json b/webapp/locales/pl.json index 0f2147996..506a04f1b 100644 --- a/webapp/locales/pl.json +++ b/webapp/locales/pl.json @@ -15,13 +15,15 @@ "followers": "Obserwujący", "following": "Obserwowani", "shouted": "Krzyknij", - "commented": "Skomentuj" + "commented": "Skomentuj", + "userAnonym": "Anonymous" }, "settings": { "name": "Ustawienia", "data": { "name": "Twoje dane", "labelName": "Twoje dane", + "namePlaceholder": "Anonymous", "labelCity": "Twoje miasto lub region", "labelBio": "O Tobie" }, diff --git a/webapp/locales/pt.json b/webapp/locales/pt.json index 4151f49c7..0636ba6f9 100644 --- a/webapp/locales/pt.json +++ b/webapp/locales/pt.json @@ -15,13 +15,15 @@ "followers": "Seguidores", "following": "Seguindo", "shouted": "Aclamou", - "commented": "Comentou" + "commented": "Comentou", + "userAnonym": "Anonymous" }, "settings": { "name": "Configurações", "data": { "name": "Seus dados", "labelName": "Seu nome", + "namePlaceholder": "Anonymous", "labelCity": "Sua cidade ou estado", "labelBio": "Sobre você" }, diff --git a/webapp/pages/profile/_id/_slug.vue b/webapp/pages/profile/_id/_slug.vue index a3b10529e..f4367d0be 100644 --- a/webapp/pages/profile/_id/_slug.vue +++ b/webapp/pages/profile/_id/_slug.vue @@ -3,23 +3,14 @@

PROFILE IMAGE

- - + + - + - - {{ user.name }} - - - {{ user.location.name }} + {{ userName() }} + + + {{ user.location.name }} - {{ $t('profile.memberSince') }} {{ user.createdAt | date('MMMM yyyy') }} - + >{{ $t('profile.memberSince') }} {{ user.createdAt | date('MMMM yyyy') }} - - + + - + - + - + - - - Netzwerk - + + Netzwerk - - - Wem folgt {{ user.name | truncate(15) }}? - + + Wem folgt {{ userName(15) }}? - + - - - Wer folgt {{ user.name | truncate(15) }}? - + + Wer folgt {{ userName(15) }}? - + @@ -219,10 +124,7 @@ - + @@ -232,10 +134,7 @@ - + @@ -245,10 +144,7 @@ - + @@ -273,25 +169,16 @@ :key="post.id" :width="{ base: '100%', md: '100%', xl: '50%' }" > - + - + @@ -395,6 +282,14 @@ export default { }, fetchPolicy: 'cache-and-network' }) + }, + userName(maxLength) { + // Return Anonymous if no Username is given + if (!this.user.name) { + return this.$t('profile.userAnonym') + } + // Return full Username or truncated Username + return maxLength ? this.user.name.substring(0, maxLength) : this.user.name } }, apollo: { diff --git a/webapp/pages/settings/index.vue b/webapp/pages/settings/index.vue index 5ff7c171e..3acaf9c4c 100644 --- a/webapp/pages/settings/index.vue +++ b/webapp/pages/settings/index.vue @@ -9,7 +9,7 @@ model="name" icon="user" :label="$t('settings.data.labelName')" - :placeholder="$t('settings.data.labelName')" + :placeholder="$t('settings.data.namePlaceholder')" /> Date: Thu, 11 Apr 2019 17:24:05 +0200 Subject: [PATCH 02/92] basic stuff from alpha --- .../Change.spec.js} | 0 .../Change.vue} | 38 ++--- webapp/components/Password/Strength.vue | 145 ++++++++++++++++++ webapp/package.json | 3 +- webapp/pages/settings/security.vue | 4 +- webapp/yarn.lock | 14 +- 6 files changed, 169 insertions(+), 35 deletions(-) rename webapp/components/{ChangePassword.spec.js => Password/Change.spec.js} (100%) rename webapp/components/{ChangePassword.vue => Password/Change.vue} (67%) create mode 100644 webapp/components/Password/Strength.vue diff --git a/webapp/components/ChangePassword.spec.js b/webapp/components/Password/Change.spec.js similarity index 100% rename from webapp/components/ChangePassword.spec.js rename to webapp/components/Password/Change.spec.js diff --git a/webapp/components/ChangePassword.vue b/webapp/components/Password/Change.vue similarity index 67% rename from webapp/components/ChangePassword.vue rename to webapp/components/Password/Change.vue index dc8cc09da..692243305 100644 --- a/webapp/components/ChangePassword.vue +++ b/webapp/components/Password/Change.vue @@ -1,35 +1,18 @@