Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CGM Trends Range Selections #36

Merged
merged 16 commits into from
Dec 15, 2016
Merged

CGM Trends Range Selections #36

merged 16 commits into from
Dec 15, 2016

Conversation

krystophv
Copy link
Member

Allows the user to toggle the display of individual ranges in the CGM Trends view.

@krystophv
Copy link
Member Author

@krystophv krystophv changed the title [WIP] CGM Trends Range Selections CGM Trends Range Selections Dec 5, 2016
@krystophv
Copy link
Member Author

Is dependency of: tidepool-org/blip#363

@krystophv
Copy link
Member Author

ping @jebeck for review (or feel free to pass to next available person)

Copy link
Contributor

@jebeck jebeck left a comment

Choose a reason for hiding this comment

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

Two overall requests: (1) the small change to the arguments to connect in RangeSelect - the () => {} is actually worse than I thought (it throws up a bunch of errors in the console) and (2) a discussion/sync up about future approach in general (deeply nested connect()-ed components or not) and the path forward for controlling Trends options via checkboxes through redux state (b/c the RangeSelect component isn't quite the right interface for the BGM options)


.label {
composes: mediumContrastText from '../../../styles/typography.css';
font-size: 16px;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we try to keep font sizes out of the component-level CSS files, please? Create a new variable in the typography.css if needed?

}, dispatch);
}

export default connect(
Copy link
Contributor

Choose a reason for hiding this comment

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

A couple of comments here: the first and third functions can just be absent (can pass null for the first and just leave the third out - if you were looking at the TrendsContainer example, it adds an additional property in the third function ({withRef: true}) for compatibility with blip's parent-child component communication through refs (an outdated strategy), but nothing like that is necessary here). Generally connect()-ed components are also considered containers, not components.

Back in the baby days of redux, it wasn't considered very good practice to nest a lot of connect()-ed components, but apparently the advice has changed a little (linking for Dan's comment, his link is now broken). However, it does sound like there are still some potential performance issues, for which there is a potential middleware solution.

Since we're starting to be concerned about performance here in viz, I think it'd be good to discuss pros & cons of the options here and sync up on future strategy (with @hntrdglss as well). Also more generally the approach you've taken here is not what I expected. Since we already had code in blip that renders checkboxes for the BGM options and since the checkboxes have to be rendered in blip code due to the current split between what blip controls of the dataviz options, I expected that code to be reused (and there was a comment about this on the card ("...the checkboxes should use the same code as the checkboxes for the options available on BGM trends (Lines on/off, Range & Avg on/off, etc.)" from Nov. 8 when @darinkrauss was helping to get things more precise on the card). I get that the Trello cards are full of lots of info in a not easily digestible format, so I'm not surprised you missed that, but it might have been nice to talk through the approach before the PR was up to make sure we're all on the same page about approach and have any discussions about pros & cons of options with respect to future code.

@krystophv
Copy link
Member Author

@jebeck - addressed the CSS issue and leaving the connect()-edness (outside of fixing the args) till we have a larger discussion. I think this is back up for review.

Conflicts:
	package.json
	src/containers/trends/CBGTrendsContainer.js
	src/containers/trends/TrendsContainer.js
	src/index.js
	src/redux/actions/trends.js
	src/redux/constants/actionTypes.js
@krystophv krystophv merged commit 513d5ba into master Dec 15, 2016
@krystophv krystophv deleted the krystophv/cgm-checkbox branch December 15, 2016 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants