Skip to content

Commit a6e9374

Browse files
fix: New conversation user, user group should be a mandatory field(#3833)
1 parent c8ec7c5 commit a6e9374

File tree

4 files changed

+20
-7
lines changed

4 files changed

+20
-7
lines changed

ui/src/locales/lang/en-US/views/chat-user.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ export default {
33
syncUsers: 'Sync Users',
44
syncUsersTip: 'Only sync newly added users',
55
setUserGroups: 'Configure User Groups',
6-
knowledgeTitleTip: 'This configuration will only take effect after enabling chat user login authentication in the associated application',
7-
applicationTitleTip: 'This configuration requires login authentication to be enabled in the application',
6+
knowledgeTitleTip:
7+
'This configuration will only take effect after enabling chat user login authentication in the associated application',
8+
applicationTitleTip:
9+
'This configuration requires login authentication to be enabled in the application',
810
autoAuthorization: 'Auto Authorization',
911
authorization: 'Authorization',
1012
batchDeleteUser: 'Delete selected {count} users?',
@@ -14,16 +16,18 @@ export default {
1416
group: {
1517
title: 'User Groups',
1618
name: 'User Group Name',
19+
requiredMessage: 'Please select user group',
1720
usernameOrName: 'Username/Name',
1821
delete: {
1922
confirmTitle: 'Confirm to delete user group:',
20-
confirmMessage: 'All members in this group will be removed after deletion. Proceed with caution!',
23+
confirmMessage:
24+
'All members in this group will be removed after deletion. Proceed with caution!',
2125
},
2226
batchDeleteMember: 'Remove selected {count} members?',
2327
},
2428
syncMessage: {
2529
title: 'Successfully synced {count} users',
2630
usernameExist: 'The following usernames already exist:',
2731
nicknameExist: 'The following nicknames already exist:',
28-
}
32+
},
2933
}

ui/src/locales/lang/zh-CN/views/chat-user.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export default {
1313
replace: '替换',
1414
group: {
1515
title: '用户组',
16+
requiredMessage: '请选择用户组',
1617
name: '用户组名称',
1718
usernameOrName: '用户名/姓名',
1819
delete: {
@@ -25,5 +26,5 @@ export default {
2526
title: '成功同步 {count} 个用户',
2627
usernameExist: '以下用户名已存在:',
2728
nicknameExist: '以下姓名已存在:',
28-
}
29+
},
2930
}

ui/src/locales/lang/zh-Hant/views/chat-user.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export default {
1313
replace: '替換',
1414
group: {
1515
title: '用戶組',
16+
requiredMessage: '請選擇用戶組',
1617
name: '用戶組名稱',
1718
usernameOrName: '用戶名/姓名',
1819
delete: {
@@ -25,5 +26,5 @@ export default {
2526
title: '成功同步 {count} 個用戶',
2627
usernameExist: '以下用戶名已存在:',
2728
nicknameExist: '以下姓名已存在:',
28-
}
29+
},
2930
}

ui/src/views/system-chat-user/chat-user/component/UserDrawer.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
<script setup lang="ts">
5252
import { ref, reactive, watch } from 'vue'
5353
import type { FormInstance } from 'element-plus'
54-
import chatUserApi from '@/api/system/chat-user'
5554
import userManageApi from '@/api/system/user-manage'
5655
import { MsgSuccess } from '@/utils/message'
5756
import { t } from '@/locales'
@@ -111,6 +110,14 @@ const rules = reactive({
111110
trigger: 'blur',
112111
},
113112
],
113+
user_group_ids: [
114+
{
115+
type: 'array',
116+
required: true,
117+
message: t('views.chatUser.group.requiredMessage'),
118+
trigger: 'change',
119+
},
120+
],
114121
})
115122
const visible = ref<boolean>(false)
116123
const loading = ref(false)

0 commit comments

Comments
 (0)