Skip to content
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
11 changes: 7 additions & 4 deletions src/pages/Route/Create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ import {
DEFAULT_STEP_1_DATA,
DEFAULT_STEP_2_DATA,
DEFAULT_STEP_3_DATA,
STEP_HEADER_2,
STEP_HEADER_4,
} from './constants';
import ResultView from './components/ResultView';
import styles from './Create.less';
Expand All @@ -36,6 +34,13 @@ type Props = {
};

const Page: React.FC<Props> = (props) => {

const { formatMessage } = useIntl();

const STEP_HEADER_2 = [formatMessage({ id: 'route.constants.define.api.request' }), formatMessage({ id: 'route.constants.preview' })];

const STEP_HEADER_4 = [formatMessage({ id: 'route.constants.define.api.request' }), formatMessage({ id: 'route.constants.define.api.backend.serve' }), formatMessage({ id: 'route.constants.plugin.configuration' }), formatMessage({ id: 'route.constants.preview' })];

const [step1Data, setStep1Data] = useState(DEFAULT_STEP_1_DATA);
const [step2Data, setStep2Data] = useState(DEFAULT_STEP_2_DATA);
const [step3Data, setStep3Data] = useState(DEFAULT_STEP_3_DATA);
Expand Down Expand Up @@ -65,8 +70,6 @@ const Page: React.FC<Props> = (props) => {
setStep3Data(data.step3Data);
});

const { formatMessage } = useIntl();

useEffect(() => {
if (props.route.path.indexOf('edit') !== -1) {
setupRoute(props.match.params.rid);
Expand Down
4 changes: 0 additions & 4 deletions src/pages/Route/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,3 @@ export const DEFAULT_STEP_2_DATA: RouteModule.Step2Data = {
export const DEFAULT_STEP_3_DATA: RouteModule.Step3Data = {
plugins: {},
};

export const STEP_HEADER_2 = ['定义 API 请求', '预览'];

export const STEP_HEADER_4 = ['定义 API 请求', '定义 API 后端服务', '插件配置', '预览'];