From 638a09a773185cd8e3ec7771e9cbe8062480c8f0 Mon Sep 17 00:00:00 2001 From: Tusooa Zhu Date: Wed, 9 Feb 2022 15:04:53 -0500 Subject: [PATCH 01/23] Add delete status confirm modal --- src/components/extra_buttons/extra_buttons.js | 34 ++++++++++++++++--- .../extra_buttons/extra_buttons.vue | 10 ++++++ src/modules/config.js | 6 ++++ src/modules/instance.js | 6 ++++ 4 files changed, 51 insertions(+), 5 deletions(-) diff --git a/src/components/extra_buttons/extra_buttons.js b/src/components/extra_buttons/extra_buttons.js index dd45b6b9..34f4ccd8 100644 --- a/src/components/extra_buttons/extra_buttons.js +++ b/src/components/extra_buttons/extra_buttons.js @@ -1,4 +1,5 @@ import Popover from '../popover/popover.vue' +import ConfirmModal from '../confirm_modal/confirm_modal.vue' import { library } from '@fortawesome/fontawesome-svg-core' import { faEllipsisH, @@ -25,15 +26,35 @@ library.add( ) const ExtraButtons = { - props: [ 'status' ], - components: { Popover }, + props: ['status'], + components: { + Popover, + ConfirmModal + }, + data () { + return { + expanded: false, + showingDeleteDialog: false + } + }, methods: { deleteStatus () { - const confirmed = window.confirm(this.$t('status.delete_confirm')) - if (confirmed) { - this.$store.dispatch('deleteStatus', { id: this.status.id }) + if (this.shouldConfirmDelete) { + this.showDeleteStatusConfirmDialog() + } else { + this.doDeleteStatus() } }, + doDeleteStatus () { + this.$store.dispatch('deleteStatus', { id: this.status.id }) + hideDeleteStatusConfirmDialog() + }, + showDeleteStatusConfirmDialog () { + this.showingDeleteDialog = true + }, + hideDeleteStatusConfirmDialog () { + this.showingDeleteDialog = false + }, pinStatus () { this.$store.dispatch('pinStatus', this.status.id) .then(() => this.$emit('onSuccess')) @@ -91,6 +112,9 @@ const ExtraButtons = { }, statusLink () { return `${this.$store.state.instance.server}${this.$router.resolve({ name: 'conversation', params: { id: this.status.id } }).href}` + }, + shouldConfirmDelete () { + return this.$store.getters.mergedConfig.modalOnDelete } } } diff --git a/src/components/extra_buttons/extra_buttons.vue b/src/components/extra_buttons/extra_buttons.vue index a3c3c767..4eb566a3 100644 --- a/src/components/extra_buttons/extra_buttons.vue +++ b/src/components/extra_buttons/extra_buttons.vue @@ -125,6 +125,16 @@ icon="ellipsis-h" /> + + {{ $t('status.delete_confirm') }} + diff --git a/src/modules/config.js b/src/modules/config.js index 5b60520b..5f4e9533 100644 --- a/src/modules/config.js +++ b/src/modules/config.js @@ -81,6 +81,12 @@ export const defaultState = { minimalScopesMode: undefined, // instance default // This hides statuses filtered via a word filter hideFilteredStatuses: undefined, // instance default + modalOnRepeat: undefined, // instance default + modalOnUnfollow: undefined, // instance default + modalOnBlock: undefined, // instance default + modalOnMute: undefined, // instance default + modalOnDelete: undefined, // instance default + modalOnLogout: undefined, // instance default playVideosInModal: false, useOneClickNsfw: false, useContainFit: true, diff --git a/src/modules/instance.js b/src/modules/instance.js index faa8692a..504fc68a 100644 --- a/src/modules/instance.js +++ b/src/modules/instance.js @@ -38,6 +38,12 @@ const defaultState = { hideSiteName: false, hideUserStats: false, muteBotStatuses: false, + modalOnRepeat: false, + modalOnUnfollow: false, + modalOnBlock: true, + modalOnMute: false, + modalOnDelete: true, + modalOnLogout: true, loginMethod: 'password', logo: '/static/logo.svg', logoMargin: '.2em', -- 2.34.1 From 6c584901475142fff99d9079f508448f0f79832b Mon Sep 17 00:00:00 2001 From: Tusooa Zhu Date: Wed, 9 Feb 2022 15:17:06 -0500 Subject: [PATCH 02/23] Add setting entries for whether to show confirmation dialogs --- .../settings_modal/tabs/general_tab.vue | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) diff --git a/src/components/settings_modal/tabs/general_tab.vue b/src/components/settings_modal/tabs/general_tab.vue index 4f5a5bc7..4b35a06e 100644 --- a/src/components/settings_modal/tabs/general_tab.vue +++ b/src/components/settings_modal/tabs/general_tab.vue @@ -172,6 +172,88 @@ {{ $t('settings.autohide_floating_post_button') }} +
  • + + {{ $t('settings.lists_navigation') }} + +
  • +
  • +

    {{ $t('settings.columns') }}

    +
  • +
  • + + {{ $t('settings.disable_sticky_headers') }} + +
  • +
  • + + {{ $t('settings.show_scrollbars') }} + +
  • +
  • + + {{ $t('settings.right_sidebar') }} + +
  • +
  • + + {{ $t('settings.third_column_mode') }} + +
  • +
  • + {{ $t('settings.column_sizes') }} +
    + + {{ $t('settings.column_sizes_' + column) }} + +
    +
  • +
  • + {{ $t('settings.confirm_dialogs') }} +
      +
    • + + {{ $t('settings.confirm_dialogs_repeat') }} + +
    • +
    • + + {{ $t('settings.confirm_dialogs_unfollow') }} + +
    • +
    • + + {{ $t('settings.confirm_dialogs_block') }} + +
    • +
    • + + {{ $t('settings.confirm_dialogs_mute') }} + +
    • +
    • + + {{ $t('settings.confirm_dialogs_delete') }} + +
    • +
    • + + {{ $t('settings.confirm_dialogs_logout') }} + +
    • +
    +
  • -- 2.34.1 From c63b55d0251175d9dff9dfa16536f53e0cf871bb Mon Sep 17 00:00:00 2001 From: Tusooa Zhu Date: Wed, 9 Feb 2022 15:49:39 -0500 Subject: [PATCH 03/23] Add confirmation for repeating --- .../retweet_button/retweet_button.js | 24 ++++++++++++++++++- .../retweet_button/retweet_button.vue | 10 ++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/src/components/retweet_button/retweet_button.js b/src/components/retweet_button/retweet_button.js index 4f71af0a..9dc4d091 100644 --- a/src/components/retweet_button/retweet_button.js +++ b/src/components/retweet_button/retweet_button.js @@ -1,3 +1,4 @@ +import ConfirmModal from '../confirm_modal/confirm_modal.vue' import { library } from '@fortawesome/fontawesome-svg-core' import { faRetweet } from '@fortawesome/free-solid-svg-icons' @@ -5,13 +6,24 @@ library.add(faRetweet) const RetweetButton = { props: ['status', 'loggedIn', 'visibility'], + components: { + ConfirmModal + }, data () { return { - animated: false + animated: false, + showingConfirmDialog: false } }, methods: { retweet () { + if (!this.status.repeated && this.shouldConfirmRepeat) { + this.showConfirmDialog() + } else { + this.doRetweet() + } + }, + doRetweet () { if (!this.status.repeated) { this.$store.dispatch('retweet', { id: this.status.id }) } else { @@ -21,6 +33,13 @@ const RetweetButton = { setTimeout(() => { this.animated = false }, 500) + this.hideConfirmDialog() + }, + showConfirmDialog () { + this.showingConfirmDialog = true + }, + hideConfirmDialog () { + this.showingConfirmDialog = false } }, computed: { @@ -29,6 +48,9 @@ const RetweetButton = { }, mergedConfig () { return this.$store.getters.mergedConfig + }, + shouldConfirmRepeat () { + return this.mergedConfig.modalOnRepeat } } } diff --git a/src/components/retweet_button/retweet_button.vue b/src/components/retweet_button/retweet_button.vue index e8a77e10..7a71add1 100644 --- a/src/components/retweet_button/retweet_button.vue +++ b/src/components/retweet_button/retweet_button.vue @@ -33,6 +33,16 @@ > {{ status.repeat_num }} + + {{ $t('status.repeat_confirm') }} +
    -- 2.34.1 From a2bffbf07623c0d2ff1aa77cc267804078b1fbad Mon Sep 17 00:00:00 2001 From: Tusooa Zhu Date: Wed, 9 Feb 2022 15:50:04 -0500 Subject: [PATCH 04/23] Add confirmation for following --- src/components/follow_button/follow_button.js | 25 +++++++++++- .../follow_button/follow_button.vue | 38 ++++++++++++++----- 2 files changed, 53 insertions(+), 10 deletions(-) diff --git a/src/components/follow_button/follow_button.js b/src/components/follow_button/follow_button.js index 3edbcb86..0a74a7a1 100644 --- a/src/components/follow_button/follow_button.js +++ b/src/components/follow_button/follow_button.js @@ -1,12 +1,20 @@ +import ConfirmModal from '../confirm_modal/confirm_modal.vue' import { requestFollow, requestUnfollow } from '../../services/follow_manipulate/follow_manipulate' export default { props: ['relationship', 'user', 'labelFollowing', 'buttonClass'], + components: { + ConfirmModal + }, data () { return { - inProgress: false + inProgress: false, + showingConfirmUnfollow: false, } }, computed: { + shouldConfirmUnfollow () { + return this.$store.getters.mergedConfig.modalOnUnfollow + }, isPressed () { return this.inProgress || this.relationship.following }, @@ -35,6 +43,12 @@ export default { } }, methods: { + showConfirmUnfollow () { + this.showingConfirmUnfollow = true + }, + hideConfirmUnfollow () { + this.showingConfirmUnfollow = false + }, onClick () { this.relationship.following || this.relationship.requested ? this.unfollow() : this.follow() }, @@ -45,12 +59,21 @@ export default { }) }, unfollow () { + if (this.shouldConfirmUnfollow) { + this.showConfirmUnfollow() + } else { + this.doUnfollow() + } + }, + doUnfollow () { const store = this.$store this.inProgress = true requestUnfollow(this.relationship.id, store).then(() => { this.inProgress = false store.commit('removeStatus', { timeline: 'friends', userId: this.relationship.id }) }) + + this.hideConfirmUnfollow() } } } diff --git a/src/components/follow_button/follow_button.vue b/src/components/follow_button/follow_button.vue index 965d5256..4fc2233a 100644 --- a/src/components/follow_button/follow_button.vue +++ b/src/components/follow_button/follow_button.vue @@ -1,13 +1,33 @@ -- 2.34.1 From 60078ea734ca5af255cad246ef5bb4bc255f7a9b Mon Sep 17 00:00:00 2001 From: Tusooa Zhu Date: Wed, 9 Feb 2022 15:50:25 -0500 Subject: [PATCH 05/23] Add ConfirmModal comp --- src/components/confirm_modal/confirm_modal.js | 42 +++++++++++++++++++ .../confirm_modal/confirm_modal.vue | 28 +++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 src/components/confirm_modal/confirm_modal.js create mode 100644 src/components/confirm_modal/confirm_modal.vue diff --git a/src/components/confirm_modal/confirm_modal.js b/src/components/confirm_modal/confirm_modal.js new file mode 100644 index 00000000..bb5e9d97 --- /dev/null +++ b/src/components/confirm_modal/confirm_modal.js @@ -0,0 +1,42 @@ +import DialogModal from '../dialog_modal/dialog_modal.vue' + +/** + * This component emits the following events: + * cancelled, emitted when the action should not be performed; + * accepted, emitted when the action should be performed; + * + * The caller should close this dialog after receiving any of the two events. + */ +const ConfirmModal = { + components: { + DialogModal + }, + data: { + }, + props: { + showing: { + type: Boolean + }, + title: { + type: String + }, + cancelText: { + type: String + }, + confirmText: { + type: String + } + }, + computed: { + }, + methods: { + onCancel () { + this.$emit('cancelled') + }, + onAccept () { + this.$emit('accepted') + } + } +} + +export default ConfirmModal diff --git a/src/components/confirm_modal/confirm_modal.vue b/src/components/confirm_modal/confirm_modal.vue new file mode 100644 index 00000000..250a6984 --- /dev/null +++ b/src/components/confirm_modal/confirm_modal.vue @@ -0,0 +1,28 @@ + + + -- 2.34.1 From dba8dcc41ad88fcd0ffd11ec8e662194fee50475 Mon Sep 17 00:00:00 2001 From: Tusooa Zhu Date: Wed, 9 Feb 2022 16:21:19 -0500 Subject: [PATCH 06/23] Add confirmation for muting --- src/components/user_card/user_card.js | 24 ++++++++++++++++++++++-- src/components/user_card/user_card.vue | 18 ++++++++++++++++++ 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/src/components/user_card/user_card.js b/src/components/user_card/user_card.js index ef898f96..97e619a2 100644 --- a/src/components/user_card/user_card.js +++ b/src/components/user_card/user_card.js @@ -6,6 +6,7 @@ import ModerationTools from '../moderation_tools/moderation_tools.vue' import AccountActions from '../account_actions/account_actions.vue' import Select from '../select/select.vue' import RichContent from 'src/components/rich_content/rich_content.jsx' +import ConfirmModal from '../confirm_modal/confirm_modal.vue' import generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator' import { mapGetters } from 'vuex' import { library } from '@fortawesome/fontawesome-svg-core' @@ -32,7 +33,8 @@ export default { data () { return { followRequestInProgress: false, - betterShadow: this.$store.state.interface.browserSupport.cssFilter + betterShadow: this.$store.state.interface.browserSupport.cssFilter, + showingConfirmMute: false } }, created () { @@ -113,6 +115,9 @@ export default { hideFollowersCount () { return this.isOtherUser && this.user.hide_followers_count }, + shouldConfirmMute () { + return this.mergedConfig.modalOnMute + }, ...mapGetters(['mergedConfig']) }, components: { @@ -123,14 +128,29 @@ export default { ProgressButton, FollowButton, Select, - RichContent + RichContent, + ConfirmModal }, methods: { refetchRelationship () { return this.$store.dispatch('fetchUserRelationship', this.user.id) }, + showConfirmMute () { + this.showingConfirmMute = true + }, + hideConfirmMute () { + this.showingConfirmMute = false + }, muteUser () { + if (!this.shouldConfirmMute) { + this.doMuteUser() + } else { + this.showConfirmMute() + } + }, + doMuteUser () { this.$store.dispatch('muteUser', this.user.id) + this.hideConfirmMute() }, unmuteUser () { this.$store.dispatch('unmuteUser', this.user.id) diff --git a/src/components/user_card/user_card.vue b/src/components/user_card/user_card.vue index 0f776e55..21532686 100644 --- a/src/components/user_card/user_card.vue +++ b/src/components/user_card/user_card.vue @@ -295,6 +295,24 @@ :handle-links="true" /> + + + + + -- 2.34.1 From f931dd99a8e75371650f123fa5cc8da4ba0e3121 Mon Sep 17 00:00:00 2001 From: Tusooa Zhu Date: Wed, 9 Feb 2022 16:26:30 -0500 Subject: [PATCH 07/23] Add confirmation for blocking --- .../account_actions/account_actions.js | 30 +++++++++++++++++-- .../account_actions/account_actions.vue | 18 +++++++++++ 2 files changed, 46 insertions(+), 2 deletions(-) diff --git a/src/components/account_actions/account_actions.js b/src/components/account_actions/account_actions.js index 8fe0fe5e..2a40c81c 100644 --- a/src/components/account_actions/account_actions.js +++ b/src/components/account_actions/account_actions.js @@ -1,5 +1,6 @@ import ProgressButton from '../progress_button/progress_button.vue' import Popover from '../popover/popover.vue' +import ConfirmModal from '../confirm_modal/confirm_modal.vue' import { library } from '@fortawesome/fontawesome-svg-core' import { faEllipsisV @@ -14,13 +15,22 @@ const AccountActions = { 'user', 'relationship' ], data () { - return { } + return { + showingConfirmBlock: false + } }, components: { ProgressButton, - Popover + Popover, + ConfirmModal }, methods: { + showConfirmBlock () { + this.showingConfirmBlock = true + }, + hideConfirmBlock () { + this.showingConfirmBlock = false + }, showRepeats () { this.$store.dispatch('showReblogs', this.user.id) }, @@ -28,7 +38,15 @@ const AccountActions = { this.$store.dispatch('hideReblogs', this.user.id) }, blockUser () { + if (!this.shouldConfirmBlock) { + this.doBlockUser() + } else { + this.showConfirmBlock() + } + }, + doBlockUser () { this.$store.dispatch('blockUser', this.user.id) + this.hideConfirmBlock() }, unblockUser () { this.$store.dispatch('unblockUser', this.user.id) @@ -36,6 +54,14 @@ const AccountActions = { reportUser () { this.$store.dispatch('openUserReportingModal', { userId: this.user.id }) } + }, + computed: { + shouldConfirmBlock () { + return this.$store.getters.mergedConfig.modalOnBlock + }, + ...mapState({ + pleromaChatMessagesAvailable: state => state.instance.pleromaChatMessagesAvailable + }) } } diff --git a/src/components/account_actions/account_actions.vue b/src/components/account_actions/account_actions.vue index afd8bb1b..63d586f3 100644 --- a/src/components/account_actions/account_actions.vue +++ b/src/components/account_actions/account_actions.vue @@ -59,6 +59,24 @@ + + + + + -- 2.34.1 From 58155abeb1e60a0b1585bf6dfdcd873c04b5b787 Mon Sep 17 00:00:00 2001 From: Tusooa Zhu Date: Wed, 9 Feb 2022 16:51:13 -0500 Subject: [PATCH 08/23] Add confirmation for logout --- .../confirm_modal/confirm_modal.vue | 1 + src/components/desktop_nav/desktop_nav.js | 12 ++++++--- src/components/desktop_nav/desktop_nav.vue | 10 +++++++ src/components/mobile_nav/mobile_nav.js | 27 ++++++++++++++++--- src/components/mobile_nav/mobile_nav.vue | 18 +++++++++++++ 5 files changed, 62 insertions(+), 6 deletions(-) diff --git a/src/components/confirm_modal/confirm_modal.vue b/src/components/confirm_modal/confirm_modal.vue index 250a6984..fa354285 100644 --- a/src/components/confirm_modal/confirm_modal.vue +++ b/src/components/confirm_modal/confirm_modal.vue @@ -1,6 +1,7 @@ @@ -206,6 +216,14 @@ } } } + .confirm-modal.dark-overlay { + &::before { + z-index: 3000; + } + .dialog-modal.panel { + z-index: 3001; + } + } } -- 2.34.1 From 8be3c46bccf3df19ec31ad35c34cd3a83f0bef34 Mon Sep 17 00:00:00 2001 From: Tusooa Zhu Date: Wed, 9 Feb 2022 17:03:17 -0500 Subject: [PATCH 09/23] Lint --- src/components/confirm_modal/confirm_modal.vue | 14 +++++++------- src/components/follow_button/follow_button.js | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/components/confirm_modal/confirm_modal.vue b/src/components/confirm_modal/confirm_modal.vue index fa354285..59e46dc1 100644 --- a/src/components/confirm_modal/confirm_modal.vue +++ b/src/components/confirm_modal/confirm_modal.vue @@ -2,26 +2,26 @@ - + diff --git a/src/components/follow_button/follow_button.js b/src/components/follow_button/follow_button.js index 0a74a7a1..443aa9bc 100644 --- a/src/components/follow_button/follow_button.js +++ b/src/components/follow_button/follow_button.js @@ -8,7 +8,7 @@ export default { data () { return { inProgress: false, - showingConfirmUnfollow: false, + showingConfirmUnfollow: false } }, computed: { -- 2.34.1 From c77e3c31ed8e03576c1035ed9580bc3b3f169f75 Mon Sep 17 00:00:00 2001 From: Tusooa Zhu Date: Fri, 11 Feb 2022 10:18:20 -0500 Subject: [PATCH 10/23] Fix logout confirm dialog title --- src/components/desktop_nav/desktop_nav.vue | 2 +- src/components/mobile_nav/mobile_nav.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/desktop_nav/desktop_nav.vue b/src/components/desktop_nav/desktop_nav.vue index cdf33fac..0f8c7824 100644 --- a/src/components/desktop_nav/desktop_nav.vue +++ b/src/components/desktop_nav/desktop_nav.vue @@ -169,7 +169,7 @@ Date: Thu, 17 Mar 2022 00:06:26 -0400 Subject: [PATCH 11/23] Use portal for modals --- .../account_actions/account_actions.vue | 36 ++++++------ src/components/confirm_modal/confirm_modal.js | 5 -- .../confirm_modal/confirm_modal.vue | 1 - src/components/desktop_nav/desktop_nav.vue | 22 ++++---- .../extra_buttons/extra_buttons.vue | 24 ++++---- .../follow_button/follow_button.vue | 56 +++++++++---------- src/components/mobile_nav/mobile_nav.vue | 22 ++++---- .../retweet_button/retweet_button.vue | 22 ++++---- src/components/user_card/user_card.vue | 36 ++++++------ 9 files changed, 115 insertions(+), 109 deletions(-) diff --git a/src/components/account_actions/account_actions.vue b/src/components/account_actions/account_actions.vue index 63d586f3..a7692635 100644 --- a/src/components/account_actions/account_actions.vue +++ b/src/components/account_actions/account_actions.vue @@ -59,24 +59,26 @@ - - + - - - + + + + + diff --git a/src/components/confirm_modal/confirm_modal.js b/src/components/confirm_modal/confirm_modal.js index bb5e9d97..96ddc118 100644 --- a/src/components/confirm_modal/confirm_modal.js +++ b/src/components/confirm_modal/confirm_modal.js @@ -11,12 +11,7 @@ const ConfirmModal = { components: { DialogModal }, - data: { - }, props: { - showing: { - type: Boolean - }, title: { type: String }, diff --git a/src/components/confirm_modal/confirm_modal.vue b/src/components/confirm_modal/confirm_modal.vue index 59e46dc1..5b5014c5 100644 --- a/src/components/confirm_modal/confirm_modal.vue +++ b/src/components/confirm_modal/confirm_modal.vue @@ -1,6 +1,5 @@ diff --git a/src/components/extra_buttons/extra_buttons.vue b/src/components/extra_buttons/extra_buttons.vue index 4eb566a3..df28ae57 100644 --- a/src/components/extra_buttons/extra_buttons.vue +++ b/src/components/extra_buttons/extra_buttons.vue @@ -124,17 +124,19 @@ class="fa-scale-110 fa-old-padding" icon="ellipsis-h" /> - - - {{ $t('status.delete_confirm') }} - + + + + {{ $t('status.delete_confirm') }} + + diff --git a/src/components/follow_button/follow_button.vue b/src/components/follow_button/follow_button.vue index 4fc2233a..5c799406 100644 --- a/src/components/follow_button/follow_button.vue +++ b/src/components/follow_button/follow_button.vue @@ -1,33 +1,33 @@ diff --git a/src/components/mobile_nav/mobile_nav.vue b/src/components/mobile_nav/mobile_nav.vue index ecf9ee17..da1b4b12 100644 --- a/src/components/mobile_nav/mobile_nav.vue +++ b/src/components/mobile_nav/mobile_nav.vue @@ -76,16 +76,18 @@ ref="sideDrawer" :logout="logout" /> - - {{ $t('login.logout_confirm') }} - + + + {{ $t('login.logout_confirm') }} + + diff --git a/src/components/retweet_button/retweet_button.vue b/src/components/retweet_button/retweet_button.vue index 7a71add1..162dc48a 100644 --- a/src/components/retweet_button/retweet_button.vue +++ b/src/components/retweet_button/retweet_button.vue @@ -33,16 +33,18 @@ > {{ status.repeat_num }} - - {{ $t('status.repeat_confirm') }} - + + + {{ $t('status.repeat_confirm') }} + + diff --git a/src/components/user_card/user_card.vue b/src/components/user_card/user_card.vue index 21532686..ba9cf014 100644 --- a/src/components/user_card/user_card.vue +++ b/src/components/user_card/user_card.vue @@ -295,24 +295,26 @@ :handle-links="true" /> - - + - - - + + + + + -- 2.34.1 From 4984d9737965733271ba6e08264088fc640ec8de Mon Sep 17 00:00:00 2001 From: Tusooa Zhu Date: Wed, 6 Apr 2022 14:54:58 -0400 Subject: [PATCH 12/23] Use vue3 teleport instead of portal --- src/components/account_actions/account_actions.vue | 4 ++-- src/components/desktop_nav/desktop_nav.vue | 4 ++-- src/components/extra_buttons/extra_buttons.vue | 4 ++-- src/components/follow_button/follow_button.vue | 4 ++-- src/components/mobile_nav/mobile_nav.vue | 4 ++-- src/components/retweet_button/retweet_button.vue | 4 ++-- src/components/user_card/user_card.vue | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/components/account_actions/account_actions.vue b/src/components/account_actions/account_actions.vue index a7692635..94c74779 100644 --- a/src/components/account_actions/account_actions.vue +++ b/src/components/account_actions/account_actions.vue @@ -59,7 +59,7 @@ - + - + diff --git a/src/components/desktop_nav/desktop_nav.vue b/src/components/desktop_nav/desktop_nav.vue index 65a690a4..32e3c73f 100644 --- a/src/components/desktop_nav/desktop_nav.vue +++ b/src/components/desktop_nav/desktop_nav.vue @@ -167,7 +167,7 @@ - + {{ $t('login.logout_confirm') }} - + diff --git a/src/components/extra_buttons/extra_buttons.vue b/src/components/extra_buttons/extra_buttons.vue index df28ae57..8ef677bb 100644 --- a/src/components/extra_buttons/extra_buttons.vue +++ b/src/components/extra_buttons/extra_buttons.vue @@ -125,7 +125,7 @@ icon="ellipsis-h" /> - + {{ $t('status.delete_confirm') }} - + diff --git a/src/components/follow_button/follow_button.vue b/src/components/follow_button/follow_button.vue index 5c799406..b4567348 100644 --- a/src/components/follow_button/follow_button.vue +++ b/src/components/follow_button/follow_button.vue @@ -7,7 +7,7 @@ @click="onClick" > {{ label }} - + - + diff --git a/src/components/mobile_nav/mobile_nav.vue b/src/components/mobile_nav/mobile_nav.vue index da1b4b12..e6a8e694 100644 --- a/src/components/mobile_nav/mobile_nav.vue +++ b/src/components/mobile_nav/mobile_nav.vue @@ -76,7 +76,7 @@ ref="sideDrawer" :logout="logout" /> - + {{ $t('login.logout_confirm') }} - + diff --git a/src/components/retweet_button/retweet_button.vue b/src/components/retweet_button/retweet_button.vue index 162dc48a..6bb7a283 100644 --- a/src/components/retweet_button/retweet_button.vue +++ b/src/components/retweet_button/retweet_button.vue @@ -33,7 +33,7 @@ > {{ status.repeat_num }} - + {{ $t('status.repeat_confirm') }} - + diff --git a/src/components/user_card/user_card.vue b/src/components/user_card/user_card.vue index ba9cf014..477ed86d 100644 --- a/src/components/user_card/user_card.vue +++ b/src/components/user_card/user_card.vue @@ -295,7 +295,7 @@ :handle-links="true" /> - + - + -- 2.34.1 From fc2d0ea23d3f1fa63f865555e46063198af688a9 Mon Sep 17 00:00:00 2001 From: Tusooa Zhu Date: Wed, 6 Apr 2022 15:02:21 -0400 Subject: [PATCH 13/23] Move modal out of vue tree --- index.html | 1 + src/App.vue | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 40db0bbe..f7e2de46 100644 --- a/index.html +++ b/index.html @@ -15,6 +15,7 @@
    + + + + {{ $t('user_card.approve_confirm', { user: user.screen_name_ui }) }} + + + {{ $t('user_card.deny_confirm', { user: user.screen_name_ui }) }} + + diff --git a/src/components/settings_modal/tabs/general_tab.vue b/src/components/settings_modal/tabs/general_tab.vue index 4b35a06e..3d58f2bf 100644 --- a/src/components/settings_modal/tabs/general_tab.vue +++ b/src/components/settings_modal/tabs/general_tab.vue @@ -252,6 +252,16 @@ {{ $t('settings.confirm_dialogs_logout') }} +
  • + + {{ $t('settings.confirm_dialogs_approve_follow') }} + +
  • +
  • + + {{ $t('settings.confirm_dialogs_deny_follow') }} + +
  • diff --git a/src/modules/config.js b/src/modules/config.js index 5f4e9533..f97e5a8f 100644 --- a/src/modules/config.js +++ b/src/modules/config.js @@ -87,6 +87,8 @@ export const defaultState = { modalOnMute: undefined, // instance default modalOnDelete: undefined, // instance default modalOnLogout: undefined, // instance default + modalOnApproveFollow: undefined, // instance default + modalOnDenyFollow: undefined, // instance default playVideosInModal: false, useOneClickNsfw: false, useContainFit: true, diff --git a/src/modules/instance.js b/src/modules/instance.js index 504fc68a..f9118e16 100644 --- a/src/modules/instance.js +++ b/src/modules/instance.js @@ -44,6 +44,8 @@ const defaultState = { modalOnMute: false, modalOnDelete: true, modalOnLogout: true, + modalOnApproveFollow: false, + modalOnDenyFollow: false, loginMethod: 'password', logo: '/static/logo.svg', logoMargin: '.2em', -- 2.34.1 From d84212baa89763fb6ef19e43a9c10aea3f62ced2 Mon Sep 17 00:00:00 2001 From: Tusooa Zhu Date: Fri, 10 Jun 2022 15:55:31 -0400 Subject: [PATCH 19/23] Auto close confirm dialog after approve/deny --- src/components/notification/notification.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/notification/notification.js b/src/components/notification/notification.js index f26f6686..0507459c 100644 --- a/src/components/notification/notification.js +++ b/src/components/notification/notification.js @@ -97,6 +97,7 @@ const Notification = { notification.type = 'follow' } }) + this.hideApproveConfirmDialog() }, denyUser () { if (this.shouldConfirmDeny) { @@ -111,6 +112,7 @@ const Notification = { this.$store.dispatch('dismissNotificationLocal', { id: this.notification.id }) this.$store.dispatch('removeFollowRequest', this.user) }) + this.hideDenyConfirmDialog() } }, computed: { -- 2.34.1 From 258ad13ec1a02e101754f1c8679e3fcd277eb629 Mon Sep 17 00:00:00 2001 From: Tusooa Zhu Date: Mon, 1 Aug 2022 11:02:21 -0400 Subject: [PATCH 20/23] Fix confirm modal lint --- src/components/confirm_modal/confirm_modal.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/confirm_modal/confirm_modal.vue b/src/components/confirm_modal/confirm_modal.vue index 1ac64b62..3b98174a 100644 --- a/src/components/confirm_modal/confirm_modal.vue +++ b/src/components/confirm_modal/confirm_modal.vue @@ -4,13 +4,13 @@ class="confirm-modal" :on-cancel="onCancel" > -