From 2c8f52f244551fa2529f8f51cf0d17adfdd8c070 Mon Sep 17 00:00:00 2001 From: nidhi garg Date: Tue, 11 Jul 2023 13:04:07 +0530 Subject: [PATCH 1/9] feat(usecase): added shared component for card3 --- src/assets/locales/de/main.json | 4 +- src/assets/locales/en/main.json | 4 +- src/components/overlays/EditUsecase/index.tsx | 38 +++- .../pages/UsecaseParticipation/index.tsx | 12 +- src/components/shared/basic/Card3/index.tsx | 166 ++++++++++++++++++ src/components/shared/basic/Card3/style.scss | 0 6 files changed, 211 insertions(+), 13 deletions(-) create mode 100644 src/components/shared/basic/Card3/index.tsx create mode 100644 src/components/shared/basic/Card3/style.scss diff --git a/src/assets/locales/de/main.json b/src/assets/locales/de/main.json index 3625316fb..2b0776cea 100644 --- a/src/assets/locales/de/main.json +++ b/src/assets/locales/de/main.json @@ -1435,8 +1435,8 @@ "framework": "Framework", "expiry": "Expiry: {{expiry}}", "editUsecase": { - "title": "Trigger the use case participation by signing and uploading the use case frame agreement for {use case name}", - "description": "To be able to participate in the data exchange of the use case {use case name} please download the use case frame agreement {placeholder until download is available} and upload the signed document in the upload window below.After submission, the platform owner will validate the uploaded document you will be informed as soon as the validation is successfully finished", + "title": "Trigger the use case participation by signing and uploading the use case frame agreement for {usecaseName}", + "description": "To be able to participate in the data exchange of the use case {usecaseName} please download the use case frame agreement {placeholder until download is available} and upload the signed document in the upload window below.After submission, the platform owner will validate the uploaded document you will be informed as soon as the validation is successfully finished", "checkboxLabel": "Yes, I confirm that I have uploaded the signed use case frameagreement" } } diff --git a/src/assets/locales/en/main.json b/src/assets/locales/en/main.json index 32f22aafe..2ece1bc7c 100644 --- a/src/assets/locales/en/main.json +++ b/src/assets/locales/en/main.json @@ -1397,8 +1397,8 @@ "framework": "Framework", "expiry": "Expiry: {{expiry}}", "editUsecase": { - "title": "Trigger the use case participation by signing and uploading the use case frame agreement for {use case name}", - "description": "To be able to participate in the data exchange of the use case {use case name} please download the use case frame agreement {placeholder until download is available} and upload the signed document in the upload window below.After submission, the platform owner will validate the uploaded document you will be informed as soon as the validation is successfully finished", + "title": "Trigger the use case participation by signing and uploading the use case frame agreement for {usecaseName}", + "description": "To be able to participate in the data exchange of the use case {usecaseName} please download the use case frame agreement {placeholder until download is available} and upload the signed document in the upload window below.After submission, the platform owner will validate the uploaded document you will be informed as soon as the validation is successfully finished", "checkboxLabel": "Yes, I confirm that I have uploaded the signed use case frameagreement" } } diff --git a/src/components/overlays/EditUsecase/index.tsx b/src/components/overlays/EditUsecase/index.tsx index 7026b08c9..5d4f11da5 100644 --- a/src/components/overlays/EditUsecase/index.tsx +++ b/src/components/overlays/EditUsecase/index.tsx @@ -35,27 +35,53 @@ import { OVERLAYS } from 'types/Constants' import { show } from 'features/control/overlay' import { store } from 'features/store' import { Dropzone } from '../../shared/basic/Dropzone' +import { + UsecaseResponse, + useFetchUsecaseQuery, +} from 'features/usecase/usecaseApiSlice' -export default function EditUsecase({ id }: { id: string }) { +export default function EditUsecase({ id: credentialType }: { id: string }) { const { t } = useTranslation() const dispatch = useDispatch() + const [usecaseItem, setUsecaseItem] = useState() const [uploadedFile, setUploadedFile] = useState() const [checked, setChecked] = useState(false) + const { data } = useFetchUsecaseQuery() + + useEffect(() => { + const usecaseItem = data?.filter( + (item) => item.credentialType === credentialType + ) + setUsecaseItem(usecaseItem?.[0]) + }, [data]) + useEffect(() => { - dispatch(fetchAny(id)) - }, [dispatch, id]) + dispatch(fetchAny(credentialType)) + }, [dispatch, credentialType]) const renderDropArea = (props: DropAreaProps) => { return } + const handleUpload = () => { + const data = { + verified_credential_external_type_id: 'id', + document: 'document file (only pdf are allowed)', + } + } + return ( <> dispatch(show(OVERLAYS.NONE, '')), }} @@ -93,7 +119,7 @@ export default function EditUsecase({ id }: { id: string }) { - + {loading ? ( + {}} + sx={{ marginLeft: '10px' }} + /> + ) : ( + + )} ) diff --git a/src/components/pages/UsecaseParticipation/index.tsx b/src/components/pages/UsecaseParticipation/index.tsx index 3e90b9728..8846e89a1 100644 --- a/src/components/pages/UsecaseParticipation/index.tsx +++ b/src/components/pages/UsecaseParticipation/index.tsx @@ -31,18 +31,28 @@ import { OVERLAYS } from 'types/Constants' import { PageBreadcrumb } from 'components/shared/frame/PageBreadcrumb/PageBreadcrumb' import { UsecaseResponse, + VerifiedCredentialsData, useFetchUsecaseQuery, } from 'features/usecase/usecaseApiSlice' import './UsecaseParticipation.scss' import { SubscriptionStatus } from 'features/apps/apiSlice' +import { useEffect } from 'react' export default function UsecaseParticipation() { const { t } = useTranslation() const dispatch = useDispatch() - const { data } = useFetchUsecaseQuery() + const { data, refetch } = useFetchUsecaseQuery() - const renderStatus = (item: UsecaseResponse, status: string) => { + useEffect(() => { + refetch() + }, [refetch]) + + const renderStatus = ( + item: UsecaseResponse, + credential: VerifiedCredentialsData + ) => { + const status = credential.ssiDetailData?.participationStatus if ( status === SubscriptionStatus.PENDING || status === SubscriptionStatus.ACTIVE @@ -61,7 +71,13 @@ export default function UsecaseParticipation() { color="secondary" label="Edit" onClick={() => - dispatch(show(OVERLAYS.EDIT_USECASE, item.credentialType)) + dispatch( + show( + OVERLAYS.EDIT_USECASE, + credential.externalDetailData.id, + item.credentialType + ) + ) } withIcon={false} type="plain" @@ -189,10 +205,7 @@ export default function UsecaseParticipation() { variant="body3" className="fifthSection" > - {renderStatus( - item, - credential.ssiDetailData?.participationStatus - )} + {renderStatus(item, credential)} diff --git a/src/features/usecase/usecaseApiSlice.ts b/src/features/usecase/usecaseApiSlice.ts index 8bb357735..cd7c223fc 100644 --- a/src/features/usecase/usecaseApiSlice.ts +++ b/src/features/usecase/usecaseApiSlice.ts @@ -47,6 +47,12 @@ export type UsecaseResponse = { verifiedCredentials: VerifiedCredentialsData[] } +export type UsecaseRequest = { + verifiedCredentialTypeId: string + credentialType: string + document: any +} + export const apiSlice = createApi({ reducerPath: 'rtk/administration/usecase', baseQuery: fetchBaseQuery(apiBaseQuery()), @@ -54,7 +60,14 @@ export const apiSlice = createApi({ fetchUsecase: builder.query({ query: () => '/api/administration/companydata/useCaseParticipation', }), + addUsecase: builder.mutation({ + query: (body) => ({ + url: 'api/administration/companydata/useCaseParticipation', + method: 'POST', + body: body, + }), + }), }), }) -export const { useFetchUsecaseQuery } = apiSlice +export const { useFetchUsecaseQuery, useAddUsecaseMutation } = apiSlice diff --git a/src/services/AccessService.tsx b/src/services/AccessService.tsx index 63100ee8b..a17619737 100644 --- a/src/services/AccessService.tsx +++ b/src/services/AccessService.tsx @@ -198,7 +198,7 @@ export const getOverlay = (overlay: OverlayState) => { case OVERLAYS.UPDATE_COMPANY_ROLE: return case OVERLAYS.EDIT_USECASE: - return + return default: return } From 477c886234a1a47df7b2b6c8081ed13c0e6d03ff Mon Sep 17 00:00:00 2001 From: nidhi garg Date: Wed, 12 Jul 2023 11:29:05 +0200 Subject: [PATCH 3/9] feat(usecase): remove unused code --- src/components/overlays/EditUsecase/index.tsx | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/components/overlays/EditUsecase/index.tsx b/src/components/overlays/EditUsecase/index.tsx index 6c61c09eb..2520565dd 100644 --- a/src/components/overlays/EditUsecase/index.tsx +++ b/src/components/overlays/EditUsecase/index.tsx @@ -17,6 +17,9 @@ * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ +import { useState } from 'react' +import { useTranslation } from 'react-i18next' +import { useDispatch } from 'react-redux' import { Button, Checkbox, @@ -27,17 +30,13 @@ import { DropAreaProps, LoadingButton, } from '@catena-x/portal-shared-components' -import { useTranslation } from 'react-i18next' -import { fetchAny } from 'features/admin/userOwn/actions' -import { useEffect, useState } from 'react' -import { useDispatch } from 'react-redux' -import './style.scss' +import { error, success } from 'services/NotifyService' import { OVERLAYS } from 'types/Constants' import { closeOverlay, show } from 'features/control/overlay' import { store } from 'features/store' import { Dropzone } from '../../shared/basic/Dropzone' import { useAddUsecaseMutation } from 'features/usecase/usecaseApiSlice' -import { error, success } from 'services/NotifyService' +import './style.scss' export default function EditUsecase({ id: verifiedCredentialTypeId, @@ -54,10 +53,6 @@ export default function EditUsecase({ const [addUsecase] = useAddUsecaseMutation() - useEffect(() => { - dispatch(fetchAny(credentialType)) - }, [dispatch, credentialType]) - const renderDropArea = (props: DropAreaProps) => { return } From e7c35677153cb4aec9b4405d68b976896361f35c Mon Sep 17 00:00:00 2001 From: nidhi garg Date: Wed, 12 Jul 2023 12:07:50 +0200 Subject: [PATCH 4/9] feat(usecase): remove unused file --- src/components/shared/basic/Card3/index.tsx | 166 ------------------- src/components/shared/basic/Card3/style.scss | 0 2 files changed, 166 deletions(-) delete mode 100644 src/components/shared/basic/Card3/index.tsx delete mode 100644 src/components/shared/basic/Card3/style.scss diff --git a/src/components/shared/basic/Card3/index.tsx b/src/components/shared/basic/Card3/index.tsx deleted file mode 100644 index 9182c3662..000000000 --- a/src/components/shared/basic/Card3/index.tsx +++ /dev/null @@ -1,166 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2021, 2023 BMW Group AG - * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ - -import { useRef } from 'react' -import { Box, Chip, useTheme } from '@mui/material' -import AccessTimeIcon from '@mui/icons-material/AccessTime' -import DeleteOutlineIcon from '@mui/icons-material/DeleteOutline' -import CheckCircleOutlineIcon from '@mui/icons-material/CheckCircleOutline' -import PendingOutlinedIcon from '@mui/icons-material/PendingOutlined' -import CancelOutlinedIcon from '@mui/icons-material/CancelOutlined' -import { LogoGrayData, Typography } from '@catena-x/portal-shared-components' -import './style.scss' - -export enum StatusVariants { - release = 'release', - active = 'active', - inactive = 'inactive', - created = 'created', - inReview = 'in_review', - pending = 'pending', -} - -export type Variants = - | StatusVariants.release - | StatusVariants.active - | StatusVariants.inactive - | StatusVariants.created - | StatusVariants.inReview - | StatusVariants.pending - -interface SSIDetailData { - credentialId: string - participationStatus: Variants - expiryDate: string - document: { - documentId: string - documentName: string - } -} - -interface AppContent { - credentialType: string - description: string - ssiDetailData: SSIDetailData[] -} - -interface Card3Props { - items: AppContent[] -} - -export const Card3 = ({ items }: Card3Props) => { - const theme = useTheme() - const boxRef = useRef(null) - - const renderStatusIcon = (item: AppContent) => { - if ( - item.ssiDetailData[0].participationStatus.toLowerCase() === - StatusVariants.active - ) { - return - } else if ( - item.ssiDetailData[0].participationStatus.toLowerCase() === - StatusVariants.pending - ) { - return - } else { - return - } - } - - return ( - - {items.map((item) => { - return ( -
- - - - {renderStatusIcon(item)} - {item.ssiDetailData[0].participationStatus.toLowerCase() !== - StatusVariants.active && - item.ssiDetailData[0].participationStatus.toLowerCase() !== - StatusVariants.pending && ( - - )} - - - {'Type: [ISO 9001]'} - - - {item.credentialType} - - - {'Valid until: '} - {item.ssiDetailData[0].expiryDate.split('T')[0]} - - - {'Status: '} - {item.ssiDetailData[0].participationStatus} - - {item.ssiDetailData[0].participationStatus.toLowerCase() === - StatusVariants.pending && ( - <> - - - - {'File Upload'} - - - - - - - {'Vertification'} - - - - - )} - {item.description && ( - - {item.description} - - )} - -
- ) - })} -
- ) -} diff --git a/src/components/shared/basic/Card3/style.scss b/src/components/shared/basic/Card3/style.scss deleted file mode 100644 index e69de29bb..000000000 From 92fc79e894ae77ce897543e555d662b720764269 Mon Sep 17 00:00:00 2001 From: nidhi garg Date: Wed, 12 Jul 2023 14:00:24 +0200 Subject: [PATCH 5/9] feat(credential): change role --- CHANGELOG.md | 1 + .../shared/basic/CertificateCard/index.tsx | 17 ++++++++--------- .../certification/certificationApiSlice.tsx | 2 +- src/types/Config.tsx | 2 +- src/types/Constants.ts | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 39209931f..1a9e81d01 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -58,6 +58,7 @@ - Certificates - Created New page under User profile - Fetch Certificates and connected to UI + - Upload document ovelay and connected to business logic - Static Pages - Data Space - Catena-X Participant diff --git a/src/components/shared/basic/CertificateCard/index.tsx b/src/components/shared/basic/CertificateCard/index.tsx index e65ddf9bf..ab30ac0c0 100644 --- a/src/components/shared/basic/CertificateCard/index.tsx +++ b/src/components/shared/basic/CertificateCard/index.tsx @@ -57,12 +57,11 @@ export const CertificateCard = ({ const renderStatusIcon = () => { if ( - ssiDetailData?.[0].participationStatus.toLowerCase() === - StatusVariants.active + ssiDetailData?.participationStatus.toLowerCase() === StatusVariants.active ) { return } else if ( - ssiDetailData?.[0].participationStatus.toLowerCase() === + ssiDetailData?.participationStatus.toLowerCase() === StatusVariants.pending ) { return @@ -84,9 +83,9 @@ export const CertificateCard = ({ {renderStatusIcon()} - {ssiDetailData?.[0].participationStatus.toLowerCase() !== + {ssiDetailData?.participationStatus.toLowerCase() !== StatusVariants.active && - ssiDetailData?.[0].participationStatus.toLowerCase() !== + ssiDetailData?.participationStatus.toLowerCase() !== StatusVariants.pending && ( )} @@ -100,14 +99,14 @@ export const CertificateCard = ({ {ssiDetailData && ( {t('content.certificates.certificateCard.valid')} - {ssiDetailData[0].expiryDate.split('T')[0]} + {ssiDetailData?.expiryDate.split('T')[0]} )} {t('content.certificates.certificateCard.status')} - {ssiDetailData?.[0].participationStatus ?? StatusEnum.INACTIVE} + {ssiDetailData?.participationStatus ?? StatusEnum.INACTIVE} - {ssiDetailData?.[0].participationStatus.toLowerCase() === + {ssiDetailData?.participationStatus.toLowerCase() === StatusVariants.pending && ( <> @@ -131,7 +130,7 @@ export const CertificateCard = ({ diff --git a/src/features/certification/certificationApiSlice.tsx b/src/features/certification/certificationApiSlice.tsx index 77f6744ad..fd4baa910 100644 --- a/src/features/certification/certificationApiSlice.tsx +++ b/src/features/certification/certificationApiSlice.tsx @@ -39,7 +39,7 @@ export type SSIDetailData = { export type CertificateResponse = { credentialType: string - ssiDetailData: SSIDetailData[] | null + ssiDetailData: SSIDetailData | null } export const apiSlice = createApi({ diff --git a/src/types/Config.tsx b/src/types/Config.tsx index 05b4ea1c8..6eb4893d9 100644 --- a/src/types/Config.tsx +++ b/src/types/Config.tsx @@ -479,7 +479,7 @@ export const ALL_PAGES: IPage[] = [ }, { name: PAGES.CERTIFICATE_CREDENTIAL, - role: ROLES.MANAGE_COMPANY_CREDENTIALS, + role: ROLES.REQUEST_SSICREDENTIAL, element: , }, { name: PAGES.DATA_SPACE, element: }, diff --git a/src/types/Constants.ts b/src/types/Constants.ts index 2ae68745a..1296bcda4 100644 --- a/src/types/Constants.ts +++ b/src/types/Constants.ts @@ -206,7 +206,7 @@ export enum ROLES { UPDATE_COMPANY_ROLE = 'update_company_role', USECASE_PARTICIPATION = 'add_use_case_participation', SUBMITTED_APPLICATION = 'view_submitted_applications', - MANAGE_COMPANY_CREDENTIALS = 'manage_company_credentials', + REQUEST_SSICREDENTIAL = 'request_ssicredential', } export enum HINTS { From 0d89b7797872b828de7eb6299d22d16360df8e8c Mon Sep 17 00:00:00 2001 From: nidhi garg Date: Wed, 12 Jul 2023 16:40:50 +0200 Subject: [PATCH 6/9] Revert "feat(credential): change role" This reverts commit 92fc79e894ae77ce897543e555d662b720764269. --- CHANGELOG.md | 1 - .../shared/basic/CertificateCard/index.tsx | 17 +++++++++-------- .../certification/certificationApiSlice.tsx | 2 +- src/types/Config.tsx | 2 +- src/types/Constants.ts | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a9e81d01..39209931f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -58,7 +58,6 @@ - Certificates - Created New page under User profile - Fetch Certificates and connected to UI - - Upload document ovelay and connected to business logic - Static Pages - Data Space - Catena-X Participant diff --git a/src/components/shared/basic/CertificateCard/index.tsx b/src/components/shared/basic/CertificateCard/index.tsx index ab30ac0c0..e65ddf9bf 100644 --- a/src/components/shared/basic/CertificateCard/index.tsx +++ b/src/components/shared/basic/CertificateCard/index.tsx @@ -57,11 +57,12 @@ export const CertificateCard = ({ const renderStatusIcon = () => { if ( - ssiDetailData?.participationStatus.toLowerCase() === StatusVariants.active + ssiDetailData?.[0].participationStatus.toLowerCase() === + StatusVariants.active ) { return } else if ( - ssiDetailData?.participationStatus.toLowerCase() === + ssiDetailData?.[0].participationStatus.toLowerCase() === StatusVariants.pending ) { return @@ -83,9 +84,9 @@ export const CertificateCard = ({ {renderStatusIcon()} - {ssiDetailData?.participationStatus.toLowerCase() !== + {ssiDetailData?.[0].participationStatus.toLowerCase() !== StatusVariants.active && - ssiDetailData?.participationStatus.toLowerCase() !== + ssiDetailData?.[0].participationStatus.toLowerCase() !== StatusVariants.pending && ( )} @@ -99,14 +100,14 @@ export const CertificateCard = ({ {ssiDetailData && ( {t('content.certificates.certificateCard.valid')} - {ssiDetailData?.expiryDate.split('T')[0]} + {ssiDetailData[0].expiryDate.split('T')[0]} )} {t('content.certificates.certificateCard.status')} - {ssiDetailData?.participationStatus ?? StatusEnum.INACTIVE} + {ssiDetailData?.[0].participationStatus ?? StatusEnum.INACTIVE} - {ssiDetailData?.participationStatus.toLowerCase() === + {ssiDetailData?.[0].participationStatus.toLowerCase() === StatusVariants.pending && ( <> @@ -130,7 +131,7 @@ export const CertificateCard = ({ diff --git a/src/features/certification/certificationApiSlice.tsx b/src/features/certification/certificationApiSlice.tsx index fd4baa910..77f6744ad 100644 --- a/src/features/certification/certificationApiSlice.tsx +++ b/src/features/certification/certificationApiSlice.tsx @@ -39,7 +39,7 @@ export type SSIDetailData = { export type CertificateResponse = { credentialType: string - ssiDetailData: SSIDetailData | null + ssiDetailData: SSIDetailData[] | null } export const apiSlice = createApi({ diff --git a/src/types/Config.tsx b/src/types/Config.tsx index 6eb4893d9..05b4ea1c8 100644 --- a/src/types/Config.tsx +++ b/src/types/Config.tsx @@ -479,7 +479,7 @@ export const ALL_PAGES: IPage[] = [ }, { name: PAGES.CERTIFICATE_CREDENTIAL, - role: ROLES.REQUEST_SSICREDENTIAL, + role: ROLES.MANAGE_COMPANY_CREDENTIALS, element: , }, { name: PAGES.DATA_SPACE, element: }, diff --git a/src/types/Constants.ts b/src/types/Constants.ts index 1296bcda4..2ae68745a 100644 --- a/src/types/Constants.ts +++ b/src/types/Constants.ts @@ -206,7 +206,7 @@ export enum ROLES { UPDATE_COMPANY_ROLE = 'update_company_role', USECASE_PARTICIPATION = 'add_use_case_participation', SUBMITTED_APPLICATION = 'view_submitted_applications', - REQUEST_SSICREDENTIAL = 'request_ssicredential', + MANAGE_COMPANY_CREDENTIALS = 'manage_company_credentials', } export enum HINTS { From ece47a408be266ce217e35bc196f1e985c30a711 Mon Sep 17 00:00:00 2001 From: nidhi garg Date: Wed, 12 Jul 2023 16:48:04 +0200 Subject: [PATCH 7/9] feat(usecase): use i18next for replacing word --- src/assets/locales/de/main.json | 4 ++-- src/assets/locales/en/main.json | 4 ++-- src/components/overlays/EditUsecase/index.tsx | 10 ++++------ 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/assets/locales/de/main.json b/src/assets/locales/de/main.json index 76aa165ca..fef4e9df1 100644 --- a/src/assets/locales/de/main.json +++ b/src/assets/locales/de/main.json @@ -1450,8 +1450,8 @@ "framework": "Framework", "expiry": "Expiry: {{expiry}}", "editUsecase": { - "title": "Trigger the use case participation by signing and uploading the use case frame agreement for {usecaseName}", - "description": "To be able to participate in the data exchange of the use case {usecaseName} please download the use case frame agreement {placeholder until download is available} and upload the signed document in the upload window below.After submission, the platform owner will validate the uploaded document you will be informed as soon as the validation is successfully finished", + "title": "Trigger the use case participation by signing and uploading the use case frame agreement for {{usecaseName}}", + "description": "To be able to participate in the data exchange of the use case {{usecaseName}} please download the use case frame agreement {placeholder until download is available} and upload the signed document in the upload window below.After submission, the platform owner will validate the uploaded document you will be informed as soon as the validation is successfully finished", "checkboxLabel": "Yes, I confirm that I have uploaded the signed use case frameagreement", "error": "Something went wrong!", "success": "Usecase document upload has been done successfully." diff --git a/src/assets/locales/en/main.json b/src/assets/locales/en/main.json index 1ad6dfcb2..556d523a5 100644 --- a/src/assets/locales/en/main.json +++ b/src/assets/locales/en/main.json @@ -1412,8 +1412,8 @@ "framework": "Framework", "expiry": "Expiry: {{expiry}}", "editUsecase": { - "title": "Trigger the use case participation by signing and uploading the use case frame agreement for {usecaseName}", - "description": "To be able to participate in the data exchange of the use case {usecaseName} please download the use case frame agreement {placeholder until download is available} and upload the signed document in the upload window below.After submission, the platform owner will validate the uploaded document you will be informed as soon as the validation is successfully finished", + "title": "Trigger the use case participation by signing and uploading the use case frame agreement for {{usecaseName}}", + "description": "To be able to participate in the data exchange of the use case {{usecaseName}} please download the use case frame agreement {placeholder until download is available} and upload the signed document in the upload window below.After submission, the platform owner will validate the uploaded document you will be informed as soon as the validation is successfully finished", "checkboxLabel": "Yes, I confirm that I have uploaded the signed use case frameagreement", "error": "Something went wrong!", "success": "Usecase document upload has been done successfully." diff --git a/src/components/overlays/EditUsecase/index.tsx b/src/components/overlays/EditUsecase/index.tsx index 2520565dd..f0bb2ab71 100644 --- a/src/components/overlays/EditUsecase/index.tsx +++ b/src/components/overlays/EditUsecase/index.tsx @@ -19,6 +19,7 @@ import { useState } from 'react' import { useTranslation } from 'react-i18next' +import i18next from 'i18next' import { useDispatch } from 'react-redux' import { Button, @@ -79,13 +80,10 @@ export default function EditUsecase({ <> dispatch(show(OVERLAYS.NONE, '')), }} From 635192e9e91cfc9e486aa345dd8340882eeadea1 Mon Sep 17 00:00:00 2001 From: nidhi garg Date: Wed, 12 Jul 2023 16:48:28 +0200 Subject: [PATCH 8/9] feat(usecase): code pretty --- src/components/overlays/EditUsecase/index.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/overlays/EditUsecase/index.tsx b/src/components/overlays/EditUsecase/index.tsx index f0bb2ab71..1b1698e13 100644 --- a/src/components/overlays/EditUsecase/index.tsx +++ b/src/components/overlays/EditUsecase/index.tsx @@ -80,9 +80,12 @@ export default function EditUsecase({ <> dispatch(show(OVERLAYS.NONE, '')), From 868603d6fa8f86d060ed81647bb13444256ace0b Mon Sep 17 00:00:00 2001 From: nidhi garg Date: Wed, 12 Jul 2023 16:59:28 +0200 Subject: [PATCH 9/9] feat(certificate): api url update --- src/components/overlays/UpdateCertificate/index.tsx | 2 +- src/features/certification/certificationApiSlice.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/overlays/UpdateCertificate/index.tsx b/src/components/overlays/UpdateCertificate/index.tsx index c87ed1a66..5482c9930 100644 --- a/src/components/overlays/UpdateCertificate/index.tsx +++ b/src/components/overlays/UpdateCertificate/index.tsx @@ -60,7 +60,7 @@ export default function UpdateCertificate({ id }: { id: string }) { try { if (uploadedFile) { const data = { - credentialTypeId: 'credentialType', + credentialType: 'DISMANTLER_CERTIFICATE', //static for now as we have only one certificate document: uploadedFile, } await addCertificate(data).unwrap() diff --git a/src/features/certification/certificationApiSlice.tsx b/src/features/certification/certificationApiSlice.tsx index 5945c2880..474321ca3 100644 --- a/src/features/certification/certificationApiSlice.tsx +++ b/src/features/certification/certificationApiSlice.tsx @@ -43,7 +43,7 @@ export type CertificateResponse = { } export type CertificateRequest = { - credentialTypeId: string + credentialType: string document: File } @@ -58,7 +58,7 @@ export const apiSlice = createApi({ }), addCertificate: builder.mutation({ query: (body) => ({ - url: 'api/administration/companydata/ssiCertificate', + url: 'api/administration/companydata/certificates', method: 'POST', body: body, }),