-
Notifications
You must be signed in to change notification settings - Fork 4
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
[DUOS-1759][risk=no] Updated step selector for data access request page #1787
Conversation
… request page - Added radio group option to forms - Added global styles (initial start) - Modified forms to extract some of the specific styling to the data submission form (that this page doesnt share)
Co-authored-by: Gregory Rushton <rushtong@users.noreply.github.com>
…to change the normal select so it does not allow you to add a value, but later. Moved new researcher code to the existing researcher component.
…nt to change the normal select so it does not allow you to add a value, but later
… Removed explicit creatable formfieldType - it will now create if a creatableConfig is provided, otherwise, it will not allow the user to add new fields
…DUOS-1752 # Conflicts: # src/components/forms/forms.css # src/components/forms/forms.js
…not saving value, converted input checkboxes to FormField components - will update the radio later :(
… the form components
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.
the tabs themselves look good!
} | ||
}, [ | ||
h(Tab, { | ||
// key: `dar-request-step-1`, |
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.
is this comment needed? if not, maybe delete.
sorry, didnt read the ticket thoroughly enough, will continue work on the behavior of this today (this pr just focused on the UI) |
1. position-stickyed the step bar 2. added window eventListener to watch for changes in scroll position and select the appropriate step. 3. One hiccup was that when you clicked on a section, it would slowly scroll there in the tab selector since the onScroll would update for the current position, overtaking the default where the tab selector would immediately change, and that ~.5s delay felt realy bad... so I added a debounce manually. Tried to do it through lodash, but it wasn't working, and I wasnt sure why.
IT'S READY AGAIN, lots of changes this time - read the ticket more closely, this is lookin' pretty sweet ;) |
@@ -215,6 +230,8 @@ class DataAccessRequestApplicationNew extends Component { | |||
prev.formData = merge(prev.formData, formData); | |||
return prev; | |||
}); | |||
|
|||
window.addEventListener('scroll', this.onScroll); |
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.
Shoot, i didnt realize codacy wouldnt like this... I don't know how to do this part of the ticket without adding an event listener though. :[ Let me brainstorm
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.
If codacy is giving us false positives here, we can change that. I'm not sure what the best practice is, but codacy shouldn't be the primary roadblock.
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.
TIL you can bypass codacy warnings by adding disabling eslint on the same lines - would this be okay? XD I guess I'll let the reviewers weigh in hehe
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.
There's nothing wrong with your function. It's a textbook definition of a debounce with a reset when the function is called repeatedly.
Codacy's issue is that it's not context aware of its warnings. Generally setTimeout
is frowned upon for anything regarding data since defining a fixed time delay on async operations (where time to completion is indeterminate) can be dangerous. In this context though the UI changes are independent of anything else going on in the component, so it's not a problem.
If you care about Codacy warnings, try looking into lodash's
(vanilla, not fp) debounce
function and see if that does anything (though odds are it'll be doing the same things under the hood).
That said, I have no idea about eventListener
warnings. If Codacy is giving you warnings about onScroll
then you can ignore them.
…kirt codacy rules
…kirt codacy rules
…kboxes and radio components on the cloud use section
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 is really cool! It's very satisfying! There's some weird behavior around step 4 on my laptop (seems to prefer staying on 3 or 5) but clicking each of them works as expected and this is likely just some weirdness with heights and such.
@@ -1062,7 +1094,12 @@ class DataAccessRequestApplicationNew extends Component { | |||
}) | |||
]), | |||
|
|||
div({ isRendered: this.state.step === 4 }, [ | |||
div({id: 'step-4', className: 'step-container'}, [ |
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.
You don't have to worry about the Progress Report component right now. The mocks have it set up, but we won't be implementing the feature on the back-end for a while due to Data Submitter and the DAR Form UI redesign being a higher priority.
The funky behavior in the scroll is probably because the div is so small that the typical user's scroll movement will shift this component in and out of your designated windowTop threshold during the debounce period.
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.
ok i will remove this for now
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.
Overall the code looks good. I've left two comments (the Codacy related one is optional) for you to look over, but the left navbar is working smoothly.
I think this is because step 4 is literally like 30 pixels large or something, so it's really hard to catch - when this component is fleshed out and implemented, we won't see this issue anymore! :) |
…ids, which ... isnt ideal. So updated the methods to use class instead of id, since the ids should not have to be futzed with and tied to the step they show up in!
Lots of ugliness in the code to accomodate keeping the existing page as it is!
Have you read Terra's Contributing Guide lately? If not, do that first.