@@ -15,7 +15,7 @@ import {
1515} from '@mui/material'
1616import { CalendarIcon } from '@mui/x-date-pickers'
1717import { CircularProgress } from '@mui/material'
18- import { Dataset , DatasetVersion } from '../../types/api'
18+ import { Dataset } from '../../types/api'
1919import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
2020import { IState } from '../../store/reducers'
2121import { LineageDataset } from '../../types/lineage'
@@ -28,7 +28,6 @@ import {
2828 deleteDataset ,
2929 dialogToggle ,
3030 fetchDataset ,
31- fetchInitialDatasetVersions ,
3231 resetDataset ,
3332 resetDatasetVersions ,
3433 setTabIndex ,
@@ -57,15 +56,12 @@ interface StateProps {
5756 lineageDataset : LineageDataset
5857 dataset : Dataset
5958 isDatasetLoading : boolean
60- initVersions : DatasetVersion [ ]
61- initVersionsLoading : boolean
6259 datasets : IState [ 'datasets' ]
6360 display : IState [ 'display' ]
6461 tabIndex : IState [ 'lineage' ] [ 'tabIndex' ]
6562}
6663
6764interface DispatchProps {
68- fetchInitialDatasetVersions : typeof fetchInitialDatasetVersions
6965 fetchDataset : typeof fetchDataset
7066 resetDatasetVersions : typeof resetDatasetVersions
7167 resetDataset : typeof resetDataset
@@ -92,11 +88,8 @@ const DatasetDetailPage: FunctionComponent<IProps> = (props) => {
9288 fetchDataset,
9389 resetDataset,
9490 resetDatasetVersions,
95- fetchInitialDatasetVersions,
9691 deleteDataset,
9792 dialogToggle,
98- initVersions,
99- initVersionsLoading,
10093 lineageDataset,
10194 tabIndex,
10295 setTabIndex,
@@ -118,7 +111,6 @@ const DatasetDetailPage: FunctionComponent<IProps> = (props) => {
118111
119112 // might need to map first version to its own state
120113 useEffect ( ( ) => {
121- fetchInitialDatasetVersions ( lineageDataset . namespace , lineageDataset . name )
122114 fetchDataset ( lineageDataset . namespace , lineageDataset . name )
123115 } , [ lineageDataset . name ] )
124116
@@ -133,19 +125,14 @@ const DatasetDetailPage: FunctionComponent<IProps> = (props) => {
133125 setTabIndex ( newValue )
134126 }
135127
136- if ( ! dataset || isDatasetLoading || ( initVersionsLoading && initVersions . length === 0 ) ) {
128+ if ( ! dataset || isDatasetLoading ) {
137129 return (
138130 < Box display = { 'flex' } justifyContent = { 'center' } mt = { 2 } >
139131 < CircularProgress color = 'primary' />
140132 </ Box >
141133 )
142134 }
143135
144- if ( initVersions . length === 0 ) {
145- return null
146- }
147-
148- const firstVersion = initVersions [ 0 ]
149136 const { name, tags, description } = dataset
150137 const facetsStatus = datasetFacetsStatus ( dataset . facets )
151138 const assertions = datasetFacetsQualityAssertions ( dataset . facets )
@@ -328,7 +315,7 @@ const DatasetDetailPage: FunctionComponent<IProps> = (props) => {
328315 checked = { showTags }
329316 onChange = { ( ) => setShowTags ( ! showTags ) }
330317 inputProps = { { 'aria-label' : 'toggle show tags' } }
331- disabled = { initVersionsLoading }
318+ disabled = { isDatasetLoading }
332319 />
333320 }
334321 label = { i18next . t ( 'datasets.show_field_tags' ) }
@@ -341,7 +328,6 @@ const DatasetDetailPage: FunctionComponent<IProps> = (props) => {
341328 dataset = { dataset }
342329 datasetFields = { dataset . fields }
343330 facets = { dataset . facets }
344- run = { firstVersion . createdByRun }
345331 showTags = { showTags }
346332 isCurrentVersion
347333 />
@@ -356,15 +342,12 @@ const mapStateToProps = (state: IState) => ({
356342 dataset : state . dataset . result ,
357343 isDatasetLoading : state . dataset . isLoading ,
358344 display : state . display ,
359- initVersions : state . datasetVersions . initDsVersion . versions ,
360- initVersionsLoading : state . datasetVersions . isInitDsVerLoading ,
361345 tabIndex : state . lineage . tabIndex ,
362346} )
363347
364348const mapDispatchToProps = ( dispatch : Redux . Dispatch ) =>
365349 bindActionCreators (
366350 {
367- fetchInitialDatasetVersions : fetchInitialDatasetVersions ,
368351 fetchDataset : fetchDataset ,
369352 resetDatasetVersions : resetDatasetVersions ,
370353 resetDataset : resetDataset ,
0 commit comments