-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FE] Fix eslint and prettier errors #117
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,15 @@ | ||
import { connect } from 'react-redux'; | ||
import { | ||
fetchClustersList, | ||
} from 'redux/actions'; | ||
import App from './App'; | ||
import { fetchClustersList } from 'redux/actions'; | ||
import { getIsClusterListFetched } from 'redux/reducers/clusters/selectors'; | ||
import { RootState } from 'redux/interfaces'; | ||
import App from './App'; | ||
|
||
const mapStateToProps = (state: RootState) => ({ | ||
isClusterListFetched: getIsClusterListFetched(state), | ||
}); | ||
|
||
const mapDispatchToProps = { | ||
fetchClustersList, | ||
} | ||
}; | ||
|
||
export default connect(mapStateToProps, mapDispatchToProps)(App); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,24 @@ | ||
import { connect } from 'react-redux'; | ||
import { | ||
fetchBrokers, | ||
fetchBrokerMetrics, | ||
} from 'redux/actions'; | ||
import Brokers from './Brokers'; | ||
import { fetchBrokers, fetchBrokerMetrics } from 'redux/actions'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why is it better? |
||
import * as brokerSelectors from 'redux/reducers/brokers/selectors'; | ||
import { RootState, ClusterName } from 'redux/interfaces'; | ||
import { RouteComponentProps } from 'react-router-dom'; | ||
import Brokers from './Brokers'; | ||
|
||
interface RouteProps { | ||
clusterName: ClusterName; | ||
} | ||
|
||
interface OwnProps extends RouteComponentProps<RouteProps> { } | ||
type OwnProps = RouteComponentProps<RouteProps>; | ||
|
||
const mapStateToProps = (state: RootState, { match: { params: { clusterName } }}: OwnProps) => ({ | ||
const mapStateToProps = ( | ||
state: RootState, | ||
{ | ||
match: { | ||
params: { clusterName }, | ||
}, | ||
}: OwnProps | ||
) => ({ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why is it better? Somewhere you collapse objects, and somewhere you don't. What logic should we follow? only the length of the line? |
||
isFetched: brokerSelectors.getIsBrokerListFetched(state), | ||
clusterName, | ||
brokerCount: brokerSelectors.getBrokerCount(state), | ||
|
@@ -24,12 +28,15 @@ const mapStateToProps = (state: RootState, { match: { params: { clusterName } }} | |
offlinePartitionCount: brokerSelectors.getOfflinePartitionCount(state), | ||
inSyncReplicasCount: brokerSelectors.getInSyncReplicasCount(state), | ||
outOfSyncReplicasCount: brokerSelectors.getOutOfSyncReplicasCount(state), | ||
underReplicatedPartitionCount: brokerSelectors.getUnderReplicatedPartitionCount(state) | ||
underReplicatedPartitionCount: brokerSelectors.getUnderReplicatedPartitionCount( | ||
state | ||
), | ||
}); | ||
|
||
const mapDispatchToProps = { | ||
fetchBrokers: (clusterName: ClusterName) => fetchBrokers(clusterName), | ||
fetchBrokerMetrics: (clusterName: ClusterName) => fetchBrokerMetrics(clusterName), | ||
fetchBrokerMetrics: (clusterName: ClusterName) => | ||
fetchBrokerMetrics(clusterName), | ||
}; | ||
|
||
export default connect(mapStateToProps, mapDispatchToProps)(Brokers); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,25 @@ | ||
import { connect } from 'react-redux'; | ||
import {ClusterName, RootState} from 'redux/interfaces'; | ||
import { ClusterName, RootState } from 'redux/interfaces'; | ||
import { getConsumerGroupsList } from 'redux/reducers/consumerGroups/selectors'; | ||
import List from './List'; | ||
import { withRouter, RouteComponentProps } from 'react-router-dom'; | ||
import List from './List'; | ||
|
||
interface RouteProps { | ||
clusterName: ClusterName; | ||
} | ||
|
||
interface OwnProps extends RouteComponentProps<RouteProps> { } | ||
type OwnProps = RouteComponentProps<RouteProps>; | ||
|
||
const mapStateToProps = (state: RootState, { match: { params: { clusterName } } }: OwnProps) => ({ | ||
const mapStateToProps = ( | ||
state: RootState, | ||
{ | ||
match: { | ||
params: { clusterName }, | ||
}, | ||
}: OwnProps | ||
) => ({ | ||
clusterName, | ||
consumerGroups: getConsumerGroupsList(state) | ||
consumerGroups: getConsumerGroupsList(state), | ||
}); | ||
|
||
export default withRouter( | ||
connect(mapStateToProps)(List) | ||
); | ||
export default withRouter(connect(mapStateToProps)(List)); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,23 +4,28 @@ import formatBytes from 'lib/utils/formatBytes'; | |
import { NavLink } from 'react-router-dom'; | ||
import { clusterBrokersPath } from 'lib/paths'; | ||
|
||
const ClusterWidget: React.FC<Cluster> = ({ | ||
name, | ||
status, | ||
topicCount, | ||
brokerCount, | ||
bytesInPerSec, | ||
bytesOutPerSec, | ||
onlinePartitionCount, | ||
interface ClusterWidgetProps { | ||
cluster: Cluster; | ||
} | ||
|
||
const ClusterWidget: React.FC<ClusterWidgetProps> = ({ | ||
cluster: { | ||
name, | ||
status, | ||
topicCount, | ||
brokerCount, | ||
bytesInPerSec, | ||
bytesOutPerSec, | ||
onlinePartitionCount, | ||
}, | ||
}) => ( | ||
<NavLink to={clusterBrokersPath(name)} className="column is-full-modile is-6"> | ||
<div className="box is-hoverable"> | ||
<div | ||
className="title is-6 has-text-overflow-ellipsis" | ||
title={name} | ||
> | ||
<div className="title is-6 has-text-overflow-ellipsis" title={name}> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why is it better? |
||
<div | ||
className={`tag has-margin-right ${status === ClusterStatus.Online ? 'is-primary' : 'is-danger'}`} | ||
className={`tag has-margin-right ${ | ||
status === ClusterStatus.Online ? 'is-primary' : 'is-danger' | ||
}`} | ||
> | ||
{status} | ||
</div> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is it better?