From 79d02bddbe2b77574844b8ade7a09043c31b1c6b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?marcin=20miko=C5=82ajczak?=
Date: Sun, 13 Feb 2022 19:07:49 +0100
Subject: [PATCH 01/52] Birthdays
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: marcin mikołajczak
---
src/components/settings_modal/tabs/profile_tab.js | 6 +++++-
.../settings_modal/tabs/profile_tab.scss | 5 +++++
src/components/settings_modal/tabs/profile_tab.vue | 12 ++++++++++++
src/components/user_profile/user_profile.js | 11 +++++++++--
src/components/user_profile/user_profile.vue | 14 ++++++++++++++
src/i18n/en.json | 5 +++++
src/i18n/pl.json | 9 +++++++--
.../entity_normalizer/entity_normalizer.service.js | 3 +++
8 files changed, 60 insertions(+), 5 deletions(-)
diff --git a/src/components/settings_modal/tabs/profile_tab.js b/src/components/settings_modal/tabs/profile_tab.js
index 64079fcdd6..0ae95dbddb 100644
--- a/src/components/settings_modal/tabs/profile_tab.js
+++ b/src/components/settings_modal/tabs/profile_tab.js
@@ -29,6 +29,8 @@ const ProfileTab = {
newLocked: this.$store.state.users.currentUser.locked,
newNoRichText: this.$store.state.users.currentUser.no_rich_text,
newDefaultScope: this.$store.state.users.currentUser.default_scope,
+ newBirthday: this.$store.state.users.currentUser.birthday,
+ showBirthday: this.$store.state.users.currentUser.show_birthday,
newFields: this.$store.state.users.currentUser.fields.map(field => ({ name: field.name, value: field.value })),
hideFollows: this.$store.state.users.currentUser.hide_follows,
hideFollowers: this.$store.state.users.currentUser.hide_followers,
@@ -132,7 +134,9 @@ const ProfileTab = {
allow_following_move: this.allowFollowingMove,
hide_follows_count: this.hideFollowsCount,
hide_followers_count: this.hideFollowersCount,
- show_role: this.showRole
+ show_role: this.showRole,
+ birthday: this.newBirthday || null,
+ show_birthday: this.showBirthday
/* eslint-enable camelcase */
} }).then((user) => {
this.newFields.splice(user.fields.length)
diff --git a/src/components/settings_modal/tabs/profile_tab.scss b/src/components/settings_modal/tabs/profile_tab.scss
index 111eaed38e..242875112f 100644
--- a/src/components/settings_modal/tabs/profile_tab.scss
+++ b/src/components/settings_modal/tabs/profile_tab.scss
@@ -124,4 +124,9 @@
padding: 0 0.5em;
}
}
+
+ .birthday-input {
+ display: block;
+ margin-bottom: 1em;
+ }
}
diff --git a/src/components/settings_modal/tabs/profile_tab.vue b/src/components/settings_modal/tabs/profile_tab.vue
index bb3c301d5c..9b92056dfc 100644
--- a/src/components/settings_modal/tabs/profile_tab.vue
+++ b/src/components/settings_modal/tabs/profile_tab.vue
@@ -95,6 +95,18 @@
{{ $t('settings.discoverable') }}
+
+
{{ $t('settings.birthday.label') }}
+
+
+ {{ $t('settings.birthday.show_birthday') }}
+
+
{{ $t('settings.profile_fields.label') }}
+
+
+ {{ $t('user_card.birthday', { birthday: formattedBirthday }) }}
+
{
} else {
output.role = 'member'
}
+
+ output.birthday = data.pleroma.birthday
}
if (data.source) {
@@ -128,6 +130,7 @@ export const parseUser = (data) => {
output.no_rich_text = data.source.pleroma.no_rich_text
output.show_role = data.source.pleroma.show_role
output.discoverable = data.source.pleroma.discoverable
+ output.show_birthday = data.pleroma.show_birthday
}
}
From b7e93739656d225ed0a8854f357746b5291b6857 Mon Sep 17 00:00:00 2001
From: Tusooa Zhu
Date: Mon, 25 Jul 2022 15:38:05 -0400
Subject: [PATCH 02/52] Add support for multiple interface languages
---
.../interface_language_switcher.vue | 75 +++++++++++++++----
.../settings_modal/tabs/profile_tab.js | 4 +-
src/i18n/messages.js | 26 ++++++-
src/modules/config.js | 5 +-
src/services/locale/locale.service.js | 5 ++
5 files changed, 92 insertions(+), 23 deletions(-)
diff --git a/src/components/interface_language_switcher/interface_language_switcher.vue b/src/components/interface_language_switcher/interface_language_switcher.vue
index 6997f149b3..e18a2a1202 100644
--- a/src/components/interface_language_switcher/interface_language_switcher.vue
+++ b/src/components/interface_language_switcher/interface_language_switcher.vue
@@ -1,21 +1,39 @@
-
-
+ >
+ {{ $t('settings.remove_language') }}
+
-
+
diff --git a/src/i18n/en.json b/src/i18n/en.json
index 9abfae67e8..7df42d92cc 100644
--- a/src/i18n/en.json
+++ b/src/i18n/en.json
@@ -334,8 +334,10 @@
"select_all": "Select all"
},
"settings": {
- "add_language": "Add another language",
+ "add_language": "Add fallback language",
"remove_language": "Remove",
+ "primary_language": "Primary language:",
+ "fallback_language": "Fallback language {index}:",
"app_name": "App name",
"expert_mode": "Show advanced",
"save": "Save changes",
diff --git a/src/modules/instance.js b/src/modules/instance.js
index 3b15e62e36..bff261519c 100644
--- a/src/modules/instance.js
+++ b/src/modules/instance.js
@@ -273,8 +273,13 @@ const instance = {
langList
.map(async lang => {
if (!state.unicodeEmojiAnnotations[lang]) {
- const annotations = await loadAnnotations(lang)
- commit('setUnicodeEmojiAnnotations', { lang, annotations })
+ try {
+ const annotations = await loadAnnotations(lang)
+ commit('setUnicodeEmojiAnnotations', { lang, annotations })
+ } catch (e) {
+ console.warn(`Error loading unicode emoji annotations for ${lang}: `, e)
+ // ignore
+ }
}
}))
},
From 3ad5df805e22ddd473fdaa9a92df335a61fad7fc Mon Sep 17 00:00:00 2001
From: Tusooa Zhu
Date: Wed, 9 Feb 2022 15:04:53 -0500
Subject: [PATCH 05/52] Add delete status confirm modal
---
src/components/extra_buttons/extra_buttons.js | 31 +++++++++++++++----
.../extra_buttons/extra_buttons.vue | 10 ++++++
src/modules/config.js | 6 ++++
src/modules/instance.js | 6 ++++
4 files changed, 47 insertions(+), 6 deletions(-)
diff --git a/src/components/extra_buttons/extra_buttons.js b/src/components/extra_buttons/extra_buttons.js
index 3dc968c981..b1458d308e 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,
@@ -32,10 +33,14 @@ library.add(
const ExtraButtons = {
props: ['status'],
- components: { Popover },
+ components: {
+ Popover,
+ ConfirmModal
+ },
data () {
return {
- expanded: false
+ expanded: false,
+ showingDeleteDialog: false
}
},
methods: {
@@ -46,11 +51,22 @@ const ExtraButtons = {
this.expanded = false
},
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'))
@@ -133,7 +149,10 @@ const ExtraButtons = {
isEdited () {
return this.status.edited_at !== null
},
- editingAvailable () { return this.$store.state.instance.editingAvailable }
+ editingAvailable () { return this.$store.state.instance.editingAvailable },
+ 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 a84d47f60d..293f6d68ba 100644
--- a/src/components/extra_buttons/extra_buttons.vue
+++ b/src/components/extra_buttons/extra_buttons.vue
@@ -165,6 +165,16 @@
/>
+
+ {{ $t('status.delete_confirm') }}
+
diff --git a/src/modules/config.js b/src/modules/config.js
index 3cd6888f07..a894903053 100644
--- a/src/modules/config.js
+++ b/src/modules/config.js
@@ -78,6 +78,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 8e8d13d3cc..6fc3830c8e 100644
--- a/src/modules/instance.js
+++ b/src/modules/instance.js
@@ -71,6 +71,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',
From 1e352fbfacddc205397153bf5087484d550129e6 Mon Sep 17 00:00:00 2001
From: Tusooa Zhu
Date: Wed, 9 Feb 2022 15:05:21 -0500
Subject: [PATCH 06/52] Add English translations for delete status confirm
modal
---
src/components/extra_buttons/extra_buttons.js | 2 +-
src/i18n/en.json | 3 +++
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/components/extra_buttons/extra_buttons.js b/src/components/extra_buttons/extra_buttons.js
index b1458d308e..48b960b2b7 100644
--- a/src/components/extra_buttons/extra_buttons.js
+++ b/src/components/extra_buttons/extra_buttons.js
@@ -59,7 +59,7 @@ const ExtraButtons = {
},
doDeleteStatus () {
this.$store.dispatch('deleteStatus', { id: this.status.id })
- hideDeleteStatusConfirmDialog()
+ this.hideDeleteStatusConfirmDialog()
},
showDeleteStatusConfirmDialog () {
this.showingDeleteDialog = true
diff --git a/src/i18n/en.json b/src/i18n/en.json
index 1ee1147ad3..b2bec6920e 100644
--- a/src/i18n/en.json
+++ b/src/i18n/en.json
@@ -852,6 +852,9 @@
"bookmark": "Bookmark",
"unbookmark": "Unbookmark",
"delete_confirm": "Do you really want to delete this status?",
+ "delete_confirm_title": "Delete confirmation",
+ "delete_confirm_accept_button": "Delete",
+ "delete_confirm_cancel_button": "Keep",
"reply_to": "Reply to",
"mentions": "Mentions",
"replies_list": "Replies:",
From 1ff2948aeb485ef48a4add6310ba8fb9d43d262c Mon Sep 17 00:00:00 2001
From: Tusooa Zhu
Date: Wed, 9 Feb 2022 15:17:06 -0500
Subject: [PATCH 07/52] Add setting entries for whether to show confirmation
dialogs
---
.../settings_modal/tabs/general_tab.vue | 35 +++++++++++++++++++
1 file changed, 35 insertions(+)
diff --git a/src/components/settings_modal/tabs/general_tab.vue b/src/components/settings_modal/tabs/general_tab.vue
index 582cb2884f..906c37584e 100644
--- a/src/components/settings_modal/tabs/general_tab.vue
+++ b/src/components/settings_modal/tabs/general_tab.vue
@@ -148,6 +148,41 @@
+
+ {{ $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') }}
+
+
+
+
From f8b522e36dd08a08cd7071c30b5e4e61832275aa Mon Sep 17 00:00:00 2001
From: Tusooa Zhu
Date: Wed, 9 Feb 2022 15:17:49 -0500
Subject: [PATCH 08/52] Add English translations for setting entries
---
src/i18n/en.json | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/i18n/en.json b/src/i18n/en.json
index b2bec6920e..ed21e2a5d9 100644
--- a/src/i18n/en.json
+++ b/src/i18n/en.json
@@ -416,6 +416,13 @@
"composing": "Composing",
"confirm_new_password": "Confirm new password",
"current_password": "Current password",
+ "confirm_dialogs": "Ask for confirmation when",
+ "confirm_dialogs_repeat": "repeating a status",
+ "confirm_dialogs_unfollow": "unfollowing a user",
+ "confirm_dialogs_block": "blocking a user",
+ "confirm_dialogs_mute": "muting a user",
+ "confirm_dialogs_delete": "deleting a status",
+ "confirm_dialogs_logout": "logging out",
"mutes_and_blocks": "Mutes and Blocks",
"data_import_export_tab": "Data import / export",
"default_vis": "Default visibility scope",
From 4d175235f1bc72c369c5e5fc8ed1997b384c0b83 Mon Sep 17 00:00:00 2001
From: Tusooa Zhu
Date: Wed, 9 Feb 2022 15:49:39 -0500
Subject: [PATCH 09/52] 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 4d92b5fa75..198b6c14b9 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,
@@ -15,13 +16,24 @@ library.add(
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 {
@@ -31,6 +43,13 @@ const RetweetButton = {
setTimeout(() => {
this.animated = false
}, 500)
+ this.hideConfirmDialog()
+ },
+ showConfirmDialog () {
+ this.showingConfirmDialog = true
+ },
+ hideConfirmDialog () {
+ this.showingConfirmDialog = false
}
},
computed: {
@@ -39,6 +58,9 @@ const RetweetButton = {
},
remoteInteractionLink () {
return this.$store.getters.remoteInteractionLink({ statusId: this.status.id })
+ },
+ shouldConfirmRepeat () {
+ return this.mergedConfig.modalOnRepeat
}
}
}
diff --git a/src/components/retweet_button/retweet_button.vue b/src/components/retweet_button/retweet_button.vue
index 7700ee0d56..38d4dc3fef 100644
--- a/src/components/retweet_button/retweet_button.vue
+++ b/src/components/retweet_button/retweet_button.vue
@@ -59,6 +59,16 @@
>
{{ status.repeat_num }}
+
+ {{ $t('status.repeat_confirm') }}
+
From a0b886459bf5e146b8b7654d97ba8838bfac29de Mon Sep 17 00:00:00 2001
From: Tusooa Zhu
Date: Wed, 9 Feb 2022 15:50:04 -0500
Subject: [PATCH 10/52] 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 3edbcb86fb..0a74a7a105 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 965d5256a6..4fc2233a6b 100644
--- a/src/components/follow_button/follow_button.vue
+++ b/src/components/follow_button/follow_button.vue
@@ -1,13 +1,33 @@
-
+
+
+
+
+
+
+
+
From 0684f19d1b903a7d941aa7cfa366044b98d97659 Mon Sep 17 00:00:00 2001
From: Tusooa Zhu
Date: Wed, 9 Feb 2022 15:50:25 -0500
Subject: [PATCH 11/52] 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 0000000000..bb5e9d979d
--- /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 0000000000..250a6984bb
--- /dev/null
+++ b/src/components/confirm_modal/confirm_modal.vue
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From a0c6d642af277954585b32724de4f2b157b02e42 Mon Sep 17 00:00:00 2001
From: Tusooa Zhu
Date: Wed, 9 Feb 2022 16:08:47 -0500
Subject: [PATCH 12/52] Add English translations for repeat and unfollow
confirmation
---
src/i18n/en.json | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/i18n/en.json b/src/i18n/en.json
index ed21e2a5d9..7e23a849d5 100644
--- a/src/i18n/en.json
+++ b/src/i18n/en.json
@@ -850,6 +850,10 @@
"status": {
"favorites": "Favorites",
"repeats": "Repeats",
+ "repeat_confirm": "Do you really want to repeat this status?",
+ "repeat_confirm_title": "Repeat confirmation",
+ "repeat_confirm_accept_button": "Repeat",
+ "repeat_confirm_cancel_button": "Do not repeat",
"delete": "Delete status",
"edit": "Edit status",
"edited_at": "(last edited {time})",
@@ -919,6 +923,10 @@
"follow_sent": "Request sent!",
"follow_progress": "Requesting…",
"follow_unfollow": "Unfollow",
+ "unfollow_confirm_title": "Unfollow confirmation",
+ "unfollow_confirm": "Do you really want to unfollow {user}?",
+ "unfollow_confirm_accept_button": "Unfollow",
+ "unfollow_confirm_cancel_button": "Do not unfollow",
"followees": "Following",
"followers": "Followers",
"following": "Following!",
From e7e35ead09589e1673dd6b6fdd24f7679ef108bf Mon Sep 17 00:00:00 2001
From: Tusooa Zhu
Date: Wed, 9 Feb 2022 16:21:19 -0500
Subject: [PATCH 13/52] 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 6787930724..1bcc434100 100644
--- a/src/components/user_card/user_card.js
+++ b/src/components/user_card/user_card.js
@@ -8,6 +8,7 @@ import UserNote from '../user_note/user_note.vue'
import Select from '../select/select.vue'
import UserLink from '../user_link/user_link.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'
@@ -46,7 +47,8 @@ export default {
data () {
return {
followRequestInProgress: false,
- betterShadow: this.$store.state.interface.browserSupport.cssFilter
+ betterShadow: this.$store.state.interface.browserSupport.cssFilter,
+ showingConfirmMute: false
}
},
created () {
@@ -137,6 +139,9 @@ export default {
supportsNote () {
return 'note' in this.relationship
},
+ shouldConfirmMute () {
+ return this.mergedConfig.modalOnMute
+ },
...mapGetters(['mergedConfig'])
},
components: {
@@ -149,11 +154,26 @@ export default {
Select,
RichContent,
UserLink,
- UserNote
+ UserNote,
+ ConfirmModal
},
methods: {
+ 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 349c7cb160..fac900a983 100644
--- a/src/components/user_card/user_card.vue
+++ b/src/components/user_card/user_card.vue
@@ -314,6 +314,24 @@
:handle-links="true"
/>
+
+
+
+
+
From c032b48219ba601df5dabc7fd271444fe7db0321 Mon Sep 17 00:00:00 2001
From: Tusooa Zhu
Date: Wed, 9 Feb 2022 16:21:30 -0500
Subject: [PATCH 14/52] Add English translation for mute confirmation
---
src/i18n/en.json | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/i18n/en.json b/src/i18n/en.json
index 7e23a849d5..fa359f88c1 100644
--- a/src/i18n/en.json
+++ b/src/i18n/en.json
@@ -938,6 +938,10 @@
"message": "Message",
"mute": "Mute",
"muted": "Muted",
+ "mute_confirm_title": "Mute confirmation",
+ "mute_confirm": "Do you really want to mute {user}?",
+ "mute_confirm_accept_button": "Mute",
+ "mute_confirm_cancel_button": "Do not mute",
"per_day": "per day",
"remote_follow": "Remote follow",
"remove_follower": "Remove follower",
From 3b7aaae2b366abe1162c22a29918336c4210446f Mon Sep 17 00:00:00 2001
From: Tusooa Zhu
Date: Wed, 9 Feb 2022 16:26:30 -0500
Subject: [PATCH 15/52] Add confirmation for blocking
---
.../account_actions/account_actions.js | 25 +++++++++++++++++--
.../account_actions/account_actions.vue | 18 +++++++++++++
2 files changed, 41 insertions(+), 2 deletions(-)
diff --git a/src/components/account_actions/account_actions.js b/src/components/account_actions/account_actions.js
index c23407f90e..7dec0c3d7c 100644
--- a/src/components/account_actions/account_actions.js
+++ b/src/components/account_actions/account_actions.js
@@ -2,6 +2,7 @@ import { mapState } from 'vuex'
import ProgressButton from '../progress_button/progress_button.vue'
import Popover from '../popover/popover.vue'
import UserListMenu from 'src/components/user_list_menu/user_list_menu.vue'
+import ConfirmModal from '../confirm_modal/confirm_modal.vue'
import { library } from '@fortawesome/fontawesome-svg-core'
import {
faEllipsisV
@@ -16,14 +17,23 @@ const AccountActions = {
'user', 'relationship'
],
data () {
- return { }
+ return {
+ showingConfirmBlock: false
+ }
},
components: {
ProgressButton,
Popover,
- UserListMenu
+ UserListMenu,
+ ConfirmModal
},
methods: {
+ showConfirmBlock () {
+ this.showingConfirmBlock = true
+ },
+ hideConfirmBlock () {
+ this.showingConfirmBlock = false
+ },
showRepeats () {
this.$store.dispatch('showReblogs', this.user.id)
},
@@ -31,7 +41,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)
@@ -50,6 +68,9 @@ const AccountActions = {
}
},
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 973a5935c6..dfe1f706f2 100644
--- a/src/components/account_actions/account_actions.vue
+++ b/src/components/account_actions/account_actions.vue
@@ -74,6 +74,24 @@
+
+
+
+
+
From 0bfe100ef77ca36e2789310b204987ea54ec2696 Mon Sep 17 00:00:00 2001
From: Tusooa Zhu
Date: Wed, 9 Feb 2022 16:26:42 -0500
Subject: [PATCH 16/52] Add English translation for block confirmation
---
src/i18n/en.json | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/i18n/en.json b/src/i18n/en.json
index fa359f88c1..1dec4b9054 100644
--- a/src/i18n/en.json
+++ b/src/i18n/en.json
@@ -914,6 +914,10 @@
"approve": "Approve",
"block": "Block",
"blocked": "Blocked!",
+ "block_confirm_title": "Block confirmation",
+ "block_confirm": "Do you really want to block {user}?",
+ "block_confirm_accept_button": "Block",
+ "block_confirm_cancel_button": "Do not block",
"deactivated": "Deactivated",
"deny": "Deny",
"edit_profile": "Edit profile",
From c202c89ca0f8c9bc1957bff3bbe3ea39e21ddbba Mon Sep 17 00:00:00 2001
From: Tusooa Zhu
Date: Wed, 9 Feb 2022 16:51:13 -0500
Subject: [PATCH 17/52] Add confirmation for logout
---
.../confirm_modal/confirm_modal.vue | 1 +
src/components/desktop_nav/desktop_nav.js | 26 +++++++++++++++---
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, 76 insertions(+), 6 deletions(-)
diff --git a/src/components/confirm_modal/confirm_modal.vue b/src/components/confirm_modal/confirm_modal.vue
index 250a6984bb..fa354285df 100644
--- a/src/components/confirm_modal/confirm_modal.vue
+++ b/src/components/confirm_modal/confirm_modal.vue
@@ -1,6 +1,7 @@
diff --git a/src/components/desktop_nav/desktop_nav.js b/src/components/desktop_nav/desktop_nav.js
index 08c0e44e25..745b1a8158 100644
--- a/src/components/desktop_nav/desktop_nav.js
+++ b/src/components/desktop_nav/desktop_nav.js
@@ -1,4 +1,5 @@
import SearchBar from 'components/search_bar/search_bar.vue'
+import ConfirmModal from '../confirm_modal/confirm_modal.vue'
import { library } from '@fortawesome/fontawesome-svg-core'
import {
faSignInAlt,
@@ -30,7 +31,8 @@ library.add(
export default {
components: {
- SearchBar
+ SearchBar,
+ ConfirmModal
},
data: () => ({
searchBarHidden: true,
@@ -40,7 +42,8 @@ export default {
window.CSS.supports('-moz-mask-size', 'contain') ||
window.CSS.supports('-ms-mask-size', 'contain') ||
window.CSS.supports('-o-mask-size', 'contain')
- )
+ ),
+ showingConfirmLogout: false
}),
computed: {
enableMask () { return this.supportsMask && this.$store.state.instance.logoMask },
@@ -73,15 +76,32 @@ export default {
hideSitename () { return this.$store.state.instance.hideSitename },
logoLeft () { return this.$store.state.instance.logoLeft },
currentUser () { return this.$store.state.users.currentUser },
- privateMode () { return this.$store.state.instance.private }
+ privateMode () { return this.$store.state.instance.private },
+ shouldConfirmLogout () {
+ return this.$store.getters.mergedConfig.modalOnLogout
+ }
},
methods: {
scrollToTop () {
window.scrollTo(0, 0)
},
+ showConfirmLogout () {
+ this.showingConfirmLogout = true
+ },
+ hideConfirmLogout () {
+ this.showingConfirmLogout = false
+ },
logout () {
+ if (!this.shouldConfirmLogout) {
+ this.doLogout()
+ } else {
+ this.showConfirmLogout()
+ }
+ },
+ doLogout () {
this.$router.replace('/main/public')
this.$store.dispatch('logout')
+ this.hideConfirmLogout()
},
onSearchBarToggled (hidden) {
this.searchBarHidden = hidden
diff --git a/src/components/desktop_nav/desktop_nav.vue b/src/components/desktop_nav/desktop_nav.vue
index 07bf8005c7..7db94a3777 100644
--- a/src/components/desktop_nav/desktop_nav.vue
+++ b/src/components/desktop_nav/desktop_nav.vue
@@ -76,6 +76,16 @@
+
+ {{ $t('login.logout_confirm') }}
+
diff --git a/src/components/mobile_nav/mobile_nav.js b/src/components/mobile_nav/mobile_nav.js
index cdbbb8127d..dad1f6aa32 100644
--- a/src/components/mobile_nav/mobile_nav.js
+++ b/src/components/mobile_nav/mobile_nav.js
@@ -1,5 +1,6 @@
import SideDrawer from '../side_drawer/side_drawer.vue'
import Notifications from '../notifications/notifications.vue'
+import ConfirmModal from '../confirm_modal/confirm_modal.vue'
import { unseenNotificationsFromStore } from '../../services/notification_utils/notification_utils'
import GestureService from '../../services/gesture_service/gesture_service'
import NavigationPins from 'src/components/navigation/navigation_pins.vue'
@@ -25,12 +26,14 @@ const MobileNav = {
components: {
SideDrawer,
Notifications,
- NavigationPins
+ NavigationPins,
+ ConfirmModal
},
data: () => ({
notificationsCloseGesture: undefined,
notificationsOpen: false,
- notificationsAtTop: true
+ notificationsAtTop: true,
+ showingConfirmLogout: false
}),
created () {
this.notificationsCloseGesture = GestureService.swipeGesture(
@@ -57,7 +60,11 @@ const MobileNav = {
...mapGetters(['unreadChatCount', 'unreadAnnouncementCount']),
chatsPinned () {
return new Set(this.$store.state.serverSideStorage.prefsStorage.collections.pinnedNavItems).has('chats')
- }
+ },
+ shouldConfirmLogout () {
+ return this.$store.getters.mergedConfig.modalOnLogout
+ },
+ ...mapGetters(['unreadChatCount'])
},
methods: {
toggleMobileSidebar () {
@@ -88,9 +95,23 @@ const MobileNav = {
scrollMobileNotificationsToTop () {
this.$refs.mobileNotifications.scrollTo(0, 0)
},
+ showConfirmLogout () {
+ this.showingConfirmLogout = true
+ },
+ hideConfirmLogout () {
+ this.showingConfirmLogout = false
+ },
logout () {
+ if (!this.shouldConfirmLogout) {
+ this.doLogout()
+ } else {
+ this.showConfirmLogout()
+ }
+ },
+ doLogout () {
this.$router.replace('/main/public')
this.$store.dispatch('logout')
+ this.hideConfirmLogout()
},
markNotificationsAsSeen () {
// this.$refs.notifications.markAsSeen()
diff --git a/src/components/mobile_nav/mobile_nav.vue b/src/components/mobile_nav/mobile_nav.vue
index d6fe102cb4..de97624b42 100644
--- a/src/components/mobile_nav/mobile_nav.vue
+++ b/src/components/mobile_nav/mobile_nav.vue
@@ -88,6 +88,16 @@
ref="sideDrawer"
:logout="logout"
/>
+
+ {{ $t('login.logout_confirm') }}
+
@@ -235,6 +245,14 @@
}
}
}
+ .confirm-modal.dark-overlay {
+ &::before {
+ z-index: 3000;
+ }
+ .dialog-modal.panel {
+ z-index: 3001;
+ }
+ }
}
From 5c048321e787b880f4c228e52b956b59edc3fc4f Mon Sep 17 00:00:00 2001
From: Tusooa Zhu
Date: Wed, 9 Feb 2022 16:51:32 -0500
Subject: [PATCH 18/52] Add English translation for logout confirmation
---
src/i18n/en.json | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/i18n/en.json b/src/i18n/en.json
index 1dec4b9054..f7d83aa324 100644
--- a/src/i18n/en.json
+++ b/src/i18n/en.json
@@ -137,6 +137,10 @@
"login": "Log in",
"description": "Log in with OAuth",
"logout": "Log out",
+ "logout_confirm_title": "Logout confirmation",
+ "logout_confirm": "Do you really want to logout?",
+ "logout_confirm_accept_button": "Logout",
+ "logout_confirm_cancel_button": "Do not logout",
"password": "Password",
"placeholder": "e.g. lain",
"register": "Register",
From 8c8a8232c8c23f706b82c03c7ddadbd94ca2f3df Mon Sep 17 00:00:00 2001
From: Tusooa Zhu
Date: Wed, 9 Feb 2022 17:03:17 -0500
Subject: [PATCH 19/52] 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 fa354285df..59e46dc185 100644
--- a/src/components/confirm_modal/confirm_modal.vue
+++ b/src/components/confirm_modal/confirm_modal.vue
@@ -2,26 +2,26 @@
-
+
-
+
+ v-text="confirmText"
+ />
+ v-text="cancelText"
+ />
diff --git a/src/components/follow_button/follow_button.js b/src/components/follow_button/follow_button.js
index 0a74a7a105..443aa9bccc 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: {
From 51ade260660b1a6586b5c0091d89c9701b684870 Mon Sep 17 00:00:00 2001
From: Tusooa Zhu
Date: Fri, 11 Feb 2022 10:18:20 -0500
Subject: [PATCH 20/52] 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 7db94a3777..0f5b31363b 100644
--- a/src/components/desktop_nav/desktop_nav.vue
+++ b/src/components/desktop_nav/desktop_nav.vue
@@ -78,7 +78,7 @@
Date: Thu, 17 Mar 2022 00:06:26 -0400
Subject: [PATCH 21/52] 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 | 22 ++++----
.../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, 114 insertions(+), 108 deletions(-)
diff --git a/src/components/account_actions/account_actions.vue b/src/components/account_actions/account_actions.vue
index dfe1f706f2..273aac6985 100644
--- a/src/components/account_actions/account_actions.vue
+++ b/src/components/account_actions/account_actions.vue
@@ -74,24 +74,26 @@
-
-
+
-
-
-
+
+
+
+
+
diff --git a/src/components/confirm_modal/confirm_modal.js b/src/components/confirm_modal/confirm_modal.js
index bb5e9d979d..96ddc118fd 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 59e46dc185..5b5014c5e1 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/desktop_nav/desktop_nav.vue b/src/components/desktop_nav/desktop_nav.vue
index 0f5b31363b..186303853a 100644
--- a/src/components/desktop_nav/desktop_nav.vue
+++ b/src/components/desktop_nav/desktop_nav.vue
@@ -76,16 +76,18 @@
-
- {{ $t('login.logout_confirm') }}
-
+
+
+ {{ $t('login.logout_confirm') }}
+
+
diff --git a/src/components/extra_buttons/extra_buttons.vue b/src/components/extra_buttons/extra_buttons.vue
index 293f6d68ba..4641947a1a 100644
--- a/src/components/extra_buttons/extra_buttons.vue
+++ b/src/components/extra_buttons/extra_buttons.vue
@@ -165,16 +165,18 @@
/>
-
- {{ $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 4fc2233a6b..5c7994062b 100644
--- a/src/components/follow_button/follow_button.vue
+++ b/src/components/follow_button/follow_button.vue
@@ -1,33 +1,33 @@
-
-
-
-
+ {{ label }}
+
+
-
-
-
-
+
+
+
+
+
+
diff --git a/src/components/mobile_nav/mobile_nav.vue b/src/components/mobile_nav/mobile_nav.vue
index 0f23b7aceb..6b6b8f21a8 100644
--- a/src/components/mobile_nav/mobile_nav.vue
+++ b/src/components/mobile_nav/mobile_nav.vue
@@ -88,16 +88,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 38d4dc3fef..9ed24bd534 100644
--- a/src/components/retweet_button/retweet_button.vue
+++ b/src/components/retweet_button/retweet_button.vue
@@ -59,16 +59,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 fac900a983..5a848ead5d 100644
--- a/src/components/user_card/user_card.vue
+++ b/src/components/user_card/user_card.vue
@@ -314,24 +314,26 @@
:handle-links="true"
/>
-
-
+
-
-
-
+
+
+
+
+
From dc04c8cbd48dd8dcfc6b1937663e57983d38562a Mon Sep 17 00:00:00 2001
From: Tusooa Zhu
Date: Wed, 6 Apr 2022 14:54:58 -0400
Subject: [PATCH 22/52] 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 273aac6985..fc303271d1 100644
--- a/src/components/account_actions/account_actions.vue
+++ b/src/components/account_actions/account_actions.vue
@@ -74,7 +74,7 @@
-
+
-
+
diff --git a/src/components/desktop_nav/desktop_nav.vue b/src/components/desktop_nav/desktop_nav.vue
index 186303853a..92622cf91c 100644
--- a/src/components/desktop_nav/desktop_nav.vue
+++ b/src/components/desktop_nav/desktop_nav.vue
@@ -76,7 +76,7 @@
-
+
{{ $t('login.logout_confirm') }}
-
+
diff --git a/src/components/extra_buttons/extra_buttons.vue b/src/components/extra_buttons/extra_buttons.vue
index 4641947a1a..c1c15c0fb5 100644
--- a/src/components/extra_buttons/extra_buttons.vue
+++ b/src/components/extra_buttons/extra_buttons.vue
@@ -165,7 +165,7 @@
/>
-
+
{{ $t('status.delete_confirm') }}
-
+
diff --git a/src/components/follow_button/follow_button.vue b/src/components/follow_button/follow_button.vue
index 5c7994062b..b45673484e 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 6b6b8f21a8..6d826622aa 100644
--- a/src/components/mobile_nav/mobile_nav.vue
+++ b/src/components/mobile_nav/mobile_nav.vue
@@ -88,7 +88,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 9ed24bd534..134fcb36a2 100644
--- a/src/components/retweet_button/retweet_button.vue
+++ b/src/components/retweet_button/retweet_button.vue
@@ -59,7 +59,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 5a848ead5d..856ed54b08 100644
--- a/src/components/user_card/user_card.vue
+++ b/src/components/user_card/user_card.vue
@@ -314,7 +314,7 @@
:handle-links="true"
/>
-
+
-
+
From 76d99c08d6740886b8c52ee4a0291706dc68ca3f Mon Sep 17 00:00:00 2001
From: Tusooa Zhu
Date: Wed, 6 Apr 2022 15:02:21 -0400
Subject: [PATCH 23/52] Move modal out of vue tree
---
index.html | 1 +
src/App.vue | 1 -
2 files changed, 1 insertion(+), 1 deletion(-)
diff --git a/index.html b/index.html
index 4af84a5940..c02bf30837 100644
--- a/index.html
+++ b/index.html
@@ -9,6 +9,7 @@
+
diff --git a/src/App.vue b/src/App.vue
index 23a388a629..fe214ce718 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -71,7 +71,6 @@
-
From 0b914d78155b8b5a5adfbeba91198766e315b9a0 Mon Sep 17 00:00:00 2001
From: Tusooa Zhu
Date: Wed, 6 Apr 2022 15:05:09 -0400
Subject: [PATCH 24/52] Make modal display over the top bar
---
src/components/dialog_modal/dialog_modal.vue | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/components/dialog_modal/dialog_modal.vue b/src/components/dialog_modal/dialog_modal.vue
index 24d651426e..341cf1054b 100644
--- a/src/components/dialog_modal/dialog_modal.vue
+++ b/src/components/dialog_modal/dialog_modal.vue
@@ -39,7 +39,7 @@
right: 0;
top: 0;
background: rgb(27 31 35 / 50%);
- z-index: 99;
+ z-index: 2000;
}
}
@@ -51,7 +51,7 @@
margin: 15vh auto;
position: fixed;
transform: translateX(-50%);
- z-index: 999;
+ z-index: 2001;
cursor: default;
display: block;
background-color: $fallback--bg;
From 91c4a57fe50fae8b6e8defe08f09c8a7090bf649 Mon Sep 17 00:00:00 2001
From: Tusooa Zhu
Date: Sat, 9 Apr 2022 23:11:19 -0400
Subject: [PATCH 25/52] Make page unscrollable when confirm modal is shown
Or we could scroll until the component is ... hidden
due to virtual-scrolling, and the modal disappears!
---
src/components/confirm_modal/confirm_modal.vue | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/components/confirm_modal/confirm_modal.vue b/src/components/confirm_modal/confirm_modal.vue
index 5b5014c5e1..1ac64b625c 100644
--- a/src/components/confirm_modal/confirm_modal.vue
+++ b/src/components/confirm_modal/confirm_modal.vue
@@ -1,5 +1,6 @@
From ec957d41620fecc5103474f1b07bbb96f5cae446 Mon Sep 17 00:00:00 2001
From: Tusooa Zhu
Date: Sat, 9 Apr 2022 23:26:27 -0400
Subject: [PATCH 26/52] Make confirm dialogs work with vue-i18n 9
---
.../account_actions/account_actions.vue | 15 ++++++++-------
src/components/follow_button/follow_button.vue | 15 ++++++++-------
src/components/user_card/user_card.vue | 15 ++++++++-------
3 files changed, 24 insertions(+), 21 deletions(-)
diff --git a/src/components/account_actions/account_actions.vue b/src/components/account_actions/account_actions.vue
index fc303271d1..161bab0999 100644
--- a/src/components/account_actions/account_actions.vue
+++ b/src/components/account_actions/account_actions.vue
@@ -83,15 +83,16 @@
@accepted="doBlockUser"
@cancelled="hideConfirmBlock"
>
-
-
-
+
+
+
+
diff --git a/src/components/follow_button/follow_button.vue b/src/components/follow_button/follow_button.vue
index b45673484e..e421c15b3a 100644
--- a/src/components/follow_button/follow_button.vue
+++ b/src/components/follow_button/follow_button.vue
@@ -16,15 +16,16 @@
@accepted="doUnfollow"
@cancelled="hideConfirmUnfollow"
>
-
-
-
+
+
+
+
diff --git a/src/components/user_card/user_card.vue b/src/components/user_card/user_card.vue
index 856ed54b08..01882aa828 100644
--- a/src/components/user_card/user_card.vue
+++ b/src/components/user_card/user_card.vue
@@ -323,15 +323,16 @@
@accepted="doMuteUser"
@cancelled="hideConfirmMute"
>
-
-
-
+
+
+
+
From 95c15fca225d989613a50a6039c8ffa809a8fd88 Mon Sep 17 00:00:00 2001
From: Tusooa Zhu
Date: Sat, 9 Apr 2022 23:32:15 -0400
Subject: [PATCH 27/52] Use correct html syntax for modal
---
index.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/index.html b/index.html
index c02bf30837..a02939f7ea 100644
--- a/index.html
+++ b/index.html
@@ -9,7 +9,7 @@
-
+
From 228a9afdf5ecc10a17de31f88bd88ad1efbe0004 Mon Sep 17 00:00:00 2001
From: Tusooa Zhu
Date: Sat, 30 Apr 2022 11:08:19 -0400
Subject: [PATCH 28/52] Add timed-mute functionality
---
src/components/poll/poll_form.js | 13 ++----------
src/components/user_card/user_card.js | 13 ++++++++++--
src/components/user_card/user_card.scss | 5 +++++
src/components/user_card/user_card.vue | 28 ++++++++++++++++++++++++-
src/modules/users.js | 7 +++++--
src/services/api/api.service.js | 8 +++++--
src/services/date_utils/date_utils.js | 16 ++++++++++++++
7 files changed, 72 insertions(+), 18 deletions(-)
diff --git a/src/components/poll/poll_form.js b/src/components/poll/poll_form.js
index e30645c34e..a207015537 100644
--- a/src/components/poll/poll_form.js
+++ b/src/components/poll/poll_form.js
@@ -94,19 +94,10 @@ export default {
},
convertExpiryToUnit (unit, amount) {
// Note: we want seconds and not milliseconds
- switch (unit) {
- case 'minutes': return (1000 * amount) / DateUtils.MINUTE
- case 'hours': return (1000 * amount) / DateUtils.HOUR
- case 'days': return (1000 * amount) / DateUtils.DAY
- }
+ return DateUtils.secondsToUnit(unit, amount)
},
convertExpiryFromUnit (unit, amount) {
- // Note: we want seconds and not milliseconds
- switch (unit) {
- case 'minutes': return 0.001 * amount * DateUtils.MINUTE
- case 'hours': return 0.001 * amount * DateUtils.HOUR
- case 'days': return 0.001 * amount * DateUtils.DAY
- }
+ return DateUtils.unitToSeconds(unit, amount)
},
expiryAmountChange () {
this.expiryAmount =
diff --git a/src/components/user_card/user_card.js b/src/components/user_card/user_card.js
index 1bcc434100..e17bf8eb28 100644
--- a/src/components/user_card/user_card.js
+++ b/src/components/user_card/user_card.js
@@ -1,3 +1,4 @@
+import { unitToSeconds } from 'src/services/date_utils/date_utils.js'
import UserAvatar from '../user_avatar/user_avatar.vue'
import RemoteFollow from '../remote_follow/remote_follow.vue'
import ProgressButton from '../progress_button/progress_button.vue'
@@ -48,7 +49,9 @@ export default {
return {
followRequestInProgress: false,
betterShadow: this.$store.state.interface.browserSupport.cssFilter,
- showingConfirmMute: false
+ showingConfirmMute: false,
+ muteExpiryAmount: 0,
+ muteExpiryUnit: 'minutes'
}
},
created () {
@@ -142,6 +145,9 @@ export default {
shouldConfirmMute () {
return this.mergedConfig.modalOnMute
},
+ muteExpiryUnits () {
+ return ['minutes', 'hours', 'days']
+ },
...mapGetters(['mergedConfig'])
},
components: {
@@ -172,7 +178,10 @@ export default {
}
},
doMuteUser () {
- this.$store.dispatch('muteUser', this.user.id)
+ this.$store.dispatch('muteUser', {
+ id: this.user.id,
+ expiresIn: this.shouldConfirmMute ? unitToSeconds(this.muteExpiryUnit, this.muteExpiryAmount) : 0
+ })
this.hideConfirmMute()
},
unmuteUser () {
diff --git a/src/components/user_card/user_card.scss b/src/components/user_card/user_card.scss
index d56b667203..4ab93a8a36 100644
--- a/src/components/user_card/user_card.scss
+++ b/src/components/user_card/user_card.scss
@@ -355,3 +355,8 @@
text-decoration: none;
}
}
+
+.mute-expiry {
+ display: flex;
+ flex-direction: row;
+}
diff --git a/src/components/user_card/user_card.vue b/src/components/user_card/user_card.vue
index 01882aa828..2de14063de 100644
--- a/src/components/user_card/user_card.vue
+++ b/src/components/user_card/user_card.vue
@@ -325,7 +325,7 @@
>
+
+
+ {{ $t('user_card.mute_duration_prompt') }}
+
+
+
+
diff --git a/src/modules/users.js b/src/modules/users.js
index 053e44b690..a1316ba259 100644
--- a/src/modules/users.js
+++ b/src/modules/users.js
@@ -61,13 +61,16 @@ const editUserNote = (store, { id, comment }) => {
.then((relationship) => store.commit('updateUserRelationship', [relationship]))
}
-const muteUser = (store, id) => {
+const muteUser = (store, args) => {
+ const id = typeof args === 'object' ? args.id : args
+ const expiresIn = typeof args === 'object' ? args.expiresIn : 0
+
const predictedRelationship = store.state.relationships[id] || { id }
predictedRelationship.muting = true
store.commit('updateUserRelationship', [predictedRelationship])
store.commit('addMuteId', id)
- return store.rootState.api.backendInteractor.muteUser({ id })
+ return store.rootState.api.backendInteractor.muteUser({ id, expiresIn })
.then((relationship) => {
store.commit('updateUserRelationship', [relationship])
store.commit('addMuteId', id)
diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js
index af12265e89..c7a36af921 100644
--- a/src/services/api/api.service.js
+++ b/src/services/api/api.service.js
@@ -1118,8 +1118,12 @@ const fetchMutes = ({ credentials }) => {
.then((users) => users.map(parseUser))
}
-const muteUser = ({ id, credentials }) => {
- return promisedRequest({ url: MASTODON_MUTE_USER_URL(id), credentials, method: 'POST' })
+const muteUser = ({ id, expiresIn, credentials }) => {
+ const payload = {}
+ if (expiresIn) {
+ payload['expires_in'] = expiresIn
+ }
+ return promisedRequest({ url: MASTODON_MUTE_USER_URL(id), credentials, method: 'POST', payload })
}
const unmuteUser = ({ id, credentials }) => {
diff --git a/src/services/date_utils/date_utils.js b/src/services/date_utils/date_utils.js
index c93d21761e..ed8e14170b 100644
--- a/src/services/date_utils/date_utils.js
+++ b/src/services/date_utils/date_utils.js
@@ -41,3 +41,19 @@ export const relativeTimeShort = (date, nowThreshold = 1) => {
r.key += '_short'
return r
}
+
+export const unitToSeconds = (unit, amount) => {
+ switch (unit) {
+ case 'minutes': return 0.001 * amount * MINUTE
+ case 'hours': return 0.001 * amount * HOUR
+ case 'days': return 0.001 * amount * DAY
+ }
+}
+
+export const secondsToUnit = (unit, amount) => {
+ switch (unit) {
+ case 'minutes': return (1000 * amount) / MINUTE
+ case 'hours': return (1000 * amount) / HOUR
+ case 'days': return (1000 * amount) / DAY
+ }
+}
From b7af37fce8bf11492681f206cfc2afcf00ff5ded Mon Sep 17 00:00:00 2001
From: Tusooa Zhu
Date: Sat, 30 Apr 2022 11:08:37 -0400
Subject: [PATCH 29/52] Add English translation for mute duration
---
src/i18n/en.json | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/i18n/en.json b/src/i18n/en.json
index f7d83aa324..fc0de3ac9e 100644
--- a/src/i18n/en.json
+++ b/src/i18n/en.json
@@ -950,6 +950,7 @@
"mute_confirm": "Do you really want to mute {user}?",
"mute_confirm_accept_button": "Mute",
"mute_confirm_cancel_button": "Do not mute",
+ "mute_duration_prompt": "Mute this user for (0 for indefinite time):",
"per_day": "per day",
"remote_follow": "Remote follow",
"remove_follower": "Remove follower",
From 547e85c7c6f9bf8779cc06344c4eebaaa8f9d775 Mon Sep 17 00:00:00 2001
From: Tusooa Zhu
Date: Tue, 7 Jun 2022 12:37:16 -0400
Subject: [PATCH 30/52] Add confirm dialogs for accept & deny follow requests
---
.../follow_request_card.js | 49 ++++++++++++++++++-
.../follow_request_card.vue | 22 +++++++++
src/components/notification/notification.js | 43 +++++++++++++++-
src/components/notification/notification.vue | 22 +++++++++
.../settings_modal/tabs/general_tab.vue | 10 ++++
src/modules/config.js | 2 +
src/modules/instance.js | 2 +
7 files changed, 147 insertions(+), 3 deletions(-)
diff --git a/src/components/follow_request_card/follow_request_card.js b/src/components/follow_request_card/follow_request_card.js
index cbd75311e8..b0873bb109 100644
--- a/src/components/follow_request_card/follow_request_card.js
+++ b/src/components/follow_request_card/follow_request_card.js
@@ -1,10 +1,18 @@
import BasicUserCard from '../basic_user_card/basic_user_card.vue'
+import ConfirmModal from '../confirm_modal/confirm_modal.vue'
import { notificationsFromStore } from '../../services/notification_utils/notification_utils.js'
const FollowRequestCard = {
props: ['user'],
components: {
- BasicUserCard
+ BasicUserCard,
+ ConfirmModal
+ },
+ data () {
+ return {
+ showingApproveConfirmDialog: false,
+ showingDenyConfirmDialog: false
+ }
},
methods: {
findFollowRequestNotificationId () {
@@ -13,7 +21,26 @@ const FollowRequestCard = {
)
return notif && notif.id
},
+ showApproveConfirmDialog () {
+ this.showingApproveConfirmDialog = true
+ },
+ hideApproveConfirmDialog () {
+ this.showingApproveConfirmDialog = false
+ },
+ showDenyConfirmDialog () {
+ this.showingDenyConfirmDialog = true
+ },
+ hideDenyConfirmDialog () {
+ this.showingDenyConfirmDialog = false
+ },
approveUser () {
+ if (this.shouldConfirmApprove) {
+ this.showApproveConfirmDialog()
+ } else {
+ this.doApprove()
+ }
+ },
+ doApprove () {
this.$store.state.api.backendInteractor.approveUser({ id: this.user.id })
this.$store.dispatch('removeFollowRequest', this.user)
@@ -25,14 +52,34 @@ const FollowRequestCard = {
notification.type = 'follow'
}
})
+ this.hideApproveConfirmDialog()
},
denyUser () {
+ if (this.shouldConfirmDeny) {
+ this.showDenyConfirmDialog()
+ } else {
+ this.doDeny()
+ }
+ },
+ doDeny () {
const notifId = this.findFollowRequestNotificationId()
this.$store.state.api.backendInteractor.denyUser({ id: this.user.id })
.then(() => {
this.$store.dispatch('dismissNotificationLocal', { id: notifId })
this.$store.dispatch('removeFollowRequest', this.user)
})
+ this.hideDenyConfirmDialog()
+ }
+ },
+ computed: {
+ mergedConfig () {
+ return this.$store.getters.mergedConfig
+ },
+ shouldConfirmApprove () {
+ return this.mergedConfig.modalOnApproveFollow
+ },
+ shouldConfirmDeny () {
+ return this.mergedConfig.modalOnDenyFollow
}
}
}
diff --git a/src/components/follow_request_card/follow_request_card.vue b/src/components/follow_request_card/follow_request_card.vue
index eb222cc7d8..55b651120b 100644
--- a/src/components/follow_request_card/follow_request_card.vue
+++ b/src/components/follow_request_card/follow_request_card.vue
@@ -14,6 +14,28 @@
{{ $t('user_card.deny') }}
+
+
+ {{ $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/notification/notification.js b/src/components/notification/notification.js
index 265aaee0a5..0ce8892e0c 100644
--- a/src/components/notification/notification.js
+++ b/src/components/notification/notification.js
@@ -8,6 +8,7 @@ import Report from '../report/report.vue'
import UserLink from '../user_link/user_link.vue'
import RichContent from 'src/components/rich_content/rich_content.jsx'
import UserPopover from '../user_popover/user_popover.vue'
+import ConfirmModal from '../confirm_modal/confirm_modal.vue'
import { isStatusNotification } from '../../services/notification_utils/notification_utils.js'
import { highlightClass, highlightStyle } from '../../services/user_highlighter/user_highlighter.js'
import generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator'
@@ -43,7 +44,9 @@ const Notification = {
return {
statusExpanded: false,
betterShadow: this.$store.state.interface.browserSupport.cssFilter,
- unmuted: false
+ unmuted: false,
+ showingApproveConfirmDialog: false,
+ showingDenyConfirmDialog: false
}
},
props: ['notification'],
@@ -56,7 +59,8 @@ const Notification = {
Report,
RichContent,
UserPopover,
- UserLink
+ UserLink,
+ ConfirmModal
},
methods: {
toggleStatusExpanded () {
@@ -71,7 +75,26 @@ const Notification = {
toggleMute () {
this.unmuted = !this.unmuted
},
+ showApproveConfirmDialog () {
+ this.showingApproveConfirmDialog = true
+ },
+ hideApproveConfirmDialog () {
+ this.showingApproveConfirmDialog = false
+ },
+ showDenyConfirmDialog () {
+ this.showingDenyConfirmDialog = true
+ },
+ hideDenyConfirmDialog () {
+ this.showingDenyConfirmDialog = false
+ },
approveUser () {
+ if (this.shouldConfirmApprove) {
+ this.showApproveConfirmDialog()
+ } else {
+ this.doApprove()
+ }
+ },
+ doApprove () {
this.$store.state.api.backendInteractor.approveUser({ id: this.user.id })
this.$store.dispatch('removeFollowRequest', this.user)
this.$store.dispatch('markSingleNotificationAsSeen', { id: this.notification.id })
@@ -83,6 +106,13 @@ const Notification = {
})
},
denyUser () {
+ if (this.shouldConfirmDeny) {
+ this.showDenyConfirmDialog()
+ } else {
+ this.doDeny()
+ }
+ },
+ doDeny () {
this.$store.state.api.backendInteractor.denyUser({ id: this.user.id })
.then(() => {
this.$store.dispatch('dismissNotificationLocal', { id: this.notification.id })
@@ -117,6 +147,15 @@ const Notification = {
isStatusNotification () {
return isStatusNotification(this.notification.type)
},
+ mergedConfig () {
+ return this.$store.getters.mergedConfig
+ },
+ shouldConfirmApprove () {
+ return this.mergedConfig.modalOnApproveFollow
+ },
+ shouldConfirmDeny () {
+ return this.mergedConfig.modalOnDenyFollow
+ },
...mapState({
currentUser: state => state.users.currentUser
})
diff --git a/src/components/notification/notification.vue b/src/components/notification/notification.vue
index f1aa542076..e1ea42aded 100644
--- a/src/components/notification/notification.vue
+++ b/src/components/notification/notification.vue
@@ -243,6 +243,28 @@
+
+
+ {{ $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 906c37584e..9de3ed81f3 100644
--- a/src/components/settings_modal/tabs/general_tab.vue
+++ b/src/components/settings_modal/tabs/general_tab.vue
@@ -181,6 +181,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 a894903053..1df279a224 100644
--- a/src/modules/config.js
+++ b/src/modules/config.js
@@ -84,6 +84,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 6fc3830c8e..fcb6eecc67 100644
--- a/src/modules/instance.js
+++ b/src/modules/instance.js
@@ -77,6 +77,8 @@ const defaultState = {
modalOnMute: false,
modalOnDelete: true,
modalOnLogout: true,
+ modalOnApproveFollow: false,
+ modalOnDenyFollow: false,
loginMethod: 'password',
logo: '/static/logo.svg',
logoMargin: '.2em',
From 041bbb162299b896f5d0583c1ed4e8dcdc035c38 Mon Sep 17 00:00:00 2001
From: Tusooa Zhu
Date: Tue, 7 Jun 2022 12:37:38 -0400
Subject: [PATCH 31/52] Add English translation for accept & deny follow
requests
---
src/i18n/en.json | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/src/i18n/en.json b/src/i18n/en.json
index fc0de3ac9e..213f9cf012 100644
--- a/src/i18n/en.json
+++ b/src/i18n/en.json
@@ -427,6 +427,8 @@
"confirm_dialogs_mute": "muting a user",
"confirm_dialogs_delete": "deleting a status",
"confirm_dialogs_logout": "logging out",
+ "confirm_dialogs_approve_follow": "approving a follower",
+ "confirm_dialogs_deny_follow": "denying a follower",
"mutes_and_blocks": "Mutes and Blocks",
"data_import_export_tab": "Data import / export",
"default_vis": "Default visibility scope",
@@ -916,6 +918,10 @@
},
"user_card": {
"approve": "Approve",
+ "approve_confirm_title": "Approve confirmation",
+ "approve_confirm_accept_button": "Approve",
+ "approve_confirm_cancel_button": "Do not approve",
+ "approve_confirm": "Do you want to approve {user}'s follow request?",
"block": "Block",
"blocked": "Blocked!",
"block_confirm_title": "Block confirmation",
@@ -924,6 +930,10 @@
"block_confirm_cancel_button": "Do not block",
"deactivated": "Deactivated",
"deny": "Deny",
+ "deny_confirm_title": "Deny confirmation",
+ "deny_confirm_accept_button": "Deny",
+ "deny_confirm_cancel_button": "Do not deny",
+ "deny_confirm": "Do you want to deny {user}'s follow request?",
"edit_profile": "Edit profile",
"favorites": "Favorites",
"follow": "Follow",
From 1856eeda40e76618717a66b51ffc49a1ecf8c967 Mon Sep 17 00:00:00 2001
From: Tusooa Zhu
Date: Fri, 10 Jun 2022 15:55:31 -0400
Subject: [PATCH 32/52] 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 0ce8892e0c..420db4f0f3 100644
--- a/src/components/notification/notification.js
+++ b/src/components/notification/notification.js
@@ -104,6 +104,7 @@ const Notification = {
notification.type = 'follow'
}
})
+ this.hideApproveConfirmDialog()
},
denyUser () {
if (this.shouldConfirmDeny) {
@@ -118,6 +119,7 @@ const Notification = {
this.$store.dispatch('dismissNotificationLocal', { id: this.notification.id })
this.$store.dispatch('removeFollowRequest', this.user)
})
+ this.hideDenyConfirmDialog()
}
},
computed: {
From 8a99d129dcc4a07375727b4f8959c7fa775b8ec0 Mon Sep 17 00:00:00 2001
From: Tusooa Zhu
Date: Mon, 1 Aug 2022 11:02:21 -0400
Subject: [PATCH 33/52] 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 1ac64b625c..3b98174aa9 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"
>
-
+
-
+