11import React , { useEffect } from 'react' ;
22import { useTranslation } from 'react-i18next' ;
3- import { Outlet , useNavigate , useParams } from 'react-router-dom' ;
3+ import { Outlet , /* useNavigate,*/ useParams } from 'react-router-dom' ;
44import Button from '@cloudscape-design/components/button' ;
55
66import { ContentLayout , DetailsHeader , Tabs } from 'components' ;
@@ -10,7 +10,11 @@ import { getServerError, riseRouterException } from 'libs';
1010import { ROUTES } from 'routes' ;
1111import { useDeleteRunsMutation , useGetRunQuery , useStopRunsMutation } from 'services/run' ;
1212
13- import { isAvailableAbortingForRun , isAvailableDeletingForRun , isAvailableStoppingForRun } from '../utils' ;
13+ import {
14+ isAvailableAbortingForRun ,
15+ isAvailableStoppingForRun ,
16+ // isAvailableDeletingForRun,
17+ } from '../utils' ;
1418
1519import styles from './styles.module.scss' ;
1620
@@ -21,7 +25,7 @@ enum CodeTab {
2125
2226export const RunDetailsPage : React . FC = ( ) => {
2327 const { t } = useTranslation ( ) ;
24- const navigate = useNavigate ( ) ;
28+ // const navigate = useNavigate();
2529 const params = useParams ( ) ;
2630 const paramProjectName = params . projectName ?? '' ;
2731 const paramRunId = params . runId ?? '' ;
@@ -41,7 +45,7 @@ export const RunDetailsPage: React.FC = () => {
4145 } , [ runError ] ) ;
4246
4347 const [ stopRun , { isLoading : isStopping } ] = useStopRunsMutation ( ) ;
44- const [ deleteRun , { isLoading : isDeleting } ] = useDeleteRunsMutation ( ) ;
48+ const [ , /* deleteRun ,*/ { isLoading : isDeleting } ] = useDeleteRunsMutation ( ) ;
4549
4650 useBreadcrumbs ( [
4751 {
@@ -100,30 +104,30 @@ export const RunDetailsPage: React.FC = () => {
100104 } ) ;
101105 } ;
102106
103- const deleteClickHandle = ( ) => {
104- if ( ! runData ) {
105- return ;
106- }
107-
108- deleteRun ( {
109- project_name : paramProjectName ,
110- runs_names : [ runData . run_spec . run_name ] ,
111- } )
112- . unwrap ( )
113- . then ( ( ) => {
114- navigate ( ROUTES . RUNS . LIST ) ;
115- } )
116- . catch ( ( error ) => {
117- pushNotification ( {
118- type : 'error' ,
119- content : t ( 'common.server_error' , { error : getServerError ( error ) } ) ,
120- } ) ;
121- } ) ;
122- } ;
107+ // const deleteClickHandle = () => {
108+ // if (!runData) {
109+ // return;
110+ // }
111+ //
112+ // deleteRun({
113+ // project_name: paramProjectName,
114+ // runs_names: [runData.run_spec.run_name],
115+ // })
116+ // .unwrap()
117+ // .then(() => {
118+ // navigate(ROUTES.RUNS.LIST);
119+ // })
120+ // .catch((error) => {
121+ // pushNotification({
122+ // type: 'error',
123+ // content: t('common.server_error', { error: getServerError(error) }),
124+ // });
125+ // });
126+ // };
123127
124128 const isDisabledAbortButton = ! runData || ! isAvailableAbortingForRun ( runData . status ) || isStopping || isDeleting ;
125129 const isDisabledStopButton = ! runData || ! isAvailableStoppingForRun ( runData . status ) || isStopping || isDeleting ;
126- const isDisabledDeleteButton = ! runData || ! isAvailableDeletingForRun ( runData . status ) || isStopping || isDeleting ;
130+ // const isDisabledDeleteButton = !runData || !isAvailableDeletingForRun(runData.status) || isStopping || isDeleting;
127131
128132 return (
129133 < div className = { styles . page } >
0 commit comments