From 37c32a313464a257430f8d20f1ede687027d6f34 Mon Sep 17 00:00:00 2001 From: jsers Date: Wed, 29 Mar 2023 20:40:20 +0800 Subject: [PATCH] refactor: replace history.push with link tag #4 --- src/pages/dashboard/List/index.tsx | 9 +++++++-- src/pages/warning/shield/index.tsx | 12 ++++++------ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/pages/dashboard/List/index.tsx b/src/pages/dashboard/List/index.tsx index 2814e7b1a..c4f401229 100644 --- a/src/pages/dashboard/List/index.tsx +++ b/src/pages/dashboard/List/index.tsx @@ -94,9 +94,14 @@ export default function index() { className: 'name-column', render: (text: string, record: DashboardType) => { return ( -
history.push(`/dashboards/${record.ident || record.id}`)}> + {text} -
+ ); }, }, diff --git a/src/pages/warning/shield/index.tsx b/src/pages/warning/shield/index.tsx index c8fa40484..14ee124a5 100644 --- a/src/pages/warning/shield/index.tsx +++ b/src/pages/warning/shield/index.tsx @@ -21,7 +21,7 @@ import { CloseCircleOutlined, ExclamationCircleOutlined, SearchOutlined } from ' import dayjs from 'dayjs'; import _ from 'lodash'; import { useTranslation } from 'react-i18next'; -import { useHistory, useLocation } from 'react-router-dom'; +import { useHistory, useLocation, Link } from 'react-router-dom'; import queryString from 'query-string'; import AdvancedWrap from '@/components/AdvancedWrap'; import PageLayout from '@/components/pageLayout'; @@ -86,14 +86,14 @@ const Shield: React.FC = () => { dataIndex: 'note', render: (data, record: any) => { return ( -
{ - history.push(`/alert-mutes/edit/${record.id}`, record); + {data} -
+ ); }, },