Skip to content

Commit

Permalink
chore: fix some spell and remove useless type
Browse files Browse the repository at this point in the history
  • Loading branch information
siriuswh0327 committed Oct 24, 2023
1 parent 19f8363 commit 54e6c81
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 43 deletions.
6 changes: 1 addition & 5 deletions packages/sqle/src/components/RuleDetail/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,7 @@ import {
RuleTemplateDetailStyleWrapper
} from './style';

export type IRuleTemplateDetail = {
//
};

const RuleDetail = (props: IRuleTemplateDetail) => {
const RuleDetail = () => {
const { t } = useTranslation();
const { goBack } = useBack();

Expand Down
6 changes: 3 additions & 3 deletions packages/sqle/src/page/AuditPlan/CreatePlan/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import audit_plan from '@actiontech/shared/lib/api/sqle/service/audit_plan';

const CreatePlan = () => {
const { t } = useTranslation();
const navigater = useNavigate();
const navigate = useNavigate();
const { projectName, projectID } = useCurrentProject();

const [submitLoading, setSubmitLoading] = useState(false);
Expand All @@ -30,7 +30,7 @@ const CreatePlan = () => {

const onSkipList = () => {
onReset();
navigater(`/sqle/project/${projectID}/auditPlan`);
navigate(`/sqle/project/${projectID}/auditPlan`);
};

const onReset = () => {
Expand Down Expand Up @@ -122,7 +122,7 @@ const CreatePlan = () => {
type="primary"
key="view-audit-plan"
onClick={() => {
navigater(
navigate(
`/sqle/project/${projectID}/auditPlan/detail/${form.getFieldValue(
'name'
)}`
Expand Down
76 changes: 41 additions & 35 deletions packages/sqle/src/page/AuditPlan/PlanDetail/DetailReport/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import {
} from '../../../../store/auditPlan';
import DetailReportDrawer from './Drawer';
import { RuleUrlParamKey } from '../../../../page/Rule/useRuleFilterForm';
import { Spin } from 'antd5';

type typeIAuditPlanReportResV1 = keyof IAuditPlanReportResV1;

Expand All @@ -61,9 +62,9 @@ const DetailReport = () => {
const dispatch = useDispatch();

const {
data: auditTask
data: auditTask,
// run: getTaskInfo,
// loading: taskLoading
loading: taskLoading
} = useRequest(() => {
return audit_plan
.getAuditPlanV1({
Expand All @@ -73,7 +74,7 @@ const DetailReport = () => {
.then((res) => res.data);
});

const { data: reportInfo } = useRequest(() =>
const { data: reportInfo, loading: reportInfoLoading } = useRequest(() =>
audit_plan
.getAuditPlanReportV1({
audit_plan_report_id: urlParams.reportId ?? '',
Expand Down Expand Up @@ -262,41 +263,46 @@ const DetailReport = () => {
/>
<DetailReportStyleWrapper>
<div className="header-wrapper">
<div className="left-header">
<h3 className="header-cont-text">
{t('auditPlan.report.time', {
time: formatTime(reportInfo?.audit_plan_report_timestamp, '--')
})}
</h3>
<section className="tag-wrapper">
<div className="custom-tag-item">
<IconTagBookMark className="custom-tag-icon bookmark-icon" />
<div>
{t('auditPlan.detailPage.auditTaskType', {
type:
auditTask?.data?.audit_plan_meta?.audit_plan_type_desc ??
'--'
})}
</div>
</div>
<div
className={classNames('custom-tag-item', {
'custom-tag-primary': !!auditTask?.data?.rule_template_name
<Spin spinning={taskLoading || reportInfoLoading}>
<div className="left-header">
<h3 className="header-cont-text">
{t('auditPlan.report.time', {
time: formatTime(
reportInfo?.audit_plan_report_timestamp,
'--'
)
})}
onClick={onSkipRule}
>
<div>
{t('auditPlan.report.rule_template', {
name: auditTask?.data?.rule_template_name ?? '--'
</h3>
<section className="tag-wrapper">
<div className="custom-tag-item">
<IconTagBookMark className="custom-tag-icon bookmark-icon" />
<div>
{t('auditPlan.detailPage.auditTaskType', {
type:
auditTask?.data?.audit_plan_meta
?.audit_plan_type_desc ?? '--'
})}
</div>
</div>
<div
className={classNames('custom-tag-item', {
'custom-tag-primary': !!auditTask?.data?.rule_template_name
})}
onClick={onSkipRule}
>
<div>
{t('auditPlan.report.rule_template', {
name: auditTask?.data?.rule_template_name ?? '--'
})}
</div>
<IconArrowRight className="custom-tag-right-icon" />
</div>
<IconArrowRight className="custom-tag-right-icon" />
</div>
</section>
</div>
<div className="right-header">
{renderScoreItem(reportInfo ?? {})}
</div>
</section>
</div>
<div className="right-header">
{renderScoreItem(reportInfo ?? {})}
</div>
</Spin>
</div>
<ActiontechTable
loading={tableLoading}
Expand Down

0 comments on commit 54e6c81

Please sign in to comment.