Skip to content

Commit

Permalink
ui: rename customgraph to customChart
Browse files Browse the repository at this point in the history
Fixes: cockroachdb#23419
Release note: None
  • Loading branch information
couchand committed Mar 15, 2018
1 parent d493daa commit 06f6ae1
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 @@ -52,7 +52,7 @@ import Range from "src/views/reports/containers/range";
import CommandQueue from "src/views/reports/containers/commandQueue";
import Debug from "src/views/reports/containers/debug";
import ReduxDebug from "src/views/reports/containers/redux";
import CustomGraph from "src/views/reports/containers/customgraph";
import CustomChart from "src/views/reports/containers/customChart";
import NotFound from "src/views/app/components/NotFound";

import { alertDataSync } from "src/redux/alerts";
Expand Down Expand Up @@ -129,7 +129,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,15 +15,15 @@ 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";

const axisUnitsOptions: DropdownOption[] = [
AxisUnits.Count,
AxisUnits.Bytes,
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 @@ -34,7 +34,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 @@ -79,7 +79,7 @@ class CustomGraph extends React.Component<CustomGraphProps & WithRouterProps> {
);

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

refresh(props = this.props) {
Expand All @@ -92,7 +92,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 @@ -144,21 +144,21 @@ 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();
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 @@ -247,7 +247,7 @@ class CustomGraph extends React.Component<CustomGraphProps & WithRouterProps> {
/>
</PageConfigItem>
</PageConfig>
{ this.renderGraph() }
{ this.renderChart() }
{ this.renderMetricsTable() }
</div>
);
Expand All @@ -265,4 +265,4 @@ const mapDispatchToProps = {
refreshNodes,
};

export default connect(mapStateToProps, mapDispatchToProps)(withRouter(CustomGraph));
export default connect(mapStateToProps, mapDispatchToProps)(withRouter(CustomChart));
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 @@ -221,10 +221,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 06f6ae1

Please sign in to comment.