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

fix: protable search&reset button i18n #1153

Merged
merged 7 commits into from
Dec 30, 2020
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
2 changes: 1 addition & 1 deletion docs/I18N_USER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ the key can be like this : [basicModule].[moduleName].[elementName].[...desc]

## Global locale keys

we have already defined many global keys, before you do i18n, you can refer to [those](https://github.com/apache/apisix-dashboard/blob/master/src/locales/zh-CN/component.ts).
we have already defined many global keys, before you do i18n, you can refer to [those](https://github.com/apache/apisix-dashboard/blob/master/web/src/locales/zh-CN/component.ts).

## Recommended subkey naming

Expand Down
3 changes: 0 additions & 3 deletions web/src/pages/Consumer/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,10 @@ import { history, useIntl } from 'umi';
import { PlusOutlined } from '@ant-design/icons';

import { timestampToLocaleString } from '@/helpers';
import useForceIntl from '@/hooks/useForceIntl';

import { fetchList, remove } from './service';

const Page: React.FC = () => {
useForceIntl();

const ref = useRef<ActionType>();
const { formatMessage } = useIntl();

Expand Down
3 changes: 0 additions & 3 deletions web/src/pages/Route/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,12 @@ import { history, useIntl } from 'umi';
import { PlusOutlined, BugOutlined } from '@ant-design/icons';

import { timestampToLocaleString } from '@/helpers';
import useForceIntl from '@/hooks/useForceIntl';
import { fetchList, remove, fetchLabelList, updateRouteStatus } from './service';
import { DebugDrawView } from './components/DebugViews';

const { OptGroup, Option } = Select;

const Page: React.FC = () => {
useForceIntl();

const ref = useRef<ActionType>();
const { formatMessage } = useIntl();

Expand Down
2 changes: 0 additions & 2 deletions web/src/pages/SSL/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,8 @@ import { PlusOutlined } from '@ant-design/icons';

import { fetchList, remove as removeSSL } from '@/pages/SSL/service';
import { timestampToLocaleString } from '@/helpers';
import useForceIntl from '@/hooks/useForceIntl';

const Page: React.FC = () => {
useForceIntl();
const tableRef = useRef<ActionType>();
const { formatMessage } = useIntl();

Expand Down
8 changes: 4 additions & 4 deletions web/src/pages/Service/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,9 @@ import ProTable, { ActionType, ProColumns } from '@ant-design/pro-table';
import { PlusOutlined } from '@ant-design/icons';
import { Button, notification, Popconfirm, Space } from 'antd';

import useForceIntl from '@/hooks/useForceIntl';

import { fetchList, remove } from './service';

const Page: React.FC = () => {
useForceIntl();

const ref = useRef<ActionType>();
const { formatMessage } = useIntl();

Expand Down Expand Up @@ -96,6 +92,10 @@ const Page: React.FC = () => {
rowKey="id"
columns={columns}
request={fetchList}
search={{
searchText: formatMessage({ id: 'component.global.search' }),
resetText: formatMessage({ id: 'component.global.reset' }),
}}
toolBarRender={() => [
<Button type="primary" onClick={() => history.push(`/service/create`)}>
<PlusOutlined />
Expand Down
3 changes: 0 additions & 3 deletions web/src/pages/Upstream/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,10 @@ import { Popconfirm, Button, notification } from 'antd';
import { history, useIntl } from 'umi';
import { PlusOutlined } from '@ant-design/icons';
import { timestampToLocaleString } from '@/helpers';
import useForceIntl from '@/hooks/useForceIntl';

import { fetchList, remove } from './service';

const Page: React.FC = () => {
useForceIntl();

const ref = useRef<ActionType>();

const { formatMessage } = useIntl();
Expand Down