-
Notifications
You must be signed in to change notification settings - Fork 0
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
Settings bounds #27 #8
Settings bounds #27 #8
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the .env and address wrapper declaration and this should be ready to be merged.
.env
Outdated
@@ -0,0 +1 @@ | |||
SKIP_PREFLIGHT_CHECK=true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.env files should not be checked into the codebase. This needs to be removed.
src/components/App.test.js
Outdated
@@ -6,6 +6,7 @@ afterEach(cleanup); | |||
|
|||
describe('<App/>', () => { | |||
it('renders without crashing', () => { | |||
let wrapper = global.renderWithRedux(<App />); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was commented on in your existing open PR that it should be removed.
f0087d1
to
4b70862
Compare
Added functionality to enable users to have controls over their math bounds in screenshot captures (#7 )
I started by creating additional inputs for top, bottom, left, and right bounds that correspond to the edges of the image returned from the asyncScreenshot() method.
I also added a dropdown to denote the user's choice of image setting between ('contain', 'stretch, 'preserveY', preserveX').
I then added the left, right, top, and bottom values from our inputs to our redux-store, passing them onto the Settings.js Component through the SettingsContainer. Now our settingsComponent could update and refer to our bound values from the store.
I then updated the settings action creator to account for the UPDATE_BOUNDS_SETTING, which adjusts our store's left, right, top, and bottom values as the user changes them live.
Now when we fetch an image from the API through the requestFrame() method, we also pass in an object 'mathBounds', that act as additional parameters for the async ScreenShot() method, accounting for errors such as if our left bound is greater than our right bound, or whether our bottom bound is greater than our top bound.
I finally adjusted the errors in requestFrame, to account for invalidBounds. Now when a user tries to capture the graph and send a request to the API, it validates whether the bounds follow protocol
(left bound is less than right, bottom bound is less than top), and flashes an error to the top-banner if an error occurs.
I also wrote tests for these as well, and they work in making sure our bounds are correct :)