Add dropdown item and dialog window for creating custom tag

This commit is contained in:
Angelina Filippova 2020-09-03 00:28:56 +03:00
parent 8908ecad81
commit 2d70096f51
4 changed files with 31 additions and 4 deletions

View file

@ -276,7 +276,8 @@ export default {
person: 'Person',
enableTagPolicy: 'Enable MRF TagPolicy to manage user tags',
confirmEnablingTagPolicy: 'Are you sure you want to add TagPolicy to the list of enabled MRF policies?',
enableTagPolicySuccessMessage: 'MRF TagPolicy was enabled'
enableTagPolicySuccessMessage: 'MRF TagPolicy was enabled',
createCustomTag: 'Create custom tag'
},
statuses: {
statuses: 'Statuses',

View file

@ -110,6 +110,12 @@
{{ $t('users.disableAnySubscription') }}
<i v-if="user.tags.includes('mrf_tag:disable-any-subscription')" class="el-icon-check"/>
</el-dropdown-item>
<el-dropdown-item
v-if="user.local && tagPolicyEnabled"
icon="el-icon-plus"
@click.native="$emit('open-custom-tag-dialog')">
{{ $t('users.createCustomTag') }}
</el-dropdown-item>
<el-dropdown-item
v-if="!tagPolicyEnabled"
divided

View file

@ -139,6 +139,12 @@
</el-button-group>
</div>
</el-dropdown-item>
<el-dropdown-item
v-if="tagPolicyEnabled"
icon="el-icon-plus"
@click.native="$emit('open-custom-tag-dialog')">
{{ $t('users.createCustomTag') }}
</el-dropdown-item>
<el-dropdown-item
v-if="!tagPolicyEnabled"
divided

View file

@ -25,7 +25,8 @@
</el-button>
<multiple-users-menu
:selected-users="selectedUsers"
@apply-action="clearSelection"/>
@apply-action="clearSelection"
@open-custom-tag-dialog="openCustomTagDialog"/>
</div>
<new-account-dialog
:dialog-form-visible="createAccountDialogOpen"
@ -102,7 +103,8 @@
v-if="propertyExists(scope.row, 'nickname')"
:user="scope.row"
:page="'users'"
@open-reset-token-dialog="openResetPasswordDialog"/>
@open-reset-token-dialog="openResetPasswordDialog"
@open-custom-tag-dialog="openCustomTagDialog"/>
<el-button v-else type="text" disabled>
{{ $t('users.moderation') }}
<i v-if="isDesktop" class="el-icon-arrow-down el-icon--right"/>
@ -113,6 +115,13 @@
<reset-password-dialog
:reset-password-dialog-open="resetPasswordDialogOpen"
@close-reset-token-dialog="closeResetPasswordDialog"/>
<el-dialog
:visible.sync="createCustomTagDialogOpen"
:show-close="false"
:title="$t('users.createCustomTag')"
@open="resetForm">
<span/>
</el-dialog>
<div v-if="!loading" class="pagination">
<el-pagination
:total="usersCount"
@ -156,7 +165,8 @@ export default {
search: '',
selectedUsers: [],
createAccountDialogOpen: false,
resetPasswordDialogOpen: false
resetPasswordDialogOpen: false,
createCustomTagDialogOpen: false
}
},
computed: {
@ -235,6 +245,9 @@ export default {
handleSelectionChange(value) {
this.$data.selectedUsers = value
},
openCustomTagDialog() {
this.createCustomTagDialogOpen = true
},
openResetPasswordDialog() {
this.resetPasswordDialogOpen = true
},
@ -244,6 +257,7 @@ export default {
regReason(reason) {
return reason && reason.length > 0
},
resetForm() {},
showDeactivatedButton(id) {
return this.$store.state.user.id !== id
}