Skip to content

Commit

Permalink
apply Gage diff
Browse files Browse the repository at this point in the history
  • Loading branch information
jenny-s51 committed May 30, 2024
1 parent 0596a3d commit 9ac0619
Showing 1 changed file with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
DropdownSeparator,
DropdownToggle,
} from '@patternfly/react-core/deprecated';
import { useNavigate, useParams } from 'react-router-dom';
import { useNavigate } from 'react-router-dom';
import { usePipelinesAPI } from '~/concepts/pipelines/context';
import useNotification from '~/utilities/useNotification';
import { PipelineRunKFv2, RuntimeStateKF, StorageStateKF } from '~/concepts/pipelines/kfTypes';
Expand All @@ -26,13 +26,12 @@ const PipelineRunDetailsActions: React.FC<PipelineRunDetailsActionsProps> = ({
run,
}) => {
const navigate = useNavigate();
const { experimentId } = useParams();
const { namespace, api } = usePipelinesAPI();
const { namespace, api, refreshAllAPI } = usePipelinesAPI();
const notification = useNotification();
const [open, setOpen] = React.useState(false);
const isExperimentsAvailable = useIsAreaAvailable(SupportedArea.PIPELINE_EXPERIMENTS).status;
const isRunActive = run?.storage_state === StorageStateKF.AVAILABLE;
const [experiment] = useExperimentById(experimentId);
const [experiment] = useExperimentById(run?.experiment_id);
const isExperimentActive = experiment?.storage_state === StorageStateKF.AVAILABLE;

const RestoreDropdownItem = (
Expand All @@ -44,6 +43,7 @@ const PipelineRunDetailsActions: React.FC<PipelineRunDetailsActionsProps> = ({
api
.unarchivePipelineRun({}, run.run_id)
.catch((e) => notification.error('Unable to restore pipeline run', e.message))
.then(() => refreshAllAPI())
}
>
Restore
Expand Down Expand Up @@ -83,7 +83,7 @@ const PipelineRunDetailsActions: React.FC<PipelineRunDetailsActionsProps> = ({
cloneRunRoute(
namespace,
run.run_id,
isExperimentsAvailable ? experimentId : undefined,
isExperimentsAvailable ? run.experiment_id : undefined,
),
)
}
Expand All @@ -101,11 +101,13 @@ const PipelineRunDetailsActions: React.FC<PipelineRunDetailsActionsProps> = ({
>
Stop
</DropdownItem>,
isExperimentsAvailable && experimentId && isRunActive ? (
isExperimentsAvailable && run.experiment_id && isRunActive ? (
<DropdownItem
key="compare-runs"
onClick={() =>
navigate(experimentsCompareRunsRoute(namespace, experimentId, [run.run_id]))
navigate(
experimentsCompareRunsRoute(namespace, run.experiment_id, [run.run_id]),
)
}
>
Compare runs
Expand Down

0 comments on commit 9ac0619

Please sign in to comment.