From ca4d5950d08aec6fe016b56f7125f7328c1e19a1 Mon Sep 17 00:00:00 2001 From: kPherox Date: Sat, 16 Nov 2019 03:12:16 +0900 Subject: [PATCH 01/13] Display user profile fields --- src/components/user_profile/user_profile.js | 8 ++++ src/components/user_profile/user_profile.vue | 50 ++++++++++++++++++++ 2 files changed, 58 insertions(+) diff --git a/src/components/user_profile/user_profile.js b/src/components/user_profile/user_profile.js index 00055707..c5ab5f26 100644 --- a/src/components/user_profile/user_profile.js +++ b/src/components/user_profile/user_profile.js @@ -123,6 +123,14 @@ const UserProfile = { onTabSwitch (tab) { this.tab = tab this.$router.replace({ query: { tab } }) + }, + linkClicked ({ target }) { + if (target.tagName === 'SPAN') { + target = target.parentNode + } + if (target.tagName === 'A') { + window.open(target.href, '_blank') + } } }, watch: { diff --git a/src/components/user_profile/user_profile.vue b/src/components/user_profile/user_profile.vue index 14082e83..f979eff4 100644 --- a/src/components/user_profile/user_profile.vue +++ b/src/components/user_profile/user_profile.vue @@ -11,6 +11,44 @@ :allow-zooming-avatar="true" rounded="top" /> +
+
+ +
+
+
+
+
+ {{ field.name }} +
+
+ {{ field.value }} +
+
+
Date: Mon, 18 Nov 2019 00:27:14 +0900 Subject: [PATCH 02/13] Fix emoji size --- src/components/user_profile/user_profile.vue | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/components/user_profile/user_profile.vue b/src/components/user_profile/user_profile.vue index f979eff4..d5aa514e 100644 --- a/src/components/user_profile/user_profile.vue +++ b/src/components/user_profile/user_profile.vue @@ -152,6 +152,18 @@ flex-basis: 500px; .user-profile-fields { + img { + object-fit: contain; + vertical-align: middle; + max-width: 100%; + max-height: 400px; + + &.emoji { + width: 32px; + height: 32px; + } + } + dl { margin: 1em 1.5em; From 004827a7f17a0bc349baf1257aa5debe3c6f6060 Mon Sep 17 00:00:00 2001 From: kPherox Date: Mon, 18 Nov 2019 02:16:37 +0900 Subject: [PATCH 03/13] Change profile fields design to horizontal --- src/components/user_profile/user_profile.vue | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/components/user_profile/user_profile.vue b/src/components/user_profile/user_profile.vue index d5aa514e..fdff0385 100644 --- a/src/components/user_profile/user_profile.vue +++ b/src/components/user_profile/user_profile.vue @@ -159,15 +159,31 @@ max-height: 400px; &.emoji { - width: 32px; - height: 32px; + width: 18px; + height: 18px; } } dl { + display: flex; margin: 1em 1.5em; + dt { + flex: 0 0 auto; + font-weight: 500; + color: var(--lightText); + width: 30%; + min-width: 120px; + } + + dd { + flex: 1 1 auto; + color: var(--text); + margin-left: 10px; + } + dt, dd { + line-height: 18px; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; From 87940ead8a9bedd312f10635462933a02e0ffb1c Mon Sep 17 00:00:00 2001 From: kPherox Date: Wed, 20 Nov 2019 18:59:37 +0900 Subject: [PATCH 04/13] Change css selectors to classname from elementname --- src/components/user_profile/user_profile.vue | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/user_profile/user_profile.vue b/src/components/user_profile/user_profile.vue index fdff0385..c1337411 100644 --- a/src/components/user_profile/user_profile.vue +++ b/src/components/user_profile/user_profile.vue @@ -18,6 +18,7 @@ -
-
-
- {{ field.name }} -
-
- {{ field.value }} -
-
-
Date: Wed, 20 Nov 2019 19:25:11 +0900 Subject: [PATCH 07/13] Change field name to right justify --- src/components/user_profile/user_profile.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/user_profile/user_profile.vue b/src/components/user_profile/user_profile.vue index 0268e5da..5bffba3a 100644 --- a/src/components/user_profile/user_profile.vue +++ b/src/components/user_profile/user_profile.vue @@ -158,6 +158,7 @@ .user-profile-field-name { flex: 0 0 auto; font-weight: 500; + text-align: right; color: var(--lightText); width: 30%; min-width: 120px; From da55b0d4352d2daf4a8d9f4130d34546e9f01555 Mon Sep 17 00:00:00 2001 From: kPherox Date: Wed, 19 Feb 2020 20:57:58 +0900 Subject: [PATCH 08/13] Add fields_text for tooltip --- .../entity_normalizer/entity_normalizer.service.js | 6 ++++++ .../entity_normalizer/entity_normalizer.spec.js | 13 +++++++++++++ 2 files changed, 19 insertions(+) diff --git a/src/services/entity_normalizer/entity_normalizer.service.js b/src/services/entity_normalizer/entity_normalizer.service.js index ca79df6f..ca2075a4 100644 --- a/src/services/entity_normalizer/entity_normalizer.service.js +++ b/src/services/entity_normalizer/entity_normalizer.service.js @@ -53,6 +53,12 @@ export const parseUser = (data) => { value: addEmojis(field.value, data.emojis) } }) + output.fields_text = data.fields.map(field => { + return { + name: field.name.replace(/<[^>]*>/g, ''), + value: field.value.replace(/<[^>]*>/g, '') + } + }) // Utilize avatar_static for gif avatars? output.profile_image_url = data.avatar diff --git a/test/unit/specs/services/entity_normalizer/entity_normalizer.spec.js b/test/unit/specs/services/entity_normalizer/entity_normalizer.spec.js index cfb380ba..9df84575 100644 --- a/test/unit/specs/services/entity_normalizer/entity_normalizer.spec.js +++ b/test/unit/specs/services/entity_normalizer/entity_normalizer.spec.js @@ -290,6 +290,19 @@ describe('API Entities normalizer', () => { expect(field).to.have.property('value').that.contains(' { + const user = makeMockUserMasto({ emojis: makeMockEmojiMasto(), fields: [{ name: 'user', value: '@user' }] }) + + const parsedUser = parseUser(user) + + expect(parsedUser).to.have.property('fields_text').to.be.an('array') + + const field = parsedUser.fields_text[0] + + expect(field).to.have.property('name').that.equal('user') + expect(field).to.have.property('value').that.equal('@user') + }) + it('adds hide_follows and hide_followers user settings', () => { const user = makeMockUserMasto({ pleroma: { hide_followers: true, hide_follows: false, hide_followers_count: false, hide_follows_count: true } }) From 064b59812c715d60526727d42c124375a2bc89d5 Mon Sep 17 00:00:00 2001 From: kPherox Date: Wed, 19 Feb 2020 21:00:39 +0900 Subject: [PATCH 09/13] Change to use tags removed fields instead of raw fields --- src/components/user_profile/user_profile.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/user_profile/user_profile.vue b/src/components/user_profile/user_profile.vue index 5bffba3a..54f2d4b3 100644 --- a/src/components/user_profile/user_profile.vue +++ b/src/components/user_profile/user_profile.vue @@ -22,13 +22,13 @@ >