From a5e03f36cb2fee037af9d1158149fa40523f290c Mon Sep 17 00:00:00 2001 From: xusongfu Date: Mon, 23 Aug 2021 14:08:25 +0800 Subject: [PATCH] fix: Fix the user's real name field to real_name For better readability, change the user's real name field to real_name Change-Id: I509e854102f4e6f90f59b78dbe75953f5c17b4c1 --- src/api/keystone/user.js | 4 ++-- src/locales/en.json | 2 +- src/locales/zh.json | 2 +- src/pages/identity/containers/User/Detail/index.jsx | 4 ++-- .../identity/containers/User/actions/Create.jsx | 4 ++-- src/pages/identity/containers/User/actions/Edit.jsx | 12 ++++++------ .../containers/User/actionsInDomain/Create.jsx | 8 ++++---- src/pages/identity/containers/User/index.jsx | 8 ++++---- src/stores/keystone/user.js | 4 ++-- test/e2e/integration/pages/identity/user.spec.js | 2 +- test/e2e/support/resource-commands.js | 2 +- 11 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/api/keystone/user.js b/src/api/keystone/user.js index 58fa92c7..570130b5 100644 --- a/src/api/keystone/user.js +++ b/src/api/keystone/user.js @@ -55,7 +55,7 @@ export const fetchUserDetails = (userId) => * @param {String} data.user.email The email for the user. * @param {String} data.user.password The password for the user. * @param {String} data.user.phone The phone for the user. - * @param {String} data.user.full_name The true name for the user. + * @param {String} data.user.real_name The true name for the user. * @param {Boolean} data.user.enabled Default value : true * @param {String} data.user.description The description for the user. * @returns {Promise} @@ -75,7 +75,7 @@ export const createUser = (data) => * @param {String} data.user.name The name for the user. * @param {String} data.user.email The email for the user. * @param {String} data.user.phone The phone for the user. - * @param {String} data.user.full_name The true name for the user. + * @param {String} data.user.real_name The true name for the user. * @param {String} data.user.description The description for the user. * @returns {Promise} */ diff --git a/src/locales/en.json b/src/locales/en.json index dd5022ce..7bf215db 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -1251,6 +1251,7 @@ "Ramdisk ID": "Ramdisk ID", "Ramdisk Image": "Ramdisk Image", "Raw": "Raw", + "Real Name": "Real Name", "Reason": "Reason", "Reason: ": "Reason: ", "Reboot": "Reboot", @@ -1567,7 +1568,6 @@ "Transfer ID": "Transfer ID", "Transfer Name": "Transfer Name", "Transform Protocol": "Transform Protocol", - "True Name": "True Name", "Type": "Type", "UDPLite": "UDPLite", "USB Info": "USB Info", diff --git a/src/locales/zh.json b/src/locales/zh.json index 56c1c2f2..e28d32d4 100644 --- a/src/locales/zh.json +++ b/src/locales/zh.json @@ -1251,6 +1251,7 @@ "Ramdisk ID": "内存盘ID", "Ramdisk Image": "Ramdisk镜像", "Raw": "原始", + "Real Name": "真实姓名", "Reason": "原因", "Reason: ": "原因:", "Reboot": "重启", @@ -1567,7 +1568,6 @@ "Transfer ID": "转让ID", "Transfer Name": "转让名称", "Transform Protocol": "转换协议", - "True Name": "真实姓名", "Type": "类型", "UDPLite": "", "USB Info": "USB 信息", diff --git a/src/pages/identity/containers/User/Detail/index.jsx b/src/pages/identity/containers/User/Detail/index.jsx index e4fae746..219d9bae 100644 --- a/src/pages/identity/containers/User/Detail/index.jsx +++ b/src/pages/identity/containers/User/Detail/index.jsx @@ -85,8 +85,8 @@ export default class UserDetail extends Base { }, }, { - title: t('True Name'), - dataIndex: 'full_name', + title: t('Real Name'), + dataIndex: 'real_name', }, // { // title: t('User Group Num'), diff --git a/src/pages/identity/containers/User/actions/Create.jsx b/src/pages/identity/containers/User/actions/Create.jsx index e83c9b97..7f9c06f9 100644 --- a/src/pages/identity/containers/User/actions/Create.jsx +++ b/src/pages/identity/containers/User/actions/Create.jsx @@ -333,8 +333,8 @@ class CreateForm extends FormAction { colNum: 2, }, { - name: 'full_name', - label: t('True Name'), + name: 'real_name', + label: t('Real Name'), type: 'input', required: true, labelCol, diff --git a/src/pages/identity/containers/User/actions/Edit.jsx b/src/pages/identity/containers/User/actions/Edit.jsx index 8686cd28..e427faf7 100644 --- a/src/pages/identity/containers/User/actions/Edit.jsx +++ b/src/pages/identity/containers/User/actions/Edit.jsx @@ -89,7 +89,7 @@ class EditForm extends ModalAction { name, email, phone, - full_name, + real_name, description, domain_id, default_project_id, @@ -105,7 +105,7 @@ class EditForm extends ModalAction { default_project_id: project ? project.name : '', email, phone, - full_name, + real_name, description, }); } @@ -153,8 +153,8 @@ class EditForm extends ModalAction { validator: phoneNumberValidate, }, { - name: 'full_name', - label: t('True Name'), + name: 'real_name', + label: t('Real Name'), type: 'input', required: true, }, @@ -174,12 +174,12 @@ class EditForm extends ModalAction { } onSubmit = (values) => { - const { email, phone, full_name, description, name } = values; + const { email, phone, real_name, description, name } = values; const { id } = this.item; return globalUserStore.edit(id, { email, phone, - full_name, + real_name, description, name, }); diff --git a/src/pages/identity/containers/User/actionsInDomain/Create.jsx b/src/pages/identity/containers/User/actionsInDomain/Create.jsx index c199fa28..d84c1bf8 100644 --- a/src/pages/identity/containers/User/actionsInDomain/Create.jsx +++ b/src/pages/identity/containers/User/actionsInDomain/Create.jsx @@ -197,8 +197,8 @@ export default class CreateForm extends ModalAction { type: 'textarea', }, { - name: 'full_name', - label: t('True Name'), + name: 'real_name', + label: t('Real Name'), type: 'input', required: true, }, @@ -214,7 +214,7 @@ export default class CreateForm extends ModalAction { enabled, default_project_id, description, - full_name, + real_name, } = values; const { id: domain_id } = this.item; const data = { @@ -225,7 +225,7 @@ export default class CreateForm extends ModalAction { domain_id, enabled, description, - full_name, + real_name, default_project_id, }; // eslint-disable-next-line no-console diff --git a/src/pages/identity/containers/User/index.jsx b/src/pages/identity/containers/User/index.jsx index 33ce0f05..0bca8ac1 100644 --- a/src/pages/identity/containers/User/index.jsx +++ b/src/pages/identity/containers/User/index.jsx @@ -76,8 +76,8 @@ export default class User extends Base { }, }, { - title: t('True Name'), - dataIndex: 'full_name', + title: t('Real Name'), + dataIndex: 'real_name', isHideable: true, }, { @@ -164,8 +164,8 @@ export default class User extends Base { name: 'name', }, { - label: t('True Name'), - name: 'full_name', + label: t('Real Name'), + name: 'real_name', }, { label: t('Enabled'), diff --git a/src/stores/keystone/user.js b/src/stores/keystone/user.js index 8d5119d4..2a335919 100644 --- a/src/stores/keystone/user.js +++ b/src/stores/keystone/user.js @@ -337,13 +337,13 @@ export class UserStore extends Base { } @action - async edit(id, { email, phone, full_name, description, name }) { + async edit(id, { email, phone, real_name, description, name }) { const url = `${this.apiVersion}/users/${id}`; const reqBody = { user: { email, phone, - full_name, + real_name, description, name, }, diff --git a/test/e2e/integration/pages/identity/user.spec.js b/test/e2e/integration/pages/identity/user.spec.js index f04afaf4..06624b66 100644 --- a/test/e2e/integration/pages/identity/user.spec.js +++ b/test/e2e/integration/pages/identity/user.spec.js @@ -48,7 +48,7 @@ describe('The User Page', () => { .formInput('password', tmpPassword) .formInput('confirmPassword', tmpPassword) .formInput('phone', phone) - .formInput('full_name', name) + .formInput('real_name', name) .formButtonClick('more') .wait(2000) .formTransfer('select_project', projectName) diff --git a/test/e2e/support/resource-commands.js b/test/e2e/support/resource-commands.js index 34812622..287792fe 100644 --- a/test/e2e/support/resource-commands.js +++ b/test/e2e/support/resource-commands.js @@ -208,7 +208,7 @@ Cypress.Commands.add('createUser', ({ name }) => { .formInput('password', password) .formInput('confirmPassword', password) .formInput('phone', phone) - .formInput('full_name', name) + .formInput('real_name', name) .clickFormActionSubmitButton() .tableSearchText(name) .waitStatusGreen(7);