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

Feature/version management #426

Merged
merged 5 commits into from
Sep 24, 2024
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
1 change: 1 addition & 0 deletions packages/base/src/locale/zh-CN/dmsMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export default {
sqlManagementConf: 'SQL管控配置',
pushRuleConfiguration: '推送规则',
pipelineConfiguration: '流水线配置',
versionManagement: '版本管理',

projectSelector: {
recentlyOpenedProjects: '最近打开的项目',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,19 @@ exports[`test genMenuItemsWithMenuStructTree should match snapshot 6`] = `
</Link>,
"structKey": "exec-workflow",
},
{
"icon": <FileVersionOutlined
height={18}
width={18}
/>,
"key": "sqle/project/projectID/version-management",
"label": <Link
to="/sqle/project/600300/version-management"
>
版本管理
</Link>,
"structKey": "version-management",
},
],
"label": "SQL上线",
"type": "group",
Expand Down Expand Up @@ -586,6 +599,19 @@ exports[`test genMenuItemsWithMenuStructTree should match snapshot 7`] = `
</Link>,
"structKey": "exec-workflow",
},
{
"icon": <FileVersionOutlined
height={18}
width={18}
/>,
"key": "sqle/project/projectID/version-management",
"label": <Link
to="/sqle/project/600300/version-management"
>
版本管理
</Link>,
"structKey": "version-management",
},
],
"label": "SQL上线",
"type": "group",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const menuStruct: MenuStructTreeType = [
{
type: 'group',
label: t('dmsMenu.groupLabel.SQLExecute'),
group: ['exec-workflow']
group: ['exec-workflow', 'version-management']
},
{
type: 'group',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@ export type MenuStructTreeKey =
| 'sqle-log'
| 'sql-management-conf'
| 'push-rule-configuration'
| 'pipeline-configuration';
| 'pipeline-configuration'
| 'version-management';
Original file line number Diff line number Diff line change
Expand Up @@ -5,76 +5,76 @@
import baseMenusCollection from './base';
import sqleMenusCollection from './sqle';

export const sideMenuData = (
projectID: string,
role: SystemRole | '',
sqlOptimizationIsSupport: boolean
) => {
const sqlDevGroup: MenuStructTreeKey[] = [
'cloud-beaver',
'data-export',
'sql-audit',
'plugin-audit'
];

// 现状: SQL优化页面在CE中会展示预览引导页面 但是在EE中需要根据 sqlOptimizationIsSupport(接口查询返回)权限来决定是否展示 没有任何提示信息 会导致用户无法感知此功能的存在 不太合理
// todo: 下一期需求周期把此问题给产品抛出 希望解决此问题
const menuStruct: MenuStructTreeType = [
'project-overview',
'dashboard',
{ type: 'divider' },
// #if [ce]
{
type: 'group',
label: t('dmsMenu.groupLabel.SQLDev'),
group: [...sqlDevGroup, 'sql-optimization']
},
// #endif
// #if [ee]
{
type: 'group',
label: t('dmsMenu.groupLabel.SQLDev'),
group: sqlOptimizationIsSupport
? [...sqlDevGroup, 'sql-optimization']
: sqlDevGroup
},
// #endif
{
type: 'group',
label: t('dmsMenu.groupLabel.SQLExecute'),
group: ['exec-workflow']
group: ['exec-workflow', 'version-management']
},
{
type: 'group',
label: t('dmsMenu.groupLabel.CICDIntegration'),
group: ['pipeline-configuration']
},
{
type: 'group',
label: t('dmsMenu.groupLabel.SQLManagement'),
group: ['sql-management', 'sql-management-conf']
},
{ type: 'divider' },
{
type: 'group',
label: t('dmsMenu.groupLabel.projectConfigure'),
group: [
'instance',
'rule-template',
'workflow-template',
'member',
'push-rule-configuration',
'whitelist',
'sql-management-exception'
]
},
{ type: 'divider' },
{
type: 'group',
label: t('dmsMenu.groupLabel.operateAndAudit'),
group: ['sqle-log']
}
];

Check warning on line 77 in packages/base/src/page/Nav/SideMenu/MenuList/menus/menu.data.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement

return genMenuItemsWithMenuStructTree(
projectID,
Expand Down
17 changes: 15 additions & 2 deletions packages/base/src/page/Nav/SideMenu/MenuList/menus/sqle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ import {
BriefcaseFilled,
PlanFilled,
GearFilled,
PipelineOutlined
PipelineOutlined,
FileVersionOutlined
} from '@actiontech/icons';

const projectOverviewMenuItem: GenerateMenuItemType = (projectID) => ({
Expand Down Expand Up @@ -192,6 +193,17 @@ const pipelineConfiguration: GenerateMenuItemType = (projectID) => ({
structKey: 'pipeline-configuration'
});

const versionManagement: GenerateMenuItemType = (projectID) => ({
label: (
<Link to={`/sqle/project/${projectID}/version-management`}>
{t('dmsMenu.versionManagement')}
</Link>
),
icon: <FileVersionOutlined width={18} height={18} />,
key: `sqle/project/${SIDE_MENU_DATA_PLACEHOLDER_KEY}/version-management`,
structKey: 'version-management'
});

const sqleMenusCollection = [
projectOverviewMenuItem,
dashboardMenuItem,
Expand All @@ -208,7 +220,8 @@ const sqleMenusCollection = [
sqlManagementConf,
pushRuleConfiguration,
sqlManagementException,
pipelineConfiguration
pipelineConfiguration,
versionManagement
];

export default sqleMenusCollection;
Original file line number Diff line number Diff line change
Expand Up @@ -951,6 +951,24 @@ exports[`base/router-sqle-ce render sqle route data snap 1`] = `
"key": "pipelineConfiguration",
"path": ":projectID/pipeline-configuration",
},
{
"children": [
{
"element": <div>
VersionManagementList
</div>,
"key": "VersionManagementList",
"path": "",
},
],
"element": <div
data-test-parent-id="versionManagement"
>
<Outlet />
</div>,
"key": "versionManagement",
"path": ":projectID/version-management",
},
{
"element": <div>
projectRedirect
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1194,6 +1194,24 @@ exports[`base/router-sqle-ee render sqle route data snap 1`] = `
"key": "pipelineConfiguration",
"path": ":projectID/pipeline-configuration",
},
{
"children": [
{
"element": <div>
VersionManagementList
</div>,
"key": "VersionManagementList",
"path": "",
},
],
"element": <div
data-test-parent-id="versionManagement"
>
<Outlet />
</div>,
"key": "versionManagement",
"path": ":projectID/version-management",
},
{
"element": <div>
projectRedirect
Expand Down
7 changes: 7 additions & 0 deletions packages/icons/docs/icon/Data.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,13 @@ import { ExceptionFileOutlined } from '@actiontech/icons';
export default () => <ExceptionFileOutlined width={32} height={32} />
```

## FileVersionOutlined
```jsx
import { FileVersionOutlined } from '@actiontech/icons';

export default () => <FileVersionOutlined width={32} height={32} />
```

## HorizontalTripleLineOutlined
```jsx
import { HorizontalTripleLineOutlined } from '@actiontech/icons';
Expand Down
23 changes: 23 additions & 0 deletions packages/icons/src/outlined/Data/FileVersionOutlined.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import type { SVGProps } from 'react';
const FileVersionOutlined = (props: SVGProps<SVGSVGElement>) => {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
width={16}
height={16}
className="FileVersionOutlined_svg__icon"
viewBox="0 0 1024 1024"
{...props}
>
<path
fill={props.color ? 'currentColor' : '#8A8F99'}
d="M527.1 887.6H220.8v-751h361.6v187.1c0 19.9 16.1 36 36 36h187.4v88.6c0 19.9 16.1 36 36 36s36-16.1 36-36V323.6c0-9.6-3.8-18.7-10.6-25.5l-223.3-223c-.6-.6-1.2-1.1-1.8-1.6l-.4-.4-1.8-1.5s-.1-.1-.2-.1l-1.8-1.2-.6-.3c-.6-.4-1.3-.8-2-1.1-.1 0-.2-.1-.2-.1-.6-.3-1.2-.6-1.9-.9l-.6-.3c-.7-.3-1.4-.6-2.1-.8-.1 0-.1 0-.2-.1-.7-.2-1.4-.5-2.1-.7-.2-.1-.4-.1-.6-.2-.7-.2-1.5-.4-2.3-.5-.7-.1-1.5-.3-2.3-.4-.2 0-.4-.1-.6-.1-.7-.1-1.4-.2-2.2-.2H202.1c-29.4 0-53.3 23.9-53.3 53.3v788.4c0 29.4 23.9 53.3 53.3 53.3h325c19.9 0 36-16.1 36-36s-16.1-36-36-36m127.4-599.9V187.5l100.2 100.2z"
/>
<path
fill={props.color ? 'currentColor' : '#8A8F99'}
d="M768.1 547c-105.5 0-191 85.5-191 191s85.5 191 191 191 191-85.5 191-191-85.5-191-191-191M885 816.5c-4.1 0-8.2-.7-12.3-2.2l-115.9-42.2c-14.3-4.8-24.6-18.3-24.6-34.1V613.7c0-19.9 16.1-36 36-36s36 16.1 36 36v99.1l93.1 33.9c18.7 6.8 28.3 27.5 21.5 46.1-5.3 14.7-19.1 23.7-33.8 23.7"
/>
</svg>
);
};
export default FileVersionOutlined;
1 change: 1 addition & 0 deletions packages/icons/src/outlined/Data/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export { default as DoubleDatabaseOutlined } from './DoubleDatabaseOutlined';
export { default as ExceptionFileOutlined } from './ExceptionFileOutlined';
export { default as FileVersionOutlined } from './FileVersionOutlined';
export { default as HorizontalTripleLineOutlined } from './HorizontalTripleLineOutlined';
export { default as PanelCardOutlined } from './PanelCardOutlined';
export { default as RiseSquareOutlined } from './RiseSquareOutlined';
Expand Down
1 change: 1 addition & 0 deletions packages/icons/svg/outlined/Data/FileVersionOutlined.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading