From da491f3278214fd56e3485d0ac162e92bf1b89ae Mon Sep 17 00:00:00 2001 From: FloatingGhost Date: Thu, 29 Dec 2022 15:17:35 +0000 Subject: [PATCH] add verification of links --- src/components/user_profile/user_profile.js | 6 ++++-- src/components/user_profile/user_profile.vue | 14 ++++++++++++++ src/i18n/en.json | 3 ++- .../entity_normalizer/entity_normalizer.service.js | 7 +++++-- 4 files changed, 25 insertions(+), 5 deletions(-) diff --git a/src/components/user_profile/user_profile.js b/src/components/user_profile/user_profile.js index 42c5ec9e..8fba1a28 100644 --- a/src/components/user_profile/user_profile.js +++ b/src/components/user_profile/user_profile.js @@ -10,11 +10,13 @@ import withLoadMore from '../../hocs/with_load_more/with_load_more' import { debounce } from 'lodash' import { library } from '@fortawesome/fontawesome-svg-core' import { - faCircleNotch + faCircleNotch, + faCircleCheck } from '@fortawesome/free-solid-svg-icons' library.add( - faCircleNotch + faCircleNotch, + faCircleCheck ) const FollowerList = withLoadMore({ diff --git a/src/components/user_profile/user_profile.vue b/src/components/user_profile/user_profile.vue index d16483e2..4e0d0b0f 100644 --- a/src/components/user_profile/user_profile.vue +++ b/src/components/user_profile/user_profile.vue @@ -37,6 +37,15 @@ :html="field.value" :emoji="user.emoji" /> + + + @@ -225,6 +234,11 @@ padding: 0.5em 1.5em; box-sizing: border-box; } + + .user-profile-field-validated { + margin-left: 1rem; + color: green; + } } } diff --git a/src/i18n/en.json b/src/i18n/en.json index 32785561..6fbac399 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -1183,7 +1183,8 @@ "user_profile": { "profile_does_not_exist": "Sorry, this profile does not exist.", "profile_loading_error": "Sorry, there was an error loading this profile.", - "timeline_title": "User timeline" + "timeline_title": "User timeline", + "field_validated": "Link Verified" }, "user_reporting": { "add_comment_description": "The report will be sent to your instance moderators. You can provide an explanation of why you are reporting this account below:", diff --git a/src/services/entity_normalizer/entity_normalizer.service.js b/src/services/entity_normalizer/entity_normalizer.service.js index df6c03b5..eb85418e 100644 --- a/src/services/entity_normalizer/entity_normalizer.service.js +++ b/src/services/entity_normalizer/entity_normalizer.service.js @@ -68,13 +68,16 @@ export const parseUser = (data) => { output.fields_html = data.fields.map(field => { return { name: escape(field.name), - value: field.value + value: field.value, + verified_at: field.verified_at } }) + console.log(output.fields_html) output.fields_text = data.fields.map(field => { return { name: unescape(field.name.replace(/<[^>]*>/g, '')), - value: unescape(field.value.replace(/<[^>]*>/g, '')) + value: unescape(field.value.replace(/<[^>]*>/g, '')), + verified_at: field.verified_at } })