Skip to content

Commit

Permalink
Merge branch 'main' into bug/upload-docs-maxFiles-count-not-updating-…
Browse files Browse the repository at this point in the history
…based-on-uploaded-files
  • Loading branch information
evegufy authored Aug 13, 2024
2 parents 89cbf73 + ba040e8 commit e139ef8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 17 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

### Bugfix

- country value is not updating if user moves back and forth between steps [#232](https://github.com/eclipse-tractusx/portal-frontend-registration/pull/232)
- remove code that always displays error message on screen [#230](https://github.com/eclipse-tractusx/portal-frontend-registration/pull/230)
- updated the logic for maxFiles count in upload docs step [#234](https://github.com/eclipse-tractusx/portal-frontend-registration/pull/234)

## 2.0.1
Expand Down
16 changes: 9 additions & 7 deletions src/components/cax-companyData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,14 @@ export const CompanyDataCax = () => {

useEffect(() => {
const index = i18n.language === 'de' ? 0 : 1
countryList = countryList?.map((country) => ({
id: country.alpha2Code,
label:
country.countryName[index]?.value + ' (' + country.alpha2Code + ')',
}))
setCountryArr(countryList)
if (countryList?.length > 0 && Array.isArray(countryList[0].countryName)) {
countryList = countryList?.map((country) => ({
id: country.alpha2Code,
label:
country.countryName[index]?.value + ' (' + country.alpha2Code + ')',
}))
setCountryArr(countryList)
}
}, [countryList, i18n.language])

const defaultSelectedCountry = countryArr?.filter(
Expand Down Expand Up @@ -586,7 +588,7 @@ export const CompanyDataCax = () => {
<Autocomplete
id="selectList"
options={countryArr}
defaultValue={defaultSelectedCountry}
value={defaultSelectedCountry}
renderInput={(params) => (
<TextField variant="standard" {...params} />
)}
Expand Down
1 change: 0 additions & 1 deletion src/components/dragdrop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,6 @@ export const DragDrop = () => {
<DragdropLayout
{...props}
error={fileError}
documentError={'documentError'}
/>
)}
inputContent={<DragdropContent />}
Expand Down
10 changes: 1 addition & 9 deletions src/components/dragdropLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,16 @@
********************************************************************************/

import { type ILayoutProps } from 'react-dropzone-uploader'
import { useTranslation } from 'react-i18next'

interface CustomLayoutProps extends ILayoutProps {
error: string
documentError: string
documentError?: string
}

function DragdropLayout(props: CustomLayoutProps) {
const { t } = useTranslation()

return (
<div>
<div {...props.dropzoneProps}>{props.input}</div>
{props.documentError && (
<div className="text-danger ms-4 mt-2 fw-bold-600 fw-font-12">
{t('documentUpload.dragDropExceedSizeErrorMsg')}
</div>
)}
{props.error && (
<div className="text-danger ms-4 mt-2 fw-bold-600 fw-font-12">
{props.error}
Expand Down

0 comments on commit e139ef8

Please sign in to comment.