move "ask" options to filtering tab
This commit is contained in:
parent
6ae52e192b
commit
6aae8a8705
4 changed files with 104 additions and 104 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
import { cloneDeep } from 'lodash'
|
import { cloneDeep } from 'lodash'
|
||||||
import { mapState, mapActions } from 'pinia'
|
import { mapState, mapActions } from 'pinia'
|
||||||
|
import { mapState as mapVuexState } from 'vuex'
|
||||||
import { v4 as uuidv4 } from 'uuid';
|
import { v4 as uuidv4 } from 'uuid';
|
||||||
|
|
||||||
import { useServerSideStorageStore } from 'src/stores/serverSideStorage'
|
import { useServerSideStorageStore } from 'src/stores/serverSideStorage'
|
||||||
|
|
@ -30,6 +31,11 @@ const FilteringTab = {
|
||||||
value: mode,
|
value: mode,
|
||||||
label: this.$t(`settings.reply_visibility_${mode}`)
|
label: this.$t(`settings.reply_visibility_${mode}`)
|
||||||
})),
|
})),
|
||||||
|
muteBlockLv1Options: ['ask', 'forever', 'temporarily'].map(mode => ({
|
||||||
|
key: mode,
|
||||||
|
value: mode,
|
||||||
|
label: this.$t(`user_card.mute_block_${mode}`)
|
||||||
|
})),
|
||||||
muteFiltersDraftObject: cloneDeep(useServerSideStorageStore().prefsStorage.simple.muteFilters),
|
muteFiltersDraftObject: cloneDeep(useServerSideStorageStore().prefsStorage.simple.muteFilters),
|
||||||
muteFiltersDraftDirty: Object.fromEntries(
|
muteFiltersDraftDirty: Object.fromEntries(
|
||||||
Object.entries(
|
Object.entries(
|
||||||
|
|
@ -93,6 +99,43 @@ const FilteringTab = {
|
||||||
muteFiltersObject: store => store.prefsStorage.simple.muteFilters
|
muteFiltersObject: store => store.prefsStorage.simple.muteFilters
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
|
...mapVuexState({
|
||||||
|
blockExpirationSupported: state => state.instance.blockExpiration
|
||||||
|
}),
|
||||||
|
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 })
|
||||||
|
}
|
||||||
|
},
|
||||||
muteFiltersDraft () {
|
muteFiltersDraft () {
|
||||||
return Object.entries(this.muteFiltersDraftObject)
|
return Object.entries(this.muteFiltersDraftObject)
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -80,6 +80,66 @@
|
||||||
<div class="setting-item">
|
<div class="setting-item">
|
||||||
<h2>{{ $t('settings.filter.mute_filter') }}</h2>
|
<h2>{{ $t('settings.filter.mute_filter') }}</h2>
|
||||||
<ul class="setting-list">
|
<ul class="setting-list">
|
||||||
|
<li>
|
||||||
|
{{ $t('user_card.default_mute_expiration') }}
|
||||||
|
<Select
|
||||||
|
id="onMuteDefaultActionLv1"
|
||||||
|
v-model="onMuteDefaultActionLv1"
|
||||||
|
>
|
||||||
|
<option
|
||||||
|
v-for="option in muteBlockLv1Options"
|
||||||
|
:key="option.key"
|
||||||
|
:value="option.value"
|
||||||
|
>
|
||||||
|
{{ option.label }}
|
||||||
|
</option>
|
||||||
|
</Select>
|
||||||
|
<ul
|
||||||
|
class="setting-list suboptions"
|
||||||
|
v-if="onMuteDefaultActionLv1 === 'temporarily'"
|
||||||
|
>
|
||||||
|
<li>
|
||||||
|
<UnitSetting
|
||||||
|
path="onMuteDefaultAction"
|
||||||
|
unit-set="time"
|
||||||
|
:units="['s', 'm', 'h', 'd']"
|
||||||
|
:min="0"
|
||||||
|
>
|
||||||
|
{{ $t('user_card.default_expiration_time') }}
|
||||||
|
</UnitSetting>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li v-if="blockExpirationSupported">
|
||||||
|
{{ $t('user_card.default_block_expiration') }}
|
||||||
|
<Select
|
||||||
|
id="onBlockDefaultActionLv1"
|
||||||
|
v-model="onBlockDefaultActionLv1"
|
||||||
|
>
|
||||||
|
<option
|
||||||
|
v-for="option in muteBlockLv1Options"
|
||||||
|
:key="option.key"
|
||||||
|
:value="option.value"
|
||||||
|
>
|
||||||
|
{{ option.label }}
|
||||||
|
</option>
|
||||||
|
</Select>
|
||||||
|
<ul
|
||||||
|
class="setting-list suboptions"
|
||||||
|
v-if="onBlockDefaultActionLv1 === 'temporarily'"
|
||||||
|
>
|
||||||
|
<li>
|
||||||
|
<UnitSetting
|
||||||
|
path="onBlockDefaultAction"
|
||||||
|
unit-set="time"
|
||||||
|
:units="['s', 'm', 'h', 'd']"
|
||||||
|
:min="0"
|
||||||
|
>
|
||||||
|
{{ $t('user_card.default_expiration_time') }}
|
||||||
|
</UnitSetting>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<BooleanSetting path="hideFilteredStatuses">
|
<BooleanSetting path="hideFilteredStatuses">
|
||||||
{{ $t('settings.hide_muted_statuses') }}
|
{{ $t('settings.hide_muted_statuses') }}
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@ import Select from 'src/components/select/select.vue'
|
||||||
import SharedComputedObject from '../helpers/shared_computed_object.js'
|
import SharedComputedObject from '../helpers/shared_computed_object.js'
|
||||||
import ProfileSettingIndicator from '../helpers/profile_setting_indicator.vue'
|
import ProfileSettingIndicator from '../helpers/profile_setting_indicator.vue'
|
||||||
|
|
||||||
import { mapState } from 'vuex'
|
|
||||||
import { clearCache, cacheKey, emojiCacheKey } from 'src/services/sw/sw.js'
|
import { clearCache, cacheKey, emojiCacheKey } from 'src/services/sw/sw.js'
|
||||||
import { library } from '@fortawesome/fontawesome-svg-core'
|
import { library } from '@fortawesome/fontawesome-svg-core'
|
||||||
import {
|
import {
|
||||||
|
|
@ -59,11 +58,6 @@ const GeneralTab = {
|
||||||
value: mode,
|
value: mode,
|
||||||
label: this.$t(`settings.unsaved_post_action_${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:
|
loopSilentAvailable:
|
||||||
// Firefox
|
// Firefox
|
||||||
Object.getOwnPropertyDescriptor(HTMLVideoElement.prototype, 'mozHasAudio') ||
|
Object.getOwnPropertyDescriptor(HTMLVideoElement.prototype, 'mozHasAudio') ||
|
||||||
|
|
@ -88,40 +82,6 @@ const GeneralTab = {
|
||||||
postFormats () {
|
postFormats () {
|
||||||
return this.$store.state.instance.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 () {
|
postContentOptions () {
|
||||||
return this.postFormats.map(format => ({
|
return this.postFormats.map(format => ({
|
||||||
key: format,
|
key: format,
|
||||||
|
|
@ -137,10 +97,7 @@ const GeneralTab = {
|
||||||
},
|
},
|
||||||
instanceShoutboxPresent () { return this.$store.state.instance.shoutAvailable },
|
instanceShoutboxPresent () { return this.$store.state.instance.shoutAvailable },
|
||||||
instanceSpecificPanelPresent () { return this.$store.state.instance.showInstanceSpecificPanel },
|
instanceSpecificPanelPresent () { return this.$store.state.instance.showInstanceSpecificPanel },
|
||||||
...SharedComputedObject(),
|
...SharedComputedObject()
|
||||||
...mapState({
|
|
||||||
blockExpirationSupported: state => state.instance.blockExpiration
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
changeDefaultScope (value) {
|
changeDefaultScope (value) {
|
||||||
|
|
|
||||||
|
|
@ -69,66 +69,6 @@
|
||||||
{{ $t('settings.user_popover_avatar_overlay') }}
|
{{ $t('settings.user_popover_avatar_overlay') }}
|
||||||
</BooleanSetting>
|
</BooleanSetting>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
|
||||||
{{ $t('user_card.default_mute_expiration') }}
|
|
||||||
<Select
|
|
||||||
id="onMuteDefaultActionLv1"
|
|
||||||
v-model="onMuteDefaultActionLv1"
|
|
||||||
>
|
|
||||||
<option
|
|
||||||
v-for="option in muteBlockLv1Options"
|
|
||||||
:key="option.key"
|
|
||||||
:value="option.value"
|
|
||||||
>
|
|
||||||
{{ option.label }}
|
|
||||||
</option>
|
|
||||||
</Select>
|
|
||||||
<ul
|
|
||||||
class="setting-list suboptions"
|
|
||||||
v-if="onMuteDefaultActionLv1 === 'temporarily'"
|
|
||||||
>
|
|
||||||
<li>
|
|
||||||
<UnitSetting
|
|
||||||
path="onMuteDefaultAction"
|
|
||||||
unit-set="time"
|
|
||||||
:units="['s', 'm', 'h', 'd']"
|
|
||||||
:min="0"
|
|
||||||
>
|
|
||||||
{{ $t('user_card.default_expiration_time') }}
|
|
||||||
</UnitSetting>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li v-if="blockExpirationSupported">
|
|
||||||
{{ $t('user_card.default_block_expiration') }}
|
|
||||||
<Select
|
|
||||||
id="onBlockDefaultActionLv1"
|
|
||||||
v-model="onBlockDefaultActionLv1"
|
|
||||||
>
|
|
||||||
<option
|
|
||||||
v-for="option in muteBlockLv1Options"
|
|
||||||
:key="option.key"
|
|
||||||
:value="option.value"
|
|
||||||
>
|
|
||||||
{{ option.label }}
|
|
||||||
</option>
|
|
||||||
</Select>
|
|
||||||
<ul
|
|
||||||
class="setting-list suboptions"
|
|
||||||
v-if="onBlockDefaultActionLv1 === 'temporarily'"
|
|
||||||
>
|
|
||||||
<li>
|
|
||||||
<UnitSetting
|
|
||||||
path="onBlockDefaultAction"
|
|
||||||
unit-set="time"
|
|
||||||
:units="['s', 'm', 'h', 'd']"
|
|
||||||
:min="0"
|
|
||||||
>
|
|
||||||
{{ $t('user_card.default_expiration_time') }}
|
|
||||||
</UnitSetting>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li>
|
<li>
|
||||||
<BooleanSetting
|
<BooleanSetting
|
||||||
path="alwaysShowNewPostButton"
|
path="alwaysShowNewPostButton"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue