Disable tags actions in multiple moderation dropdown when TagPolicy is disabled

This commit is contained in:
Angelina Filippova 2020-08-27 01:50:49 +03:00
parent d19aef2e94
commit 8b4fe37a60

View file

@ -61,79 +61,79 @@
@click.native="requirePasswordReset">
{{ $t('users.requirePasswordReset') }}
</el-dropdown-item>
<el-dropdown-item divided class="no-hover">
<el-dropdown-item :disabled="tagPolicyDisabled" divided class="no-hover">
<div class="tag-container">
<span class="tag-text">{{ $t('users.forceNsfw') }}</span>
<el-button-group class="tag-button-group">
<el-button size="mini" @click.native="addTagForMultipleUsers('mrf_tag:media-force-nsfw')">
<el-button :disabled="tagPolicyDisabled" size="mini" @click.native="addTagForMultipleUsers('mrf_tag:media-force-nsfw')">
{{ $t('users.apply') }}
</el-button>
<el-button size="mini" @click.native="removeTagFromMultipleUsers('mrf_tag:media-force-nsfw')">
<el-button :disabled="tagPolicyDisabled" size="mini" @click.native="removeTagFromMultipleUsers('mrf_tag:media-force-nsfw')">
{{ $t('users.remove') }}
</el-button>
</el-button-group>
</div>
</el-dropdown-item>
<el-dropdown-item class="no-hover">
<el-dropdown-item :disabled="tagPolicyDisabled" class="no-hover">
<div class="tag-container">
<span class="tag-text">{{ $t('users.stripMedia') }}</span>
<el-button-group class="tag-button-group">
<el-button size="mini" @click.native="addTagForMultipleUsers('mrf_tag:media-strip')">
<el-button :disabled="tagPolicyDisabled" size="mini" @click.native="addTagForMultipleUsers('mrf_tag:media-strip')">
{{ $t('users.apply') }}
</el-button>
<el-button size="mini" @click.native="removeTagFromMultipleUsers('mrf_tag:media-strip')">
<el-button :disabled="tagPolicyDisabled" size="mini" @click.native="removeTagFromMultipleUsers('mrf_tag:media-strip')">
{{ $t('users.remove') }}
</el-button>
</el-button-group>
</div>
</el-dropdown-item>
<el-dropdown-item class="no-hover">
<el-dropdown-item :disabled="tagPolicyDisabled" class="no-hover">
<div class="tag-container">
<span class="tag-text">{{ $t('users.forceUnlisted') }}</span>
<el-button-group class="tag-button-group">
<el-button size="mini" @click.native="addTagForMultipleUsers('mrf_tag:force-unlisted')">
<el-button :disabled="tagPolicyDisabled" size="mini" @click.native="addTagForMultipleUsers('mrf_tag:force-unlisted')">
{{ $t('users.apply') }}
</el-button>
<el-button size="mini" @click.native="removeTagFromMultipleUsers('mrf_tag:force-unlisted')">
<el-button :disabled="tagPolicyDisabled" size="mini" @click.native="removeTagFromMultipleUsers('mrf_tag:force-unlisted')">
{{ $t('users.remove') }}
</el-button>
</el-button-group>
</div>
</el-dropdown-item>
<el-dropdown-item class="no-hover">
<el-dropdown-item :disabled="tagPolicyDisabled" class="no-hover">
<div class="tag-container">
<span class="tag-text">{{ $t('users.sandbox') }}</span>
<el-button-group class="tag-button-group">
<el-button size="mini" @click.native="addTagForMultipleUsers('mrf_tag:sandbox')">
<el-button :disabled="tagPolicyDisabled" size="mini" @click.native="addTagForMultipleUsers('mrf_tag:sandbox')">
{{ $t('users.apply') }}
</el-button>
<el-button size="mini" @click.native="removeTagFromMultipleUsers('mrf_tag:sandbox')">
<el-button :disabled="tagPolicyDisabled" size="mini" @click.native="removeTagFromMultipleUsers('mrf_tag:sandbox')">
{{ $t('users.remove') }}
</el-button>
</el-button-group>
</div>
</el-dropdown-item>
<el-dropdown-item class="no-hover">
<el-dropdown-item :disabled="tagPolicyDisabled" class="no-hover">
<div class="tag-container">
<span class="tag-text">{{ $t('users.disableRemoteSubscriptionForMultiple') }}</span>
<el-button-group class="tag-button-group">
<el-button size="mini" @click.native="addTagForMultipleUsers('mrf_tag:disable-remote-subscription')">
<el-button :disabled="tagPolicyDisabled" size="mini" @click.native="addTagForMultipleUsers('mrf_tag:disable-remote-subscription')">
{{ $t('users.apply') }}
</el-button>
<el-button size="mini" @click.native="removeTagFromMultipleUsers('mrf_tag:disable-remote-subscription')">
<el-button :disabled="tagPolicyDisabled" size="mini" @click.native="removeTagFromMultipleUsers('mrf_tag:disable-remote-subscription')">
{{ $t('users.remove') }}
</el-button>
</el-button-group>
</div>
</el-dropdown-item>
<el-dropdown-item class="no-hover">
<el-dropdown-item :disabled="tagPolicyDisabled" class="no-hover">
<div class="tag-container">
<span class="tag-text">{{ $t('users.disableAnySubscriptionForMultiple') }}</span>
<el-button-group class="tag-button-group">
<el-button size="mini" @click.native="addTagForMultipleUsers('mrf_tag:disable-any-subscription')">
<el-button :disabled="tagPolicyDisabled" size="mini" @click.native="addTagForMultipleUsers('mrf_tag:disable-any-subscription')">
{{ $t('users.apply') }}
</el-button>
<el-button size="mini" @click.native="removeTagFromMultipleUsers('mrf_tag:disable-any-subscription')">
<el-button :disabled="tagPolicyDisabled" size="mini" @click.native="removeTagFromMultipleUsers('mrf_tag:disable-any-subscription')">
{{ $t('users.remove') }}
</el-button>
</el-button-group>
@ -159,11 +159,14 @@ export default {
}
},
computed: {
isDesktop() {
return this.$store.state.app.device === 'desktop'
},
showDropdownForMultipleUsers() {
return this.$props.selectedUsers.length > 0
},
isDesktop() {
return this.$store.state.app.device === 'desktop'
tagPolicyDisabled() {
return this.$store.state.users.tagPolicyDisabled
}
},
methods: {