Skip to content

Commit

Permalink
ui: rename customgraph to customChart
Browse files Browse the repository at this point in the history
Fixes: #23419
Release note: None
  • Loading branch information
couchand committed Mar 20, 2018
1 parent 3bd0dcc commit 2a76f73
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions pkg/ui/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import NodeLogs from "src/views/cluster/containers/nodeLogs";
import JobsPage from "src/views/jobs";
import Certificates from "src/views/reports/containers/certificates";
import CommandQueue from "src/views/reports/containers/commandQueue";
import CustomGraph from "src/views/reports/containers/customgraph";
import CustomChart from "src/views/reports/containers/customChart";
import Debug from "src/views/reports/containers/debug";
import ProblemRanges from "src/views/reports/containers/problemRanges";
import Localities from "src/views/reports/containers/localities";
Expand Down Expand Up @@ -126,7 +126,7 @@ ReactDOM.render(
<Route path="debug">
<IndexRoute component={Debug} />
<Route path="redux" component={ReduxDebug} />
<Route path="graph" component={CustomGraph} />
<Route path="chart" component={CustomChart} />
</Route>
<Route path="raft" component={ Raft }>
<IndexRedirect to="ranges" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { Metric, Axis, AxisUnits } from "src/views/shared/components/metricQuery
import { PageConfig, PageConfigItem } from "src/views/shared/components/pageconfig";

import { CustomMetricState, CustomMetricRow } from "./customMetric";
import "./customgraph.styl";
import "./customChart.styl";

import { NodeStatus$Properties } from "../../../../util/proto";

Expand All @@ -25,7 +25,7 @@ const axisUnitsOptions: DropdownOption[] = [
AxisUnits.Duration,
].map(au => ({ label: AxisUnits[au], value: au.toString() }));

export interface CustomGraphProps {
export interface CustomChartProps {
refreshNodes: typeof refreshNodes;
nodesQueryValid: boolean;
nodesSummary: NodesSummary;
Expand All @@ -36,7 +36,7 @@ interface UrlState {
units: string;
}

class CustomGraph extends React.Component<CustomGraphProps & WithRouterProps> {
class CustomChart extends React.Component<CustomChartProps & WithRouterProps> {
// Selector which computes dropdown options based on the nodes available on
// the cluster.
private nodeOptions = createSelector(
Expand Down Expand Up @@ -81,7 +81,7 @@ class CustomGraph extends React.Component<CustomGraphProps & WithRouterProps> {
);

static title() {
return "Custom Graph";
return "Custom Chart";
}

refresh(props = this.props) {
Expand All @@ -94,7 +94,7 @@ class CustomGraph extends React.Component<CustomGraphProps & WithRouterProps> {
this.refresh();
}

componentWillReceiveProps(props: CustomGraphProps & WithRouterProps) {
componentWillReceiveProps(props: CustomChartProps & WithRouterProps) {
this.refresh(props);
}

Expand Down Expand Up @@ -146,22 +146,22 @@ class CustomGraph extends React.Component<CustomGraphProps & WithRouterProps> {
});
}

// Render a graph of the currently selected metrics.
renderGraph() {
// Render a chart of the currently selected metrics.
renderChart() {
const metrics = this.currentMetrics();
const units = this.currentAxisUnits();
const { nodesSummary } = this.props;
if (_.isEmpty(metrics)) {
return (
<section className="section">
<h3>Click "Add Metric" to add a metric to the custom graph.</h3>
<h3>Click "Add Metric" to add a metric to the custom chart.</h3>
</section>
);
}

return (
<section className="section">
<MetricsDataProvider id="debug-custom-graph">
<MetricsDataProvider id="debug-custom-chart">
<LineGraph>
<Axis units={units}>
{
Expand Down Expand Up @@ -269,7 +269,7 @@ class CustomGraph extends React.Component<CustomGraphProps & WithRouterProps> {
/>
</PageConfigItem>
</PageConfig>
{ this.renderGraph() }
{ this.renderChart() }
{ this.renderMetricsTable() }
</div>
);
Expand All @@ -287,7 +287,7 @@ const mapDispatchToProps = {
refreshNodes,
};

export default connect(mapStateToProps, mapDispatchToProps)(withRouter(CustomGraph));
export default connect(mapStateToProps, mapDispatchToProps)(withRouter(CustomChart));

function isStoreMetric(nodeStatus: NodeStatus$Properties, metricName: string) {
return _.has(nodeStatus.store_statuses[0].metrics, metricName);
Expand Down
6 changes: 3 additions & 3 deletions pkg/ui/src/views/reports/containers/debug/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,10 @@ export default function Debug() {
url="#/debug/redux"
/>
</DebugTableRow>
<DebugTableRow title="Custom Time-Series Graph">
<DebugTableRow title="Custom Time-Series Chart">
<DebugTableLink
name="Customizable graph of time series metrics"
url="#/debug/graph"
name="Customizable chart of time series metrics"
url="#/debug/chart"
/>
</DebugTableRow>
</DebugTable>
Expand Down

0 comments on commit 2a76f73

Please sign in to comment.