Skip to content

Commit

Permalink
fix(cardeditformcontent): populate timeRange on load
Browse files Browse the repository at this point in the history
  • Loading branch information
scottdickerson committed Nov 24, 2020
1 parent 496230f commit 7ee2c89
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -250,11 +250,12 @@ const CardEditFormContent = ({
validTimeRangeOption.id === selectedTimeRange
)}
light
onChange={({ selectedItem }) => {
onChange={({ selectedItem, interval }) => {
const { range } = timeRangeToJSON[selectedItem.id];
setSelectedTimeRange(selectedItem.id);
onChange({
...cardConfig,
interval,
timeRange: selectedItem.id,
dataSource: { ...cardConfig.dataSource, range },
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ const cardConfig = {
timeDataSourceId: 'timestamp',
addSpaceOnEdges: 1,
},
interval: 'day',
};

const mockOnChange = jest.fn();
Expand Down

0 comments on commit 7ee2c89

Please sign in to comment.