diff --git a/CHANGELOG.md b/CHANGELOG.md index d0ee2901a..65c2b30da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,9 +4,19 @@ ### Change +- **Technical User Details** + - 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) - **Onboarding Service Provider Management** - Added search to ospm table[#1132](https://github.com/eclipse-tractusx/portal-frontend/pull/1132) +### Bugfixes + +- **Connector Management** + - fixed overlay enabling on click of managed connectors(details) [#1142](https://github.com/eclipse-tractusx/portal-frontend/pull/1142) + - fixed customer link selection and fixed resetting values [#1119](https://github.com/eclipse-tractusx/portal-frontend/pull/1119) + ## 2.2.0-alpha.1 ### Bugfixes diff --git a/src/components/pages/CompanySubscriptions/index.tsx b/src/components/pages/CompanySubscriptions/index.tsx index e41e53bc5..5ed78576b 100644 --- a/src/components/pages/CompanySubscriptions/index.tsx +++ b/src/components/pages/CompanySubscriptions/index.tsx @@ -252,7 +252,7 @@ export default function CompanySubscriptions() { { const { t } = useTranslation() const [selectedValue, setSelectedValue] = useState() const [serviceAccountUsers, setServiceAccountUsers] = useState([]) - const [selectedTechnicalUser, setSelectedTechnicalUser] = useState('') + const [selectedTechnicalUser, setSelectedTechnicalUser] = useState({}) + const [selectedCustomerLink, setSelectedCustomerLink] = useState({}) useEffect(() => { if (fetchServiceAccountUsers) @@ -274,10 +279,20 @@ any) => { i.serviceAccountId === getValues().ConnectorTechnicalUser ) if (selectedConnectorTechnicalUser.length > 0) { - setSelectedTechnicalUser(selectedConnectorTechnicalUser[0]?.name) + setSelectedTechnicalUser(selectedConnectorTechnicalUser[0]) } }, [serviceAccountUsers]) + useEffect(() => { + const selectedCustomer: EdcSubscriptionsType[] = subscriptions?.filter( + (item: { subscriptionId: string }) => + item.subscriptionId === getValues().ConnectorSubscriptionId + ) + if (selectedCustomer.length > 0) { + setSelectedCustomerLink(selectedCustomer[0]) + } + }, [subscriptions]) + const handleTechnicalUserSubmit = () => { if ( selectedValue === t('content.edcconnector.modal.createNewTechnicalUser') @@ -354,6 +369,12 @@ any) => { )} onChange={(event) => { setSelectedValue(event.target.value) + resetField('TechnicalUserName', { + defaultValue: '', + }) + resetField('TechnicalUserDescription', { + defaultValue: '', + }) }} size="small" sx={{ @@ -612,7 +633,7 @@ any) => { 'content.edcconnector.modal.insertform.subscription.error' ), items: subscriptions, - defaultSelectValue: {}, + defaultSelectValue: selectedCustomerLink ?? {}, keyTitle: 'name', }} /> diff --git a/src/components/pages/EdcConnector/AddConnectorOverlay/index.tsx b/src/components/pages/EdcConnector/AddConnectorOverlay/index.tsx index c0077f692..441539a13 100644 --- a/src/components/pages/EdcConnector/AddConnectorOverlay/index.tsx +++ b/src/components/pages/EdcConnector/AddConnectorOverlay/index.tsx @@ -109,6 +109,7 @@ const AddConnectorOverlay = ({ handleSubmit, getValues, control, + resetField, trigger, formState: { errors }, reset, @@ -120,8 +121,10 @@ const AddConnectorOverlay = ({ const [selected, setSelected] = useState({}) useEffect(() => { - if (openDialog) reset(formFields) - }, [openDialog, reset]) + if (openDialog || connectorStep === 0) { + reset(formFields) + } + }, [openDialog, reset, connectorStep]) useEffect(() => { if (serviceAccounts && serviceAccounts?.meta?.totalPages > page) { @@ -216,7 +219,14 @@ const AddConnectorOverlay = ({ setNewTechnicalUSer={setNewTechnicalUSer} newUserLoading={newUserLoading} newUserSuccess={newUserSuccess} - {...{ handleSubmit, control, errors, trigger, getValues }} + {...{ + handleSubmit, + control, + errors, + trigger, + getValues, + resetField, + }} /> )} @@ -225,12 +235,9 @@ const AddConnectorOverlay = ({