Skip to content

Commit

Permalink
fix(graphCard): issues/380 graph refresh on query (#384)
Browse files Browse the repository at this point in the history
  • Loading branch information
cdcabrera committed Aug 25, 2020
1 parent 10eea39 commit 850eb65
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ exports[`GraphCard Component should render a non-connected component: non-connec
dataSets={Array []}
domain={Object {}}
height={275}
key="generatedid-"
key="chart_{\\"granularity\\":\\"daily\\"}"
padding={
Object {
"bottom": 75,
Expand Down Expand Up @@ -272,7 +272,7 @@ exports[`GraphCard Component should render multiple states: error with 403 statu
}
domain={Object {}}
height={275}
key="generatedid-"
key="chart_{\\"granularity\\":\\"daily\\"}"
padding={
Object {
"bottom": 75,
Expand Down Expand Up @@ -384,7 +384,7 @@ exports[`GraphCard Component should render multiple states: error with 500 statu
}
domain={Object {}}
height={275}
key="generatedid-"
key="chart_{\\"granularity\\":\\"daily\\"}"
padding={
Object {
"bottom": 75,
Expand Down Expand Up @@ -496,7 +496,7 @@ exports[`GraphCard Component should render multiple states: fulfilled 1`] = `
}
domain={Object {}}
height={275}
key="generatedid-"
key="chart_{\\"granularity\\":\\"daily\\"}"
padding={
Object {
"bottom": 75,
Expand Down
4 changes: 2 additions & 2 deletions src/components/graphCard/graphCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class GraphCard extends React.Component {
* @returns {Node}
*/
renderChart() {
const { filterGraphData, graphData, selectOptionsType, productShortLabel, viewId } = this.props;
const { filterGraphData, graphData, selectOptionsType, productShortLabel, query, viewId } = this.props;
const graphGranularity = this.getQueryGranularity();
const { selected } = graphCardTypes.getGranularityOptions(selectOptionsType);
const updatedGranularity = graphGranularity || selected;
Expand Down Expand Up @@ -144,7 +144,7 @@ class GraphCard extends React.Component {

return (
<ChartArea
key={helpers.generateId()}
key={`chart_${JSON.stringify(query)}`}
{...chartAreaProps}
dataSets={filteredGraphData(graphData)}
chartLegend={({ chart, datum }) => (
Expand Down

0 comments on commit 850eb65

Please sign in to comment.