Create separate table column for registration reason when need_approval filter activated

This commit is contained in:
Angelina Filippova 2020-08-09 03:04:04 +03:00
parent efee8997f8
commit 7815274d17
2 changed files with 25 additions and 13 deletions

View file

@ -268,7 +268,8 @@ export default {
invalidAccount: 'This account has invalid nickname and can\'t be modified', invalidAccount: 'This account has invalid nickname and can\'t be modified',
invalidNickname: 'invalid nickname', invalidNickname: 'invalid nickname',
passwordResetTokenGenerated: 'Password reset token was generated:', passwordResetTokenGenerated: 'Password reset token was generated:',
linkToResetPassword: 'You can also use this link to reset password:' linkToResetPassword: 'You can also use this link to reset password:',
registrationReason: 'Registration Reason'
}, },
statuses: { statuses: {
statuses: 'Statuses', statuses: 'Statuses',

View file

@ -76,11 +76,20 @@
{{ isDesktop ? $t('users.unapproved') : getFirstLetter($t('users.unapproved')) }} {{ isDesktop ? $t('users.unapproved') : getFirstLetter($t('users.unapproved')) }}
</el-tag> </el-tag>
</el-tooltip> </el-tooltip>
<div v-if="pendingView && isDesktop" class="reason-text">
"{{ scope.row.registration_reason | truncate(100, '...') }}"
</div>
</template> </template>
</el-table-column>
<el-table-column v-if="pendingView && isDesktop" :label="$t('users.registrationReason')">
<template slot-scope="scope">
<el-tooltip
v-if="regReason(scope.row.registration_reason)"
:content="scope.row.registration_reason"
popper-class="reason-tooltip"
effect="dark">
<span>
"{{ scope.row.registration_reason | truncate(100, '...') }}"
</span>
</el-tooltip>
</template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('users.actions')" fixed="right"> <el-table-column :label="$t('users.actions')" fixed="right">
<template slot-scope="scope"> <template slot-scope="scope">
@ -134,11 +143,7 @@ export default {
}, },
filters: { filters: {
truncate: function(text, length, suffix) { truncate: function(text, length, suffix) {
if (text.length > length) { return text.length < length ? text : text.substring(0, length) + suffix
return text.substring(0, length) + suffix
} else {
return text
}
} }
}, },
data() { data() {
@ -233,6 +238,9 @@ export default {
propertyExists(account, property) { propertyExists(account, property) {
return account[property] return account[property]
}, },
regReason(reason) {
return reason && reason.length > 0
},
showDeactivatedButton(id) { showDeactivatedButton(id) {
return this.$store.state.user.id !== id return this.$store.state.user.id !== id
} }
@ -278,6 +286,9 @@ export default {
.password-reset-token-dialog { .password-reset-token-dialog {
width: 50% width: 50%
} }
.reason-tooltip {
max-width: 450px;
}
.reset-password-link { .reset-password-link {
text-decoration: underline; text-decoration: underline;
} }
@ -291,6 +302,9 @@ export default {
margin: 10px 0 0 15px; margin: 10px 0 0 15px;
height: 40px; height: 40px;
} }
.cell {
word-break: break-word;
}
.el-table__row:hover { .el-table__row:hover {
cursor: pointer; cursor: pointer;
} }
@ -319,9 +333,6 @@ export default {
color: gray; color: gray;
font-size: 28px; font-size: 28px;
} }
.reason-text {
word-break: normal;
}
} }
@media only screen and (max-width:480px) { @media only screen and (max-width:480px) {