display the namespace on add,edit,detail configuration page #(9827) (#9845)

* display the namespace on add,edit,detail configuration page and resolve junit test problem #(9827)

* delete duplicate UT code

---------

Co-authored-by: githubcheng2978 <yeliang.cheng@freemud.com>
This commit is contained in:
githubcheng2978 2023-02-14 17:23:17 +08:00 committed by GitHub
parent 0c9f08130e
commit e736455713
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 29 additions and 0 deletions

View File

@ -262,6 +262,7 @@ const I18N_CONF = {
sourceIp: 'Source IP',
configureContent: 'Configuration Content',
back: 'Back',
namespace: 'Namespace',
},
DashboardCard: {
importantReminder0: 'Important reminder',
@ -385,6 +386,7 @@ const I18N_CONF = {
confirmSyanx: 'The configuration information may has a syntax error. Are you sure to submit?',
dataIdExists: 'Configuration already exists. Enter a new Data ID and Group name.',
dataRequired: 'Data cannot be empty, submission failed',
namespace: 'Namespace',
},
CloneDialog: {
terminate: 'Terminate',
@ -446,6 +448,7 @@ const I18N_CONF = {
dialogCurrentArea: 'Current Value',
dialogOriginalArea: 'Original Value',
publishFailed403: 'Publish failed. No operation permission',
namespace: 'Namespace',
},
EditorNameSpace: {
notice: 'Notice',
@ -544,6 +547,7 @@ const I18N_CONF = {
groupInput: 'Please Enter Group',
namespaceSelect: 'Please Select namespace',
configNotFind: 'The Configuration is not found, Please select again',
namespace: 'Namespace',
},
ConfigRollback: {
rollBack: 'Roll Back',
@ -561,6 +565,7 @@ const I18N_CONF = {
update: 'Update',
insert: 'Insert',
additionalRollbackMessage: 'This operation will delete the below config!',
namespace: 'Namespace',
},
UserManagement: {
userManagement: 'User Management',

View File

@ -260,6 +260,7 @@ const I18N_CONF = {
operator: '操作人',
sourceIp: '来源 IP',
back: '返回',
namespace: '命名空间',
},
DashboardCard: {
importantReminder0: '重要提醒',
@ -381,6 +382,7 @@ const I18N_CONF = {
confirmSyanx: '配置信息可能有语法错误, 确定提交吗?',
dataIdExists: '配置已存在, 试试别的dataid和group的组合吧',
dataRequired: '数据不能为空, 提交失败',
namespace: '命名空间',
},
CloneDialog: {
terminate: '终止克隆',
@ -442,6 +444,7 @@ const I18N_CONF = {
dialogCurrentArea: '当前值',
dialogOriginalArea: '原始值',
publishFailed403: '发布失败,请检查是否有权限',
namespace: '命名空间',
},
EditorNameSpace: {
notice: '提示',
@ -539,6 +542,7 @@ const I18N_CONF = {
groupInput: '请输入Group',
namespaceSelect: '请选择命名空间',
configNotFind: '未查询到指定配置,请重新选择',
namespace: '命名空间',
},
ConfigRollback: {
rollBack: '回滚配置',
@ -556,6 +560,7 @@ const I18N_CONF = {
update: '更新',
insert: '插入',
additionalRollbackMessage: '此操作将删除以下配置',
namespace: '命名空间',
},
UserManagement: {
userManagement: '用户管理',

View File

@ -318,6 +318,9 @@ class ConfigDetail extends React.Component {
''
)}
<Form inline={false} field={this.field} {...formItemLayout}>
<FormItem label={locale.namespace} required>
<p>{this.tenant}</p>
</FormItem>
<FormItem label={'Data ID'} required>
<Input htmlType={'text'} readOnly {...init('dataId')} />
</FormItem>

View File

@ -613,6 +613,9 @@ class ConfigEditor extends React.Component {
)}
<Form field={this.field}>
<FormItem label={locale.namespace} required>
<p>{this.tenant}</p>
</FormItem>
<FormItem label="Data ID" {...formItemLayout}>
<Input
disabled

View File

@ -92,6 +92,7 @@ class ConfigEditor extends React.Component {
componentDidMount() {
const isNewConfig = !getParams('dataId');
const group = getParams('group').trim();
this.tenant = getParams('namespace') || '';
this.setState({ isNewConfig }, () => {
if (!isNewConfig) {
this.changeForm(
@ -493,6 +494,9 @@ class ConfigEditor extends React.Component {
</Tab>
)}
<Form className="new-config-form" {...formItemLayout}>
<Form.Item label={locale.namespace} required>
<p>{this.tenant}</p>
</Form.Item>
<Form.Item label="Data ID" required {...dataIdError}>
<Input
value={form.dataId}

View File

@ -196,6 +196,9 @@ class ConfigRollback extends React.Component {
<div>
<h1>{locale.configurationRollback}</h1>
<Form field={this.field}>
<FormItem label={locale.namespace} required {...formItemLayout}>
<p>{this.tenant}</p>
</FormItem>
<FormItem label="Data ID" required {...formItemLayout}>
<Input htmlType="text" readOnly {...init('dataId')} />
<div style={{ marginTop: 10 }}>

View File

@ -113,6 +113,9 @@ class HistoryDetail extends React.Component {
<div>
<h1>{locale.historyDetails}</h1>
<Form field={this.field}>
<Form.Item label={locale.namespace} required {...formItemLayout}>
<p>{this.tenant}</p>
</Form.Item>
<Form.Item label="Data ID" required {...formItemLayout}>
<Input htmlType="text" readOnly {...init('dataId')} />
<div style={{ marginTop: 10 }}>

View File

@ -471,6 +471,9 @@ class NewConfig extends React.Component {
>
<h1>{locale.newListing}</h1>
<Form className="new-config-form" field={this.field} {...formItemLayout}>
<Form.Item label={locale.namespace} required>
<p>{this.tenant}</p>
</Form.Item>
<FormItem label={'Data ID'} required>
<Input
{...init('dataId', {