Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
1d75ef0
[feature]: init dms kit
LZS911 Aug 6, 2025
4017602
[feature](kit): update generate script
LZS911 Aug 11, 2025
e44a060
temp commit
LZS911 Aug 11, 2025
603139a
[feature](kit): complete the kit package
LZS911 Aug 12, 2025
1f9a95c
fix: update pnpm lock file
LZS911 Aug 12, 2025
53ae874
fix: add postinstall script
LZS911 Aug 12, 2025
d850bf0
build(icons): add publish todo
LZS911 Aug 12, 2025
08e561a
feat: update dms kit
LZS911 Aug 14, 2025
a08b7c8
feat(shared、icons): refactor publish pipeline to build in temp dir wi…
LZS911 Aug 15, 2025
d82b8bb
Merge pull request #698 from actiontech/feature/init-dms-kit
Rain-1214 Aug 15, 2025
d3e6711
dms-kit
tianzuzhao Aug 25, 2025
88663ca
buildkit
tianzuzhao Aug 25, 2025
2b72d3f
prettier
tianzuzhao Aug 25, 2025
df79286
update github workflow
tianzuzhao Aug 25, 2025
3cfa686
handle comments
tianzuzhao Aug 25, 2025
7dc331a
fixbug
tianzuzhao Aug 25, 2025
6358509
update packagejson
tianzuzhao Aug 26, 2025
47bbb76
update packagejson
tianzuzhao Aug 26, 2025
cfe0c5a
Merge pull request #707 from actiontech/feature/dms-kit
LZS911 Sep 1, 2025
cf89029
dms-kit docs
tianzuzhao Sep 1, 2025
731e3dd
remove package
tianzuzhao Sep 4, 2025
f8f0ad5
set ignore
tianzuzhao Sep 4, 2025
3663a9e
fixbug
tianzuzhao Sep 4, 2025
d63b4ef
Merge pull request #720 from actiontech/feature/dms-kit
LZS911 Sep 4, 2025
9004f8d
[feature]: Add user guide modal
zzyangh Sep 11, 2025
05303fe
update dms-kit
LZS911 Sep 11, 2025
bf0efdd
[fix]: Optimize code
zzyangh Sep 11, 2025
e673d3b
[test]: Update unit tests
zzyangh Sep 11, 2025
8bbfcf1
fix error
LZS911 Sep 11, 2025
590a14f
Merge pull request #730 from actiontech/feature/update-dms-kit
Rain-1214 Sep 11, 2025
32c1f71
[fix](Nav): enhance navigation conditions
zzyangh Sep 11, 2025
5362bbe
Merge branch 'temporary/support-cloub-beaver' into feature/user-guide-2
zzyangh Sep 11, 2025
1131de7
[chore]: Change import syntax
zzyangh Sep 11, 2025
8ff25c7
[fix](Nav): Delete environment variable isPROD
zzyangh Sep 12, 2025
1ff3bd9
Merge pull request #729 from actiontech/feature/user-guide-2
LZS911 Sep 12, 2025
1099391
[feat]: support odc to create export work orders and fix dms-kit bug
LZS911 Sep 17, 2025
153371c
[test]: update snapshot
LZS911 Sep 17, 2025
c8f5fbe
[feature](Account&Nav): Update user guide and availability zone inst…
zzyangh Sep 18, 2025
7f6fd42
[test]: Update unit tests
zzyangh Sep 18, 2025
707c44b
[test]: Update unit test snap file
zzyangh Sep 18, 2025
1018593
Merge pull request #736 from actiontech/feature/support-export-data-w…
Rain-1214 Sep 18, 2025
8711919
Merge pull request #737 from actiontech/feature/user-guide-2
LZS911 Sep 19, 2025
be02d12
[refactor](useRecentlySelectedZone): Remove the dependency on Redux
zzyangh Sep 25, 2025
92ba827
[chore]: Cancel the file changes to tsconfig
zzyangh Sep 25, 2025
de3a591
Merge pull request #743 from actiontech/refactor/zone
LZS911 Sep 25, 2025
9324f8e
[fix]: Word spelling error
zzyangh Sep 25, 2025
49d263e
[fix]: Add synchronous state subscription
zzyangh Sep 25, 2025
049009e
Merge pull request #744 from actiontech/refactor/zone
LZS911 Sep 25, 2025
b31fa63
[chore]: Export useRecentlySelectedZone in index
zzyangh Sep 26, 2025
15b8dff
Merge pull request #746 from actiontech/refactor/zone
LZS911 Sep 26, 2025
c655628
[chore]: Replace the ActiontechTable component
zzyangh Sep 28, 2025
a50b2cc
[test]: Update unit test snap file
zzyangh Sep 28, 2025
a2f6578
Merge pull request #747 from actiontech/chore/replace-table
LZS911 Sep 28, 2025
d55214b
[feature](dms-kit): update package version
LZS911 Sep 28, 2025
373f82d
Merge branch 'main' into temporary/support-cloub-beaver-2
zzyangh Sep 28, 2025
5bc1a6e
[test]: Update unit tests
zzyangh Sep 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ dist
/build
/packages/icons-svg/es/*
/packages/icons-svg/lib/*
/packages/dms-kit/lib/*
/packages/dms-kit/.dumi/tmp*

# misc
.DS_Store
Expand Down
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
registry=https://registry.npmmirror.com
@actiontech:registry=http://10.186.18.19:4873/
4 changes: 3 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
*.snap
*.md
*.md
**/demo/**
**/demos/**
37 changes: 37 additions & 0 deletions DumiHeaderExtraSlots/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import React from 'react';
import Select from 'antd/es/select';
import { HeaderExtraStyleWrapper } from './style';

// 该值取自 /packages/**/.dumirc.ts的define字段
declare const VERSION: string;

const HeaderExtra: React.FC<{ pkg?: 'dms-kit' | 'icons' }> = ({
pkg = 'dms-kit'
}) => {
const curVersion = Number(VERSION.split('.')[0]);
const historyVersions = new Array(curVersion)
.fill(0)
.map((_, idx) => `v${idx}`)
.reverse();
const options = [VERSION, ...historyVersions].map((item) => ({
value: item,
label: item
}));

const handleVersionChange = (version: string) => {
window.location.href = `/doc/${pkg}-${version}`;
};

return (
<HeaderExtraStyleWrapper>
<Select
value={VERSION}
options={options}
onChange={handleVersionChange}
style={{ borderRadius: 10 }}
/>
</HeaderExtraStyleWrapper>
);
};

export default HeaderExtra;
9 changes: 9 additions & 0 deletions DumiHeaderExtraSlots/style.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { styled } from '@mui/material/styles';

export const HeaderExtraStyleWrapper = styled('div')`
margin-left: 10px;
'& .ant-select .ant-select-selector': {
border-radius: 10px;
background-color: transparent;
}
`;
2 changes: 2 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ export default defineConfig([
'**/packages/shared/lib/api/*',
'**/packages/**/mockApi/*',
'**/packages/**/testUtil/*',
'**/packages/**/demo/*',
'**/packages/**/demos/*',
'jest-setup.ts',
'node_modules/*',
'**/packages/*/node_modules/*',
Expand Down
2 changes: 1 addition & 1 deletion jest-setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import i18n from 'i18next';
import { initReactI18next } from 'react-i18next';
import baseZhCN from './packages/base/src/locale/zh-CN';
import sqleZhCN from './packages/sqle/src/locale/zh-CN';
import commonZhCN from './packages/shared/lib/locale/zh-CN';
import commonZhCN from './packages/dms-kit/src/locale/zh-CN';
import Adapter from '@cfaester/enzyme-adapter-react-18';
import * as Enzyme from 'enzyme';
import 'jest-canvas-mock';
Expand Down
5 changes: 4 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,12 @@ module.exports = {
'!packages/**/index.enum.ts',
'!packages/sqle/src/page/SqlAnalyze/SqlAnalyze/ProcessListCom/**',
'!packages/shared/lib/hooks/usePrompt/index.tsx',
'!packages/sqle/src/page/Knowledge/Graph/components/**'
'!packages/sqle/src/page/Knowledge/Graph/components/**',
'!packages/**/demo/**',
'!packages/**/demos/**'
],
setupFilesAfterEnv: ['<rootDir>/jest-setup.ts'],
testPathIgnorePatterns: ['/node_modules/', '/demo/', '/demos/'],
reporters: [
'default',
[
Expand Down
21 changes: 11 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
},
"scripts": {
"preinstall": "npx only-allow pnpm",
"start": "pnpm --filter base start",
"start:ee": "pnpm --filter base start:ee",
"start:demo": "pnpm --filter base start:demo",
"build": "pnpm --filter base build",
"build:ee": "pnpm --filter base build:ee",
"build:demo": "pnpm --filter base build:demo",
"prettier:w": "prettier -w packages/*/src/ packages/*/lib/ scripts/cli/*/src",
"prettier:c": "prettier -c packages/*/src/ packages/*/lib/ scripts/cli/*/src",
"eslint": "eslint packages/*/src/ packages/*/lib/ scripts/cli/*/src",
"start": "concurrently \"pnpm --filter base start\" \"pnpm --filter @actiontech/dms-kit dev\"",
"start:ee": "concurrently \"pnpm --filter base start:ee\" \"pnpm --filter @actiontech/dms-kit dev\"",
"start:demo": "concurrently \"pnpm --filter base start:demo\" \"pnpm --filter @actiontech/dms-kit dev\"",
"build": "pnpm --filter @actiontech/dms-kit build && pnpm --filter base build",
"build:ee": "pnpm --filter @actiontech/dms-kit build && pnpm --filter base build:ee",
"build:demo": "pnpm --filter @actiontech/dms-kit build && pnpm --filter base build:demo",
"prettier:w": "prettier -w packages/*/src/ packages/shared/lib/ scripts/cli/*/src",
"prettier:c": "prettier -c packages/*/src/ packages/shared/lib/ scripts/cli/*/src",
"eslint": "eslint packages/*/src/ packages/shared/lib/ scripts/cli/*/src",
"stylelint": "stylelint packages/*/{src,lib}/**/{*.less,style.ts,element.ts}",
"ts-check": "tsc --noEmit",
"checker": "concurrently \"pnpm ts-check\" \"pnpm eslint\" \"pnpm stylelint\" \"pnpm prettier:c\"",
Expand All @@ -33,7 +33,8 @@
"dms:g": "pnpm --filter @actiontech/cli-create-dms-page build && create-dms-page",
"api_client:g": "npm_config_registry=http://10.186.18.19:4873 pnpx @actiontech/cli api-client -y",
"api_mocks:g": "npm_config_registry=http://10.186.18.19:4873 pnpx @actiontech/cli api-mocks -y",
"ai-doc": "npm_config_registry=http://10.186.18.19:4873 pnpx @actiontech/cli ai-doc"
"ai-doc": "npm_config_registry=http://10.186.18.19:4873 pnpx @actiontech/cli ai-doc",
"postinstall": "pnpm --filter @actiontech/dms-kit build"
},
"keywords": [],
"author": "",
Expand Down
3 changes: 2 additions & 1 deletion packages/base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@
},
"dependencies": {
"@actiontech/shared": "workspace:^",
"@actiontech/dms-kit": "workspace:^",
"babel-preset-react-app": "^10.0.1",
"sqle": "workspace:^",
"@actiontech/icons": "workspace:^"
}
}
}
2 changes: 1 addition & 1 deletion packages/base/src/App.ce.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { mockUseDbServiceDriver } from '@actiontech/shared/lib/testUtil/mockHook
import { mockUseCurrentUser } from '@actiontech/shared/lib/testUtil/mockHook/mockUseCurrentUser';
import { mockUsePermission } from '@actiontech/shared/lib/testUtil/mockHook/mockUsePermission';
import { mockSystemConfig } from './testUtils/mockHooks/mockSystemConfig';
import { LocalStorageWrapper } from '@actiontech/shared';
import { LocalStorageWrapper } from '@actiontech/dms-kit';
import system from '@actiontech/shared/lib/testUtil/mockApi/sqle/system';
import baseSystem from '@actiontech/shared/lib/testUtil/mockApi/base/system';
import { superRender } from '@actiontech/shared/lib/testUtil/superRender';
Expand Down
20 changes: 8 additions & 12 deletions packages/base/src/App.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ import {
} from '@actiontech/shared/lib/testUtil/common';
import system from '@actiontech/shared/lib/testUtil/mockApi/sqle/system';
import baseSystem from '@actiontech/shared/lib/testUtil/mockApi/base/system';
import { LocalStorageWrapper } from '@actiontech/shared';
import { LocalStorageWrapper } from '@actiontech/dms-kit';
import { compressToBase64 } from 'lz-string';
import { DMS_REDIRECT_KEY_PARAMS_NAME } from '@actiontech/shared/lib/data/routePaths';
import { SystemRole } from '@actiontech/shared/lib/enum';
import { DMS_REDIRECT_KEY_PARAMS_NAME } from '@actiontech/dms-kit';
import { SystemRole } from '@actiontech/dms-kit';
import { AuthRouterConfig } from './router/router';
import { cloneDeep } from 'lodash';
import dmsSystem from '@actiontech/shared/lib/testUtil/mockApi/base/system';
Expand All @@ -32,8 +32,8 @@ import gateway from '@actiontech/shared/lib/testUtil/mockApi/base/gateway';
import project from '@actiontech/shared/lib/testUtil/mockApi/base/project';
import EventEmitter from './utils/EventEmitter';
import EmitterKey from './data/EmitterKey';
import { eventEmitter as sharedEventEmitter } from '@actiontech/shared/lib/utils/EventEmitter';
import sharedEmitterKey from '@actiontech/shared/lib/data/EmitterKey';
import { eventEmitter as sharedEventEmitter } from '@actiontech/dms-kit/es/utils/EventEmitter';
import sharedEmitterKey from '@actiontech/dms-kit/es/data/EmitterKey';

jest.mock('react-router-dom', () => ({
...jest.requireActual('react-router-dom'),
Expand Down Expand Up @@ -99,6 +99,9 @@ describe('App', () => {
modalStatus: {
[ModalName.Company_Notice]: false
}
},
availabilityZone: {
availabilityZoneTips: []
}
});
});
Expand Down Expand Up @@ -297,13 +300,6 @@ describe('App', () => {
expect(AuthRouterConfig).toEqual(routerConfigBackup);
});

it('should initialize the availability zone', () => {
baseSuperRender(<App />);
expect(
mockUseRecentlySelectedZoneData.initializeAvailabilityZone
).toHaveBeenCalledTimes(1);
});

it('should reload the initial data when the event is triggered', async () => {
baseSuperRender(<App />);
expect(getUserBySessionSpy).toHaveBeenCalledTimes(1);
Expand Down
61 changes: 15 additions & 46 deletions packages/base/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,10 @@ import { AuthRouterConfig, unAuthRouterConfig } from './router/router';
import { IReduxState } from './store';
import { useSelector } from 'react-redux';
import { StyledEngineProvider, ThemeProvider } from '@mui/system';
import {
EmptyBox,
HeaderProgress,
SpinIndicator,
useTypedNavigate
} from '@actiontech/shared';
import { EmptyBox, HeaderProgress, SpinIndicator } from '@actiontech/dms-kit';
import { useTypedNavigate } from '@actiontech/shared';
import { useNotificationContext } from '@actiontech/shared/lib/hooks';
import { SupportLanguage, SupportTheme } from '@actiontech/shared/lib/enum';
import { SupportLanguage, SupportTheme } from '@actiontech/dms-kit';
import Nav from './page/Nav';
import {
useChangeTheme,
Expand Down Expand Up @@ -46,28 +42,28 @@ import antd_en_US from 'antd/locale/en_US';
import useFetchPermissionData from './hooks/useFetchPermissionData';
import { useDispatch } from 'react-redux';
import { updateModuleFeatureSupport } from './store/permission';
import { ROUTE_PATHS } from '@actiontech/shared/lib/data/routePaths';
import { ROUTE_PATHS } from '@actiontech/dms-kit';
import useSyncDmsCloudBeaverChannel from './hooks/useSyncDmsCloudBeaverChannel';
import { getSystemModuleStatusModuleNameEnum } from '@actiontech/shared/lib/api/sqle/service/system/index.enum';
import { ComponentControlHeight } from '@actiontech/shared/lib/data/common';
import { ComponentControlHeight } from '@actiontech/dms-kit';
import EventEmitter from './utils/EventEmitter';
import EmitterKey from './data/EmitterKey';
import { eventEmitter as sharedEventEmitter } from '@actiontech/shared/lib/utils/EventEmitter';
import sharedEmitterKey from '@actiontech/shared/lib/data/EmitterKey';
import useRecentlySelectedZone from './hooks/useRecentlySelectedZone';
import { eventEmitter as sharedEventEmitter } from '@actiontech/dms-kit/es/utils/EventEmitter';
import sharedEmitterKey from '@actiontech/dms-kit/es/data/EmitterKey';
import useRecentlySelectedZone from '@actiontech/dms-kit/es/features/useRecentlySelectedZone';
import { debounce } from 'lodash';
import ErrorBoundary from './page/ErrorBoundary';
import './index.less';

dayjs.extend(updateLocale);
dayjs.updateLocale('zh-cn', {
weekStart: 0
});

Spin.setDefaultIndicator(<SpinIndicator />);

//fix https://github.com/actiontech/sqle/issues/1350
export const Wrapper: React.FC<{ children: ReactNode }> = ({ children }) => {
export const Wrapper: React.FC<{
children: ReactNode;
}> = ({ children }) => {
const [initRenderApp, setInitRenderApp] = useState<boolean>(true);
const token = useSelector<IReduxState, string>((state) => state.user.token);
const location = useLocation();
Expand All @@ -86,45 +82,36 @@ export const Wrapper: React.FC<{ children: ReactNode }> = ({ children }) => {
) {
const currentPath = location.pathname;
const currentSearch = location.search;

const fullPath = currentSearch
? `${currentPath}${currentSearch}`
: currentPath;

navigate(ROUTE_PATHS.BASE.LOGIN.index, {
queries: { target: encodeURIComponent(fullPath) },
queries: {
target: encodeURIComponent(fullPath)
},
replace: true
});
}
}, [initRenderApp, location.pathname, location.search, navigate, token]);
return <>{!initRenderApp && children}</>;
};

function App() {
const { token } = useSelector((state: IReduxState) => ({
token: state.user.token
}));

const dispatch = useDispatch();

const { notificationContextHolder } = useNotificationContext();

const { getUserBySession } = useSessionUser();

const {
isUserInfoFetched,
theme,
language: currentLanguage
} = useCurrentUser();

const { fetchModuleSupportStatus, isFeatureSupportFetched } =
useFetchPermissionData();

const antdLanguage =
currentLanguage === SupportLanguage.enUS ? antd_en_US : antd_zh_CN;

const { isDriverInfoFetched, updateDriverList } = useDbServiceDriver();

const { checkPagePermission, userOperationPermissions } = usePermission();

// #if [ee]
Expand Down Expand Up @@ -158,7 +145,6 @@ function App() {
return acc;
}, verifiedRoutes);
};

if (
isUserInfoFetched &&
isFeatureSupportFetched &&
Expand All @@ -173,16 +159,13 @@ function App() {
isUserInfoFetched,
userOperationPermissions
]);

const elements = useRoutes(
token ? (AuthRouterConfigData as RouteObject[]) : unAuthRouterConfig
);
useChangeTheme();

const themeData = useMemo(() => {
return ThemeData[theme];
}, [theme]);

const body = useMemo(() => {
if (
!isUserInfoFetched ||
Expand All @@ -202,7 +185,6 @@ function App() {
isFeatureSupportFetched,
elements
]);

const getInitialData = useCallback(() => {
getUserBySession({});
updateDriverList();
Expand All @@ -221,30 +203,24 @@ function App() {
}
});
}, [dispatch, fetchModuleSupportStatus, getUserBySession, updateDriverList]);

useEffect(() => {
if (token) {
getInitialData();
}
}, [token, getInitialData]);

useEffect(() => {
i18n.changeLanguage(currentLanguage);
}, [currentLanguage]);

// #if [ee]
const { initializeAvailabilityZone, clearRecentlySelectedZone } =
useRecentlySelectedZone();

const { clearRecentlySelectedZone } = useRecentlySelectedZone();
useEffect(() => {
const { unsubscribe } = EventEmitter.subscribe(
EmitterKey.DMS_Reload_Initial_Data,
getInitialData
);

return unsubscribe;
}, [getInitialData]);

useEffect(() => {
const { unsubscribe } = sharedEventEmitter.subscribe(
sharedEmitterKey.DMS_CLEAR_AVAILABILITY_ZONE_AND_RELOAD_INITIAL_DATA,
Expand All @@ -253,16 +229,10 @@ function App() {
getInitialData();
}, 1000)
);

return unsubscribe;
}, [getInitialData, clearRecentlySelectedZone]);

useEffect(() => {
initializeAvailabilityZone();
}, [initializeAvailabilityZone]);
// #endif
useSyncDmsCloudBeaverChannel();

return (
<Wrapper>
<StyleProvider
Expand Down Expand Up @@ -354,5 +324,4 @@ function App() {
</Wrapper>
);
}

export default App;
Loading