From 1a333aabba759fb68449ead9c47e986f456e8c8c Mon Sep 17 00:00:00 2001 From: Sean King Date: Tue, 7 Jun 2022 21:31:48 -0600 Subject: Add edit status functionality --- CONTRIBUTORS.md | 1 + src/App.js | 2 + src/App.vue | 1 + .../edit_status_modal/edit_status_modal.js | 75 ++++++++++++++++++ .../edit_status_modal/edit_status_modal.vue | 48 ++++++++++++ src/components/extra_buttons/extra_buttons.js | 13 ++++ src/components/extra_buttons/extra_buttons.vue | 11 +++ .../post_status_form/post_status_form.js | 45 ++++++++--- .../post_status_form/post_status_form.vue | 1 + src/i18n/en.json | 2 + src/main.js | 3 + src/modules/api.js | 2 + src/modules/editStatus.js | 25 ++++++ src/modules/statuses.js | 6 ++ src/services/api/api.service.js | 88 +++++++++++++++++++++- .../entity_normalizer/entity_normalizer.service.js | 12 +++ .../status_poster/status_poster.service.js | 42 +++++++++++ 17 files changed, 365 insertions(+), 12 deletions(-) create mode 100644 src/components/edit_status_modal/edit_status_modal.js create mode 100644 src/components/edit_status_modal/edit_status_modal.vue create mode 100644 src/modules/editStatus.js diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index f666a4ef..18f4a930 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -10,3 +10,4 @@ Contributors of this project. - shpuld (shpuld@shitposter.club): CSS and styling - Vincent Guth (https://unsplash.com/photos/XrwVIFy6rTw): Background images. - hj (hj@shigusegubu.club): Code +- Sean King (seanking@freespeechextremist.com): Code diff --git a/src/App.js b/src/App.js index f01f8788..6e0e34a8 100644 --- a/src/App.js +++ b/src/App.js @@ -11,6 +11,7 @@ import MobilePostStatusButton from './components/mobile_post_status_button/mobil import MobileNav from './components/mobile_nav/mobile_nav.vue' import DesktopNav from './components/desktop_nav/desktop_nav.vue' import UserReportingModal from './components/user_reporting_modal/user_reporting_modal.vue' +import EditStatusModal from './components/edit_status_modal/edit_status_modal.vue' import PostStatusModal from './components/post_status_modal/post_status_modal.vue' import GlobalNoticeList from './components/global_notice_list/global_notice_list.vue' import { windowWidth, windowHeight } from './services/window_utils/window_utils' @@ -35,6 +36,7 @@ export default { SettingsModal, UserReportingModal, PostStatusModal, + EditStatusModal, GlobalNoticeList }, data: () => ({ diff --git a/src/App.vue b/src/App.vue index 5b448972..9484f993 100644 --- a/src/App.vue +++ b/src/App.vue @@ -52,6 +52,7 @@ +
@@ -257,7 +257,7 @@ @keydown.enter.prevent="" >

- {{ localDescription }} + {{ attachment.description }}

-- cgit v1.2.3-70-g09d2 From 80ec88beabefd41e75040dd35364a94783e423a0 Mon Sep 17 00:00:00 2001 From: Sean King Date: Sat, 11 Jun 2022 16:32:46 -0600 Subject: Use statusId instead of repliedUser.id --- src/components/edit_status_modal/edit_status_modal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/edit_status_modal/edit_status_modal.js b/src/components/edit_status_modal/edit_status_modal.js index 14320d21..75adfea7 100644 --- a/src/components/edit_status_modal/edit_status_modal.js +++ b/src/components/edit_status_modal/edit_status_modal.js @@ -29,7 +29,7 @@ const EditStatusModal = { }, watch: { params (newVal, oldVal) { - if (get(newVal, 'repliedUser.id') !== get(oldVal, 'repliedUser.id')) { + if (get(newVal, 'statusId') !== get(oldVal, 'statusId')) { this.resettingForm = true this.$nextTick(() => { this.resettingForm = false -- cgit v1.2.3-70-g09d2 From 32ecdfdd8738befa004f865f496b7df17a4c2030 Mon Sep 17 00:00:00 2001 From: Sean King Date: Sat, 11 Jun 2022 16:38:03 -0600 Subject: Don't pollute the original timeline when new media attachment is added --- src/components/extra_buttons/extra_buttons.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/extra_buttons/extra_buttons.js b/src/components/extra_buttons/extra_buttons.js index 9508a707..8a703953 100644 --- a/src/components/extra_buttons/extra_buttons.js +++ b/src/components/extra_buttons/extra_buttons.js @@ -80,7 +80,7 @@ const ExtraButtons = { statusText: data.text, statusIsSensitive: this.status.nsfw, statusPoll: this.status.poll, - statusFiles: this.status.attachments, + statusFiles: [...this.status.attachments], visibility: this.status.visibility, statusContentType: data.content_type })) -- cgit v1.2.3-70-g09d2 From 29e7972d8b46e9ad15ecc0cdd398f6054fe0004a Mon Sep 17 00:00:00 2001 From: Sean King Date: Sat, 11 Jun 2022 16:44:08 -0600 Subject: Credit to the chad tusooa --- CONTRIBUTORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 18f4a930..bfc41ac4 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -11,3 +11,4 @@ Contributors of this project. - Vincent Guth (https://unsplash.com/photos/XrwVIFy6rTw): Background images. - hj (hj@shigusegubu.club): Code - Sean King (seanking@freespeechextremist.com): Code +- Tusooa Zhu (tusooa@kazv.moe): Code -- cgit v1.2.3-70-g09d2 From c195e3571c113d29778ad86f4cbea019716fe787 Mon Sep 17 00:00:00 2001 From: Tusooa Zhu Date: Sat, 11 Jun 2022 20:33:12 -0400 Subject: Handle explicit mention changes in status updates --- src/components/status_body/status_body.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/components/status_body/status_body.js b/src/components/status_body/status_body.js index b8f6f9a0..0a3dcf79 100644 --- a/src/components/status_body/status_body.js +++ b/src/components/status_body/status_body.js @@ -125,6 +125,13 @@ const StatusContent = { generateTagLink (tag) { return `/tag/${tag}` } + }, + watch: { + 'status.raw_html' (newVal, oldVal) { + if (newVal !== oldVal) { + this.parseReadyDone = false + } + } } } -- cgit v1.2.3-70-g09d2 From 6e42409b8a0002ecbc75433b4f0881f10eb58bff Mon Sep 17 00:00:00 2001 From: Sean King Date: Sat, 11 Jun 2022 19:30:29 -0600 Subject: Fetch status when highlighting it --- src/components/conversation/conversation.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/conversation/conversation.js b/src/components/conversation/conversation.js index 2ef2977a..1e6c0008 100644 --- a/src/components/conversation/conversation.js +++ b/src/components/conversation/conversation.js @@ -395,6 +395,7 @@ const conversation = { setHighlight (id) { if (!id) return this.highlight = id + this.$store.dispatch('fetchStatus', id) this.$store.dispatch('fetchFavsAndRepeats', id) this.$store.dispatch('fetchEmojiReactionsBy', id) }, -- cgit v1.2.3-70-g09d2 From 8dac3932fed30e4238c2a7ef9cef8255a5c83a5a Mon Sep 17 00:00:00 2001 From: Sean King Date: Sat, 11 Jun 2022 20:10:16 -0600 Subject: Only refetch status on highlight if streaming is not enabled --- src/components/conversation/conversation.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/components/conversation/conversation.js b/src/components/conversation/conversation.js index 1e6c0008..f8df9eb5 100644 --- a/src/components/conversation/conversation.js +++ b/src/components/conversation/conversation.js @@ -1,6 +1,8 @@ import { reduce, filter, findIndex, clone, get } from 'lodash' import Status from '../status/status.vue' import ThreadTree from '../thread_tree/thread_tree.vue' +import { WSConnectionStatus } from '../../services/api/api.service.js' +import { mapGetters, mapState } from 'vuex' import { library } from '@fortawesome/fontawesome-svg-core' import { @@ -77,6 +79,9 @@ const conversation = { const maxDepth = this.$store.getters.mergedConfig.maxDepthInThread - 2 return maxDepth >= 1 ? maxDepth : 1 }, + streamingEnabled () { + return this.mergedConfig.useStreamingApi && this.mastoUserSocketStatus === WSConnectionStatus.JOINED + }, displayStyle () { return this.$store.getters.mergedConfig.conversationDisplay }, @@ -339,7 +344,11 @@ const conversation = { }, maybeHighlight () { return this.isExpanded ? this.highlight : null - } + }, + ...mapGetters(['mergedConfig']), + ...mapState({ + mastoUserSocketStatus: state => state.api.mastoUserSocketStatus + }) }, components: { Status, @@ -395,7 +404,11 @@ const conversation = { setHighlight (id) { if (!id) return this.highlight = id - this.$store.dispatch('fetchStatus', id) + + if (!this.streamingEnabled) { + this.$store.dispatch('fetchStatus', id) + } + this.$store.dispatch('fetchFavsAndRepeats', id) this.$store.dispatch('fetchEmojiReactionsBy', id) }, -- cgit v1.2.3-70-g09d2 From 87fa7b82fb597ea597ee228c97cb2350a7d6c044 Mon Sep 17 00:00:00 2001 From: Sean King Date: Sat, 11 Jun 2022 20:40:53 -0600 Subject: Add warning for editing statuses --- src/components/post_status_form/post_status_form.js | 3 +++ src/components/post_status_form/post_status_form.vue | 8 ++++++++ src/i18n/en.json | 2 ++ 3 files changed, 13 insertions(+) diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js index d73219ad..ae81bfa6 100644 --- a/src/components/post_status_form/post_status_form.js +++ b/src/components/post_status_form/post_status_form.js @@ -261,6 +261,9 @@ const PostStatusForm = { uploadFileLimitReached () { return this.newStatus.files.length >= this.fileLimit }, + isEdit () { + return typeof this.statusId !== 'undefined' && this.statusId.trim() !== '' + }, ...mapGetters(['mergedConfig']), ...mapState({ mobileLayout: state => state.interface.mobileLayout diff --git a/src/components/post_status_form/post_status_form.vue b/src/components/post_status_form/post_status_form.vue index 60cab745..650b5b8c 100644 --- a/src/components/post_status_form/post_status_form.vue +++ b/src/components/post_status_form/post_status_form.vue @@ -66,6 +66,14 @@ {{ $t('post_status.direct_warning_to_first_only') }} {{ $t('post_status.direct_warning_to_all') }}

+

+ {{ $t('post_status.edit_remote_warning') }} +
+ {{ $t('post_status.edit_unsupported_warning') }} +

Date: Sat, 11 Jun 2022 23:51:13 -0600 Subject: Clarification on unsupported edit features warning --- src/i18n/en.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/i18n/en.json b/src/i18n/en.json index a303c0e8..b7a1dcbf 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -217,7 +217,7 @@ "direct_warning_to_all": "This post will be visible to all the mentioned users.", "direct_warning_to_first_only": "This post will only be visible to the mentioned users at the beginning of the message.", "edit_remote_warning": "Other remote instances may not support editing and unable to receive the latest version of your post.", - "edit_unsupported_warning": "Pleroma currently does not support editing mentions or polls.", + "edit_unsupported_warning": "Pleroma does not support removing mentions or editing polls.", "posting": "Posting", "post": "Post", "preview": "Preview", -- cgit v1.2.3-70-g09d2 From 1b796691b0c396c1780e5520bf285e22923f3b6a Mon Sep 17 00:00:00 2001 From: Sean King Date: Sun, 12 Jun 2022 10:16:56 -0600 Subject: Change message on unsupported edit features --- src/i18n/en.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/i18n/en.json b/src/i18n/en.json index b7a1dcbf..7b1bac79 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -217,7 +217,7 @@ "direct_warning_to_all": "This post will be visible to all the mentioned users.", "direct_warning_to_first_only": "This post will only be visible to the mentioned users at the beginning of the message.", "edit_remote_warning": "Other remote instances may not support editing and unable to receive the latest version of your post.", - "edit_unsupported_warning": "Pleroma does not support removing mentions or editing polls.", + "edit_unsupported_warning": "Pleroma does not support editing mentions or polls.", "posting": "Posting", "post": "Post", "preview": "Preview", -- cgit v1.2.3-70-g09d2 From fa5d35523dd081b6948d38325374cac5707b7868 Mon Sep 17 00:00:00 2001 From: Sean King Date: Mon, 20 Jun 2022 22:52:08 -0600 Subject: Add ability to view status history for edited statuses --- src/App.js | 2 + src/App.vue | 1 + src/components/extra_buttons/extra_buttons.js | 23 ++++++++- src/components/extra_buttons/extra_buttons.vue | 11 ++++ .../status_history_modal/status_history_modal.js | 60 ++++++++++++++++++++++ .../status_history_modal/status_history_modal.vue | 46 +++++++++++++++++ src/i18n/en.json | 3 +- src/main.js | 2 + src/modules/statusHistory.js | 25 +++++++++ src/modules/statuses.js | 3 ++ src/services/api/api.service.js | 17 +++--- .../entity_normalizer/entity_normalizer.service.js | 6 ++- 12 files changed, 186 insertions(+), 13 deletions(-) create mode 100644 src/components/status_history_modal/status_history_modal.js create mode 100644 src/components/status_history_modal/status_history_modal.vue create mode 100644 src/modules/statusHistory.js diff --git a/src/App.js b/src/App.js index 6e0e34a8..af638a1c 100644 --- a/src/App.js +++ b/src/App.js @@ -13,6 +13,7 @@ import DesktopNav from './components/desktop_nav/desktop_nav.vue' import UserReportingModal from './components/user_reporting_modal/user_reporting_modal.vue' import EditStatusModal from './components/edit_status_modal/edit_status_modal.vue' import PostStatusModal from './components/post_status_modal/post_status_modal.vue' +import StatusHistoryModal from './components/status_history_modal/status_history_modal.vue' import GlobalNoticeList from './components/global_notice_list/global_notice_list.vue' import { windowWidth, windowHeight } from './services/window_utils/window_utils' import { mapGetters } from 'vuex' @@ -37,6 +38,7 @@ export default { UserReportingModal, PostStatusModal, EditStatusModal, + StatusHistoryModal, GlobalNoticeList }, data: () => ({ diff --git a/src/App.vue b/src/App.vue index 9484f993..1b513e08 100644 --- a/src/App.vue +++ b/src/App.vue @@ -53,6 +53,7 @@ +
:first-child { + margin-top: 0; + } + + > :last-child { + margin-bottom: 0; + } + } + .media-upload-icon, .poll-icon, .emoji-icon { font-size: 1.85em; line-height: 1.1; -- cgit v1.2.3-70-g09d2 From ed8bc6102290cb50d44c1c7aa5696aac5624d907 Mon Sep 17 00:00:00 2001 From: Tusooa Zhu Date: Wed, 22 Jun 2022 16:05:27 -0400 Subject: Add last edited at indicator in status --- src/components/status/status.js | 6 ++++++ src/components/status/status.scss | 3 ++- src/components/status/status.vue | 24 ++++++++++++++++++++++++ 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/src/components/status/status.js b/src/components/status/status.js index a925f30b..b7f20374 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -392,6 +392,12 @@ const Status = { }, visibilityLocalized () { return this.$i18n.t('general.scope_in_timeline.' + this.status.visibility) + }, + isEdited () { + return this.status.edited_at !== null + }, + editingAvailable () { + return this.$store.state.instance.editingAvailable } }, methods: { diff --git a/src/components/status/status.scss b/src/components/status/status.scss index b3ad3818..ada9841e 100644 --- a/src/components/status/status.scss +++ b/src/components/status/status.scss @@ -156,7 +156,8 @@ margin-right: 0.2em; } - & .heading-reply-row { + & .heading-reply-row, + & .heading-edited-row { position: relative; align-content: baseline; font-size: 0.85em; diff --git a/src/components/status/status.vue b/src/components/status/status.vue index 67ce999a..a9630a53 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -328,6 +328,30 @@ class="mentions-line" />
+
+ + + +
Date: Wed, 22 Jun 2022 16:05:44 -0400 Subject: Add English translation for last edited at indicator --- src/i18n/en.json | 1 + 1 file changed, 1 insertion(+) diff --git a/src/i18n/en.json b/src/i18n/en.json index f125c249..c4a044f5 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -748,6 +748,7 @@ "repeats": "Repeats", "delete": "Delete status", "edit": "Edit status", + "edited_at": "(last edited {time})", "pin": "Pin on profile", "unpin": "Unpin from profile", "pinned": "Pinned", -- cgit v1.2.3-70-g09d2 From acd53957e09a499b04c8f901e5829607f7363b57 Mon Sep 17 00:00:00 2001 From: Tusooa Zhu Date: Wed, 22 Jun 2022 16:14:19 -0400 Subject: Do not show edited indicator in history items --- src/components/status/status.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/status/status.vue b/src/components/status/status.vue index a9630a53..00462f0a 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -329,7 +329,7 @@ />
Date: Sun, 26 Jun 2022 13:25:36 -0600 Subject: Use watch to change localDescription --- src/components/attachment/attachment.js | 3 +++ src/components/attachment/attachment.vue | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/components/attachment/attachment.js b/src/components/attachment/attachment.js index d62a4adc..5dc50475 100644 --- a/src/components/attachment/attachment.js +++ b/src/components/attachment/attachment.js @@ -129,6 +129,9 @@ const Attachment = { ...mapGetters(['mergedConfig']) }, watch: { + 'attachment.description' (newVal) { + this.localDescription = newVal + }, localDescription (newVal) { this.onEdit(newVal) } diff --git a/src/components/attachment/attachment.vue b/src/components/attachment/attachment.vue index 14f6a0ae..2a89886d 100644 --- a/src/components/attachment/attachment.vue +++ b/src/components/attachment/attachment.vue @@ -166,7 +166,7 @@ :icon="placeholderIconClass" />

- {{ edit ? localDescription : attachment.description }} + {{ localDescription }}

@@ -244,7 +244,7 @@
@@ -257,7 +257,7 @@ @keydown.enter.prevent="" >

- {{ attachment.description }} + {{ localDescription }}

-- cgit v1.2.3-70-g09d2 From 6f4b57e84559871f8c59f968d5cf17f2971e74c3 Mon Sep 17 00:00:00 2001 From: Sean King Date: Sun, 26 Jun 2022 17:41:21 -0600 Subject: Use a better way to clone the original status --- src/components/extra_buttons/extra_buttons.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/extra_buttons/extra_buttons.js b/src/components/extra_buttons/extra_buttons.js index 92eb63b0..5ddb7f0f 100644 --- a/src/components/extra_buttons/extra_buttons.js +++ b/src/components/extra_buttons/extra_buttons.js @@ -88,8 +88,7 @@ const ExtraButtons = { })) }, showStatusHistory () { - let originalStatus = {} - Object.assign(originalStatus, this.status) + let originalStatus = { ...this.status } delete originalStatus.attachments delete originalStatus.created_at delete originalStatus.emojis -- cgit v1.2.3-70-g09d2 From 29ff63d1b420d0c36fb16c72389fdccd1294205a Mon Sep 17 00:00:00 2001 From: Sean King Date: Sun, 26 Jun 2022 18:10:30 -0600 Subject: Refactor to delete the properties for originalStatus in showStatusHistory in a better way --- src/components/extra_buttons/extra_buttons.js | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/components/extra_buttons/extra_buttons.js b/src/components/extra_buttons/extra_buttons.js index 5ddb7f0f..ef040d26 100644 --- a/src/components/extra_buttons/extra_buttons.js +++ b/src/components/extra_buttons/extra_buttons.js @@ -88,16 +88,9 @@ const ExtraButtons = { })) }, showStatusHistory () { - let originalStatus = { ...this.status } - delete originalStatus.attachments - delete originalStatus.created_at - delete originalStatus.emojis - delete originalStatus.text - delete originalStatus.raw_html - delete originalStatus.nsfw - delete originalStatus.poll - delete originalStatus.summary - delete originalStatus.summary_raw_html + const originalStatus = { ...this.status } + const stripFieldsList = ['attachments', 'created_at', 'emojis', 'text', 'raw_html', 'nsfw', 'poll', 'summary', 'summary_raw_html'] + stripFieldsList.forEach(p => delete originalStatus[p]) this.$store.dispatch('openStatusHistoryModal', originalStatus) } }, -- cgit v1.2.3-70-g09d2 From 75216c5feb32b32e24952663ffa4233410585785 Mon Sep 17 00:00:00 2001 From: Sean King Date: Sun, 10 Jul 2022 21:07:47 -0600 Subject: Remove guard for raw_html --- src/components/status_body/status_body.js | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/components/status_body/status_body.js b/src/components/status_body/status_body.js index 0a3dcf79..b8f6f9a0 100644 --- a/src/components/status_body/status_body.js +++ b/src/components/status_body/status_body.js @@ -125,13 +125,6 @@ const StatusContent = { generateTagLink (tag) { return `/tag/${tag}` } - }, - watch: { - 'status.raw_html' (newVal, oldVal) { - if (newVal !== oldVal) { - this.parseReadyDone = false - } - } } } -- cgit v1.2.3-70-g09d2 From 232cc72df8352db15ac3e6b11c1f9c5908069771 Mon Sep 17 00:00:00 2001 From: Sean King Date: Mon, 1 Aug 2022 18:45:52 -0600 Subject: Fix lint errors and warnings --- src/components/edit_status_modal/edit_status_modal.vue | 6 +++--- src/components/status/status.vue | 12 +++++------- src/components/status_history_modal/status_history_modal.vue | 4 ++-- src/services/api/api.service.js | 6 +++--- src/services/entity_normalizer/entity_normalizer.service.js | 2 +- 5 files changed, 14 insertions(+), 16 deletions(-) diff --git a/src/components/edit_status_modal/edit_status_modal.vue b/src/components/edit_status_modal/edit_status_modal.vue index 00dde7de..1dbacaab 100644 --- a/src/components/edit_status_modal/edit_status_modal.vue +++ b/src/components/edit_status_modal/edit_status_modal.vue @@ -11,10 +11,10 @@ diff --git a/src/components/status/status.vue b/src/components/status/status.vue index a13e5ab0..5ddb94b4 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -340,13 +340,11 @@ keypath="time.in_past" tag="span" > - + diff --git a/src/components/status_history_modal/status_history_modal.vue b/src/components/status_history_modal/status_history_modal.vue index d6680df2..990be35b 100644 --- a/src/components/status_history_modal/status_history_modal.vue +++ b/src/components/status_history_modal/status_history_modal.vue @@ -17,9 +17,9 @@ v-for="status in history" :key="status.id" :statusoid="status" - :isPreview="true" + :is-preview="true" class="conversation-status status-fadein panel-body" - /> + /> diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js index 41c14596..381dd112 100644 --- a/src/services/api/api.service.js +++ b/src/services/api/api.service.js @@ -417,7 +417,7 @@ const fetchStatus = ({ id, credentials }) => { } const fetchStatusSource = ({ id, credentials }) => { - let url = MASTODON_STATUS_SOURCE_URL(id) + const url = MASTODON_STATUS_SOURCE_URL(id) return fetch(url, { headers: authHeaders(credentials) }) .then((data) => { if (data.ok) { @@ -430,7 +430,7 @@ const fetchStatusSource = ({ id, credentials }) => { } const fetchStatusHistory = ({ status, credentials }) => { - let url = MASTODON_STATUS_HISTORY_URL(status.id) + const url = MASTODON_STATUS_HISTORY_URL(status.id) return promisedRequest({ url, credentials }) .then((data) => { data.reverse() @@ -767,7 +767,7 @@ const editStatus = ({ }) } - let putHeaders = authHeaders(credentials) + const putHeaders = authHeaders(credentials) return fetch(MASTODON_STATUS_URL(id), { body: form, diff --git a/src/services/entity_normalizer/entity_normalizer.service.js b/src/services/entity_normalizer/entity_normalizer.service.js index c00e9796..c1b2ffac 100644 --- a/src/services/entity_normalizer/entity_normalizer.service.js +++ b/src/services/entity_normalizer/entity_normalizer.service.js @@ -378,7 +378,7 @@ export const parseStatus = (data) => { output.favoritedBy = [] output.rebloggedBy = [] - if (data.hasOwnProperty('originalStatus')) { + if (Object.prototype.hasOwnProperty.call(data, 'originalStatus')) { Object.assign(output, data.originalStatus) } -- cgit v1.2.3-70-g09d2 From b70d50407cef26926635b1b47131c01e597fcfc6 Mon Sep 17 00:00:00 2001 From: Sean King Date: Mon, 1 Aug 2022 21:25:08 -0600 Subject: Refresh the relative time object for a Timeago component if the time changes --- src/components/timeago/timeago.vue | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/components/timeago/timeago.vue b/src/components/timeago/timeago.vue index 2b487dfd..fce9605b 100644 --- a/src/components/timeago/timeago.vue +++ b/src/components/timeago/timeago.vue @@ -34,6 +34,13 @@ export default { unmounted () { clearTimeout(this.interval) }, + watch: { + time (newVal, oldVal) { + if (oldVal !== newVal) { + this.refreshRelativeTimeObject() + } + } + }, methods: { refreshRelativeTimeObject () { const nowThreshold = typeof this.nowThreshold === 'number' ? this.nowThreshold : 1 -- cgit v1.2.3-70-g09d2 From 04e62df377fdd2ea563f58dcd23ea8048fc1c140 Mon Sep 17 00:00:00 2001 From: Sean King Date: Tue, 2 Aug 2022 23:19:25 -0600 Subject: Allow for template inside Timeago component that shows unless the time string is 'just now' --- src/components/status/status.vue | 16 ++++++---------- src/components/timeago/timeago.vue | 26 ++++++++++++++++++-------- 2 files changed, 24 insertions(+), 18 deletions(-) diff --git a/src/components/status/status.vue b/src/components/status/status.vue index 5ddb94b4..8036ddf4 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -336,16 +336,12 @@ tag="span" > diff --git a/src/components/timeago/timeago.vue b/src/components/timeago/timeago.vue index fce9605b..b5f49515 100644 --- a/src/components/timeago/timeago.vue +++ b/src/components/timeago/timeago.vue @@ -3,7 +3,7 @@ :datetime="time" :title="localeDateString" > - {{ $tc(relativeTime.key, relativeTime.num, [relativeTime.num]) }} + {{ relativeTimeString }} @@ -13,7 +13,7 @@ import localeService from 'src/services/locale/locale.service.js' export default { name: 'Timeago', - props: ['time', 'autoUpdate', 'longFormat', 'nowThreshold'], + props: ['time', 'autoUpdate', 'longFormat', 'nowThreshold', 'templateKey'], data () { return { relativeTime: { key: 'time.now', num: 0 }, @@ -26,21 +26,31 @@ export default { return typeof this.time === 'string' ? new Date(Date.parse(this.time)).toLocaleString(browserLocale) : this.time.toLocaleString(browserLocale) + }, + relativeTimeString () { + const timeString = this.$i18n.tc(this.relativeTime.key, this.relativeTime.num, [this.relativeTime.num]) + + if (typeof this.templateKey === 'string' && this.relativeTime.key !== 'time.now') { + return this.$i18n.t(this.templateKey, [timeString]) + } + + return timeString } }, - created () { - this.refreshRelativeTimeObject() - }, - unmounted () { - clearTimeout(this.interval) - }, watch: { time (newVal, oldVal) { if (oldVal !== newVal) { + clearTimeout(this.interval) this.refreshRelativeTimeObject() } } }, + created () { + this.refreshRelativeTimeObject() + }, + unmounted () { + clearTimeout(this.interval) + }, methods: { refreshRelativeTimeObject () { const nowThreshold = typeof this.nowThreshold === 'number' ? this.nowThreshold : 1 -- cgit v1.2.3-70-g09d2 From 420f29b6a460ead0a5b4d9ff61e3d3ca097bd798 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Tue, 23 Aug 2022 02:01:56 +0300 Subject: add a mask to load shape to flow text around quicker --- src/assets/pleromatan_apology_fox_mask.png | Bin 0 -> 2827 bytes src/assets/pleromatan_apology_mask.png | Bin 0 -> 2366 bytes .../update_notification/update_notification.js | 5 ++++- 3 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 src/assets/pleromatan_apology_fox_mask.png create mode 100644 src/assets/pleromatan_apology_mask.png diff --git a/src/assets/pleromatan_apology_fox_mask.png b/src/assets/pleromatan_apology_fox_mask.png new file mode 100644 index 00000000..4d1990d5 Binary files /dev/null and b/src/assets/pleromatan_apology_fox_mask.png differ diff --git a/src/assets/pleromatan_apology_mask.png b/src/assets/pleromatan_apology_mask.png new file mode 100644 index 00000000..18adafff Binary files /dev/null and b/src/assets/pleromatan_apology_mask.png differ diff --git a/src/components/update_notification/update_notification.js b/src/components/update_notification/update_notification.js index ba008d81..6cfe893c 100644 --- a/src/components/update_notification/update_notification.js +++ b/src/components/update_notification/update_notification.js @@ -2,6 +2,8 @@ import Modal from 'src/components/modal/modal.vue' import { library } from '@fortawesome/fontawesome-svg-core' import pleromaTan from 'src/assets/pleromatan_apology.png' import pleromaTanFox from 'src/assets/pleromatan_apology_fox.png' +import pleromaTanMask from 'src/assets/pleromatan_apology_mask.png' +import pleromaTanFoxMask from 'src/assets/pleromatan_apology_fox_mask.png' import { faTimes @@ -25,8 +27,9 @@ const UpdateNotification = { }, computed: { pleromaTanStyles () { + const mask = this.pleromaTanVariant === pleromaTan ? pleromaTanMask : pleromaTanFoxMask return { - 'shape-outside': 'url(' + this.pleromaTanVariant + ')' + 'shape-outside': 'url(' + mask + ')' } }, dynamicStyles () { -- cgit v1.2.3-70-g09d2 From 6e1639cc1e0f15760fdb26786c28fca4c3fd8c17 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Tue, 23 Aug 2022 02:06:54 +0300 Subject: fetch text height only after mask has been loaded --- src/components/update_notification/update_notification.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/components/update_notification/update_notification.js b/src/components/update_notification/update_notification.js index 6cfe893c..c389750d 100644 --- a/src/components/update_notification/update_notification.js +++ b/src/components/update_notification/update_notification.js @@ -60,9 +60,14 @@ const UpdateNotification = { } }, mounted () { - setTimeout(() => { - this.contentHeight = this.$refs.animatedText.scrollHeight - }, 1000) + // Workaround to get the text height only after mask loaded. A bit hacky. + const newImg = new Image() + newImg.onload = () => { + setTimeout(() => { + this.contentHeight = this.$refs.animatedText.scrollHeight + }, 100) + } + newImg.src = this.pleromaTanVariant === pleromaTan ? pleromaTanMask : pleromaTanFoxMask } } -- cgit v1.2.3-70-g09d2 From 21eeda3f048134b4bbd3df97911496ee3db412c9 Mon Sep 17 00:00:00 2001 From: Pleroma Renovate Bot Date: Tue, 30 Aug 2022 09:09:41 +0000 Subject: Update dependency sinon to v14 --- package.json | 2 +- yarn.lock | 107 +++++++++++++++++++++++++++++++++++++++++------------------ 2 files changed, 75 insertions(+), 34 deletions(-) diff --git a/package.json b/package.json index f63eb7d7..a3a4d6b1 100644 --- a/package.json +++ b/package.json @@ -110,7 +110,7 @@ "semver": "7.3.7", "serviceworker-webpack5-plugin": "2.0.0", "shelljs": "0.8.5", - "sinon": "2.4.1", + "sinon": "14.0.0", "sinon-chai": "3.7.0", "stylelint": "13.13.1", "stylelint-config-standard": "20.0.0", diff --git a/yarn.lock b/yarn.lock index 6f891f30..383f1d66 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1667,6 +1667,34 @@ resolved "https://registry.yarnpkg.com/@ruffle-rs/ruffle/-/ruffle-0.1.0-nightly.2022.7.12.tgz#c2d77fce7a0e98d51a6535371550e0bff019d0ea" integrity sha512-DFsiT4kdUuSHsYXzHV97e9Ui3FkcsHEg1GyHJipt/lCpCoZ2uRtP41uEz9eNc9ug8jWd7UyXxJmdkkRvs9UHgQ== +"@sinonjs/commons@^1.6.0", "@sinonjs/commons@^1.7.0", "@sinonjs/commons@^1.8.3": + version "1.8.3" + resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.3.tgz#3802ddd21a50a949b6721ddd72da36e67e7f1b2d" + integrity sha512-xkNcLAn/wZaX14RPlwizcKicDk9G3F8m2nU3L7Ukm5zBgTwiT0wsoFAHx9Jq56fJA1z/7uKGtCRu16sOUCLIHQ== + dependencies: + type-detect "4.0.8" + +"@sinonjs/fake-timers@>=5", "@sinonjs/fake-timers@^9.1.2": + version "9.1.2" + resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-9.1.2.tgz#4eaab737fab77332ab132d396a3c0d364bd0ea8c" + integrity sha512-BPS4ynJW/o92PUR4wgriz2Ud5gpST5vz6GQfMixEDK0Z8ZCUv2M7SkBLykH56T++Xs+8ln9zTGbOvNGIe02/jw== + dependencies: + "@sinonjs/commons" "^1.7.0" + +"@sinonjs/samsam@^6.1.1": + version "6.1.1" + resolved "https://registry.yarnpkg.com/@sinonjs/samsam/-/samsam-6.1.1.tgz#627f7f4cbdb56e6419fa2c1a3e4751ce4f6a00b1" + integrity sha512-cZ7rKJTLiE7u7Wi/v9Hc2fs3Ucc3jrWeMgPHbbTCeVAB2S0wOBbYlkJVeNSL04i7fdhT8wIbDq1zhC/PXTD2SA== + dependencies: + "@sinonjs/commons" "^1.6.0" + lodash.get "^4.4.2" + type-detect "^4.0.8" + +"@sinonjs/text-encoding@^0.7.1": + version "0.7.2" + resolved "https://registry.yarnpkg.com/@sinonjs/text-encoding/-/text-encoding-0.7.2.tgz#5981a8db18b56ba38ef0efb7d995b12aa7b51918" + integrity sha512-sXXKG+uL9IrKqViTtao2Ws6dy0znu9sOaP1di/jKGW1M6VssO8vlpXCQcpZ+jisQ1tTFAC5Jo/EOzFbggBagFQ== + "@socket.io/base64-arraybuffer@~1.0.2": version "1.0.2" resolved "https://registry.yarnpkg.com/@socket.io/base64-arraybuffer/-/base64-arraybuffer-1.0.2.tgz#568d9beae00b0d835f4f8c53fd55714986492e61" @@ -3373,7 +3401,7 @@ didyoumean@1.2.2: resolved "https://registry.yarnpkg.com/didyoumean/-/didyoumean-1.2.2.tgz#989346ffe9e839b4555ecf5666edea0d3e8ad037" integrity sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw== -diff@3.5.0, diff@^3.1.0: +diff@3.5.0: version "3.5.0" resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA== @@ -3383,6 +3411,11 @@ diff@5.0.0: resolved "https://registry.yarnpkg.com/diff/-/diff-5.0.0.tgz#7ed6ad76d859d030787ec35855f5b1daf31d852b" integrity sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w== +diff@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-5.1.0.tgz#bc52d298c5ea8df9194800224445ed43ffc87e40" + integrity sha512-D+mk+qE8VC/PAUrlAU34N+VfXev0ghe5ywmpqrawphmVZc1bEfn56uo9qpyGp1p4xpzOHkSW4ztBd6L7Xx4ACw== + dijkstrajs@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/dijkstrajs/-/dijkstrajs-1.0.2.tgz#2e48c0d3b825462afe75ab4ad5e829c8ece36257" @@ -4213,12 +4246,6 @@ form-data@^4.0.0: combined-stream "^1.0.8" mime-types "^2.1.12" -formatio@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/formatio/-/formatio-1.2.0.tgz#f3b2167d9068c4698a8d51f4f760a39a54d818eb" - dependencies: - samsam "1.x" - forwarded@0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.2.0.tgz#2269936428aad4c15c7ebe9779a84bf0b2a81811" @@ -5210,6 +5237,11 @@ jszip@^3.10.0: readable-stream "~2.3.6" setimmediate "^1.0.5" +just-extend@^4.0.2: + version "4.2.1" + resolved "https://registry.yarnpkg.com/just-extend/-/just-extend-4.2.1.tgz#ef5e589afb61e5d66b24eca749409a8939a8c744" + integrity sha512-g3UB796vUFIY90VIv/WX3L2c8CS2MdWUww3CNrYmqza1Fg0DURc2K/O4YrnklBdQarSJ/y8JnJYDGc+1iumQjg== + karma-coverage@2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/karma-coverage/-/karma-coverage-2.2.0.tgz#64f838b66b71327802e7f6f6c39d569b7024e40c" @@ -5530,6 +5562,11 @@ lodash.find@^3.2.1: lodash.isarray "^3.0.0" lodash.keys "^3.0.0" +lodash.get@^4.4.2: + version "4.4.2" + resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99" + integrity sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ== + lodash.isarguments@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz#2f573d85c6a24289ff00663b491c1d338ff3458a" @@ -5672,7 +5709,7 @@ log4js@^6.4.1: rfdc "^1.3.0" streamroller "^3.0.6" -lolex@1.6.0, lolex@^1.6.0: +lolex@1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/lolex/-/lolex-1.6.0.tgz#3a9a0283452a47d7439e72731b9e07d7386e49f6" integrity sha1-OpoCg0UqR9dDnnJzG54H1zhuSfY= @@ -6064,10 +6101,6 @@ nanoid@^3.3.4: resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.4.tgz#730b67e3cd09e2deacf03c027c81c9d9dbc5e8ab" integrity sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw== -native-promise-only@^0.8.1: - version "0.8.1" - resolved "https://registry.yarnpkg.com/native-promise-only/-/native-promise-only-0.8.1.tgz#20a318c30cb45f71fe7adfbf7b21c99c1472ef11" - natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" @@ -6118,6 +6151,17 @@ nightwatch@2.3.3: stacktrace-parser "^0.1.10" strip-ansi "6.0.1" +nise@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/nise/-/nise-5.1.1.tgz#ac4237e0d785ecfcb83e20f389185975da5c31f3" + integrity sha512-yr5kW2THW1AkxVmCnKEh4nbYkJdB3I7LUkiUgOvEkOp414mc2UMaHMA7pjq1nYowhdoJZGwEKGaQVbxfpWj10A== + dependencies: + "@sinonjs/commons" "^1.8.3" + "@sinonjs/fake-timers" ">=5" + "@sinonjs/text-encoding" "^0.7.1" + just-extend "^4.0.2" + path-to-regexp "^1.7.0" + no-case@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/no-case/-/no-case-3.0.4.tgz#d361fd5c9800f558551a8369fc0dcd4662b6124d" @@ -7330,10 +7374,6 @@ safe-buffer@^5.1.0, safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" -samsam@1.x, samsam@^1.1.3: - version "1.3.0" - resolved "https://registry.yarnpkg.com/samsam/-/samsam-1.3.0.tgz#8d1d9350e25622da30de3e44ba692b5221ab7c50" - sass-loader@13.0.2: version "13.0.2" resolved "https://registry.yarnpkg.com/sass-loader/-/sass-loader-13.0.2.tgz#e81a909048e06520e9f2ff25113a801065adb3fe" @@ -7522,19 +7562,17 @@ sinon-chai@3.7.0: resolved "https://registry.yarnpkg.com/sinon-chai/-/sinon-chai-3.7.0.tgz#cfb7dec1c50990ed18c153f1840721cf13139783" integrity sha512-mf5NURdUaSdnatJx3uhoBOrY9dtL19fiOtAdT1Azxg3+lNJFiuN0uzaU3xX1LeAfL17kHQhTAJgpsfhbMJMY2g== -sinon@2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/sinon/-/sinon-2.4.1.tgz#021fd64b54cb77d9d2fb0d43cdedfae7629c3a36" - integrity sha512-vFTrO9Wt0ECffDYIPSP/E5bBugt0UjcBQOfQUMh66xzkyPEnhl/vM2LRZi2ajuTdkH07sA6DzrM6KvdvGIH8xw== +sinon@14.0.0: + version "14.0.0" + resolved "https://registry.yarnpkg.com/sinon/-/sinon-14.0.0.tgz#203731c116d3a2d58dc4e3cbe1f443ba9382a031" + integrity sha512-ugA6BFmE+WrJdh0owRZHToLd32Uw3Lxq6E6LtNRU+xTVBefx632h03Q7apXWRsRdZAJ41LB8aUfn2+O4jsDNMw== dependencies: - diff "^3.1.0" - formatio "1.2.0" - lolex "^1.6.0" - native-promise-only "^0.8.1" - path-to-regexp "^1.7.0" - samsam "^1.1.3" - text-encoding "0.6.4" - type-detect "^4.0.0" + "@sinonjs/commons" "^1.8.3" + "@sinonjs/fake-timers" "^9.1.2" + "@sinonjs/samsam" "^6.1.1" + diff "^5.0.0" + nise "^5.1.1" + supports-color "^7.2.0" slash@^3.0.0: version "3.0.0" @@ -7893,6 +7931,13 @@ supports-color@^7.1.0: dependencies: has-flag "^4.0.0" +supports-color@^7.2.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" + integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== + dependencies: + has-flag "^4.0.0" + supports-preserve-symlinks-flag@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" @@ -7960,10 +8005,6 @@ terser@^5.10.0, terser@^5.14.1: commander "^2.20.0" source-map-support "~0.5.20" -text-encoding@0.6.4: - version "0.6.4" - resolved "https://registry.yarnpkg.com/text-encoding/-/text-encoding-0.6.4.tgz#e399a982257a276dae428bb92845cb71bdc26d19" - text-table@0.2.0, text-table@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" @@ -8023,7 +8064,7 @@ type-check@^0.4.0, type-check@~0.4.0: dependencies: prelude-ls "^1.2.1" -type-detect@4.0.8, type-detect@^4.0.0, type-detect@^4.0.5: +type-detect@4.0.8, type-detect@^4.0.0, type-detect@^4.0.5, type-detect@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" -- cgit v1.2.3-70-g09d2 From 8ecb67230c87754d43c4255c56c05566c8c53feb Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Wed, 31 Aug 2022 00:48:38 +0300 Subject: make custom router-link for nav-entry to un-nest the interactive elements --- src/components/nav_panel/nav_panel.vue | 7 -- src/components/navigation/navigation_entry.js | 4 + src/components/navigation/navigation_entry.vue | 133 +++++++++++---------- .../optional_router_link/optional_router_link.vue | 22 ++++ 4 files changed, 99 insertions(+), 67 deletions(-) create mode 100644 src/components/optional_router_link/optional_router_link.vue diff --git a/src/components/nav_panel/nav_panel.vue b/src/components/nav_panel/nav_panel.vue index 2688bcf4..7373ca63 100644 --- a/src/components/nav_panel/nav_panel.vue +++ b/src/components/nav_panel/nav_panel.vue @@ -121,7 +121,6 @@ border-bottom: 1px solid; border-color: $fallback--border; border-color: var(--border, $fallback--border); - padding: 0; } > li { @@ -150,12 +149,6 @@ font-size: 1.1em; } - .menu-item { - .timelines-chevron { - margin-right: 0; - } - } - .timelines-background { padding: 0 0 0 0.6em; background-color: $fallback--lightBg; diff --git a/src/components/navigation/navigation_entry.js b/src/components/navigation/navigation_entry.js index fe3402fc..81cc936a 100644 --- a/src/components/navigation/navigation_entry.js +++ b/src/components/navigation/navigation_entry.js @@ -1,5 +1,6 @@ import { mapState } from 'vuex' import { USERNAME_ROUTES } from 'src/components/navigation/navigation.js' +import OptionalRouterLink from 'src/components/optional_router_link/optional_router_link.vue' import { library } from '@fortawesome/fontawesome-svg-core' import { faThumbtack } from '@fortawesome/free-solid-svg-icons' @@ -7,6 +8,9 @@ library.add(faThumbtack) const NavigationEntry = { props: ['item', 'showPin'], + components: { + OptionalRouterLink + }, methods: { isPinned (value) { return this.pinnedItems.has(value) diff --git a/src/components/navigation/navigation_entry.vue b/src/components/navigation/navigation_entry.vue index 824c00a2..b984b234 100644 --- a/src/components/navigation/navigation_entry.vue +++ b/src/components/navigation/navigation_entry.vue @@ -1,26 +1,37 @@ @@ -55,7 +66,21 @@ @import '../../_variables.scss'; .NavigationEntry { - .label { + display: flex; + box-sizing: border-box; + align-items: baseline; + height: 3.5em; + line-height: 3.5em; + padding: 0 1em; + width: 100%; + color: $fallback--link; + color: var(--link, $fallback--link); + + .timelines-chevron { + margin-right: 0; + } + + .main-link { flex: 1; } @@ -72,48 +97,36 @@ } } - .menu-item { - display: flex; - box-sizing: border-box; - align-items: baseline; - height: 3.5em; - line-height: 3.5em; - padding: 0 1em; - width: 100%; + &:hover { + background-color: $fallback--lightBg; + background-color: var(--selectedMenu, $fallback--lightBg); color: $fallback--link; - color: var(--link, $fallback--link); - - &:hover { - background-color: $fallback--lightBg; - background-color: var(--selectedMenu, $fallback--lightBg); - color: $fallback--link; - color: var(--selectedMenuText, $fallback--link); - --faint: var(--selectedMenuFaintText, $fallback--faint); - --faintLink: var(--selectedMenuFaintLink, $fallback--faint); - --lightText: var(--selectedMenuLightText, $fallback--lightText); + color: var(--selectedMenuText, $fallback--link); + --faint: var(--selectedMenuFaintText, $fallback--faint); + --faintLink: var(--selectedMenuFaintLink, $fallback--faint); + --lightText: var(--selectedMenuLightText, $fallback--lightText); - .menu-icon { - --icon: var(--text, $fallback--icon); - } + .menu-icon { + --icon: var(--text, $fallback--icon); } + } - &.router-link-active { - font-weight: bolder; - background-color: $fallback--lightBg; - background-color: var(--selectedMenu, $fallback--lightBg); - color: $fallback--text; - color: var(--selectedMenuText, $fallback--text); - --faint: var(--selectedMenuFaintText, $fallback--faint); - --faintLink: var(--selectedMenuFaintLink, $fallback--faint); - --lightText: var(--selectedMenuLightText, $fallback--lightText); + &.-active { + font-weight: bolder; + background-color: $fallback--lightBg; + background-color: var(--selectedMenu, $fallback--lightBg); + color: $fallback--text; + color: var(--selectedMenuText, $fallback--text); + --faint: var(--selectedMenuFaintText, $fallback--faint); + --faintLink: var(--selectedMenuFaintLink, $fallback--faint); + --lightText: var(--selectedMenuLightText, $fallback--lightText); - .menu-icon { - --icon: var(--text, $fallback--icon); - } + .menu-icon { + --icon: var(--text, $fallback--icon); + } - &:hover { - text-decoration: underline; - } + &:hover { + text-decoration: underline; } } } diff --git a/src/components/optional_router_link/optional_router_link.vue b/src/components/optional_router_link/optional_router_link.vue new file mode 100644 index 00000000..4eef0d6a --- /dev/null +++ b/src/components/optional_router_link/optional_router_link.vue @@ -0,0 +1,22 @@ + + + -- cgit v1.2.3-70-g09d2 From 98f97ff9a9806b2cb16f9b9f15df531be0f98919 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Wed, 31 Aug 2022 00:57:02 +0300 Subject: lint --- src/components/optional_router_link/optional_router_link.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/optional_router_link/optional_router_link.vue b/src/components/optional_router_link/optional_router_link.vue index 4eef0d6a..a9877dd5 100644 --- a/src/components/optional_router_link/optional_router_link.vue +++ b/src/components/optional_router_link/optional_router_link.vue @@ -1,4 +1,5 @@