Skip to content

Commit

Permalink
feat(company data): re-enable csv upload and revert setting of ready …
Browse files Browse the repository at this point in the history
…state (#1144)

enabled feature is needed for R24.12 and setting of ready state is now taken care of from BDPM side due to changed configuration
  • Loading branch information
manojava-gk authored Oct 7, 2024
1 parent df8a53e commit 5a2f397
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 19 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
- updated technical user details with user type and service endpoint fields. Also, updated copy icon color for better view and made copy icon available only when value is available [#1137](https://github.com/eclipse-tractusx/portal-frontend/pull/1137)
- **Company Subscriptions**
- update API query parameters and fix tab UI scroll [#1131](https://github.com/eclipse-tractusx/portal-frontend/pull/1131)
- **Customer Data**
- re-enabled CSV upload [#1144](https://github.com/eclipse-tractusx/portal-frontend/pull/1144)
- reverted manual intervention with ready state api [#1144](https://github.com/eclipse-tractusx/portal-frontend/pull/1144)
- **Onboarding Service Provider**
- enhanced permission and company role validation for Onboarding Service Provider [#1176](https://github.com/eclipse-tractusx/portal-frontend/pull/1176)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ import {
} from 'features/companyData/slice'
import { statusColorMap } from 'utils/dataMapper'
import AddCircleOutlineIcon from '@mui/icons-material/AddCircleOutline'
import { show } from 'features/control/overlay'
import { OVERLAYS } from 'types/Constants'
import UploadIcon from '@mui/icons-material/Upload'

export const CompanyAddressList = ({
handleButtonClick,
Expand Down Expand Up @@ -195,6 +198,11 @@ export const CompanyAddressList = ({
},
icon: <AddCircleOutlineIcon />,
},
{
title: t('content.companyData.csvUploadBtn'),
click: () => dispatch(show(OVERLAYS.CSV_UPLOAD_OVERLAY)),
icon: <UploadIcon />,
},
]}
autoFocus={false}
onButtonClick={handleButtonClick}
Expand Down
21 changes: 2 additions & 19 deletions src/components/pages/CompanyData/components/EditForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import {
type CompanyDataType,
useUpdateCompanySiteAndAddressMutation,
type CompanyDataFieldsType,
useUpdateCompanyStatusToReadyMutation,
} from 'features/companyData/companyDataApiSlice'
import { useSelector } from 'react-redux'
import {
Expand Down Expand Up @@ -68,7 +67,6 @@ export default function EditForm({
const [loading, setLoading] = useState<boolean>(false)
const [isValid, setIsValid] = useState<boolean>(false)
const [updateData] = useUpdateCompanySiteAndAddressMutation()
const [updateReadyState] = useUpdateCompanyStatusToReadyMutation()
const companyData = useSelector(companyDataSelector)
const [success, setSuccess] = useState<boolean>(false)
const [error, setError] = useState<boolean>(false)
Expand Down Expand Up @@ -123,11 +121,9 @@ export default function EditForm({
}
}

const updateStateToReady = async (response: CompanyDataType[]) => {
const handleCreation = async () => {
try {
await updateReadyState({
externalIds: [response[0].externalId],
})
await updateData([input])
.unwrap()
.then(() => {
setSuccess(true)
Expand All @@ -138,19 +134,6 @@ export default function EditForm({
setLoading(false)
}

const handleCreation = async () => {
try {
await updateData([input])
.unwrap()
.then((response) => {
updateStateToReady(response)
})
} catch (e) {
setError(true)
setLoading(false)
}
}

const getTitle = () => {
if (newForm) {
return isAddress
Expand Down

0 comments on commit 5a2f397

Please sign in to comment.