From 48d173431193fbb19b6ad686aaa8bc64efe227f7 Mon Sep 17 00:00:00 2001 From: lavanya-bmw <106523828+lavanya-bmw@users.noreply.github.com> Date: Fri, 14 Jul 2023 16:14:37 +0200 Subject: [PATCH 01/15] fix(app-release-process): selected values disappears (#137) --- CHANGELOG.md | 14 +++ .../basic/ReleaseProcess/AppPage/index.tsx | 24 ----- .../ContractAndConsent/index.tsx | 89 +++++++++---------- .../components/CommonContractAndConsent.tsx | 7 ++ 4 files changed, 63 insertions(+), 71 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fedf5df91..d1623a4ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,20 @@ - Show done state - Provide icon for marking a notification as read/unread - New Header and Filter UI +- App Release Process + - App lead image load issue fix + - Fixed issue-upon upload of the conformity certificate, previous selected consents are gone + - Service Marketplace + - Subscription Button cross service highlighted +- BugFix + - Home - Carousel + - Responsiveness - when switching the portal width screens get rendering issues + - Notification + - isRead action issue fix +- Company Role Update + - Change the payload data as per backend logic +- App Subscription + - Add and Edit Tenant URL functionality in detail overlay - Connectors - Disable DAPS related sections - App Subscription diff --git a/src/components/shared/basic/ReleaseProcess/AppPage/index.tsx b/src/components/shared/basic/ReleaseProcess/AppPage/index.tsx index c472c7889..cc878ac10 100644 --- a/src/components/shared/basic/ReleaseProcess/AppPage/index.tsx +++ b/src/components/shared/basic/ReleaseProcess/AppPage/index.tsx @@ -587,30 +587,6 @@ export default function AppPage() { }} errorText={t('content.apprelease.appReleaseForm.fileSizeError')} /> - {item === 'uploadDataPrerequisits' && - errors?.uploadDataPrerequisits?.type === ErrorType.REQUIRED && ( - - {t( - 'content.apprelease.appReleaseForm.fileUploadIsMandatory' - )} - - )} - {item === 'uploadTechnicalGuide' && - errors?.uploadTechnicalGuide?.type === ErrorType.REQUIRED && ( - - {t( - 'content.apprelease.appReleaseForm.fileUploadIsMandatory' - )} - - )} - {item === 'uploadAppContract' && - errors?.uploadAppContract?.type === ErrorType.REQUIRED && ( - - {t( - 'content.apprelease.appReleaseForm.fileUploadIsMandatory' - )} - - )} ))} diff --git a/src/components/shared/basic/ReleaseProcess/ContractAndConsent/index.tsx b/src/components/shared/basic/ReleaseProcess/ContractAndConsent/index.tsx index 4129da985..97b9a0b09 100644 --- a/src/components/shared/basic/ReleaseProcess/ContractAndConsent/index.tsx +++ b/src/components/shared/basic/ReleaseProcess/ContractAndConsent/index.tsx @@ -45,12 +45,9 @@ export default function ContractAndConsent() { }).data const [updateAgreementConsents] = useUpdateAgreementConsentsMutation() const [updateDocumentUpload] = useUpdateDocumentUploadMutation() - const { data: fetchAppStatus, isFetching } = useFetchAppStatusQuery( - appId ?? '', - { - refetchOnMountOrArgChange: true, - } - ) + const { data: fetchAppStatus } = useFetchAppStatusQuery(appId ?? '', { + refetchOnMountOrArgChange: true, + }) const [getDocumentById] = useFetchNewDocumentByIdMutation() const [fetchFrameDocumentById] = useFetchFrameDocumentByIdMutation() @@ -60,47 +57,45 @@ export default function ContractAndConsent() { return (
- {!isFetching && ( - - )} +
) } diff --git a/src/components/shared/basic/ReleaseProcess/components/CommonContractAndConsent.tsx b/src/components/shared/basic/ReleaseProcess/components/CommonContractAndConsent.tsx index eadc0cc18..8e7c79ce1 100644 --- a/src/components/shared/basic/ReleaseProcess/components/CommonContractAndConsent.tsx +++ b/src/components/shared/basic/ReleaseProcess/components/CommonContractAndConsent.tsx @@ -133,6 +133,12 @@ export default function CommonContractAndConsent({ useEffect(() => { deleteResponse.isSuccess && setDeleteSuccess(true) + if (deleteResponse.isError) { + resetField('uploadImageConformity', { + defaultValue: + fetchStatusData?.documents?.CONFORMITY_APPROVAL_BUSINESS_APPS ?? null, + }) + } }, [deleteResponse]) const deleteDocument = async (documentId: string) => { @@ -171,6 +177,7 @@ export default function CommonContractAndConsent({ reset, getValues, setValue, + resetField, } = useForm({ defaultValues: defaultValues, mode: 'onChange', From 17f7c00aaaadcbdff9458e758635d0adbc26da80 Mon Sep 17 00:00:00 2001 From: Manojava Koushik <111366021+manojava-gk@users.noreply.github.com> Date: Fri, 14 Jul 2023 19:45:15 +0530 Subject: [PATCH 02/15] updates(connector): managed connectors (#136) --- CHANGELOG.md | 7 ++ src/assets/locales/de/main.json | 5 + src/assets/locales/en/main.json | 5 + .../components/ConnectorInsertForm.tsx | 91 ++++++++++++++++--- .../AddConnectorOverlay/index.tsx | 14 ++- src/components/pages/EdcConnector/index.tsx | 4 +- src/features/connector/connectorApiSlice.ts | 14 ++- 7 files changed, 120 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d1623a4ee..c3da72569 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -52,6 +52,13 @@ - Add and Edit Tenant URL functionality in detail overlay - Connectors - Disable DAPS related sections + - Create Connectors + - fetch offer subscription in managed connectors + - create managed api end point update + - update created managed api body with subscriptionId +- Certificates + - Created New page under User profile + - Fetch Certificates and connected to UI - App Subscription - Add and Edit Tenant URL functionality in detail overlay - Static Pages diff --git a/src/assets/locales/de/main.json b/src/assets/locales/de/main.json index 35732ca0b..6e1c8f539 100644 --- a/src/assets/locales/de/main.json +++ b/src/assets/locales/de/main.json @@ -519,6 +519,11 @@ "label": "Öffentlicher Authentifizierungsschlüssel/Zertifikat*", "error": "Please use a valid type. e.g. .pem; .cert", "tooltipMsg": "Laden Sie das Zertifikat hoch, das die öffentlichen Schlüsselinformationen Ihres Connectors enthält." + }, + "subscription": { + "label": "Customer Link", + "placeholder": "Select the related subscription", + "tooltipMsg": "Select the related subscription" } }, "create": { diff --git a/src/assets/locales/en/main.json b/src/assets/locales/en/main.json index 3c6b82a2b..99ad1b941 100644 --- a/src/assets/locales/en/main.json +++ b/src/assets/locales/en/main.json @@ -518,6 +518,11 @@ "label": "Public Authentication Key/Certificate*", "error": "Please use a valid type. E.g. .pem; .cert", "tooltipMsg": "Upload the certificate that contains your connector's public key information." + }, + "subscription": { + "label": "Customer Link", + "placeholder": "Select the related subscription", + "tooltipMsg": "Select the related subscription" } }, "create": { diff --git a/src/components/pages/EdcConnector/AddConnectorOverlay/components/ConnectorInsertForm.tsx b/src/components/pages/EdcConnector/AddConnectorOverlay/components/ConnectorInsertForm.tsx index 3c3b88e31..c6e32f646 100644 --- a/src/components/pages/EdcConnector/AddConnectorOverlay/components/ConnectorInsertForm.tsx +++ b/src/components/pages/EdcConnector/AddConnectorOverlay/components/ConnectorInsertForm.tsx @@ -24,6 +24,7 @@ import { Controller } from 'react-hook-form' import { DropArea, Input, + SelectList, Tooltips, Typography, } from '@catena-x/portal-shared-components' @@ -45,10 +46,13 @@ const ConnectorFormInput = ({ type, dropzoneProps, patternError, + defaultSelectValue, + items, + keyTitle, }: any) => { return ( <> - {type === 'dropzone' ? ( + {type === 'dropzone' && ( <>
- ) : ( + )} + {type === 'input' && ( <> { @@ -144,6 +149,65 @@ const ConnectorFormInput = ({ /> )} + {type === 'select' && ( + <> +
+ + {label} + + + + + + } + /> +
+ { + return ( + { + onChange(e) + }} + keyTitle={keyTitle} + /> + ) + }} + name={name} + control={control} + rules={rules} + /> + + )} ) } @@ -156,6 +220,7 @@ const ConnectorInsertForm = ({ control, trigger, selectedService, + subscriptions, }: any) => { const { t } = useTranslation() const theme = useTheme() @@ -190,6 +255,7 @@ const ConnectorInsertForm = ({ control, trigger, errors, + type: 'input', name: 'ConnectorName', rules: { required: true, @@ -222,6 +288,7 @@ const ConnectorInsertForm = ({ control, trigger, errors, + type: 'input', name: 'ConnectorURL', rules: { required: true, @@ -246,6 +313,7 @@ const ConnectorInsertForm = ({ control, trigger, errors, + type: 'input', name: 'ConnectorLocation', rules: { required: true, @@ -274,23 +342,20 @@ const ConnectorInsertForm = ({ control, trigger, errors, - name: 'ConnectorBPN', - rules: { - required: true, - pattern: Patterns.BPN, - }, - helperText: t( - 'content.edcconnector.modal.insertform.bpn.error' - ), + type: 'select', + name: 'ConnectorSubscription', label: t( - 'content.edcconnector.modal.insertform.bpn.label' + 'content.edcconnector.modal.insertform.subscription.label' ), placeholder: t( - 'content.edcconnector.modal.insertform.bpn.placeholder' + 'content.edcconnector.modal.insertform.subscription.placeholder' ), tooltipMsg: t( - 'content.edcconnector.modal.insertform.bpn.tooltipMsg' + 'content.edcconnector.modal.insertform.subscription.tooltipMsg' ), + items: subscriptions, + defaultSelectValue: subscriptions[0], + keyTitle: 'offerName', }} />
diff --git a/src/components/pages/EdcConnector/AddConnectorOverlay/index.tsx b/src/components/pages/EdcConnector/AddConnectorOverlay/index.tsx index bfe74f642..dba0ec94a 100644 --- a/src/components/pages/EdcConnector/AddConnectorOverlay/index.tsx +++ b/src/components/pages/EdcConnector/AddConnectorOverlay/index.tsx @@ -31,7 +31,11 @@ import { import ConnectorTypeSelection from './components/ConnectorTypeSelection' import ConnectorInsertForm from './components/ConnectorInsertForm' import { useForm } from 'react-hook-form' -import { ConnectorType } from 'features/connector/connectorApiSlice' +import { + ConnectorType, + EdcSubscriptionsType, + useFetchOfferSubscriptionsQuery, +} from 'features/connector/connectorApiSlice' import Box from '@mui/material/Box' interface AddCollectorOverlayProps { @@ -47,7 +51,7 @@ interface AddCollectorOverlayProps { export type FormFieldsType = { ConnectorName: string ConnectorURL: string - ConnectorBPN: string + ConnectorSubscription: EdcSubscriptionsType ConnectorLocation: string // ConnectorDoc: any TO-DO: Enable when DAPS enabled } @@ -55,7 +59,6 @@ export type FormFieldsType = { const formFields = { ConnectorName: '', ConnectorURL: '', - ConnectorBPN: '', ConnectorLocation: '', // ConnectorDoc: '', TO-DO: Enable when DAPS enabled } @@ -70,7 +73,7 @@ const AddConnectorOverlay = ({ onStepChange, }: AddCollectorOverlayProps) => { const { t } = useTranslation() - + const { data } = useFetchOfferSubscriptionsQuery() const { handleSubmit, getValues, @@ -93,7 +96,7 @@ const AddConnectorOverlay = ({ const validateFields = await trigger([ 'ConnectorName', 'ConnectorURL', - 'ConnectorBPN', + 'ConnectorLocation', // 'ConnectorDoc', TO-DO: Enable when DAPS enabled ]) if (validateFields) { @@ -142,6 +145,7 @@ const AddConnectorOverlay = ({ ) : ( <> diff --git a/src/components/pages/EdcConnector/index.tsx b/src/components/pages/EdcConnector/index.tsx index a93844821..bf49b641a 100644 --- a/src/components/pages/EdcConnector/index.tsx +++ b/src/components/pages/EdcConnector/index.tsx @@ -152,7 +152,9 @@ const EdcConnector = () => { .then(() => showOverlay(true)) .catch(() => showOverlay(false)) } else if (selectedService.type === ConnectType.MANAGED_CONNECTOR) { - body.append('providerBpn', data.ConnectorBPN) + // body.append('providerBpn', data.ConnectorBPN) + body.append('subscriptionId', data.ConnectorSubscription.subscriptionId) + body.append('technicalUserId', data.ConnectorSubscription.subscriptionId) await createManagedConnector(body) .unwrap() .then(() => showOverlay(true)) diff --git a/src/features/connector/connectorApiSlice.ts b/src/features/connector/connectorApiSlice.ts index e4b3111bd..e9b822d8b 100644 --- a/src/features/connector/connectorApiSlice.ts +++ b/src/features/connector/connectorApiSlice.ts @@ -59,6 +59,13 @@ export type ConnectorResponseBody = { DapsRegistrationSuccessful?: boolean } +export interface EdcSubscriptionsType { + connectorIds: string[] + customerName: string + offerName: string + subscriptionId: string +} + export const apiSlice = createApi({ reducerPath: 'rtk/admin/connector', baseQuery: fetchBaseQuery(apiBaseQuery()), @@ -72,7 +79,7 @@ export const apiSlice = createApi({ }), createManagedConnector: builder.mutation({ query: (body) => ({ - url: '/api/administration/connectors/managed-daps', + url: '/api/administration/connectors/managed', method: 'POST', body, }), @@ -108,6 +115,10 @@ export const apiSlice = createApi({ query: (filters) => `/api/administration/connectors/managed?page=${filters.page}&size=10`, }), + fetchOfferSubscriptions: builder.query({ + query: () => + '/api/administration/Connectors/offerSubscriptions?connectorIdSet=false', + }), }), }) @@ -118,4 +129,5 @@ export const { useFetchConnectorsQuery, useTriggerDapsMutation, useFetchManagedConnectorsQuery, + useFetchOfferSubscriptionsQuery, } = apiSlice From 9af4295e599ab2754ecbd9b2d45dd993aa256685 Mon Sep 17 00:00:00 2001 From: Manojava Koushik <111366021+manojava-gk@users.noreply.github.com> Date: Fri, 14 Jul 2023 19:45:46 +0530 Subject: [PATCH 03/15] updates(search): enable search in all pages (#133) --- CHANGELOG.md | 4 + src/components/Main.tsx | 2 + src/components/overlays/AppInfo/index.tsx | 2 +- src/components/overlays/NewsDetail/index.tsx | 16 ---- src/components/overlays/UserInfo/index.tsx | 21 +--- .../SearchSection/search-section.scss | 35 ------- src/components/pages/Home/index.tsx | 4 - .../shared/basic/SearchResult/index.tsx | 5 +- .../SearchResultGroup/SearchResultGroup.scss} | 39 ++++++-- .../shared/basic/SearchResultGroup/index.tsx | 18 ++-- .../shared/basic/SearchResultItem/index.tsx | 26 ++++- .../frame/SearchOverlay}/NewSearchSection.tsx | 16 +--- .../shared/frame/SearchOverlay/Search.scss | 95 +++++++++++++++++++ .../SearchResultSection/index.tsx | 23 ++++- .../search-result-section.scss | 81 ++++++++++++++++ .../shared/frame/SearchOverlay/index.tsx | 53 +++++++++++ src/features/info/search/types.ts | 1 + 17 files changed, 326 insertions(+), 115 deletions(-) rename src/components/{pages/Home/components/SearchResultSection/search-result-section.scss => shared/basic/SearchResultGroup/SearchResultGroup.scss} (62%) rename src/components/{pages/Home/components/SearchSection => shared/frame/SearchOverlay}/NewSearchSection.tsx (83%) create mode 100644 src/components/shared/frame/SearchOverlay/Search.scss rename src/components/{pages/Home/components => shared/frame/SearchOverlay}/SearchResultSection/index.tsx (71%) create mode 100644 src/components/shared/frame/SearchOverlay/SearchResultSection/search-result-section.scss create mode 100644 src/components/shared/frame/SearchOverlay/index.tsx diff --git a/CHANGELOG.md b/CHANGELOG.md index c3da72569..a256370aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -64,6 +64,10 @@ - Static Pages - Data Space - Catena-X Participant +- Search + - Enable search in all the pages + - Search input UI updates + - Search Result UI updates - SSI Certificat Credential Adminboard - Add new page and created UI - Portal diff --git a/src/components/Main.tsx b/src/components/Main.tsx index 0f58b8d8f..7c750218d 100644 --- a/src/components/Main.tsx +++ b/src/components/Main.tsx @@ -30,6 +30,7 @@ import { useEffect } from 'react' import { OVERLAYS } from 'types/Constants' import './styles/main.scss' import MainNotify from './MainNotify' +import MainSearchOverlay from './shared/frame/SearchOverlay' export default function Main() { document.title = useTranslation().t('title') @@ -47,6 +48,7 @@ export default function Main() { main={AccessService.mainMenuTree()} user={AccessService.userMenu()} /> +