diff --git a/packages/rath-client/src/interfaces.ts b/packages/rath-client/src/interfaces.ts index 9518e464a..375d8c0c4 100644 --- a/packages/rath-client/src/interfaces.ts +++ b/packages/rath-client/src/interfaces.ts @@ -127,6 +127,10 @@ export interface PreferencePanelConfig { visMode: 'common' | 'dist'; nlg: boolean; excludeScaleZero: boolean; + viewSizeLimit: { + dimension: number; + measure: number; + } } export interface IDBFieldMeta { fid: string; diff --git a/packages/rath-client/src/loggers/dataImport.ts b/packages/rath-client/src/loggers/dataImport.ts index b3510c163..343bdca98 100644 --- a/packages/rath-client/src/loggers/dataImport.ts +++ b/packages/rath-client/src/loggers/dataImport.ts @@ -40,11 +40,7 @@ export async function dataBackup (file: File) { method: 'POST', credentials: 'include', body: data - }).then(res => res.json()) - .then(res => { - // eslint-disable-next-line no-console - console.log(res) - }).catch(err => { + }).then(res => res.json()).catch(err => { console.warn(err) }) } else { diff --git a/packages/rath-client/src/pages/dataSource/baseActions/mainActionButton.tsx b/packages/rath-client/src/pages/dataSource/baseActions/mainActionButton.tsx index 5b3efb738..c29de6ec1 100644 --- a/packages/rath-client/src/pages/dataSource/baseActions/mainActionButton.tsx +++ b/packages/rath-client/src/pages/dataSource/baseActions/mainActionButton.tsx @@ -5,6 +5,7 @@ import intl from 'react-intl-universal'; import { Menu, MenuButtonProps, MenuItem, MenuList, MenuPopover, MenuTrigger, SplitButton } from '@fluentui/react-components'; import { Poll24Regular } from '@fluentui/react-icons'; import va from '@vercel/analytics'; +import { toJS } from 'mobx'; import { EXPLORE_MODE, PIVOT_KEYS } from '../../../constants'; import { useGlobalStore } from '../../../store'; @@ -14,7 +15,7 @@ export const useActionModes = function () { const { exploreMode, taskMode } = commonStore; const { satisfyAnalysisCondition, fieldMetas } = dataSourceStore; const startMegaAutoAnalysis = useCallback(() => { - ltsPipeLineStore.startTask(taskMode).then(() => { + ltsPipeLineStore.startTask(taskMode, toJS(megaAutoStore.visualConfig.viewSizeLimit)).then(() => { megaAutoStore.emitViewChangeTransaction(0); }); commonStore.setAppKey(PIVOT_KEYS.megaAuto); diff --git a/packages/rath-client/src/pages/megaAutomation/index.tsx b/packages/rath-client/src/pages/megaAutomation/index.tsx index 42deb16e5..bdba1939f 100644 --- a/packages/rath-client/src/pages/megaAutomation/index.tsx +++ b/packages/rath-client/src/pages/megaAutomation/index.tsx @@ -2,7 +2,7 @@ import React, { useCallback, useRef } from 'react'; import { observer } from 'mobx-react-lite'; import styled from 'styled-components'; import intl from 'react-intl-universal'; -import { runInAction } from 'mobx'; +import { runInAction, toJS } from 'mobx'; import { DefaultButton, PrimaryButton } from '@fluentui/react'; import { useGlobalStore } from '../../store'; import { PIVOT_KEYS } from '../../constants'; @@ -82,7 +82,7 @@ const LTSPage: React.FC = () => { // }) // }, [megaAutoStore]) const startTask = useCallback(() => { - ltsPipeLineStore.startTask(taskMode).then(() => { + ltsPipeLineStore.startTask(taskMode, toJS(megaAutoStore.visualConfig.viewSizeLimit)).then(() => { megaAutoStore.emitViewChangeTransaction(0); }); commonStore.setAppKey(PIVOT_KEYS.megaAuto); diff --git a/packages/rath-client/src/pages/megaAutomation/preference.tsx b/packages/rath-client/src/pages/megaAutomation/preference.tsx index 27844c938..fd08e57c1 100644 --- a/packages/rath-client/src/pages/megaAutomation/preference.tsx +++ b/packages/rath-client/src/pages/megaAutomation/preference.tsx @@ -19,12 +19,13 @@ import { runInAction } from 'mobx'; import { useGlobalStore } from '../../store'; import { EXPLORE_VIEW_ORDER } from '../../store/megaAutomation'; import { IResizeMode } from '../../interfaces'; +import { Label } from '@fluentui/react-components'; const PreferencePanel: React.FC = () => { const { megaAutoStore } = useGlobalStore(); const { visualConfig, showPreferencePannel, nlgThreshold, vizMode } = megaAutoStore; - const { nlg } = visualConfig; + const { nlg, viewSizeLimit } = visualConfig; const orderOptions: IDropdownOption[] = Object.values(EXPLORE_VIEW_ORDER).map((or) => ({ text: intl.get(`megaAuto.orderBy.${or}`), @@ -52,8 +53,8 @@ const PreferencePanel: React.FC = () => { runInAction(() => { megaAutoStore.setShowPreferencePannel(false); megaAutoStore.refreshMainViewSpec(); - }) - }, [megaAutoStore]) + }); + }, [megaAutoStore]); const onRenderFooterContent = () => (