Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: ROOT Org show orgs-and-roles in user-detail page #3820

Merged
merged 1 commit into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/components/Cards/DetailCard/index.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<IBox :fa="fa" :title="title">
<el-form class="content" label-position="left" label-width="25%">
<el-form-item v-for="item in items" :key="item.key" :label="item.key">
<el-form-item v-for="item in iItems" :key="item.key" :label="item.key">
<ItemValue :value="item.value" class="item-value" v-bind="item" />
</el-form-item>
</el-form>
Expand Down Expand Up @@ -35,6 +35,13 @@ export default {
type: String,
default: 'left'
}
},
data() {
return {
iItems: this.items.filter(item => {
return !item.hasOwnProperty('has') || item.has === true
})
}
}
}
</script>
Expand Down
1 change: 1 addition & 0 deletions src/i18n/langs/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1996,6 +1996,7 @@
"UpdateNodeAssetHardwareInfo": "Update node asset hardware information"
},
"users": {
"OrgRoleRelations": "Organizations",
"LunaSettingUpdate": "Luna setting",
"KokoSettingUpdate": "Koko setting",
"UserSetting": "User setting",
Expand Down
1 change: 1 addition & 0 deletions src/i18n/langs/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -1987,6 +1987,7 @@
"UpdateNodeAssetHardwareInfo": "ノード資産ハードウェア情報の更新"
},
"users": {
"OrgRoleRelations": "しょぞくそしき",
"LunaSettingUpdate": "Luna 設定更新",
"KokoSettingUpdate": "Koko 設定更新",
"UserSetting": "個人設定",
Expand Down
1 change: 1 addition & 0 deletions src/i18n/langs/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -1981,6 +1981,7 @@
"PasskeyAddDisableInfo": "你的认证来源是 {source}, 不支持添加 Passkey"
},
"users": {
"OrgRoleRelations": "所属组织",
"LunaSettingUpdate": "Luna 配置设置",
"KokoSettingUpdate": "Koko 配置设置",
"UserSetting": "偏好设置",
Expand Down
18 changes: 18 additions & 0 deletions src/views/users/User/UserDetail/UserInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,24 @@ export default {
return <div>{dom}</div>
}
},
{
key: this.$t('users.OrgRoleRelations'),
has: this.$store.getters.currentOrgIsRoot,
formatter: (item, val) => {
const doms = []
const orgsRoles = this.object.orgs_roles
const allowKeyMaxLength = 50
Object.entries(orgsRoles).forEach(([key, value]) => {
let prettyKey = key
if (key.length >= allowKeyMaxLength) {
prettyKey = key.substring(0, allowKeyMaxLength - 3) + '...'
}
const domKey = <el-tag size='mini' type='success'>{prettyKey}</el-tag>
doms.push(domKey)
})
return <div>{doms}</div>
}
},
'mfa_level', 'source', 'created_by', 'date_joined', 'date_expired',
'date_password_last_updated', 'last_login', 'comment'
],
Expand Down
Loading