Skip to content

Commit

Permalink
chore: update Consumer (#1748)
Browse files Browse the repository at this point in the history
  • Loading branch information
juzhiyuan authored Apr 13, 2021
1 parent b3ce073 commit 419128d
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 23 deletions.
1 change: 1 addition & 0 deletions web/src/locales/en-US/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export default {
'component.global.loading': 'Loading',
'component.global.list': 'List',
'component.global.description': 'Description',
'component.global.description.required': 'Please enter the description',
'component.global.labels': 'Labels',
'component.global.version': 'Version',
'component.global.operation': 'Operation',
Expand Down
3 changes: 2 additions & 1 deletion web/src/locales/zh-CN/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ export default {
'component.global.edit.plugin': '配置插件',
'component.global.loading': '加载中',
'component.global.list': '列表',
'component.global.description': '描述信息',
'component.global.description': '描述',
'component.global.description.required': '请输入描述信息',
'component.global.labels': '标签',
'component.global.version': '路由版本',
'component.global.operation': '操作',
Expand Down
22 changes: 10 additions & 12 deletions web/src/pages/Consumer/Create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,12 @@ const Page: React.FC = (props) => {
(username ? update(username, data) : create(data))
.then(() => {
notification.success({
message: `${
username
? formatMessage({ id: 'component.global.edit' })
: formatMessage({ id: 'component.global.create' })
} ${formatMessage({ id: 'menu.consumer' })} ${formatMessage({
id: 'component.status.success',
})}`,
message: `${username
? formatMessage({ id: 'component.global.edit' })
: formatMessage({ id: 'component.global.create' })
} ${formatMessage({ id: 'menu.consumer' })} ${formatMessage({
id: 'component.status.success',
})}`,
});
history.push('/consumer/list');
})
Expand Down Expand Up @@ -99,11 +98,10 @@ const Page: React.FC = (props) => {
return (
<>
<PageContainer
title={`${
(props as any).match.params.username
? formatMessage({ id: 'component.global.edit' })
: formatMessage({ id: 'component.global.create' })
} ${formatMessage({ id: 'menu.consumer' })}`}
title={`${(props as any).match.params.username
? formatMessage({ id: 'page.consumer.configure' })
: formatMessage({ id: 'page.consumer.create' })
}`}
>
<Card bordered={false}>
<Steps current={step - 1} style={{ marginBottom: 30 }}>
Expand Down
2 changes: 1 addition & 1 deletion web/src/pages/Consumer/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ const Page: React.FC = () => {
];

return (
<PageContainer title={formatMessage({ id: 'page.consumer.list' })}>
<PageContainer title={formatMessage({ id: 'page.consumer.list' })} content={formatMessage({ id: "page.consumer.description" })}>
<ProTable<ConsumerModule.ResEntity>
actionRef={ref}
columns={columns}
Expand Down
9 changes: 2 additions & 7 deletions web/src/pages/Consumer/components/Step1.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,15 @@ const Step1: React.FC<Props> = ({ form, disabled }) => {
message: formatMessage({ id: 'page.consumer.form.itemRuleMessage.username' }),
},
]}
extra={formatMessage({ id: 'page.consumer.form.itemExtraMessage.username' })}
>
<Input
placeholder={`${formatMessage({ id: 'component.global.pleaseEnter' })} ${formatMessage({
id: 'page.consumer.username',
})}`}
placeholder={formatMessage({ id: 'page.consumer.username.required' })}
disabled={disabled || window.location.pathname.indexOf('edit') !== -1}
/>
</Form.Item>
<Form.Item label={formatMessage({ id: 'component.global.description' })} name="desc">
<Input.TextArea
placeholder={`${formatMessage({ id: 'component.global.pleaseEnter' })} ${formatMessage({
id: 'component.global.description',
})}`}
placeholder={formatMessage({ id: 'component.global.description.required' })}
disabled={disabled}
/>
</Form.Item>
Expand Down
6 changes: 5 additions & 1 deletion web/src/pages/Consumer/locales/en-US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ export default {
'page.consumer.notification.warning.enableAuthenticationPlugin':
'Please enable one authentication plugin',
'page.consumer.username': 'Name',
'page.consumer.username.required': 'Please enter the Consumer\'s name',
'page.consumer.updateTime': 'Update Time',
'page.consumer.list': 'Consumer List'
'page.consumer.list': 'Consumer List',
'page.consumer.description': 'Consumers are the consumers of Routes, e.g developers, end users, API calls, etc. When creating a consumer, you need to bind at least one Authentication plugin.',
'page.consumer.create': 'Create Consumer',
'page.consumer.configure': 'Configure Consumer',
};
6 changes: 5 additions & 1 deletion web/src/pages/Consumer/locales/zh-CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ export default {
'page.consumer.form.itemExtraMessage.username': '名称需唯一',
'page.consumer.notification.warning.enableAuthenticationPlugin': '请启用一种身份认证类插件',
'page.consumer.username': '名称',
'page.consumer.username.required': '请输入消费者名称',
'page.consumer.updateTime': '更新时间',
'page.consumer.list': '消费者列表'
'page.consumer.list': '消费者列表',
'page.consumer.description': '消费者是路由的消费方,形式包括开发者、最终用户、API 调用等。创建消费者时,需绑定至少一个认证类插件。',
'page.consumer.create': '创建消费者',
'page.consumer.configure': '配置消费者',
};

0 comments on commit 419128d

Please sign in to comment.