-
Notifications
You must be signed in to change notification settings - Fork 6
Feature 2309 team skills report query parameters #2321
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
Feature 2309 team skills report query parameters #2321
Conversation
| className, | ||
| style | ||
| }) => { | ||
| const isControlled = !!selected && Array.isArray(selected); |
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.
Previously this component maintained its own state of selected members in addition to allowing them to be passed in by a component that also maintains that same state. I changed this to require the selected members to be passed in using the selected prop. The function specified by the onChange prop is called every time the selection of members changes so the parent component can update its state. This simplifies the code and works much better with our custom hook useQueryParameters.
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 component is a little tricky I'm noticing, as both the earlier and the current implementations do not seem to update the member selection when the selected prop changes (e.g. during runtime as data becomes available from the server) as I'd expected. Typically with controlled components, changes to the controlling props (like selected in this case) should cause a re-render of the child. Just noting the observation 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.
Was a little tricky. Now it works like a dream. ✨
| import React, { useContext, useState } from 'react'; | ||
| import React, { useContext, useRef, useState } from 'react'; | ||
|
|
||
| import { Autocomplete, Button, TextField, Typography } from '@mui/material'; |
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 combined some MUI imports.
| listHeight={300} | ||
| onChange={selected => setSelectedMembers(selected)} | ||
| onChange={setSelectedMembers} | ||
| selected={selectedMembers} |
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 MemberSelector component now requires the selected prop.
| const [showRadar, setShowRadar] = useState(false); | ||
|
|
||
| const processedQPs = useRef(false); | ||
| useQueryParameters( |
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 the main point of this PR.
|
You may want to check for snapshots or what is causing the Gradle build to fail. |
No description provided.