Skip to content

Commit

Permalink
[Refactor][Web] Move DataStudioNew to DataStudio (#3919)
Browse files Browse the repository at this point in the history
Signed-off-by: Zzm0809 <[email protected]>
Co-authored-by: Zzm0809 <[email protected]>
  • Loading branch information
Zzm0809 and Zzm0809 authored Nov 18, 2024
1 parent 9188b9a commit 49e994e
Show file tree
Hide file tree
Showing 97 changed files with 184 additions and 179 deletions.
2 changes: 1 addition & 1 deletion dinky-web/config/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default [
name: 'datastudio',
icon: 'CodeOutlined',
footerRender: false,
component: './DataStudioNew'
component: './DataStudio'
},
{
path: '/devops',
Expand Down
4 changes: 2 additions & 2 deletions dinky-web/src/components/CustomEditor/CodeEdit/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ import { Editor, loader, Monaco, OnChange } from '@monaco-editor/react';
import { connect } from '@umijs/max';
import useMemoCallback from 'rc-menu/es/hooks/useMemoCallback';
import { memo, useCallback, useContext, useRef } from 'react';
import { DataStudioState } from '@/pages/DataStudioNew/model';
import { DataStudioState } from '@/pages/DataStudio/model';
import ITextModel = editor.ITextModel;
import CompletionItem = languages.CompletionItem;
import CompletionContext = languages.CompletionContext;
import CompletionList = languages.CompletionList;
import ProviderResult = languages.ProviderResult;
import LanguageSelector = languages.LanguageSelector;
import { DevopsContext } from '@/pages/DevOps';
import { DataStudioContext, DataStudioContextType } from '@/pages/DataStudioNew/DataStudioContext';
import { DataStudioContext, DataStudioContextType } from '@/pages/DataStudio/DataStudioContext';

loader.config({ monaco });

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
*
*/

import { CenterTab, DataStudioState } from '@/pages/DataStudioNew/model';
import { CenterTab, DataStudioState } from '@/pages/DataStudio/model';
import RightTagsRouter from '@/pages/RegCenter/DataSource/components/DataSourceDetail/RightTagsRouter';
import { QueryParams } from '@/pages/RegCenter/DataSource/components/DataSourceDetail/RightTagsRouter/data';
import { connect } from '@@/exports';
import { mapDispatchToProps } from '@/pages/DataStudioNew/DvaFunction';
import { mapDispatchToProps } from '@/pages/DataStudio/DvaFunction';

const DataSourceDetail = (props: CenterTab) => {
const { params } = props;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import { l } from '@/utils/intl';
import { Divider, Typography } from 'antd';
import { Fragment } from 'react';
import { KEY_BOARD_MIDDLE } from '@/pages/DataStudioNew/CenterTabContent/KeyBoard/constant';
import { KEY_BOARD_MIDDLE } from '@/pages/DataStudio/CenterTabContent/KeyBoard/constant';

const { Title, Paragraph, Text } = Typography;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { l } from '@/utils/intl';
import { Link } from '@umijs/max';
import { Divider, Typography } from 'antd';
import { Fragment } from 'react';
import { QUICK_GUIDE } from '@/pages/DataStudioNew/CenterTabContent/QuickGuide/constant';
import { QUICK_GUIDE } from '@/pages/DataStudio/CenterTabContent/QuickGuide/constant';

const { Title, Paragraph } = Typography;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { TagAlignLeft } from '@/components/StyledComponents';
import { Tag } from 'antd';
import { ProFormSelect } from '@ant-design/pro-components';
import { l } from '@/utils/intl';
import { TaskState, TempData } from '@/pages/DataStudioNew/type';
import { TaskState, TempData } from '@/pages/DataStudio/type';

export default (props: { databaseDataList: TempData['dataSourceDataList']; data: TaskState }) => {
const dataSourceData: Record<string, React.ReactNode> = {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { l } from '@/utils/intl';
import { ProFormSelect } from '@ant-design/pro-components';

import '../index.less';
import { EnvType } from '@/pages/DataStudioNew/type';
import { EnvType } from '@/pages/DataStudio/type';

export const SelectFlinkEnv = memo((params: { flinkEnv: EnvType[] }) => {
const { flinkEnv } = params;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import { ProFormCascader } from '@ant-design/pro-form/lib';
import { CascaderProps, Tag } from 'antd';
import { DefaultOptionType } from 'antd/es/select';
import { FlinkCluster } from '@/pages/DataStudioNew/type';
import { FlinkCluster } from '@/pages/DataStudio/type';
import { memo } from 'react';

type Option = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import styles from '../index.less';
import {
DIFF_EDITOR_PARAMS,
PARAM_DIFF_TABLE_COL
} from '@/pages/DataStudioNew/CenterTabContent/SqlTask/constants';
} from '@/pages/DataStudio/CenterTabContent/SqlTask/constants';

loader.config({ monaco });

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ import { l } from '@/utils/intl';
import { InfoCircleOutlined } from '@ant-design/icons';
import { SWITCH_OPTIONS } from '@/services/constants';
import { ProFormDependency } from '@ant-design/pro-form';
import { ProFormFlinkConfig } from '@/pages/DataStudioNew/CenterTabContent/SqlTask/TaskConfig/ProFormFlinkConfig';
import { ProFormFlinkUdfConfig } from '@/pages/DataStudioNew/CenterTabContent/SqlTask/TaskConfig/ProFormFlinkUdfConfig';
import { ProFormFlinkConfig } from '@/pages/DataStudio/CenterTabContent/SqlTask/TaskConfig/ProFormFlinkConfig';
import { ProFormFlinkUdfConfig } from '@/pages/DataStudio/CenterTabContent/SqlTask/TaskConfig/ProFormFlinkUdfConfig';
import React, { useEffect, useRef, useState } from 'react';
import { TaskState, TempData } from '@/pages/DataStudioNew/type';
import { TaskState, TempData } from '@/pages/DataStudio/type';
import { JOB_LIFE_CYCLE } from '@/pages/DevOps/constants';
import { Alert } from 'antd';
import { SAVE_POINT_TYPE } from '@/pages/DataStudioNew/constants';
import { buildAlertGroupOptions } from '@/pages/DataStudioNew/CenterTabContent/SqlTask/TaskConfig/function';
import { SAVE_POINT_TYPE } from '@/pages/DataStudio/constants';
import { buildAlertGroupOptions } from '@/pages/DataStudio/CenterTabContent/SqlTask/TaskConfig/function';

export const BasicConfig = (props: {
tempData: TempData;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import FlinkOptionsSelect from '@/components/Flink/OptionsSelect';
import React, { useState } from 'react';
import { DefaultOptionType } from 'antd/es/select';
import CodeShow from '@/components/CustomEditor/CodeShow';
import { calculatorWidth } from '@/pages/DataStudioNew/CenterTabContent/SqlTask/TaskConfig/function';
import { calculatorWidth } from '@/pages/DataStudio/CenterTabContent/SqlTask/TaskConfig/function';

export const ProFormFlinkConfig = (props: {
containerWidth: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ import FlinkUdfOptionsSelect from '@/components/Flink/UdfSelect';
import React, { useState } from 'react';
import { DefaultOptionType } from 'antd/es/select';
import { TaskUdfRefer } from '@/types/Studio/data';
import { calculatorWidth } from '@/pages/DataStudioNew/CenterTabContent/SqlTask/TaskConfig/function';
import {TaskState} from "@/pages/DataStudioNew/type";
import { calculatorWidth } from '@/pages/DataStudio/CenterTabContent/SqlTask/TaskConfig/function';
import { TaskState } from '@/pages/DataStudioNew/type';

export const ProFormFlinkUdfConfig = (props: {
containerWidth: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ import { l } from '@/utils/intl';
import React from 'react';
import { InfoCircleOutlined } from '@ant-design/icons';
import { DIALECT, SWITCH_OPTIONS } from '@/services/constants';
import { TaskState, TempData } from '@/pages/DataStudioNew/type';
import { BasicConfig } from '@/pages/DataStudioNew/CenterTabContent/SqlTask/TaskConfig/BasicConfig';
import { isSql, assert } from '@/pages/DataStudioNew/utils';
import { TaskState, TempData } from '@/pages/DataStudio/type';
import { BasicConfig } from '@/pages/DataStudio/CenterTabContent/SqlTask/TaskConfig/BasicConfig';
import { isSql, assert } from '@/pages/DataStudio/utils';
import { DataSources } from '@/types/RegCenter/data';
import { TagAlignLeft } from '@/components/StyledComponents';
import { JOB_LIFE_CYCLE } from '@/pages/DevOps/constants';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
import { l } from '@/utils/intl';
import { Descriptions } from 'antd';
import Paragraph from 'antd/es/typography/Paragraph';
import { TaskState } from '@/pages/DataStudioNew/type';
import { showFirstLevelOwner, showSecondLevelOwners } from '@/pages/DataStudioNew/function';
import { TaskState } from '@/pages/DataStudio/type';
import { showFirstLevelOwner, showSecondLevelOwners } from '@/pages/DataStudio/function';
import { UserBaseInfo } from '@/types/AuthCenter/data';

export const TaskInfo = (props: { params: TaskState; users: UserBaseInfo.User[] }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*
*/

import { CenterTab, DataStudioState } from '@/pages/DataStudioNew/model';
import { CenterTab, DataStudioState } from '@/pages/DataStudio/model';
import { Button, Col, Divider, Flex, Row, Skeleton, TabsProps } from 'antd';
import '../index.less';
import React, { memo, useCallback, useEffect, useRef, useState } from 'react';
Expand All @@ -43,17 +43,17 @@ import {
SafetyCertificateOutlined,
SaveOutlined
} from '@ant-design/icons';
import RunToolBarButton from '@/pages/DataStudioNew/components/RunToolBarButton';
import RunToolBarButton from '@/pages/DataStudio/components/RunToolBarButton';
import { connect, useModel } from '@umijs/max';
import CusPanelResizeHandle from '@/pages/DataStudioNew/components/CusPanelResizeHandle';
import CusPanelResizeHandle from '@/pages/DataStudio/components/CusPanelResizeHandle';
import { ProForm, ProFormInstance } from '@ant-design/pro-components';
import { useAsyncEffect, useFullscreen } from 'ahooks';
import { SelectFlinkEnv } from '@/pages/DataStudioNew/CenterTabContent/RunToolbar/SelectFlinkEnv';
import { SelectFlinkRunMode } from '@/pages/DataStudioNew/CenterTabContent/RunToolbar/SelectFlinkRunMode';
import { mapDispatchToProps } from '@/pages/DataStudioNew/DvaFunction';
import { TaskInfo } from '@/pages/DataStudioNew/CenterTabContent/SqlTask/TaskInfo';
import { HistoryVersion } from '@/pages/DataStudioNew/CenterTabContent/SqlTask/HistoryVersion';
import { FlinkTaskRunType, StudioLineageParams, TaskState } from '@/pages/DataStudioNew/type';
import { SelectFlinkEnv } from '@/pages/DataStudio/CenterTabContent/RunToolbar/SelectFlinkEnv';
import { SelectFlinkRunMode } from '@/pages/DataStudio/CenterTabContent/RunToolbar/SelectFlinkRunMode';
import { mapDispatchToProps } from '@/pages/DataStudio/DvaFunction';
import { TaskInfo } from '@/pages/DataStudio/CenterTabContent/SqlTask/TaskInfo';
import { HistoryVersion } from '@/pages/DataStudio/CenterTabContent/SqlTask/HistoryVersion';
import { FlinkTaskRunType, StudioLineageParams, TaskState } from '@/pages/DataStudio/type';
import { JOB_LIFE_CYCLE } from '@/pages/DevOps/constants';
import { debounce } from 'lodash';
import {
Expand All @@ -64,22 +64,22 @@ import {
explainSql,
getJobPlan,
getTaskDetails
} from '@/pages/DataStudioNew/service';
} from '@/pages/DataStudio/service';
import { l } from '@/utils/intl';
import { editor } from 'monaco-editor';
import { DataStudioActionType } from '@/pages/DataStudioNew/data.d';
import { DataStudioActionType } from '@/pages/DataStudio/data.d';
import { getDataByParams, handlePutDataJson, queryDataByParams } from '@/services/BusinessCrud';
import { API_CONSTANTS } from '@/services/endpoints';
import { Jobs, LineageDetailInfo } from '@/types/DevOps/data';
import { isStatusDone, lockTask, matchLanguage } from '@/pages/DataStudioNew/function';
import { isStatusDone, lockTask, matchLanguage } from '@/pages/DataStudio/function';
import { PushpinIcon } from '@/components/Icons/CustomIcons';
import { assert, isSql } from '@/pages/DataStudioNew/utils';
import { assert, isSql } from '@/pages/DataStudio/utils';
import { DIALECT } from '@/services/constants';
import { SysConfigStateType } from '@/pages/SettingCenter/GlobalSetting/model';
import CodeEdit from '@/components/CustomEditor/CodeEdit';
import DiffModal from '@/pages/DataStudioNew/CenterTabContent/SqlTask/DiffModal';
import TaskConfig from '@/pages/DataStudioNew/CenterTabContent/SqlTask/TaskConfig';
import SelectDb from '@/pages/DataStudioNew/CenterTabContent/RunToolbar/SelectDb';
import DiffModal from '@/pages/DataStudio/CenterTabContent/SqlTask/DiffModal';
import TaskConfig from '@/pages/DataStudio/CenterTabContent/SqlTask/TaskConfig';
import SelectDb from '@/pages/DataStudio/CenterTabContent/RunToolbar/SelectDb';

export type FlinkSqlProps = {
showDesc: boolean;
Expand Down Expand Up @@ -418,13 +418,18 @@ export const SqlTask = memo((props: FlinkSqlProps & any) => {
params: {
taskId: params.taskId,
columns: res.data?.result?.columns ?? [],
rowData: res.data?.result?.rowData ?? [],
rowData: res.data?.result?.rowData ?? []
}
});
setCurrentState((prevState) => {
return {
...prevState,
status: res.data.status === 'SUCCESS' ? (res.data.pipeline?'RUNNING':'SUCCESS') : res.data.status
status:
res.data.status === 'SUCCESS'
? res.data.pipeline
? 'RUNNING'
: 'SUCCESS'
: res.data.status
};
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

import { Divider } from 'antd';
import React, { memo } from 'react';
import KeyBoard from '@/pages/DataStudioNew/CenterTabContent/KeyBoard';
import QuickGuide from '@/pages/DataStudioNew/CenterTabContent/QuickGuide';
import KeyBoard from '@/pages/DataStudio/CenterTabContent/KeyBoard';
import QuickGuide from '@/pages/DataStudio/CenterTabContent/QuickGuide';

export default memo(() => {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ import {
SwitcherOutlined,
SyncOutlined
} from '@ant-design/icons';
import { leftDefaultShowTab } from '@/pages/DataStudioNew/Toolbar/ToolbarRoute';
import { leftDefaultShowTab } from '@/pages/DataStudio/Toolbar/ToolbarRoute';
import { l } from '@/utils/intl';
import * as Algorithm from 'rc-dock/src/Algorithm';
import { createNewPanel } from '@/pages/DataStudioNew/DockLayoutFunction';
import { ToolbarPosition, ToolbarRoute } from '@/pages/DataStudioNew/Toolbar/data.d';
import { DataStudioActionType } from '@/pages/DataStudioNew/data.d';
import { createNewPanel } from '@/pages/DataStudio/DockLayoutFunction';
import { ToolbarPosition, ToolbarRoute } from '@/pages/DataStudio/Toolbar/data.d';
import { DataStudioActionType } from '@/pages/DataStudio/data.d';

const quickGuideTab: TabData = {
closable: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
*/

import { BoxData } from 'rc-dock/es';
import { DataStudioState } from '@/pages/DataStudioNew/model';
import { ToolbarPosition, ToolbarRoute } from '@/pages/DataStudioNew/Toolbar/data.d';
import { DataStudioState } from '@/pages/DataStudio/model';
import { ToolbarPosition, ToolbarRoute } from '@/pages/DataStudio/Toolbar/data.d';
import { PanelData, TabData } from 'rc-dock/es/DockData';
import { DockLayout, LayoutData } from 'rc-dock';
import { Filter } from 'rc-dock/es/Algorithm';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*
*/

import { STUDIO_MODEL, STUDIO_MODEL_ASYNC } from '@/pages/DataStudioNew/model';
import { STUDIO_MODEL, STUDIO_MODEL_ASYNC } from '@/pages/DataStudio/model';
import { Dispatch } from '@umijs/max';
import {
CenterTabDTO,
Expand All @@ -26,7 +26,7 @@ import {
SaveToolbarLayoutDTO,
SetLayoutDTO,
UpdateActionDTO
} from '@/pages/DataStudioNew/type';
} from '@/pages/DataStudio/type';
import { CONFIG_MODEL_ASYNC } from '@/pages/SettingCenter/GlobalSetting/model';

export const mapDispatchToProps = (dispatch: Dispatch) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import { StopTwoTone } from '@ant-design/icons';
import { Col, Modal, Progress, Row, Space } from 'antd';
import React from 'react';
import { JobRunningMsgType } from '@/pages/DataStudioNew/type';
import { JobRunningMsgType } from '@/pages/DataStudio/type';

type JobRunningModalProps = {
visible: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import { Dropdown } from 'antd';
import { MenuItemType } from 'antd/es/menu/interface';
import { MenuInfo } from 'rc-menu/es/interface';
import React from 'react';
import { RightMenuItemProps } from '@/pages/DataStudioNew/data.d';
import { DataStudioState } from '@/pages/DataStudioNew/model';
import { RightMenuItemProps } from '@/pages/DataStudio/data.d';
import { DataStudioState } from '@/pages/DataStudio/model';
import { l } from '@/utils/intl';

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ import { DefaultOptionType } from 'rc-select/lib/Select';
import React, { useEffect, useState } from 'react';
import { getMSCatalogs, getMSColumns, getMSSchemaInfo } from './service';
import { useAsyncEffect } from 'ahooks';
import { CenterTab, DataStudioState } from '@/pages/DataStudioNew/model';
import { mapDispatchToProps } from '@/pages/DataStudioNew/DvaFunction';
import { isSql } from '@/pages/DataStudioNew/utils';
import { TableDataNode } from '@/pages/DataStudioNew/Toolbar/Catalog/data';
import { DataStudioActionType } from '@/pages/DataStudioNew/data.d';
import { CenterTab, DataStudioState } from '@/pages/DataStudio/model';
import { mapDispatchToProps } from '@/pages/DataStudio/DvaFunction';
import { isSql } from '@/pages/DataStudio/utils';
import { TableDataNode } from '@/pages/DataStudio/Toolbar/Catalog/data';
import { DataStudioActionType } from '@/pages/DataStudio/data.d';

type CatalogState = {
envId?: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import { postAll } from '@/services/api';
import { API_CONSTANTS } from '@/services/endpoints';
import { StudioMetaStoreParam } from '@/pages/DataStudioNew/Toolbar/Catalog/data';
import { StudioMetaStoreParam } from '@/pages/DataStudio/Toolbar/Catalog/data';

export async function getMSSchemaInfo(params: StudioMetaStoreParam) {
return (await postAll(API_CONSTANTS.STUDIO_GET_MSSCHEMA_INFO, params)).data;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ import { memo, useEffect, useRef, useState } from 'react';
import { clearDataSourceTable, getDataSourceList, showDataSourceTable } from './service';
import { useAsyncEffect } from 'ahooks';
import { ProFormCascader } from '@ant-design/pro-form/lib';
import { CenterTab, DataStudioState } from '@/pages/DataStudioNew/model';
import { mapDispatchToProps } from '@/pages/DataStudioNew/DvaFunction';
import { CenterTab, DataStudioState } from '@/pages/DataStudio/model';
import { mapDispatchToProps } from '@/pages/DataStudio/DvaFunction';
import { connect } from '@umijs/max';
import { DataStudioActionType } from '@/pages/DataStudioNew/data.d';
import { DataStudioActionType } from '@/pages/DataStudio/data.d';

interface Option {
value: number | string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ import { getData } from '@/services/api';
import { Cluster } from '@/types/RegCenter/data';
import { CLUSTER_TYPE_OPTIONS, ClusterType } from '@/pages/RegCenter/Cluster/constants';
import { l } from '@/utils/intl';
import TerminalContent from '@/pages/DataStudioNew/Toolbar/FlinkSqlClient/Terminal/TerminalContent';
import TerminalContent from '@/pages/DataStudio/Toolbar/FlinkSqlClient/Terminal/TerminalContent';
import {
getTermConfig,
setTermConfig,
TermProps
} from '@/pages/DataStudioNew/Toolbar/FlinkSqlClient/Terminal/TerminalConfig';
} from '@/pages/DataStudio/Toolbar/FlinkSqlClient/Terminal/TerminalConfig';

const TerminalTab = () => {
// const [form] = Form.useForm();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import React, { useRef, useState } from 'react';
import { Tabs } from 'antd';
import './index.less';
import TerminalTab from '@/pages/DataStudioNew/Toolbar/FlinkSqlClient/Terminal';
import TerminalTab from '@/pages/DataStudio/Toolbar/FlinkSqlClient/Terminal';
type TargetKey = React.MouseEvent | React.KeyboardEvent | string;
type TabItem = {
label: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { Catalogue } from '@/types/Studio/data';
import { ModalForm } from '@ant-design/pro-components';
import { Form } from 'antd';
import React, { useEffect } from 'react';
import FolderForm from '@/pages/DataStudioNew/Toolbar/Project/FolderModal/FolderForm';
import FolderForm from '@/pages/DataStudio/Toolbar/Project/FolderModal/FolderForm';

type JobModalProps = {
onCancel: () => void;
Expand Down
Loading

0 comments on commit 49e994e

Please sign in to comment.