Skip to content

Commit cfc329e

Browse files
committed
eslint fix changes
Signed-off-by: tito12 <vladyslav.sedenko@gmail.com>
1 parent c6d7793 commit cfc329e

7 files changed

Lines changed: 84 additions & 75 deletions

File tree

Lines changed: 43 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
// SPDX-License-Identifier: Apache-2.0
22

3-
import React, { FunctionComponent, useEffect } from 'react'
43
import * as Redux from 'redux'
54
import { Box, Button } from '@material-ui/core'
6-
import MqEmpty from '../core/empty/MqEmpty'
7-
import MqJson from '../core/code/MqJson'
8-
import MqText from '../core/text/MqText'
5+
import { Dataset } from '../../types/api'
6+
import { IState } from '../../store/reducers'
7+
import { LineageDataset } from '../lineage/types'
98
import { bindActionCreators } from 'redux'
109
import { connect } from 'react-redux'
11-
import { Dataset } from '../../types/api'
1210
import { fetchDataset, resetDataset } from '../../store/actionCreators'
1311
import { fileSize } from '../../helpers'
14-
import { LineageDataset } from '../lineage/types'
1512
import { saveAs } from 'file-saver'
16-
import { IState } from '../../store/reducers'
13+
import MqEmpty from '../core/empty/MqEmpty'
14+
import MqJson from '../core/code/MqJson'
15+
import MqText from '../core/text/MqText'
16+
import React, { FunctionComponent, useEffect } from 'react'
1717

1818
interface DatasetColumnLineageProps {
1919
lineageDataset: LineageDataset
@@ -39,9 +39,12 @@ const DatasetColumnLineage: FunctionComponent<IProps> = props => {
3939
}, [lineageDataset.name])
4040

4141
// unmounting
42-
useEffect(() => () => {
43-
resetDataset()
44-
}, [])
42+
useEffect(
43+
() => () => {
44+
resetDataset()
45+
},
46+
[]
47+
)
4548

4649
const handleDownloadPayload = (data: object) => {
4750
const title = `${lineageDataset.name}-${lineageDataset.namespace}-columnLineage`
@@ -51,46 +54,40 @@ const DatasetColumnLineage: FunctionComponent<IProps> = props => {
5154

5255
return (
5356
<>
54-
{columnLineage
55-
? (
56-
<>
57-
{fileSize(JSON.stringify(columnLineage)).kiloBytes > 500 ? (
58-
<Box p={2}>
59-
<MqEmpty title={'Payload is too big for render'}>
60-
<div>
61-
<MqText subdued>
62-
Please click on button and download payload as file
63-
</MqText>
64-
<br />
65-
<Button
66-
variant='outlined'
67-
color='primary'
68-
onClick={() => handleDownloadPayload(columnLineage)}
69-
>
70-
Download payload
71-
</Button>
72-
</div>
73-
</MqEmpty>
74-
</Box>
75-
) : (
76-
<MqJson
77-
code={columnLineage}
78-
wrapLongLines={true}
79-
showLineNumbers={true}
80-
/>
81-
)}
82-
</>
83-
)
84-
: (
85-
<MqEmpty title={'No column lineage'} body={'Column lineage not available for the specified dataset.'} />
86-
)
87-
}
57+
{columnLineage ? (
58+
<>
59+
{fileSize(JSON.stringify(columnLineage)).kiloBytes > 500 ? (
60+
<Box p={2}>
61+
<MqEmpty title={'Payload is too big for render'}>
62+
<div>
63+
<MqText subdued>Please click on button and download payload as file</MqText>
64+
<br />
65+
<Button
66+
variant='outlined'
67+
color='primary'
68+
onClick={() => handleDownloadPayload(columnLineage)}
69+
>
70+
Download payload
71+
</Button>
72+
</div>
73+
</MqEmpty>
74+
</Box>
75+
) : (
76+
<MqJson code={columnLineage} wrapLongLines={true} showLineNumbers={true} />
77+
)}
78+
</>
79+
) : (
80+
<MqEmpty
81+
title={'No column lineage'}
82+
body={'Column lineage not available for the specified dataset.'}
83+
/>
84+
)}
8885
</>
8986
)
9087
}
9188

9289
const mapStateToProps = (state: IState) => ({
93-
dataset: state.dataset.result,
90+
dataset: state.dataset.result
9491
})
9592

9693
const mapDispatchToProps = (dispatch: Redux.Dispatch) =>
@@ -105,4 +102,4 @@ const mapDispatchToProps = (dispatch: Redux.Dispatch) =>
105102
export default connect(
106103
mapStateToProps,
107104
mapDispatchToProps
108-
)(DatasetColumnLineage)
105+
)(DatasetColumnLineage)

web/src/components/datasets/DatasetDetailPage.tsx

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// SPDX-License-Identifier: Apache-2.0
22

3-
import React, { ChangeEvent, FunctionComponent, SetStateAction, useEffect } from 'react'
43
import * as Redux from 'redux'
54
import { Box, Chip, Tab, Tabs } from '@material-ui/core'
65
import { DatasetVersion } from '../../types/api'
@@ -15,9 +14,8 @@ import { LineageDataset } from '../lineage/types'
1514
import { bindActionCreators } from 'redux'
1615
import { connect } from 'react-redux'
1716
import {
18-
fetchDataset,
19-
resetDataset,
2017
fetchDatasetVersions,
18+
resetDataset,
2119
resetDatasetVersions
2220
} from '../../store/actionCreators'
2321
import { useHistory } from 'react-router-dom'
@@ -28,6 +26,7 @@ import DatasetInfo from './DatasetInfo'
2826
import DatasetVersions from './DatasetVersions'
2927
import IconButton from '@material-ui/core/IconButton'
3028
import MqText from '../core/text/MqText'
29+
import React, { ChangeEvent, FunctionComponent, SetStateAction, useEffect } from 'react'
3130

3231
const styles = ({ spacing }: ITheme) => {
3332
return createStyles({
@@ -57,7 +56,6 @@ interface StateProps {
5756

5857
interface 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

7472
const 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) =>
183190
export default connect(
184191
mapStateToProps,
185192
mapDispatchToProps
186-
)(withStyles(styles)(DatasetDetailPage))
193+
)(withStyles(styles)(DatasetDetailPage))

web/src/components/sidenav/Sidenav.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,9 @@ class Sidenav extends React.Component<SidenavProps> {
9090
title={i18next.t('sidenav.events')}
9191
active={this.props.location.pathname === '/events'}
9292
>
93-
<SVG
94-
src="https://raw.githubusercontent.com/MarquezProject/marquez/main/web/src/img/iconSearchArrow.svg"
95-
width={'30px'}
93+
<SVG
94+
src='https://raw.githubusercontent.com/MarquezProject/marquez/main/web/src/img/iconSearchArrow.svg'
95+
width={'30px'}
9696
/>
9797
</MqIconButton>
9898
</RouterLink>

web/src/store/reducers/dataset.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
// SPDX-License-Identifier: Apache-2.0
22

33
import { Dataset } from '../../types/api'
4-
import {
5-
FETCH_DATASET,
6-
FETCH_DATASET_SUCCESS,
7-
RESET_DATASET
8-
} from '../actionCreators/actionTypes'
9-
import { fetchDatasetSuccess } from '../actionCreators';
4+
import { FETCH_DATASET, FETCH_DATASET_SUCCESS, RESET_DATASET } from '../actionCreators/actionTypes'
5+
import { fetchDatasetSuccess } from '../actionCreators'
106

117
export type IDatasetState = { isLoading: boolean; result: Dataset; init: boolean }
128

13-
export const initialState: IDatasetState = { isLoading: false, init: false, result: { } as Dataset }
9+
export const initialState: IDatasetState = { isLoading: false, init: false, result: {} as Dataset }
1410

1511
type IDatasetAction = ReturnType<typeof fetchDatasetSuccess>
1612

web/src/store/reducers/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import { History } from 'history'
44
import { Reducer, combineReducers } from 'redux'
55
import { connectRouter } from 'connected-react-router'
6-
import dataset, { IDatasetState } from './dataset';
6+
import dataset, { IDatasetState } from './dataset'
77
import datasetVersions, { IDatasetVersionsState } from './datasetVersions'
88
import datasets, { IDatasetsState } from './datasets'
99
import display, { IDisplayState } from './display'

web/src/store/requests/datasets.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: Apache-2.0
22

33
import { API_URL } from '../../globals'
4-
import { Dataset, DatasetVersions, Datasets } from "../../types/api";
4+
import { Dataset, DatasetVersions, Datasets } from '../../types/api'
55
import { genericFetchWrapper } from './index'
66

77
export const getDatasets = async (namespace: string, limit = 25, offset = 0) => {

web/src/store/sagas/index.ts

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,41 @@
22

33
import * as Effects from 'redux-saga/effects'
44
import {
5+
FETCH_DATASET,
56
FETCH_DATASETS,
67
FETCH_DATASET_VERSIONS,
78
FETCH_EVENTS,
89
FETCH_JOBS,
910
FETCH_LINEAGE,
1011
FETCH_RUNS,
11-
FETCH_SEARCH,
12-
FETCH_DATASET
13-
} from "../actionCreators/actionTypes";
12+
FETCH_SEARCH
13+
} from '../actionCreators/actionTypes'
1414
import { Namespaces } from '../../types/api'
1515
import { all, put, take } from 'redux-saga/effects'
1616

1717
const call: any = Effects.call
1818

1919
import {
2020
applicationError,
21+
fetchDatasetSuccess,
2122
fetchDatasetVersionsSuccess,
2223
fetchDatasetsSuccess,
2324
fetchEventsSuccess,
2425
fetchJobsSuccess,
2526
fetchLineageSuccess,
2627
fetchNamespacesSuccess,
2728
fetchRunsSuccess,
28-
fetchSearchSuccess, fetchDatasetSuccess
29-
} from "../actionCreators";
30-
import { getDatasetVersions, getDatasets, getDataset, getEvents, getJobs, getNamespaces, getRuns } from '../requests'
29+
fetchSearchSuccess
30+
} from '../actionCreators'
31+
import {
32+
getDataset,
33+
getDatasetVersions,
34+
getDatasets,
35+
getEvents,
36+
getJobs,
37+
getNamespaces,
38+
getRuns
39+
} from '../requests'
3140
import { getLineage } from '../requests/lineage'
3241
import { getSearch } from '../requests/search'
3342

0 commit comments

Comments
 (0)