-
Notifications
You must be signed in to change notification settings - Fork 511
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
[Deps]: Remove dependency on redux-form #2593
[Deps]: Remove dependency on redux-form #2593
Conversation
Signed-off-by: Hariom Gupta <[email protected]>
Signed-off-by: Hariom Gupta <[email protected]>
Signed-off-by: Hariom Gupta <[email protected]>
Signed-off-by: Hariom Gupta <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2593 +/- ##
==========================================
+ Coverage 96.58% 96.61% +0.03%
==========================================
Files 255 255
Lines 7732 7744 +12
Branches 2009 1998 -11
==========================================
+ Hits 7468 7482 +14
+ Misses 264 262 -2 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Hariom Gupta <[email protected]>
@@ -16,4 +16,4 @@ export const DEFAULT_OPERATION = 'all'; | |||
export const DEFAULT_LOOKBACK = '1h'; | |||
export const DEFAULT_LIMIT = 20; | |||
|
|||
export const FORM_CHANGE_ACTION_TYPE = '@@redux-form/CHANGE'; | |||
export const FORM_CHANGE_ACTION_TYPE = '@@redux/searchSideBar/CHANGE_SERVICE'; |
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.
FORM_CHANGE
is a very generic name while the event seems to be a change in a single specific dropdown
@@ -673,23 +719,19 @@ export function mapStateToProps(state) { | |||
traceIDs: traceIDs || null, | |||
}, | |||
searchMaxLookback: _get(state, 'config.search.maxLookback'), | |||
selectedService: searchSideBarFormSelector(state, 'service'), | |||
selectedLookback: searchSideBarFormSelector(state, 'lookback'), |
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.
no replacement for this one?
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.
redux-form
maps the redux state to props and those props are then used in the component. These values were being populated after a user selects a service or lookback and are then used to conditionally show the startDate
startDateTime
endDate
endDateTime
fields, and also to trigger the middleware to load updated operations for the selectedService.
This whole state is now being selected from fromData
state, so there's no need for a replacement for this
Signed-off-by: Hariom Gupta <[email protected]>
Signed-off-by: Hariom Gupta <[email protected]>
Signed-off-by: Hariom Gupta <[email protected]>
} = this.props; | ||
const { invalid, searchMaxLookback, services, submitting: disabled } = this.props; | ||
const { formData } = this.state; | ||
const { service: selectedService, lookback: selectedLookback } = formData; |
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.
I noticed there is no selectedOperation
. When reloading the Search screen the service remains, but the operation is reset to all
. Could we retain operation as well? OK to create a separate issue.
@@ -16,4 +16,4 @@ export const DEFAULT_OPERATION = 'all'; | |||
export const DEFAULT_LOOKBACK = '1h'; | |||
export const DEFAULT_LIMIT = 20; | |||
|
|||
export const FORM_CHANGE_ACTION_TYPE = '@@redux-form/CHANGE'; | |||
export const SEARCH_SIDEBAR_CHANGE_SERVICE_ACTION_TYPE = '@@redux/searchSideBar/CHANGE_SERVICE'; |
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.
given the context of search-form
package I think CHANGE_SERVICE_ACTION_TYPE
would've been sufficient, but ok.
const isInvalid = blur && Boolean(validationResult); | ||
|
||
return ( | ||
<Popover placement="bottomLeft" open={isInvalid} {...validationResult}> |
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.
one thing I noticed that if I put an invalid value into duration, like 100kg, I get this permanent tooltip popup, but the Find Traces button is still enabled, resulting in a server error if clicked. It would make sense to disable the button (can be a separate issue)
services, | ||
submitting: disabled, | ||
} = this.props; | ||
const { invalid, searchMaxLookback, services, submitting: disabled } = this.props; |
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.
Personally I think it should always be called submitting
, to reflect the state of the form. disabled
is just a property of individual fields.
Signed-off-by: Yuri Shkuro <[email protected]>
Thanks! Feel free to address comments in the follow up PRs (but not a high priority) |
Which problem is this PR solving?
Description of the changes
ValidatedFormField
component is created to handle the Validated minDuration and maxDuration fields that require validation andPopover
to be displayed on failed validations.redux-form
field, but would now trigger on selecting a new service from Service Selector.How was this change tested?
Checklist
jaeger
:make lint test
jaeger-ui
:npm run lint
andnpm run test