Skip to content

Commit 51fae37

Browse files
tito12tito1212
andauthored
Refactoring for display column lineage JSON (#2301)
* refactoring for display column lineage JSON Signed-off-by: tito1212 <vladyslav.sedenko@getindata.com> * request api after click Signed-off-by: tito1212 <vladyslav.sedenko@getindata.com> Signed-off-by: tito1212 <vladyslav.sedenko@getindata.com> Co-authored-by: tito1212 <vladyslav.sedenko@getindata.com>
1 parent c003400 commit 51fae37

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

web/src/components/datasets/DatasetDetailPage.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ interface StateProps {
5555
versions: DatasetVersion[]
5656
dataset: Dataset
5757
versionsLoading: boolean
58+
isDatasetInit: boolean
5859
}
5960

6061
interface DispatchProps {
@@ -94,6 +95,13 @@ const DatasetDetailPage: FunctionComponent<IProps> = props => {
9495
setTab(newValue)
9596
}
9697

98+
const handleFetchDataset = () => {
99+
if(!props.isDatasetInit) {
100+
fetchDataset(props.lineageDataset.namespace, props.lineageDataset.name)
101+
}
102+
return true
103+
}
104+
97105
if (versionsLoading) {
98106
return (
99107
<Box display={'flex'} justifyContent={'center'}>
@@ -148,7 +156,7 @@ const DatasetDetailPage: FunctionComponent<IProps> = props => {
148156
/>
149157
)}
150158
{tab === 1 && <DatasetVersions versions={props.versions} />}
151-
{tab === 2 && <DatasetColumnLineage columnLineage={props.dataset.columnLineage} />}
159+
{tab === 2 && handleFetchDataset() && <DatasetColumnLineage columnLineage={props.dataset.columnLineage} />}
152160
</Box>
153161
)
154162
}
@@ -157,7 +165,8 @@ const mapStateToProps = (state: IState) => ({
157165
datasets: state.datasets.result,
158166
versions: state.datasetVersions.result.versions,
159167
dataset: state.dataset.result,
160-
versionsLoading: state.datasetVersions.isLoading
168+
versionsLoading: state.datasetVersions.isLoading,
169+
isDatasetInit: state.dataset.init,
161170
})
162171

163172
const mapDispatchToProps = (dispatch: Redux.Dispatch) =>

0 commit comments

Comments
 (0)