Skip to content

Conversation

@billyvg
Copy link
Member

@billyvg billyvg commented Jan 25, 2019

  • Optimizes the number of queries and re-renders dashboard widgets make
  • Refactors intervals to be a bit more generic and allows dashboard widgets
    to zoom.
  • Adds tests

Depends on #11669

* Optimizes the number of queries and re-renders dashboard widgets make
* Refactors intervals to be a bit more generic and allows dashboard widgets to zoom.
* Adds tests
@billyvg billyvg force-pushed the feat/dashboard/allow-widget-zoom branch from 70dad63 to 56e6cf3 Compare January 25, 2019 19:56
}),
};

export const DiscoverResult = PropTypes.arrayOf(PropTypes.shape(DiscoverResultShape));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be named DiscoverResults (instead of DiscoverResult) and DiscoverResult (instead of DiscoverResultShape)

return diffInMinutes <= TWENTY_FOUR_HOURS;
}

export function getInterval(datetimeObj, highFidelity) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe highFidelity=false here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth having unit tests for this function?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't highFidelity=false implied?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not required but it can be nice to have it always a boolean and in the method signature so reading the rest of the function won't be required to figure that out


export function getInterval(datetimeObj) {
return useShortInterval(datetimeObj) ? '5m' : '30m';
function getDiffInMinutes(datetimeObj) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unit tests for this as well?

),
timing: PropTypes.shape({
duration_ms: PropTypes.number,
marks_ms: PropTypes.shape({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we just do PropTypes.object here for now - I didn't realise this was being returned until now and it might be better to just exclude it from the api response

@billyvg billyvg requested a review from lynnagara January 29, 2019 21:11
Copy link
Member

@lynnagara lynnagara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@billyvg billyvg merged commit 0897714 into master Jan 30, 2019
@billyvg billyvg deleted the feat/dashboard/allow-widget-zoom branch January 30, 2019 00:32
@github-actions github-actions bot locked and limited conversation to collaborators Dec 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants