11// SPDX-License-Identifier: Apache-2.0
22
3- import React , { ChangeEvent , FunctionComponent , SetStateAction , useEffect } from 'react'
43import * as Redux from 'redux'
54import { Box , Chip , Tab , Tabs } from '@material-ui/core'
65import { DatasetVersion } from '../../types/api'
@@ -15,9 +14,8 @@ import { LineageDataset } from '../lineage/types'
1514import { bindActionCreators } from 'redux'
1615import { connect } from 'react-redux'
1716import {
18- fetchDataset ,
19- resetDataset ,
2017 fetchDatasetVersions ,
18+ resetDataset ,
2119 resetDatasetVersions
2220} from '../../store/actionCreators'
2321import { useHistory } from 'react-router-dom'
@@ -28,6 +26,7 @@ import DatasetInfo from './DatasetInfo'
2826import DatasetVersions from './DatasetVersions'
2927import IconButton from '@material-ui/core/IconButton'
3028import MqText from '../core/text/MqText'
29+ import React , { ChangeEvent , FunctionComponent , SetStateAction , useEffect } from 'react'
3130
3231const styles = ( { spacing } : ITheme ) => {
3332 return createStyles ( {
@@ -57,7 +56,6 @@ interface StateProps {
5756
5857interface DispatchProps {
5958 fetchDatasetVersions : typeof fetchDatasetVersions
60- fetchDataset : typeof fetchDataset
6159 resetDatasetVersions : typeof resetDatasetVersions
6260 resetDataset : typeof resetDataset
6361}
@@ -72,7 +70,14 @@ function a11yProps(index: number) {
7270}
7371
7472const DatasetDetailPage : FunctionComponent < IProps > = props => {
75- const { classes, fetchDatasetVersions, fetchDataset, resetDataset, resetDatasetVersions, versions, versionsLoading } = props
73+ const {
74+ classes,
75+ fetchDatasetVersions,
76+ resetDataset,
77+ resetDatasetVersions,
78+ versions,
79+ versionsLoading
80+ } = props
7681 const { root } = classes
7782 const history = useHistory ( )
7883 const i18next = require ( 'i18next' )
@@ -82,10 +87,13 @@ const DatasetDetailPage: FunctionComponent<IProps> = props => {
8287 } , [ props . lineageDataset . name ] )
8388
8489 // unmounting
85- useEffect ( ( ) => ( ) => {
86- resetDataset ( )
87- resetDatasetVersions ( )
88- } , [ ] )
90+ useEffect (
91+ ( ) => ( ) => {
92+ resetDataset ( )
93+ resetDatasetVersions ( )
94+ } ,
95+ [ ]
96+ )
8997
9098 const [ tab , setTab ] = React . useState ( 0 )
9199 const handleChange = ( event : ChangeEvent , newValue : SetStateAction < number > ) => {
@@ -173,7 +181,6 @@ const mapDispatchToProps = (dispatch: Redux.Dispatch) =>
173181 bindActionCreators (
174182 {
175183 fetchDatasetVersions : fetchDatasetVersions ,
176- fetchDataset : fetchDataset ,
177184 resetDatasetVersions : resetDatasetVersions ,
178185 resetDataset : resetDataset
179186 } ,
@@ -183,4 +190,4 @@ const mapDispatchToProps = (dispatch: Redux.Dispatch) =>
183190export default connect (
184191 mapStateToProps ,
185192 mapDispatchToProps
186- ) ( withStyles ( styles ) ( DatasetDetailPage ) )
193+ ) ( withStyles ( styles ) ( DatasetDetailPage ) )
0 commit comments