Skip to content
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

change select menus with Autocomplete component #1475

Merged

Conversation

dzhaniivanov
Copy link
Contributor

@github-actions
Copy link

github-actions bot commented Jul 10, 2023

✅ Tests will run for this PR. Once they succeed it can be merged.

Copy link
Contributor

@igoychev igoychev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great!
just please fix a few minor comments

Comment on lines +22 to +23
<Autocomplete
value={beneficiary}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add size="small" here to preserve the original for more condensed size of the dropdown

}
isOptionEqualToValue={(option, value) =>
option.person
? option.person.firstName === value?.person?.firstName
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it enough to compare only the first name?
(not sure what is the expected behaviour just by reading the code)

import { useTranslation } from 'react-i18next'
import { useBeneficiariesList } from 'service/beneficiary'

export default function BeneficiarySelect({ name = 'beneficiaryId' }) {
const { t } = useTranslation()
const { data } = useBeneficiariesList()
const [field, meta] = useField(name)
const [field, meta, { setValue }] = useField(name)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the linter will complain that 'field' is unused now. to fix it just skip the field like this:
const [, meta, { setValue }] = useField(name)

@igoychev igoychev added the run tests Allows running the tests workflows for forked repos label Jul 11, 2023
@github-actions github-actions bot removed the run tests Allows running the tests workflows for forked repos label Jul 11, 2023
@igoychev igoychev merged commit fc7859d into podkrepi-bg:master Jul 11, 2023
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants