Skip to content

Commit

Permalink
fix run list for new partitions view (#7742)
Browse files Browse the repository at this point in the history
  • Loading branch information
prha committed May 4, 2022
1 parent 97ed20f commit 8cc4bdc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import React from 'react';
import {Link} from 'react-router-dom';
import styled from 'styled-components/macro';

import {featureEnabled, FeatureFlag} from '../app/Flags';
import {PYTHON_ERROR_FRAGMENT} from '../app/PythonErrorInfo';
import {RunTable, RUN_TABLE_RUN_FRAGMENT} from '../runs/RunTable';
import {DagsterTag} from '../runs/RunTag';
Expand Down Expand Up @@ -59,6 +60,7 @@ export const PartitionRunListForStep: React.FC<PartitionRunListForStepProps> = (
/>
);
}
const newPartitionsView = featureEnabled(FeatureFlag.flagNewPartitionsView);
return (
<div>
<RunTable
Expand All @@ -69,16 +71,20 @@ export const PartitionRunListForStep: React.FC<PartitionRunListForStepProps> = (
Step Info
</th>,
]}
additionalColumnsForRow={(run) => [
<StepStatsColumn
key="context"
stats={props.stepStatsByRunId[run.runId] || null}
linkToLogs={`/instance/runs/${run.runId}?${qs.stringify({
selection: props.stepName,
logs: `step:${props.stepName}`,
})}`}
/>,
]}
additionalColumnsForRow={
newPartitionsView
? undefined
: (run) => [
<StepStatsColumn
key="context"
stats={props.stepStatsByRunId[run.runId] || null}
linkToLogs={`/instance/runs/${run.runId}?${qs.stringify({
selection: props.stepName,
logs: `step:${props.stepName}`,
})}`}
/>,
]
}
/>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import * as React from 'react';
import styled from 'styled-components/macro';

import {useViewport} from '../gantt/useViewport';
import {QueryPersistedStateConfig, useQueryPersistedState} from '../hooks/useQueryPersistedState';
import {GRAPH_EXPLORER_SOLID_HANDLE_FRAGMENT} from '../pipelines/GraphExplorer';
import {linkToRunEvent} from '../runs/RunUtils';
import {RunFilterToken} from '../runs/RunsFilterInput';
Expand Down Expand Up @@ -75,18 +74,10 @@ const timeboundsOfPartitions = (partitionColumns: {steps: {unix: number}[]}[]) =
return [minUnix, maxUnix] as const;
};

const PartitionRunSelectionQueryConfig: QueryPersistedStateConfig<PartitionRunSelection | null> = {
encode: (val) => ({partitionName: val?.partitionName, stepName: val?.stepName}),
decode: (qs) =>
qs.partitionName && qs.stepName
? {partitionName: qs.partitionName, stepName: qs.stepName}
: null,
};

export const PartitionStepStatus: React.FC<PartitionStepStatusProps> = (props) => {
const {viewport, containerProps} = useViewport();
const [hovered, setHovered] = React.useState<PartitionRunSelection | null>(null);
const [focused, setFocused] = useQueryPersistedState(PartitionRunSelectionQueryConfig);
const [focused, setFocused] = React.useState<PartitionRunSelection | null>(null);
const {setPageSize} = props;

React.useEffect(() => {
Expand Down

0 comments on commit 8cc4bdc

Please sign in to comment.