-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[frontend] refacto objectOrganisationFIeld jsx to tsx #13781
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
base: master
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #13781 +/- ##
=======================================
Coverage 30.79% 30.80%
=======================================
Files 2907 2907
Lines 192125 192166 +41
Branches 39165 39187 +22
=======================================
+ Hits 59166 59188 +22
- Misses 132959 132978 +19
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
1c222ef to
2cb4539
Compare
| // Deprecated - https://mui.com/system/styles/basics/ | ||
| // Do not use it for new code. | ||
| const useStyles = makeStyles(() => ({ | ||
| const useStyles = makeStyles<Theme>(() => ({ |
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.
makeStyles is deprecated, you should rather integrate the styles directly in the html :)
| const handleChangeObjectOrganization = ( | ||
| name: string, | ||
| values: { label: string; value: string }[], | ||
| value: FieldOption[], |
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 can keep the denomination 'values' since it's an array
| const handleChangeObjectOrganization = ( | ||
| name: string, | ||
| values: { label: string; value: string }[], | ||
| value: FieldOption[], |
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.
| value: FieldOption[], | |
| values: FieldOption[], |
| setOrganizations(searchResults); | ||
| }); | ||
| const searchOrganizations = (event?: SyntheticEvent<Element, Event>) => { | ||
| if (event?.target instanceof HTMLInputElement) { |
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 are changing the behavior with this if, you can remove it if you event is typed correctly (BaseSyntheticEvent)
| })); | ||
| setOrganizations(searchResults); | ||
| }); | ||
| const searchOrganizations = (event?: SyntheticEvent<Element, Event>) => { |
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.
| const searchOrganizations = (event?: SyntheticEvent<Element, Event>) => { | |
| const searchOrganizations = (event?: BaseSyntheticEvent) => { |
Proposed changes
Checklist