diff --git a/changelog.d/zoomlag.skip b/changelog.d/zoomlag.skip deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/App.scss b/src/App.scss index d56306c9e..1b3133a7c 100644 --- a/src/App.scss +++ b/src/App.scss @@ -679,6 +679,11 @@ option { } } +.btn-block { + display: block; + width: 100%; +} + .btn-group { position: relative; display: inline-flex; diff --git a/src/boot/after_store.js b/src/boot/after_store.js index 3ef92fd11..65c4c9205 100644 --- a/src/boot/after_store.js +++ b/src/boot/after_store.js @@ -254,7 +254,6 @@ const getNodeInfo = async ({ store }) => { const data = await res.json() const metadata = data.metadata const features = metadata.features - console.log(features) store.dispatch('setInstanceOption', { name: 'name', value: metadata.nodeName }) store.dispatch('setInstanceOption', { name: 'registrationOpen', value: data.openRegistrations }) store.dispatch('setInstanceOption', { name: 'mediaProxyAvailable', value: features.includes('media_proxy') }) @@ -275,7 +274,6 @@ const getNodeInfo = async ({ store }) => { store.dispatch('setInstanceOption', { name: 'mailerEnabled', value: metadata.mailerEnabled }) store.dispatch('setInstanceOption', { name: 'quotingAvailable', value: features.includes('quote_posting') }) store.dispatch('setInstanceOption', { name: 'groupActorAvailable', value: features.includes('pleroma:group_actors') }) - store.dispatch('setInstanceOption', { name: 'blockExpiration', value: features.includes('pleroma:block_expiration') }) store.dispatch('setInstanceOption', { name: 'localBubbleInstances', value: metadata.localBubbleInstances ?? [] }) const uploadLimits = metadata.uploadLimits diff --git a/src/components/account_actions/account_actions.js b/src/components/account_actions/account_actions.js index f8ad0e11b..9a63f57eb 100644 --- a/src/components/account_actions/account_actions.js +++ b/src/components/account_actions/account_actions.js @@ -3,7 +3,6 @@ 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 UserTimedFilterModal from 'src/components/user_timed_filter_modal/user_timed_filter_modal.vue' import { library } from '@fortawesome/fontawesome-svg-core' import { faEllipsisV @@ -28,10 +27,15 @@ const AccountActions = { ProgressButton, Popover, UserListMenu, - ConfirmModal, - UserTimedFilterModal + ConfirmModal }, methods: { + showConfirmBlock () { + this.showingConfirmBlock = true + }, + hideConfirmBlock () { + this.showingConfirmBlock = false + }, showConfirmRemoveUserFromFollowers () { this.showingConfirmRemoveFollower = true }, @@ -45,14 +49,10 @@ const AccountActions = { this.$store.dispatch('hideReblogs', this.user.id) }, blockUser () { - if (this.$refs.timedBlockDialog) { - this.$refs.timedBlockDialog.optionallyPrompt() + if (!this.shouldConfirmBlock) { + this.doBlockUser() } else { - if (!this.shouldConfirmBlock) { - this.doBlockUser() - } else { - this.showingConfirmBlock = true - } + this.showConfirmBlock() } }, doBlockUser () { @@ -91,7 +91,6 @@ const AccountActions = { return this.$store.getters.mergedConfig.modalOnRemoveUserFromFollowers }, ...mapState({ - blockExpirationSupported: state => state.instance.blockExpiration, pleromaChatMessagesAvailable: state => state.instance.pleromaChatMessagesAvailable }) } diff --git a/src/components/account_actions/account_actions.vue b/src/components/account_actions/account_actions.vue index f3cca45d0..fd4837ee4 100644 --- a/src/components/account_actions/account_actions.vue +++ b/src/components/account_actions/account_actions.vue @@ -96,8 +96,7 @@ - diff --git a/src/components/block_card/block_card.js b/src/components/block_card/block_card.js index 360cfe740..0bf4e37bc 100644 --- a/src/components/block_card/block_card.js +++ b/src/components/block_card/block_card.js @@ -1,9 +1,12 @@ -import { mapState } from 'vuex' - import BasicUserCard from '../basic_user_card/basic_user_card.vue' const BlockCard = { props: ['userId'], + data () { + return { + progress: false + } + }, computed: { user () { return this.$store.getters.findUser(this.userId) @@ -13,16 +16,7 @@ const BlockCard = { }, blocked () { return this.relationship.blocking - }, - blockExpiry () { - console.log(this.user) - return this.user.block_expires_at == null - ? this.$t('user_card.block_expires_forever') - : this.$t('user_card.block_expires_at', [new Date(this.user.mute_expires_at).toLocaleString()]) - }, - ...mapState({ - blockExpirationSupported: state => state.instance.blockExpiration, - }) + } }, components: { BasicUserCard @@ -30,14 +24,15 @@ const BlockCard = { methods: { unblockUser () { this.progress = true - this.$store.dispatch('unblockUser', this.user.id) + this.$store.dispatch('unblockUser', this.user.id).then(() => { + this.progress = false + }) }, blockUser () { - if (this.blockExpirationSupported) { - this.$refs.timedBlockDialog.optionallyPrompt() - } else { - this.$store.dispatch('blockUser', this.user.id) - } + this.progress = true + this.$store.dispatch('blockUser', this.user.id).then(() => { + this.progress = false + }) } } } diff --git a/src/components/block_card/block_card.vue b/src/components/block_card/block_card.vue index 61aafb288..b14ef8448 100644 --- a/src/components/block_card/block_card.vue +++ b/src/components/block_card/block_card.vue @@ -1,32 +1,33 @@ diff --git a/src/components/component_preview/component_preview.js b/src/components/component_preview/component_preview.js index 9f830cd72..c0a2aad72 100644 --- a/src/components/component_preview/component_preview.js +++ b/src/components/component_preview/component_preview.js @@ -52,7 +52,7 @@ export default { this.$emit('update:shadow', { axis, value: Number(value) }) }, update () { - const sheet = createStyleSheet('style-component-preview', 90) + const sheet = createStyleSheet('style-component-preview') sheet.clear() diff --git a/src/components/confirm_modal/mute_confirm.js b/src/components/confirm_modal/mute_confirm.js index a279dc716..1bef9f620 100644 --- a/src/components/confirm_modal/mute_confirm.js +++ b/src/components/confirm_modal/mute_confirm.js @@ -1,3 +1,4 @@ +import { unitToSeconds } from 'src/services/date_utils/date_utils.js' import { mapGetters } from 'vuex' import ConfirmModal from './confirm_modal.vue' @@ -7,13 +8,21 @@ export default { props: ['type', 'user', 'status'], emits: ['hide', 'show', 'muted'], data: () => ({ - showing: false + showing: false, + muteExpiryAmount: 2, + muteExpiryUnit: 'hours' }), components: { ConfirmModal, Select }, computed: { + muteExpiryValue () { + unitToSeconds(this.muteExpiryUnit, this.muteExpiryAmount) + }, + muteExpiryUnits () { + return ['minutes', 'hours', 'days'] + }, domain () { return this.user.fqn.split('@')[1] }, @@ -22,8 +31,13 @@ export default { return 'status.mute_domain_confirm' } else if (this.type === 'conversation') { return 'status.mute_conversation_confirm' + } else { + return 'user_card.mute_confirm' } }, + userIsMuted () { + return this.$store.getters.relationship(this.user.id).muting + }, conversationIsMuted () { return this.status.conversation_muted }, @@ -35,9 +49,12 @@ export default { case 'domain': { return this.mergedConfig.modalOnMuteDomain } - default: { // conversation + case 'conversation': { return this.mergedConfig.modalOnMuteConversation } + default: { + return this.mergedConfig.modalOnMute + } } }, ...mapGetters(['mergedConfig']) @@ -62,7 +79,7 @@ export default { switch (this.type) { case 'domain': { if (!this.domainIsMuted) { - this.$store.dispatch('muteDomain', { id: this.domain }) + this.$store.dispatch('muteDomain', { id: this.domain, expiresIn: this.muteExpiryValue }) } else { this.$store.dispatch('unmuteDomain', { id: this.domain }) } @@ -70,12 +87,20 @@ export default { } case 'conversation': { if (!this.conversationIsMuted) { - this.$store.dispatch('muteConversation', { id: this.status.id }) + this.$store.dispatch('muteConversation', { id: this.status.id, expiresIn: this.muteExpiryValue }) } else { this.$store.dispatch('unmuteConversation', { id: this.status.id }) } break } + default: { + if (!this.userIsMuted) { + this.$store.dispatch('muteUser', { id: this.user.id, expiresIn: this.muteExpiryValue }) + } else { + this.$store.dispatch('unmuteUser', { id: this.user.id }) + } + break + } } this.$emit('muted') this.hide() diff --git a/src/components/confirm_modal/mute_confirm.vue b/src/components/confirm_modal/mute_confirm.vue index 7c754b006..bf7ab338f 100644 --- a/src/components/confirm_modal/mute_confirm.vue +++ b/src/components/confirm_modal/mute_confirm.vue @@ -18,6 +18,36 @@ +
+

+ + + {{ ' ' }} + +

+
diff --git a/src/components/mute_card/mute_card.js b/src/components/mute_card/mute_card.js index 3d655465f..cbec0e9bb 100644 --- a/src/components/mute_card/mute_card.js +++ b/src/components/mute_card/mute_card.js @@ -1,8 +1,12 @@ import BasicUserCard from '../basic_user_card/basic_user_card.vue' -import UserTimedFilterModal from 'src/components/user_timed_filter_modal/user_timed_filter_modal.vue' const MuteCard = { props: ['userId'], + data () { + return { + progress: false + } + }, computed: { user () { return this.$store.getters.findUser(this.userId) @@ -12,24 +16,23 @@ const MuteCard = { }, muted () { return this.relationship.muting - }, - muteExpiry () { - return this.user.mute_expires_at == null - ? this.$t('user_card.mute_expires_forever') - : this.$t('user_card.mute_expires_at', [new Date(this.user.mute_expires_at).toLocaleString()]) } }, components: { - BasicUserCard, - UserTimedFilterModal + BasicUserCard }, methods: { unmuteUser () { this.progress = true - this.$store.dispatch('unmuteUser', this.userId) + this.$store.dispatch('unmuteUser', this.userId).then(() => { + this.progress = false + }) }, muteUser () { - this.$refs.timedMuteDialog.optionallyPrompt() + this.progress = true + this.$store.dispatch('muteUser', this.userId).then(() => { + this.progress = false + }) } } } diff --git a/src/components/mute_card/mute_card.vue b/src/components/mute_card/mute_card.vue index 08f62da9a..97e91cbca 100644 --- a/src/components/mute_card/mute_card.vue +++ b/src/components/mute_card/mute_card.vue @@ -1,32 +1,33 @@ diff --git a/src/components/settings_modal/tabs/appearance_tab.js b/src/components/settings_modal/tabs/appearance_tab.js index 838ac6d6c..e0f446a0e 100644 --- a/src/components/settings_modal/tabs/appearance_tab.js +++ b/src/components/settings_modal/tabs/appearance_tab.js @@ -412,9 +412,11 @@ const AppearanceTab = { } - const sheet = createStyleSheet('appearance-tab-previews', 90) + const sheet = createStyleSheet('appearance-tab-previews') sheet.addRule([ - '#theme-preview-', key, ' {\n', + '#theme-preview-', + key, + ' {\n', getCssRules(theme3.eager).join('\n'), '\n}' ].join('')) diff --git a/src/components/settings_modal/tabs/filtering_tab.js b/src/components/settings_modal/tabs/filtering_tab.js index f78f6815c..5ff137062 100644 --- a/src/components/settings_modal/tabs/filtering_tab.js +++ b/src/components/settings_modal/tabs/filtering_tab.js @@ -107,7 +107,7 @@ const FilteringTab = { ...mapActions(useServerSideStorageStore, ['setPreference', 'unsetPreference', 'pushServerSideStorage']), getDatetimeLocal (timestamp) { const date = new Date(timestamp) - const fmt = new Intl.NumberFormat("en-US", {minimumIntegerDigits: 2}) + let fmt = new Intl.NumberFormat("en-US", {minimumIntegerDigits: 2}) const datetime = [ date.getFullYear(), '-', diff --git a/src/components/settings_modal/tabs/general_tab.js b/src/components/settings_modal/tabs/general_tab.js index 7074a6d81..df28a23e3 100644 --- a/src/components/settings_modal/tabs/general_tab.js +++ b/src/components/settings_modal/tabs/general_tab.js @@ -5,12 +5,9 @@ import IntegerSetting from '../helpers/integer_setting.vue' import FloatSetting from '../helpers/float_setting.vue' import UnitSetting from '../helpers/unit_setting.vue' import InterfaceLanguageSwitcher from 'src/components/interface_language_switcher/interface_language_switcher.vue' -import Select from 'src/components/select/select.vue' import SharedComputedObject from '../helpers/shared_computed_object.js' import ProfileSettingIndicator from '../helpers/profile_setting_indicator.vue' - -import { mapState } from 'vuex' import { clearCache, cacheKey, emojiCacheKey } from 'src/services/sw/sw.js' import { library } from '@fortawesome/fontawesome-svg-core' import { @@ -59,11 +56,6 @@ const GeneralTab = { value: mode, label: this.$t(`settings.unsaved_post_action_${mode}`) })), - muteBlockLv1Options: ['ask', 'forever', 'temporarily'].map(mode => ({ - key: mode, - value: mode, - label: this.$t(`user_card.mute_block_${mode}`) - })), loopSilentAvailable: // Firefox Object.getOwnPropertyDescriptor(HTMLVideoElement.prototype, 'mozHasAudio') || @@ -81,47 +73,12 @@ const GeneralTab = { UnitSetting, InterfaceLanguageSwitcher, ScopeSelector, - ProfileSettingIndicator, - Select + ProfileSettingIndicator }, computed: { postFormats () { return this.$store.state.instance.postFormats || [] }, - onMuteDefaultActionLv1: { - get () { - const value = this.$store.state.config.onMuteDefaultAction - if (value === 'ask' || value === 'forever') { - return value - } else { - return 'temporarily' - } - }, - set (value) { - let realValue = value - if (value !== 'ask' && value !== 'forever') { - realValue = '14d' - } - this.$store.dispatch('setOption', { name: 'onMuteDefaultAction', value: realValue }) - } - }, - onBlockDefaultActionLv1: { - get () { - const value = this.$store.state.config.onBlockDefaultAction - if (value === 'ask' || value === 'forever') { - return value - } else { - return 'temporarily' - } - }, - set (value) { - let realValue = value - if (value !== 'ask' && value !== 'forever') { - realValue = '14d' - } - this.$store.dispatch('setOption', { name: 'onBlockDefaultAction', value: realValue }) - } - }, postContentOptions () { return this.postFormats.map(format => ({ key: format, @@ -137,10 +94,7 @@ const GeneralTab = { }, instanceShoutboxPresent () { return this.$store.state.instance.shoutAvailable }, instanceSpecificPanelPresent () { return this.$store.state.instance.showInstanceSpecificPanel }, - ...SharedComputedObject(), - ...mapState({ - blockExpirationSupported: state => state.instance.blockExpiration - }) + ...SharedComputedObject() }, methods: { changeDefaultScope (value) { diff --git a/src/components/settings_modal/tabs/general_tab.vue b/src/components/settings_modal/tabs/general_tab.vue index 648d7ac84..b8da782fb 100644 --- a/src/components/settings_modal/tabs/general_tab.vue +++ b/src/components/settings_modal/tabs/general_tab.vue @@ -69,66 +69,6 @@ {{ $t('settings.user_popover_avatar_overlay') }} -
  • - {{ $t('user_card.default_mute_expiration') }} - - -
  • -
  • - {{ $t('user_card.default_block_expiration') }} - - -
  • - + {{ $t('settings.confirm_dialogs_block') }}
  • +
  • + + {{ $t('settings.confirm_dialogs_mute') }} + +
  • {{ $t('settings.confirm_dialogs_mute_conversation') }} diff --git a/src/components/settings_modal/tabs/style_tab/style_tab.js b/src/components/settings_modal/tabs/style_tab/style_tab.js index 5453da57b..f92579bb2 100644 --- a/src/components/settings_modal/tabs/style_tab/style_tab.js +++ b/src/components/settings_modal/tabs/style_tab/style_tab.js @@ -695,7 +695,7 @@ export default { return } - const sheet = createStyleSheet('style-tab-overall-preview', 90) + const sheet = createStyleSheet('style-tab-overall-preview') sheet.clear() sheet.addRule([ diff --git a/src/components/settings_modal/tabs/theme_tab/theme_tab.js b/src/components/settings_modal/tabs/theme_tab/theme_tab.js index 4b558471f..70854e3bd 100644 --- a/src/components/settings_modal/tabs/theme_tab/theme_tab.js +++ b/src/components/settings_modal/tabs/theme_tab/theme_tab.js @@ -697,7 +697,7 @@ export default { liteMode: true }) - const sheet = createStyleSheet('theme-tab-overall-preview', 90) + const sheet = createStyleSheet('theme-tab-overall-preview') const rule = getScopedVersion( getCssRules(theme3.eager), '&' diff --git a/src/components/status_action_buttons/action_button_container.js b/src/components/status_action_buttons/action_button_container.js index a8f20800b..313e3022f 100644 --- a/src/components/status_action_buttons/action_button_container.js +++ b/src/components/status_action_buttons/action_button_container.js @@ -1,7 +1,6 @@ import ActionButton from './action_button.vue' import Popover from 'src/components/popover/popover.vue' import MuteConfirm from 'src/components/confirm_modal/mute_confirm.vue' -import UserTimedFilterModal from 'src/components/user_timed_filter_modal/user_timed_filter_modal.vue' import { library } from '@fortawesome/fontawesome-svg-core' import { @@ -20,8 +19,7 @@ export default { components: { ActionButton, Popover, - MuteConfirm, - UserTimedFilterModal + MuteConfirm }, props: ['button', 'status'], emits: ['interacted'], diff --git a/src/components/status_action_buttons/action_button_container.vue b/src/components/status_action_buttons/action_button_container.vue index 75f5010ee..931a40349 100644 --- a/src/components/status_action_buttons/action_button_container.vue +++ b/src/components/status_action_buttons/action_button_container.vue @@ -94,10 +94,11 @@ :status="status" :user="user" /> - diff --git a/src/components/user_card/user_card.js b/src/components/user_card/user_card.js index 0c01d5ff4..55c76225c 100644 --- a/src/components/user_card/user_card.js +++ b/src/components/user_card/user_card.js @@ -8,8 +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 UserTimedFilterModal from 'src/components/user_timed_filter_modal/user_timed_filter_modal.vue' - +import MuteConfirm from '../confirm_modal/mute_confirm.vue' import generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator' import { mapGetters } from 'vuex' import { usePostStatusStore } from 'src/stores/post_status' @@ -49,19 +48,6 @@ export default { 'onClose', 'hasNoteEditor' ], - components: { - UserAvatar, - RemoteFollow, - ModerationTools, - AccountActions, - ProgressButton, - FollowButton, - Select, - RichContent, - UserLink, - UserNote, - UserTimedFilterModal - }, data () { return { followRequestInProgress: false, @@ -159,21 +145,24 @@ export default { supportsNote () { return 'note' in this.relationship }, - muteExpiry () { - return this.user.mute_expires_at == null - ? this.$t('user_card.mute_expires_forever') - : this.$t('user_card.mute_expires_at', [new Date(this.user.mute_expires_at).toLocaleString()]) - }, - blockExpiry () { - return this.user.block_expires_at == null - ? this.$t('user_card.block_expires_forever') - : this.$t('user_card.block_expires_at', [new Date(this.user.mute_expires_at).toLocaleString()]) - }, ...mapGetters(['mergedConfig']) }, + components: { + UserAvatar, + RemoteFollow, + ModerationTools, + AccountActions, + ProgressButton, + FollowButton, + Select, + RichContent, + UserLink, + UserNote, + MuteConfirm + }, methods: { muteUser () { - this.$refs.timedMuteDialog.optionallyPrompt() + this.$refs.confirmation.optionallyPrompt() }, unmuteUser () { this.$store.dispatch('unmuteUser', this.user.id) diff --git a/src/components/user_card/user_card.scss b/src/components/user_card/user_card.scss index 418bef08b..d263be1c0 100644 --- a/src/components/user_card/user_card.scss +++ b/src/components/user_card/user_card.scss @@ -8,11 +8,6 @@ --_still-image-label-visibility: hidden; } - .btn-mute, .btn-mention { - display: block; - width: 100%; - } - .panel-heading { padding: 0.5em 0; text-align: center; diff --git a/src/components/user_card/user_card.vue b/src/components/user_card/user_card.vue index 5e606d653..36935424d 100644 --- a/src/components/user_card/user_card.vue +++ b/src/components/user_card/user_card.vue @@ -136,18 +136,6 @@ size="sm" /> - - {{ muteExpiry }} - - - {{ blockExpiry }} -