Skip to content

Commit

Permalink
Remove exp. tracking utils, reducers, styles
Browse files Browse the repository at this point in the history
Signed-off-by: tynandebold <[email protected]>
  • Loading branch information
tynandebold committed Nov 22, 2024
1 parent 72ebf34 commit 6974f07
Show file tree
Hide file tree
Showing 18 changed files with 8 additions and 412 deletions.
30 changes: 0 additions & 30 deletions src/actions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,36 +326,6 @@ export function toggleBookmark(bookmark, runId) {
};
}

export const UPDATE_RUN_TITLE = 'UPDATE_RUN_TITLE';

/**
* Update Run title
* @param {String} title
* @param {string} runId
*/
export function updateRunTitle(title, runId) {
return {
type: UPDATE_RUN_TITLE,
title,
runId,
};
}

export const UPDATE_RUN_NOTES = 'UPDATE_RUN_NOTES';

/**
* Update Run Notes
* @param {String} notes
* @param {string} runId
*/
export function updateRunNotes(notes, runId) {
return {
type: UPDATE_RUN_NOTES,
notes,
runId,
};
}

export const UPDATE_STATE_FROM_OPTIONS = 'UPDATE_STATE_FROM_OPTIONS';

/**
Expand Down
36 changes: 0 additions & 36 deletions src/components/app/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,6 @@
--color-base-20: #{colors.$grey-300};
--color-black-10: #{colors.$white-200};
--color-border-line: #{colors.$white-500};

// Experiment tracking colors below
--color-exp-tracking-bg: #{colors.$white-0};
--color-exp-tracking-metadata: #{colors.$white-0};
--color-exp-tracking-datasets: #{colors.$white-100};
--color-metrics-plot-text: #{colors.$grey-200};
--color-metrics-plot-text-bold: #{colors.$black-900};
--color-metrics-plot-axis-ends: #{colors.$grey-800};
--color-metrics-plot-parallel-coords-line: #{colors.$white-200};
--color-metrics-plot-parallel-coords-line-hover: #{colors.$black-0};
--color-metrics-plot-parallel-coords-axis-hover: #{colors.$grey-800};
--color-metrics-plot-tooltip-value: #{colors.$white-0};
--color-metrics-plot-tooltip-label: #{colors.$grey-300};
--color-metrics-plot-time-series-metric-line: #{colors.$grey-200};
--color-metrics-plot-time-series-axis: #{colors.$grey-300};
--color-metrics-plot-time-series-run-line: #{colors.$grey-100};
--color-metrics-plot-time-series-run-line-hovered: #{colors.$black-0};
--color-metrics-plot-time-series-dotted-line: #{colors.$grey-600};
}

.kui-theme--dark {
Expand All @@ -67,24 +49,6 @@
--color-run-list-hover: #{colors.$slate-0};
--color-base-20: #{colors.$grey-800};
--color-black-10: #{colors.$slate-700};

// Experiment tracking colors below
--color-exp-tracking-bg: #{colors.$slate-900};
--color-exp-tracking-metadata: #{colors.$slate-800};
--color-exp-tracking-datasets: #{colors.$black-850};
--color-metrics-plot-text: #{colors.$grey-900};
--color-metrics-plot-text-bold: #{colors.$white-0};
--color-metrics-plot-axis-ends: #{colors.$grey-300};
--color-metrics-plot-parallel-coords-line: #{colors.$slate-300};
--color-metrics-plot-parallel-coords-line-hover: #{colors.$grey-400};
--color-metrics-plot-parallel-coords-axis-hover: #{colors.$white-900};
--color-metrics-plot-tooltip-value: #{colors.$black-900};
--color-metrics-plot-tooltip-label: #{colors.$black-500};
--color-metrics-plot-time-series-metric-line: #{colors.$grey-700};
--color-metrics-plot-time-series-axis: #{colors.$grey-900};
--color-metrics-plot-time-series-run-line: #{colors.$slate-200};
--color-metrics-plot-time-series-run-line-hovered: #{colors.$white-0};
--color-metrics-plot-time-series-dotted-line: #{colors.$grey-500};
}

.kedro {
Expand Down
12 changes: 0 additions & 12 deletions src/components/experiment-warning/experiment-warning.js

This file was deleted.

24 changes: 0 additions & 24 deletions src/components/experiment-warning/experiment-warning.scss

This file was deleted.

3 changes: 0 additions & 3 deletions src/components/experiment-warning/index.js

This file was deleted.

62 changes: 1 addition & 61 deletions src/components/flowchart-wrapper/flowchart-wrapper.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState, useEffect, useCallback, useRef } from 'react';
import { useHistory, useLocation } from 'react-router-dom';
import { useLocation } from 'react-router-dom';
import { connect } from 'react-redux';
import classnames from 'classnames';
import { isLoading } from '../../selectors/loading';
Expand All @@ -24,13 +24,9 @@ import MetaData from '../metadata';
import MetadataModal from '../metadata-modal';
import ShareableUrlMetadata from '../shareable-url-modal/shareable-url-metadata';
import Sidebar from '../sidebar';
import Button from '../ui/button';
import CircleProgressBar from '../ui/circle-progress-bar';
import { loadLocalStorage, saveLocalStorage } from '../../store/helpers';
import {
errorMessages,
linkToFlowchartInitialVal,
localStorageFlowchartLink,
localStorageName,
localStorageBannerStatus,
params,
Expand All @@ -54,7 +50,6 @@ export const FlowChartWrapper = ({
displaySidebar,
graph,
loading,
metadataVisible,
modularPipelinesTree,
nodes,
onToggleFocusMode,
Expand All @@ -72,7 +67,6 @@ export const FlowChartWrapper = ({
displayExportBtn,
displayBanner,
}) => {
const history = useHistory();
const { pathname, search } = useLocation();
const searchParams = new URLSearchParams(search);
const { toSetQueryParam } = useGeneratePathname();
Expand All @@ -81,10 +75,6 @@ export const FlowChartWrapper = ({
const [isInvalidUrl, setIsInvalidUrl] = useState(false);
const [usedNavigationBtn, setUsedNavigationBtn] = useState(false);

const [counter, setCounter] = useState(60);
const [goBackToExperimentTracking, setGoBackToExperimentTracking] =
useState(false);

const graphRef = useRef(null);

const {
Expand Down Expand Up @@ -232,10 +222,6 @@ export const FlowChartWrapper = ({
};
}, [handlePopState]);

useEffect(() => {
setGoBackToExperimentTracking(loadLocalStorage(localStorageFlowchartLink));
}, []);

/**
* To handle redirecting to a different location via the URL (e.g. selectedNode,
* focusNode, etc.) we only need to call the matchPath actions when:
Expand Down Expand Up @@ -280,37 +266,6 @@ export const FlowChartWrapper = ({
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [graph, usedNavigationBtn, isInvalidUrl]);

const resetLinkingToFlowchartLocalStorage = useCallback(() => {
saveLocalStorage(localStorageFlowchartLink, linkToFlowchartInitialVal);

setGoBackToExperimentTracking(linkToFlowchartInitialVal);
}, []);

useEffect(() => {
if (goBackToExperimentTracking?.showGoBackBtn) {
const timer =
counter > 0 && setInterval(() => setCounter(counter - 1), 1000);

if (counter === 0) {
resetLinkingToFlowchartLocalStorage();
}

return () => clearInterval(timer);
}
}, [
counter,
goBackToExperimentTracking?.showGoBackBtn,
resetLinkingToFlowchartLocalStorage,
]);

const onGoBackToExperimentTrackingHandler = () => {
const url = goBackToExperimentTracking.fromURL;

history.push(url);

resetLinkingToFlowchartLocalStorage();
};

const handleBannerClose = (bannerKey) => {
saveLocalStorage(localStorageBannerStatus, { [bannerKey]: false });
};
Expand Down Expand Up @@ -355,21 +310,6 @@ export const FlowChartWrapper = ({
<div className="pipeline-wrapper">
<PipelineWarning />
<FlowChart />
<div
className={classnames('pipeline-wrapper__go-back-btn', {
'pipeline-wrapper__go-back-btn--show':
goBackToExperimentTracking?.showGoBackBtn,
'pipeline-wrapper__go-back-btn--show-sidebar-visible':
sidebarVisible,
'pipeline-wrapper__go-back-btn--show-metadata-visible':
metadataVisible,
})}
>
<Button onClick={onGoBackToExperimentTrackingHandler}>
<CircleProgressBar>{counter}</CircleProgressBar>
Return to Experiment Tracking
</Button>
</div>
<div
className={classnames('pipeline-wrapper__loading', {
'pipeline-wrapper__loading--sidebar-visible': sidebarVisible,
Expand Down
25 changes: 1 addition & 24 deletions src/components/metadata/metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,10 @@ import {
import { toggleNodeClicked } from '../../actions/nodes';
import { toggleCode, togglePlotModal } from '../../actions';
import getShortType from '../../utils/short-type';
import {
useGeneratePathname,
useGeneratePathnameForExperimentTracking,
} from '../../utils/hooks/use-generate-pathname';
import { useGeneratePathname } from '../../utils/hooks/use-generate-pathname';

import './styles/metadata.scss';
import MetaDataStats from './metadata-stats';
import { isRunningLocally } from '../../utils';

/**
* Shows node meta data
Expand All @@ -43,8 +39,6 @@ const MetaData = ({
showDatasetPreviews,
}) => {
const { toSelectedPipeline } = useGeneratePathname();
const { toExperimentTrackingPath, toMetricsViewPath } =
useGeneratePathnameForExperimentTracking();

// Hide code panel when selected metadata changes
useEffect(() => onToggleCode(false), [metadata, onToggleCode]);
Expand Down Expand Up @@ -321,23 +315,6 @@ const MetaData = ({
</button>
</>
)}
{isRunningLocally()
? hasTrackingData && (
<button
className="pipeline-metadata__link"
onClick={
isMetricsTrackingDataset
? toMetricsViewPath
: toExperimentTrackingPath
}
>
<ExpandIcon className="pipeline-metadata__link-icon"></ExpandIcon>
<span className="pipeline-metadata__link-text">
Open in Experiment Tracking
</span>
</button>
)
: null}
{hasTablePreview && (
<>
<div className="pipeline-metadata__preview">
Expand Down
14 changes: 0 additions & 14 deletions src/components/metadata/metadata.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -425,13 +425,6 @@ describe('MetaData', () => {
expect.stringContaining('3 items')
);
});
it('shows the experiment link', () => {
const wrapper = mount({
nodeId: modelInputDatasetNodeId,
mockMetadata: nodeMetricsData,
});
expect(wrapper.find('.pipeline-metadata__link').length).toBe(1);
});
});

describe('JSON dataset nodes', () => {
Expand All @@ -445,13 +438,6 @@ describe('MetaData', () => {
expect.stringContaining('3 items')
);
});
it('shows the experiment link', () => {
const wrapper = mount({
nodeId: modelInputDatasetNodeId,
mockMetadata: nodeJSONData,
});
expect(wrapper.find('.pipeline-metadata__link').length).toBe(1);
});
});

describe('Plot nodes', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/primary-toolbar/primary-toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import MenuIcon from '../icons/menu';
import './primary-toolbar.scss';

/**
* Toolbar to house buttons that controls display options for the main panel (flowchart, experiment details, etc)
* Toolbar to house buttons that controls display options for the main panel (flowchart, etc)
* @param {JSX} children The content to be rendered within the toolbar
* @param {Function} onToggleSidebar Handle toggling of sidebar collapsable view
* @param {Boolean} visible Handle display of tooltip text in relation to collapsable view
Expand Down
4 changes: 0 additions & 4 deletions src/components/sidebar/sidebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,6 @@
visibility: visible;
transition: visibility 0s;
}

&--experiment-tracking {
overflow-y: scroll;
}
}

.pipeline-toolbar {
Expand Down
11 changes: 0 additions & 11 deletions src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { sanitizedPathname } from './utils';
export const localStorageName = 'KedroViz';
export const localStorageFlowchartLink = 'KedroViz-link-to-flowchart';
export const localStorageMetricsSelect = 'KedroViz-metrics-chart-select';
export const localStorageRunsMetadata = 'KedroViz-runs-metadata';
export const localStorageShareableUrl = 'KedroViz-shareable-url';
export const localStorageFeedbackSeen = 'KedroViz-feedback-seen';
export const localStorageBannerStatus = 'KedroViz-banners';
Expand Down Expand Up @@ -123,19 +122,12 @@ export const routes = {
selectedName: `${pathname}?${activePipeline}&${params.selectedName}=:fullName`,
selectedPipeline: `${pathname}?${activePipeline}`,
},
experimentTracking: {
main: `${pathname}experiment-tracking`,
selectedView: `${pathname}experiment-tracking?${params.view}=:view`,
selectedRuns: `${pathname}experiment-tracking?${params.run}=:ids&${params.view}=:view&${params.comparisonMode}=:isComparison`,
},
};

export const errorMessages = {
node: 'Please check the value of "selected_id"/"sid" or "selected_name"/"sn" in the URL',
modularPipeline: 'Please check the value of "focused_id"/"fid" in the URL',
pipeline: 'Please check the value of "pipeline_id"/"pid" in the URL',
experimentTracking: `Please check the spelling of "run_ids" or "view" or "comparison" in the URL. It may be a typo 😇`,
runIds: `Please check the value of "run_ids" in the URL. Perhaps you've deleted the entity 🙈 or it may be a typo 😇`,
};

export const datasetStatLabels = ['rows', 'columns', 'file_size'];
Expand Down Expand Up @@ -167,9 +159,6 @@ export const inputKeyToStateKeyMap = {
endpoint: 'hasEndpoint',
};

export const RUN_TITLE = 'title';
export const RUN_NOTES = 'notes';

export const PACKAGE_FSSPEC = 'fsspec';
export const PACKAGE_KEDRO_DATASETS = 'kedro-datasets';

Expand Down
2 changes: 0 additions & 2 deletions src/reducers/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { combineReducers } from 'redux';
import runsMetadata from './runs-metadata';
import flags from './flags';
import graph from './graph';
import layer from './layers';
Expand Down Expand Up @@ -84,7 +83,6 @@ const combinedReducer = combineReducers({
tag,
modularPipeline,
visible,
runsMetadata,
showBanner: bannerReducer,
// These props don't have any actions associated with them
display: createReducer(null),
Expand Down
Loading

0 comments on commit 6974f07

Please sign in to comment.