From 53c26bbd15ee45e4922c848cfcdf59211394e21a Mon Sep 17 00:00:00 2001 From: LZS911 <932177767@qq.com> Date: Tue, 20 Aug 2024 15:46:51 +0800 Subject: [PATCH 1/2] [chore]: modify table row key and remove redundant components --- .../SqlStatusFilterContainer/index.tsx | 36 --------- .../SqlStatusFilterContainer/index.type.ts | 6 -- .../SqlStatusFilterContainer/style.ts | 77 ------------------- .../__snapshots__/index.test.tsx.snap | 32 ++++---- .../Detail/ScanTypeSqlCollection/indx.tsx | 2 +- .../mockApi/instanceAuditPlan/data.ts | 6 ++ 6 files changed, 20 insertions(+), 139 deletions(-) delete mode 100644 packages/sqle/src/page/SqlManagementConf/Detail/ScanTypeSqlCollection/SqlStatusFilterContainer/index.tsx delete mode 100644 packages/sqle/src/page/SqlManagementConf/Detail/ScanTypeSqlCollection/SqlStatusFilterContainer/index.type.ts delete mode 100644 packages/sqle/src/page/SqlManagementConf/Detail/ScanTypeSqlCollection/SqlStatusFilterContainer/style.ts diff --git a/packages/sqle/src/page/SqlManagementConf/Detail/ScanTypeSqlCollection/SqlStatusFilterContainer/index.tsx b/packages/sqle/src/page/SqlManagementConf/Detail/ScanTypeSqlCollection/SqlStatusFilterContainer/index.tsx deleted file mode 100644 index 15af3347f..000000000 --- a/packages/sqle/src/page/SqlManagementConf/Detail/ScanTypeSqlCollection/SqlStatusFilterContainer/index.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import { BasicButton, CustomSegmentedFilter } from '@actiontech/shared'; -import { SqlStatusFilterContainerStyleWrapper } from './style'; -import { SqlStatusFilterContainerProps } from './index.type'; -import { useTranslation } from 'react-i18next'; -import { formatTime } from '@actiontech/shared/lib/utils/Common'; - -const SqlStatusFilterContainer: React.FC = ({ - auditAction, - lastAuditTime, - ...filterProps -}) => { - const { t } = useTranslation(); - return ( - - - -
- - {t('managementConf.detail.scanTypeSqlCollection.action.urgentAudit')} - -
- {t( - 'managementConf.detail.scanTypeSqlCollection.action.lastAuditTime', - { time: formatTime(lastAuditTime, '-') } - )} -
-
-
- ); -}; - -export default SqlStatusFilterContainer; diff --git a/packages/sqle/src/page/SqlManagementConf/Detail/ScanTypeSqlCollection/SqlStatusFilterContainer/index.type.ts b/packages/sqle/src/page/SqlManagementConf/Detail/ScanTypeSqlCollection/SqlStatusFilterContainer/index.type.ts deleted file mode 100644 index 884483e6f..000000000 --- a/packages/sqle/src/page/SqlManagementConf/Detail/ScanTypeSqlCollection/SqlStatusFilterContainer/index.type.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { CustomSegmentedFilterProps } from '@actiontech/shared/lib/components/CustomSegmentedFilter/index.type'; - -export type SqlStatusFilterContainerProps = { - auditAction: () => void; - lastAuditTime: string; -} & CustomSegmentedFilterProps; diff --git a/packages/sqle/src/page/SqlManagementConf/Detail/ScanTypeSqlCollection/SqlStatusFilterContainer/style.ts b/packages/sqle/src/page/SqlManagementConf/Detail/ScanTypeSqlCollection/SqlStatusFilterContainer/style.ts deleted file mode 100644 index 030fa12fe..000000000 --- a/packages/sqle/src/page/SqlManagementConf/Detail/ScanTypeSqlCollection/SqlStatusFilterContainer/style.ts +++ /dev/null @@ -1,77 +0,0 @@ -import { styled } from '@mui/material'; - -export const SqlStatusFilterContainerStyleWrapper = styled('div')` - padding: 24px 40px; - border-bottom: 1px solid - ${({ theme }) => theme.sharedTheme.uiToken.colorBorderSecondary}; - display: flex; - justify-content: space-between; - align-items: center; - - & .sql-status-filter-option { - display: flex; - - .custom-segmented-filter-item { - &:not(:last-of-type) { - margin-right: 8px; - } - - cursor: pointer; - display: flex; - padding: 8px 16px; - justify-content: center; - border-radius: 4px; - background: ${({ theme }) => theme.sharedTheme.uiToken.colorFillTertiary}; - transition: background-color 0.3s ease-out; - transition: color 0.3s ease-out; - min-width: 100px; - - .sql-status-filter-item-wrapper { - display: flex; - flex-direction: column; - justify-content: center; - - .sql-status-filter-number { - font-weight: 900; - font-size: 16px; - color: ${({ theme }) => theme.sharedTheme.uiToken.colorTextSecondary}; - margin-bottom: 8px; - text-align: center; - } - - .sql-status-filter-text { - font-size: 12px; - color: ${({ theme }) => theme.sharedTheme.uiToken.colorTextTertiary}; - } - } - } - - .custom-segmented-filter-item-checked { - background: ${({ theme }) => - theme.sharedTheme.basic.colorPrimaryBgActive}; - - .sql-status-filter-item-wrapper { - .sql-status-filter-number { - color: ${({ theme }) => theme.sharedTheme.uiToken.colorPrimary}; - } - - .sql-status-filter-text { - color: ${({ theme }) => theme.sharedTheme.uiToken.colorPrimary}; - } - } - } - } - - & .sql-status-filter-extra { - display: flex; - flex-direction: column; - align-items: end; - - .sql-status-filter-extra-tips { - position: relative; - margin-top: 8px; - font-size: 12px; - color: ${({ theme }) => theme.sharedTheme.uiToken.colorTextTertiary}; - } - } -`; diff --git a/packages/sqle/src/page/SqlManagementConf/Detail/ScanTypeSqlCollection/__tests__/__snapshots__/index.test.tsx.snap b/packages/sqle/src/page/SqlManagementConf/Detail/ScanTypeSqlCollection/__tests__/__snapshots__/index.test.tsx.snap index 5bbfe4581..3a9742731 100644 --- a/packages/sqle/src/page/SqlManagementConf/Detail/ScanTypeSqlCollection/__tests__/__snapshots__/index.test.tsx.snap +++ b/packages/sqle/src/page/SqlManagementConf/Detail/ScanTypeSqlCollection/__tests__/__snapshots__/index.test.tsx.snap @@ -1077,8 +1077,7 @@ exports[`test ScanTypeSqlCollection should match snapshot 2`] = `