Skip to content

Commit

Permalink
some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
isabellafagioli committed Dec 9, 2024
1 parent 6565f7e commit 414e71a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## [Unreleased]

### Changed
- Changed cost center autocomplet to give suggestions based on the selected organizations
- Changed cost center autocomplete to give suggestions based on the selected organizations

## [0.4.0] - 2024-09-26

Expand Down
12 changes: 5 additions & 7 deletions react/components/CostCentersAutocomplete.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React, { useEffect, useState } from 'react'
import { useQuery } from 'react-apollo'

import { useIntl } from 'react-intl'
import { EXPERIMENTAL_Select } from 'vtex.styleguide'

Check failure on line 4 in react/components/CostCentersAutocomplete.tsx

View workflow job for this annotation

GitHub Actions / QE / Lint Node.js

There should be at least one empty line between import groups
import { messages } from './customers-admin'

Check failure on line 5 in react/components/CostCentersAutocomplete.tsx

View workflow job for this annotation

GitHub Actions / QE / Lint Node.js

There should be no empty line within import group

import GET_COST_CENTER_BY_ORG from '../queries/costCentersByOrg.gql'
import { SEARCH_TERM_DELAY_MS } from '../constants/debounceDelay'

Expand Down Expand Up @@ -44,11 +44,8 @@ const CostCenterAutocomplete = ({ onChange, organizationId }: Props) => {
})
) || []

const handleSearchInputChange = (debouncedSearchTerm: string) => {
if (!debouncedSearchTerm.trim()) {
setCostCenterTextInput(debouncedSearchTerm)
}
setCostCenterTextInput(debouncedSearchTerm)
const handleSearchInputChange = (serachInput: string) => {
setCostCenterTextInput(serachInput)

Check failure on line 49 in react/components/CostCentersAutocomplete.tsx

View workflow job for this annotation

GitHub Actions / QE / Lint Node.js

Replace `⏎` with `··`
}

Expand All @@ -75,7 +72,7 @@ const CostCenterAutocomplete = ({ onChange, organizationId }: Props) => {
}, [debouncedSearchTerm])

const handleChange = (selectedOption: { value: string | null; label: string } | null) => {

Check failure on line 74 in react/components/CostCentersAutocomplete.tsx

View workflow job for this annotation

GitHub Actions / QE / Lint Node.js

Replace `selectedOption:·{·value:·string·|·null;·label:·string·}·|·null` with `⏎····selectedOption:·{·value:·string·|·null;·label:·string·}·|·null⏎··`
onChange(selectedOption || { value: null, label: '' })
onChange(selectedOption ?? { value: null, label: '' })

Check failure on line 75 in react/components/CostCentersAutocomplete.tsx

View workflow job for this annotation

GitHub Actions / QE / Lint Node.js

Delete `·`
}

return (
Expand All @@ -86,6 +83,7 @@ const CostCenterAutocomplete = ({ onChange, organizationId }: Props) => {
options={options}
placeholder={formatMessage(messages.costCenter)}
multi={false}
valuesMaxHeight={200}
/>
)
}
Expand Down

0 comments on commit 414e71a

Please sign in to comment.