From fbc73facf8e4dd0b44a12bfddc1b43bf7e7544e5 Mon Sep 17 00:00:00 2001 From: nidhi garg Date: Wed, 14 Dec 2022 10:13:34 +0530 Subject: [PATCH 001/112] fix postcode validation btn fix --- src/components/cax-companyData.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/cax-companyData.tsx b/src/components/cax-companyData.tsx index ce81c8b1..f1541902 100644 --- a/src/components/cax-companyData.tsx +++ b/src/components/cax-companyData.tsx @@ -389,7 +389,7 @@ export const CompanyDataCax = ({ labelNext={t('button.confirm')} handleBackClick={() => backClick()} handleNextClick={() => nextClick()} - disabled={ !legalEntity || !registeredName || !streetHouseNumber || !city || !country || errors.streetHouseNumber !== '' || errors.country !== '' } + disabled={ !legalEntity || !registeredName || !streetHouseNumber || !city || !country || errors.streetHouseNumber !== '' || errors.country !== '' || errors.postalCode !== '' } /> ) From 4bdbc39d29b2a11a7b7282e90c7739b791152c1a Mon Sep 17 00:00:00 2001 From: Evelyn Gurschler Date: Mon, 19 Dec 2022 15:10:26 +0100 Subject: [PATCH 002/112] CPLP-1420: Change to tx-portal-cd for auto deployment --- .github/workflows/build.yml | 4 ++-- .github/workflows/release.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 47817cbc..92bbc2e9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -80,8 +80,8 @@ jobs: run: | curl -v \ --request POST \ - --url https://api.github.com/repos/catenax-ng/product-portal-cd/actions/workflows/portal-registration-image-update.yml/dispatches \ + --url https://api.github.com/repos/catenax-ng/tx-portal-cd/actions/workflows/portal-registration-image-update.yml/dispatches \ --header "authorization: Bearer $TOKEN" \ --header "Accept: application/vnd.github.v3+json" \ - --data '{"ref":"main", "inputs": { "new-image":"${{ github.ref_name }}_${{ env.COMMIT_SHA }}" }}' \ + --data '{"ref":"helm-environments", "inputs": { "new-image":"${{ github.ref_name }}_${{ env.COMMIT_SHA }}" }}' \ --fail diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2d5d91d8..e05620e7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -107,8 +107,8 @@ jobs: run: | curl -v \ --request POST \ - --url https://api.github.com/repos/catenax-ng/product-portal-cd/actions/workflows/portal-registration-int-release-image-update.yml/dispatches \ + --url https://api.github.com/repos/catenax-ng/tx-portal-cd/actions/workflows/portal-registration-int-release-image-update.yml/dispatches \ --header "authorization: Bearer $TOKEN" \ --header "Accept: application/vnd.github.v3+json" \ - --data '{"ref":"main", "inputs": { "new-image":"${{ env.RELEASE_VERSION }}" }}' \ + --data '{"ref":"helm-environments", "inputs": { "new-image":"${{ env.RELEASE_VERSION }}" }}' \ --fail From 88880962148093dce32cd6b45ab8d74b2ed27e89 Mon Sep 17 00:00:00 2001 From: nidhi garg Date: Wed, 28 Dec 2022 12:57:38 +0530 Subject: [PATCH 003/112] handle API error in step 1 --- src/components/cax-companyData.tsx | 14 ++++++++++++-- src/components/cax-responsibilities.tsx | 1 - src/locales/de/translations.json | 3 ++- src/locales/en/translations.json | 3 ++- src/state/features/application/slice.ts | 20 ++++++++++++++++++++ src/state/features/application/types.ts | 1 + 6 files changed, 37 insertions(+), 5 deletions(-) diff --git a/src/components/cax-companyData.tsx b/src/components/cax-companyData.tsx index f1541902..720ed2ca 100644 --- a/src/components/cax-companyData.tsx +++ b/src/components/cax-companyData.tsx @@ -61,7 +61,17 @@ export const CompanyDataCax = ({ const { t } = useTranslation() const dispatch = useDispatch() - const { status, error, companyDetails } = useSelector(applicationSelector) + const [nextClicked, setNextClicked] = useState(false) + + const { status, error, loading, saveError, companyDetails } = useSelector(applicationSelector) + + if(nextClicked && !loading){ + if(saveError){ + toast.error(t('registrationStepOne.submitError')) + }else{ + addCurrentStep(currentActiveStep + 1) + } + } const obj = status[status.length - 1] //.find(o => o['applicationStatus'] === CREATED); const applicationId = obj['applicationId'] @@ -213,7 +223,6 @@ export const CompanyDataCax = ({ } const nextClick = () => { - addCurrentStep(currentActiveStep + 1) const companyData = { ...companyDetails } companyData.bpn = bpn companyData.name = legalEntity @@ -224,6 +233,7 @@ export const CompanyDataCax = ({ companyData.countryAlpha2Code = country //addCompanyData(companyData) dispatch(saveCompanyDetailsWithAddress({ applicationId, companyData })) + setNextClicked(true) } return ( diff --git a/src/components/cax-responsibilities.tsx b/src/components/cax-responsibilities.tsx index cd5b28d8..2e640fe5 100644 --- a/src/components/cax-responsibilities.tsx +++ b/src/components/cax-responsibilities.tsx @@ -60,7 +60,6 @@ interface ResponsibilitiesCaxProps { export const ResponsibilitiesCax = ({ currentActiveStep, addCurrentStep, - removeFromInviteList, }: ResponsibilitiesCaxProps) => { const { t } = useTranslation() const [email, setEmail] = useState('') diff --git a/src/locales/de/translations.json b/src/locales/de/translations.json index da2f56a0..3bdd572c 100644 --- a/src/locales/de/translations.json +++ b/src/locales/de/translations.json @@ -52,7 +52,8 @@ "streetHouseNumberError": "Bitte geben Sie eine gültige Straße und Hausnummer ein.", "postalCodeError": "Bitte geben Sie eine gültige Postleitzahl ein.", "cityError": "Bitte geben Sie einen gültigen Städtenamen ein.", - "countryError": "Please enter a valid country code. Country codes have a 2 digit alpha character." + "countryError": "Please enter a valid country code. Country codes have a 2 digit alpha character.", + "submitError": "Something went wrong. Your entered data could not get saved. Please try again later or contact the administrator." }, "finish": { "greetingMsg": "Glückwunsch! Ihre Registrierung wurde erfolgreich abgesendet!", diff --git a/src/locales/en/translations.json b/src/locales/en/translations.json index ad54971b..6a3777ac 100644 --- a/src/locales/en/translations.json +++ b/src/locales/en/translations.json @@ -52,7 +52,8 @@ "streetHouseNumberError": "Please enter a valid street and house number", "postalCodeError": "Please enter a valid postal code", "cityError": "Please enter a valid city name", - "countryError": "Please enter a valid country code. Hint: country codes are 2 alpha letters." + "countryError": "Please enter a valid country code. Hint: country codes are 2 alpha letters.", + "submitError": "Something went wrong. Your entered data could not get saved. Please try again later or contact the administrator." }, "finish": { "greetingMsg": "Congratulations! Your registration has been successfully submitted!", diff --git a/src/state/features/application/slice.ts b/src/state/features/application/slice.ts index 60ea55ce..a88bd8a7 100644 --- a/src/state/features/application/slice.ts +++ b/src/state/features/application/slice.ts @@ -24,6 +24,7 @@ import { fetchId, updateInvitation, getCompanyDetailsWithAddress, + saveCompanyDetailsWithAddress } from './actions' import { ApplicationState, InitialCompanyDetail } from './types' @@ -32,6 +33,7 @@ const initialState: ApplicationState = { companyDetails: InitialCompanyDetail, loading: false, error: null, + saveError: null } const applicationSlice = createSlice({ @@ -93,6 +95,24 @@ const applicationSlice = createSlice({ loading: false, error: action.error.message as string, })) + builder.addCase(saveCompanyDetailsWithAddress.pending, (state) => ({ + ...state, + loading: true, + saveError: null, + })) + builder.addCase( + saveCompanyDetailsWithAddress.fulfilled, + (state) => ({ + ...state, + loading: false, + saveError: null, + }) + ) + builder.addCase(saveCompanyDetailsWithAddress.rejected, (state, action) => ({ + ...state, + loading: false, + saveError: action.error.message as string, + })) }, }) diff --git a/src/state/features/application/types.ts b/src/state/features/application/types.ts index e35525e0..4543d498 100644 --- a/src/state/features/application/types.ts +++ b/src/state/features/application/types.ts @@ -58,6 +58,7 @@ export interface ApplicationState { companyDetails: CompanyDetails | null loading: boolean error: string + saveError: string } export const InitialCompanyDetail = { From c4f1d6f751e357b0663755cae890cbb8576b67f4 Mon Sep 17 00:00:00 2001 From: nidhi garg Date: Wed, 28 Dec 2022 13:31:34 +0530 Subject: [PATCH 004/112] add changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a1207151..2b3cc2ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ New features, fixed bugs, known defects and other noteworthy changes to each release of the Catena-X Portal Frontend Registration. ### Unreleased -n/a +* BugFix - Step1 API Endpoint Error Handling ## 0.10.0 From b8821b18f474029ecc7dfbd1f6f1673d401bc2e9 Mon Sep 17 00:00:00 2001 From: nidhi garg Date: Wed, 28 Dec 2022 16:35:01 +0530 Subject: [PATCH 005/112] fix validate email hotspot --- CHANGELOG.md | 1 + src/components/cax-responsibilities.tsx | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b3cc2ed..070d02c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ New features, fixed bugs, known defects and other noteworthy changes to each rel ### Unreleased * BugFix - Step1 API Endpoint Error Handling +* BugFix - Security Hotspot (Sonarcould) ## 0.10.0 diff --git a/src/components/cax-responsibilities.tsx b/src/components/cax-responsibilities.tsx index 2e640fe5..b72a0109 100644 --- a/src/components/cax-responsibilities.tsx +++ b/src/components/cax-responsibilities.tsx @@ -104,7 +104,7 @@ export const ResponsibilitiesCax = ({ const validateEmail = (email) => //eslint-disable-next-line - /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email) + /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\])|(([a-z0-9-]+\.)+[a-z]{2,}))$/i.test(email) const validatePersonalNote = (note: string) => /^[a-zA-Z][a-zA-Z0-9 !#'$@&%()*+,\-_./:;=<>?[\]\\^]{0,255}$/.test(note) From 2dc8df18d6b62bbfe2626bcd9a1d81fe340c7f0b Mon Sep 17 00:00:00 2001 From: nidhi garg Date: Wed, 28 Dec 2022 17:18:27 +0530 Subject: [PATCH 006/112] change email regex --- src/components/cax-responsibilities.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/cax-responsibilities.tsx b/src/components/cax-responsibilities.tsx index b72a0109..33463fa2 100644 --- a/src/components/cax-responsibilities.tsx +++ b/src/components/cax-responsibilities.tsx @@ -104,7 +104,9 @@ export const ResponsibilitiesCax = ({ const validateEmail = (email) => //eslint-disable-next-line - /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\])|(([a-z0-9-]+\.)+[a-z]{2,}))$/i.test(email) + email.match( + /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/ + ); const validatePersonalNote = (note: string) => /^[a-zA-Z][a-zA-Z0-9 !#'$@&%()*+,\-_./:;=<>?[\]\\^]{0,255}$/.test(note) From 3e1c2504bcf0b0641e1a68fa16050e5ca384ac97 Mon Sep 17 00:00:00 2001 From: nidhi garg Date: Wed, 28 Dec 2022 17:47:03 +0530 Subject: [PATCH 007/112] change email regex --- src/components/cax-responsibilities.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/components/cax-responsibilities.tsx b/src/components/cax-responsibilities.tsx index 33463fa2..2e640fe5 100644 --- a/src/components/cax-responsibilities.tsx +++ b/src/components/cax-responsibilities.tsx @@ -104,9 +104,7 @@ export const ResponsibilitiesCax = ({ const validateEmail = (email) => //eslint-disable-next-line - email.match( - /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/ - ); + /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email) const validatePersonalNote = (note: string) => /^[a-zA-Z][a-zA-Z0-9 !#'$@&%()*+,\-_./:;=<>?[\]\\^]{0,255}$/.test(note) From c4b2e4f989a5600d207bbb60fc829bb107c0f651 Mon Sep 17 00:00:00 2001 From: nidhi garg Date: Thu, 29 Dec 2022 16:31:16 +0530 Subject: [PATCH 008/112] fixregex code smll --- src/components/cax-responsibilities.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/cax-responsibilities.tsx b/src/components/cax-responsibilities.tsx index 2e640fe5..c920ac43 100644 --- a/src/components/cax-responsibilities.tsx +++ b/src/components/cax-responsibilities.tsx @@ -104,12 +104,13 @@ export const ResponsibilitiesCax = ({ const validateEmail = (email) => //eslint-disable-next-line - /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email) + /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[.\d{1,3}\])|(([a-z0-9-]+\.)+[a-z]{2,}))$/i.test(email) const validatePersonalNote = (note: string) => /^[a-zA-Z][a-zA-Z0-9 !#'$@&%()*+,\-_./:;=<>?[\]\\^]{0,255}$/.test(note) - const handleSendInvite = () => { + + const handleSendInvite = () => { if (email && validateEmail(email)) { const user = { email: email, From 9abfc291a3ae25819108db5a02df7f8d578078ac Mon Sep 17 00:00:00 2001 From: nidhi garg Date: Thu, 29 Dec 2022 16:39:09 +0530 Subject: [PATCH 009/112] reduxe email regex --- src/components/cax-responsibilities.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/cax-responsibilities.tsx b/src/components/cax-responsibilities.tsx index c920ac43..e4fe7ab5 100644 --- a/src/components/cax-responsibilities.tsx +++ b/src/components/cax-responsibilities.tsx @@ -104,7 +104,7 @@ export const ResponsibilitiesCax = ({ const validateEmail = (email) => //eslint-disable-next-line - /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[.\d{1,3}\])|(([a-z0-9-]+\.)+[a-z]{2,}))$/i.test(email) + /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@(([a-z0-9-]+\.)+[a-z]{2,})$/i.test(email) const validatePersonalNote = (note: string) => /^[a-zA-Z][a-zA-Z0-9 !#'$@&%()*+,\-_./:;=<>?[\]\\^]{0,255}$/.test(note) From 8c6b180753f173c091dd8b182a5bc52c53f831b7 Mon Sep 17 00:00:00 2001 From: jjeroch <94133633+jjeroch@users.noreply.github.com> Date: Mon, 2 Jan 2023 21:02:18 +0100 Subject: [PATCH 010/112] Update translations.json --- src/locales/en/translations.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/locales/en/translations.json b/src/locales/en/translations.json index 6a3777ac..7c5d6b5e 100644 --- a/src/locales/en/translations.json +++ b/src/locales/en/translations.json @@ -44,7 +44,7 @@ "streetHouseNumber": "Street with House Number", "postalCode": "Postal Code", "city": "City", - "country": "Country", + "country": "Country Code (ISO 3166 Alpha 2 - e.g. DE)", "bpnInvalidError": "The BPN is invalid, please enter a valid BPN or use the manual flow below. Hint: A BPN has 16-digits.", "bpnNotExistError": "This BPN doesn't exist, please enter a valid BPN or use the manual flow below.", "legalEntityError": "Please enter a valid legal entity name.", From f753ff548d0c6f2a26d3ccfd1d936cca194903d5 Mon Sep 17 00:00:00 2001 From: jjeroch <94133633+jjeroch@users.noreply.github.com> Date: Mon, 2 Jan 2023 21:03:35 +0100 Subject: [PATCH 011/112] Update translations.json --- src/locales/de/translations.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/locales/de/translations.json b/src/locales/de/translations.json index 3bdd572c..62091c60 100644 --- a/src/locales/de/translations.json +++ b/src/locales/de/translations.json @@ -44,7 +44,7 @@ "streetHouseNumber": "Straße und Hausnummer", "postalCode": "Postleitzahl", "city": "Stadt", - "country": "Land", + "country": "Ländercode (ISO 3166 Alpha 2 - z.B. DE)", "bpnInvalidError": "The BPN is invalid, please enter a valid BPN or use the manual flow below. Hint: A BPN has 16-digits.", "bpnNotExistError": "This BPN doesn't exist, please enter a valid BPN or use the manual flow below.", "legalEntityError": "Bitte geben Sie einen gültigen Wert für die juristische Person ein.", From a0b60c528cbad6b6a003b8715a05ac28a85fd3a7 Mon Sep 17 00:00:00 2001 From: nidhi garg Date: Tue, 3 Jan 2023 14:27:58 +0530 Subject: [PATCH 012/112] make simpler email regex --- src/components/cax-responsibilities.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/cax-responsibilities.tsx b/src/components/cax-responsibilities.tsx index e4fe7ab5..944bb835 100644 --- a/src/components/cax-responsibilities.tsx +++ b/src/components/cax-responsibilities.tsx @@ -104,7 +104,7 @@ export const ResponsibilitiesCax = ({ const validateEmail = (email) => //eslint-disable-next-line - /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@(([a-z0-9-]+\.)+[a-z]{2,})$/i.test(email) + /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*))@(([a-z0-9-]+\.)+[a-z]{2,})$/.test(email) const validatePersonalNote = (note: string) => /^[a-zA-Z][a-zA-Z0-9 !#'$@&%()*+,\-_./:;=<>?[\]\\^]{0,255}$/.test(note) From 5cdae4379d666302367da2c20ccf56bdf58bc4c7 Mon Sep 17 00:00:00 2001 From: jjeroch <94133633+jjeroch@users.noreply.github.com> Date: Wed, 11 Jan 2023 10:42:05 +0100 Subject: [PATCH 013/112] ChangeLog creation 1.0.0 RC1 --- CHANGELOG.md | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 070d02c7..075b75b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,8 +3,20 @@ New features, fixed bugs, known defects and other noteworthy changes to each release of the Catena-X Portal Frontend Registration. ### Unreleased -* BugFix - Step1 API Endpoint Error Handling -* BugFix - Security Hotspot (Sonarcould) + +## 1.0.0 RC-1 + +### Change +* implemented in the step 1 "company data" error handling for unsuccessful company data save function + +### Feature +n/a + +### Technical Support +n/a + +### Bugfix +n/a ## 0.10.0 From f442f3486708ae79ee0acb777d2d22f645247dd3 Mon Sep 17 00:00:00 2001 From: Evelyn Gurschler Date: Wed, 11 Jan 2023 11:30:36 +0100 Subject: [PATCH 014/112] docs: fix typo --- CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 075b75b7..a63543f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ New features, fixed bugs, known defects and other noteworthy changes to each rel ### Unreleased -## 1.0.0 RC-1 +## 1.0.0-RC1 ### Change * implemented in the step 1 "company data" error handling for unsuccessful company data save function @@ -53,7 +53,7 @@ n/a n/a ### Feature -* Registration Step 3 (company role and consent agreement); fetching agreement document from the portal backend and enabling direct documente download. +* Registration Step 3 (company role and consent agreement); fetching agreement document from the portal backend and enabling direct document download. ### Technical Support n/a @@ -83,7 +83,7 @@ n/a ### Feature * Registration Welcome: Introduction of a welcome page including a "how to" for the following registration steps * Registration Submission: Support of the registration submission incl. new page for successful submission and triggered email to the registrator -* Registration Closed Function: Company registrations in status "submitted", "approved" or "declined" can not re-visit the registration document. A closed registration information gets displayed. +* Registration Closed Function: Company registrations in status "submitted", "approved" or "declined" cannot re-visit the registration document. A closed registration information gets displayed. ### Technical Support * n/a From 0b8f01bb4cb2e3f4a6fd1a0abd20536d7c99bb35 Mon Sep 17 00:00:00 2001 From: Evelyn Gurschler Date: Wed, 11 Jan 2023 11:39:31 +0100 Subject: [PATCH 015/112] cplp-1864: bump version for release of v1.0.0-RC1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 27dfb384..d2273129 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "product-portal-frontend-registration", - "version": "0.10.0", + "version": "v1.0.0-RC1", "license": "Apache-2.0", "homepage": "/registration", "scripts": { From ee619bee6423c2d6510188523bea18c6954ca41f Mon Sep 17 00:00:00 2001 From: Evelyn Gurschler Date: Wed, 11 Jan 2023 11:54:03 +0100 Subject: [PATCH 016/112] remove v prefix from version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d2273129..b6a105be 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "product-portal-frontend-registration", - "version": "v1.0.0-RC1", + "version": "1.0.0-RC1", "license": "Apache-2.0", "homepage": "/registration", "scripts": { From 7ba4492c83623ea18905ea2fa6d40495cbd5a8b7 Mon Sep 17 00:00:00 2001 From: jjeroch <94133633+jjeroch@users.noreply.github.com> Date: Sun, 15 Jan 2023 17:59:41 +0100 Subject: [PATCH 017/112] bugfix_translation --- src/locales/en/translations.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/locales/en/translations.json b/src/locales/en/translations.json index 7c5d6b5e..cc99d3e6 100644 --- a/src/locales/en/translations.json +++ b/src/locales/en/translations.json @@ -84,7 +84,7 @@ "documentUpload": { "title": "Upload documents", "step": "4", - "subTitle": "Please upload your legal company commercial register document as well as the conformity approval (if app/service provider role was selected).
Please ensure to upload a pdf document only with limited document size of < 8MB.", + "subTitle": "Please upload your legal company commercial register document as well as the conformity approval (if app/service provider role was selected). /n Please ensure to upload a pdf document only with limited document size of < 8MB.", "dragDropMessage": "Drag and drop files here, or click to select files", "dragDropCaption": "on your computer", "dragDropSpanCaption": "browse files", From 0ce6dbc40cfa3ddf14b524b1714ac1b069cab7d1 Mon Sep 17 00:00:00 2001 From: jjeroch <94133633+jjeroch@users.noreply.github.com> Date: Sun, 15 Jan 2023 23:50:28 +0100 Subject: [PATCH 018/112] bugfix_text messages --- src/components/cax-companyData.tsx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/components/cax-companyData.tsx b/src/components/cax-companyData.tsx index 720ed2ca..a11c569f 100644 --- a/src/components/cax-companyData.tsx +++ b/src/components/cax-companyData.tsx @@ -278,7 +278,8 @@ export const CompanyDataCax = ({ {t('registrationStepOne.bpn')}{' '} @@ -295,7 +296,8 @@ export const CompanyDataCax = ({ {t('registrationStepOne.legalEntity')}{' '} {' '} {' '} {t('registrationStepOne.registeredName')}{' '} - Date: Sun, 15 Jan 2023 23:53:40 +0100 Subject: [PATCH 019/112] Update translations.json --- src/locales/en/translations.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/locales/en/translations.json b/src/locales/en/translations.json index cc99d3e6..4546d312 100644 --- a/src/locales/en/translations.json +++ b/src/locales/en/translations.json @@ -33,7 +33,7 @@ }, "registrationStepOne": { "verifyCompayDataHeading": "Add your company data", - "verifyCompayDataSubHeading": "Please add your legal entity company data below. For a quick and easy data entering, use your company business partner number (BPN) to automatically retrieve all necessary information. If you don't have a BPN so far, you can enter the company data manually.", + "verifyCompayDataSubHeading": "Please add your legal entity company data below. For a quick and easy data entering, use your company business partner number (BPN) to automatically retrieve all necessary information. If you don't have a BPN so far, you can enter the company data manually.", "seachDatabase": "Search for your company data by BPN to autofill the relevant data fields", "enterManualText": "or enter your data manually:", "bpn": "Business Partner Number", From 50b05507120fd5f4a4a8b14fa86ebb7372f1fb8b Mon Sep 17 00:00:00 2001 From: jjeroch <94133633+jjeroch@users.noreply.github.com> Date: Sun, 15 Jan 2023 23:54:29 +0100 Subject: [PATCH 020/112] Update translations.json --- src/locales/de/translations.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/locales/de/translations.json b/src/locales/de/translations.json index 62091c60..96acbf9e 100644 --- a/src/locales/de/translations.json +++ b/src/locales/de/translations.json @@ -33,7 +33,7 @@ }, "registrationStepOne": { "verifyCompayDataHeading": "Unternehmensdaten", - "verifyCompayDataSubHeading": "Bitte fügen Sie in dem relevanten Felden die Unternehmensdaten aus. Um schnell und einfach die Daten zu befüllen, empfehlen wir die automatische befüllung der Felder via der Unternehmensdaten suche mit der Business Partner Number (BPN). Sollten Sie die BPN nicht zur Hand haben, dann können sie ihre Daten manuell eingeben.", + "verifyCompayDataSubHeading": "Bitte fügen Sie in dem relevanten Felden die Unternehmensdaten aus. Um schnell und einfach die Daten zu befüllen, empfehlen wir die automatische befüllung der Felder via der Unternehmensdaten suche mit der Business Partner Number (BPN). Sollten Sie die BPN nicht zur Hand haben, dann können sie ihre Daten manuell eingeben.", "seachDatabase": "Suche (mit Hilfe der BPN)", "enterManualText": "oder füllen Sie die relevanten Felder manuell aus:", "bpn": "Business Partner Number", From c7c31d75ecf6541f33324a313291fd28f6cf2b8f Mon Sep 17 00:00:00 2001 From: Evelyn Gurschler Date: Tue, 17 Jan 2023 13:46:14 +0100 Subject: [PATCH 021/112] cplp-1874: add placeholder --- public/index.html | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/public/index.html b/public/index.html index a887440f..978a387e 100644 --- a/public/index.html +++ b/public/index.html @@ -31,6 +31,12 @@
+ From f3dcc50d816e9d93a73f929cf6a7313c8896f9ce Mon Sep 17 00:00:00 2001 From: Evelyn Gurschler Date: Tue, 17 Jan 2023 21:28:49 +0100 Subject: [PATCH 022/112] cplp-1874: enable dynamic config injection --- .conf/Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.conf/Dockerfile b/.conf/Dockerfile index d4e0047d..2f845f7d 100644 --- a/.conf/Dockerfile +++ b/.conf/Dockerfile @@ -1,4 +1,7 @@ FROM nginxinc/nginx-unprivileged:alpine COPY .conf/nginx.conf /etc/nginx/conf.d/default.conf COPY ./build /usr/share/nginx/html +USER root +RUN mv /usr/share/nginx/html/registration/index.html /usr/share/nginx/html/registration/index.html.reference +RUN apk update && apk add bash USER 101 From de37c6f5feebd6b30baf482512db8241f2a3d32b Mon Sep 17 00:00:00 2001 From: Evelyn Gurschler Date: Wed, 18 Jan 2023 09:29:54 +0100 Subject: [PATCH 023/112] wip: cplp-1874 - inject dynamic config in index.html --- scripts/inject-dynamic-env.sh | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 scripts/inject-dynamic-env.sh diff --git a/scripts/inject-dynamic-env.sh b/scripts/inject-dynamic-env.sh new file mode 100644 index 00000000..ee6c561e --- /dev/null +++ b/scripts/inject-dynamic-env.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +custom_env_vars='{"HOSTTYPE":"'$HOSTTYPE'","HOSTTYPE":"hosttype","HOSTTYPE":"hosttype"}' +custom_env_vars_anchor='' +index_html_reference=`cat index.html` +index_html=${index_html_reference//$custom_env_vars_anchor/$custom_env_vars} +echo "$index_html" > index2.html From 35eb843c9146939deb803e9f1cfa497513d1a28c Mon Sep 17 00:00:00 2001 From: Evelyn Gurschler Date: Wed, 18 Jan 2023 13:17:37 +0100 Subject: [PATCH 024/112] cplp-1874: enable dynamic config injection --- .conf/Dockerfile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.conf/Dockerfile b/.conf/Dockerfile index 2f845f7d..429d8fbc 100644 --- a/.conf/Dockerfile +++ b/.conf/Dockerfile @@ -1,7 +1,12 @@ FROM nginxinc/nginx-unprivileged:alpine COPY .conf/nginx.conf /etc/nginx/conf.d/default.conf COPY ./build /usr/share/nginx/html +# Change to root user for renaming of index.html to index.html.reference, to be used by env variables inject script USER root -RUN mv /usr/share/nginx/html/registration/index.html /usr/share/nginx/html/registration/index.html.reference +RUN mv /usr/share/nginx/html/index.html /usr/share/nginx/html/index.html.reference +# Install bash for env variables inject script RUN apk update && apk add bash +# Change to nginx user USER 101 +# Add env variables inject script +COPY ./scripts/inject-dynamic-env.sh /docker-entrypoint.d/00-inject-dynamic-env.sh From 7333123513e517c2847db3d87eb49325092dbd84 Mon Sep 17 00:00:00 2001 From: Evelyn Gurschler Date: Wed, 18 Jan 2023 13:18:22 +0100 Subject: [PATCH 025/112] cplp-1874: add env placeholder for dynamic config injection --- public/index.html | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/public/index.html b/public/index.html index 978a387e..2a81a6d8 100644 --- a/public/index.html +++ b/public/index.html @@ -27,15 +27,12 @@ Catena-X - +
- From c0e7189c32253c3199af629f34c21c25c5e7b098 Mon Sep 17 00:00:00 2001 From: Evelyn Gurschler Date: Wed, 18 Jan 2023 13:23:05 +0100 Subject: [PATCH 026/112] chore: add header --- .conf/Dockerfile | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.conf/Dockerfile b/.conf/Dockerfile index 429d8fbc..9d49b82a 100644 --- a/.conf/Dockerfile +++ b/.conf/Dockerfile @@ -1,3 +1,20 @@ +# Copyright (c) 2021,2022,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 + FROM nginxinc/nginx-unprivileged:alpine COPY .conf/nginx.conf /etc/nginx/conf.d/default.conf COPY ./build /usr/share/nginx/html From e27c9464f20e7e4a70a8fae83d580b27bd37f0e2 Mon Sep 17 00:00:00 2001 From: Evelyn Gurschler Date: Wed, 18 Jan 2023 13:40:41 +0100 Subject: [PATCH 027/112] cplp-1874 - inject dynamic config in index.html --- scripts/inject-dynamic-env.sh | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/scripts/inject-dynamic-env.sh b/scripts/inject-dynamic-env.sh index ee6c561e..c79377d1 100644 --- a/scripts/inject-dynamic-env.sh +++ b/scripts/inject-dynamic-env.sh @@ -1,7 +1,26 @@ #!/bin/bash -custom_env_vars='{"HOSTTYPE":"'$HOSTTYPE'","HOSTTYPE":"hosttype","HOSTTYPE":"hosttype"}' -custom_env_vars_anchor='' -index_html_reference=`cat index.html` +# Copyright (c) 2021,2022,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 + +custom_env_vars='{"PORTAL_FRONTEND_URL":"'$PORTAL_FRONTEND_URL'","PORTAL_BACKEND_URL":"'$PORTAL_BACKEND_URL'","CENTRALIDP_URL":"'$CENTRALIDP_URL'"}' +custom_env_vars_anchor='{"PORTAL_FRONTEND_URL":"https://portal.dummy","PORTAL_BACKEND_URL":"https://portal-backend.dummy","CENTRALIDP_URL":"https://centralidp.dummy/auth"}' +index_html_reference=`cat /usr/share/nginx/html/index.html.reference` index_html=${index_html_reference//$custom_env_vars_anchor/$custom_env_vars} -echo "$index_html" > index2.html +echo "$index_html" > /usr/share/nginx/html/index.html +rm /usr/share/nginx/html/index.html.reference +echo "Environment config successfully injected into index.html" \ No newline at end of file From 7cb776d78c4dd47e7b51ec51d3f536792acd2813 Mon Sep 17 00:00:00 2001 From: Evelyn Gurschler Date: Wed, 18 Jan 2023 16:15:48 +0100 Subject: [PATCH 028/112] cplp-1874: mark script as executable --- .conf/Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.conf/Dockerfile b/.conf/Dockerfile index 9d49b82a..c11f67b5 100644 --- a/.conf/Dockerfile +++ b/.conf/Dockerfile @@ -21,9 +21,10 @@ COPY ./build /usr/share/nginx/html # Change to root user for renaming of index.html to index.html.reference, to be used by env variables inject script USER root RUN mv /usr/share/nginx/html/index.html /usr/share/nginx/html/index.html.reference +# Add env variables inject script and mark as executable +COPY ./scripts/inject-dynamic-env.sh /docker-entrypoint.d/00-inject-dynamic-env.sh +RUN chmod +x /docker-entrypoint.d/00-inject-dynamic-env.sh # Install bash for env variables inject script RUN apk update && apk add bash # Change to nginx user USER 101 -# Add env variables inject script -COPY ./scripts/inject-dynamic-env.sh /docker-entrypoint.d/00-inject-dynamic-env.sh From 1b56e746201345ffb9ae705d6199b89ae5f24f46 Mon Sep 17 00:00:00 2001 From: Evelyn Gurschler Date: Wed, 18 Jan 2023 17:59:44 +0100 Subject: [PATCH 029/112] cplp-1873: don't delete reference file --- scripts/inject-dynamic-env.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/inject-dynamic-env.sh b/scripts/inject-dynamic-env.sh index c79377d1..515c3976 100644 --- a/scripts/inject-dynamic-env.sh +++ b/scripts/inject-dynamic-env.sh @@ -22,5 +22,4 @@ custom_env_vars_anchor='{"PORTAL_FRONTEND_URL":"https://portal.dummy","PORTAL_BA index_html_reference=`cat /usr/share/nginx/html/index.html.reference` index_html=${index_html_reference//$custom_env_vars_anchor/$custom_env_vars} echo "$index_html" > /usr/share/nginx/html/index.html -rm /usr/share/nginx/html/index.html.reference echo "Environment config successfully injected into index.html" \ No newline at end of file From 1162af332419998cb3d2146381b3a93df1f70822 Mon Sep 17 00:00:00 2001 From: Evelyn Gurschler Date: Wed, 18 Jan 2023 18:00:29 +0100 Subject: [PATCH 030/112] cplp-1874: set nginx as owner --- .conf/Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.conf/Dockerfile b/.conf/Dockerfile index c11f67b5..0e02bbe0 100644 --- a/.conf/Dockerfile +++ b/.conf/Dockerfile @@ -26,5 +26,6 @@ COPY ./scripts/inject-dynamic-env.sh /docker-entrypoint.d/00-inject-dynamic-env. RUN chmod +x /docker-entrypoint.d/00-inject-dynamic-env.sh # Install bash for env variables inject script RUN apk update && apk add bash -# Change to nginx user -USER 101 +# Make nginx owner of /usr/share/nginx/html/ and change to nginx user +RUN chown -R nginx:nginx /usr/share/nginx/html/ +USER nginx From bcd21c2a7b781e2dbf4d04ee9e069f4b61e2da20 Mon Sep 17 00:00:00 2001 From: evegufy Date: Wed, 18 Jan 2023 19:51:39 +0100 Subject: [PATCH 031/112] cplp1874: remove quotes due to change to const object --- public/index.html | 2 +- scripts/inject-dynamic-env.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/public/index.html b/public/index.html index 2a81a6d8..332ba487 100644 --- a/public/index.html +++ b/public/index.html @@ -32,7 +32,7 @@
diff --git a/scripts/inject-dynamic-env.sh b/scripts/inject-dynamic-env.sh index 515c3976..08e5b42b 100644 --- a/scripts/inject-dynamic-env.sh +++ b/scripts/inject-dynamic-env.sh @@ -17,8 +17,8 @@ # SPDX-License-Identifier: Apache-2.0 -custom_env_vars='{"PORTAL_FRONTEND_URL":"'$PORTAL_FRONTEND_URL'","PORTAL_BACKEND_URL":"'$PORTAL_BACKEND_URL'","CENTRALIDP_URL":"'$CENTRALIDP_URL'"}' -custom_env_vars_anchor='{"PORTAL_FRONTEND_URL":"https://portal.dummy","PORTAL_BACKEND_URL":"https://portal-backend.dummy","CENTRALIDP_URL":"https://centralidp.dummy/auth"}' +custom_env_vars='{PORTAL_FRONTEND_URL:"'$PORTAL_FRONTEND_URL'",PORTAL_BACKEND_URL:"'$PORTAL_BACKEND_URL'",CENTRALIDP_URL:"'$CENTRALIDP_URL'"}' +custom_env_vars_anchor='{PORTAL_FRONTEND_URL:"https://portal.dummy",PORTAL_BACKEND_URL:"https://portal-backend.dummy",CENTRALIDP_URL:"https://centralidp.dummy/auth"}' index_html_reference=`cat /usr/share/nginx/html/index.html.reference` index_html=${index_html_reference//$custom_env_vars_anchor/$custom_env_vars} echo "$index_html" > /usr/share/nginx/html/index.html From 4ab1ab0a8098bbf4892dce89b67733f8648e1256 Mon Sep 17 00:00:00 2001 From: evegufy Date: Wed, 18 Jan 2023 19:57:11 +0100 Subject: [PATCH 032/112] cplp-1874: change to dev env as default values --- public/index.html | 2 +- scripts/inject-dynamic-env.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/index.html b/public/index.html index 332ba487..353c3a1b 100644 --- a/public/index.html +++ b/public/index.html @@ -32,7 +32,7 @@
diff --git a/scripts/inject-dynamic-env.sh b/scripts/inject-dynamic-env.sh index 08e5b42b..c0a455be 100644 --- a/scripts/inject-dynamic-env.sh +++ b/scripts/inject-dynamic-env.sh @@ -18,7 +18,7 @@ # SPDX-License-Identifier: Apache-2.0 custom_env_vars='{PORTAL_FRONTEND_URL:"'$PORTAL_FRONTEND_URL'",PORTAL_BACKEND_URL:"'$PORTAL_BACKEND_URL'",CENTRALIDP_URL:"'$CENTRALIDP_URL'"}' -custom_env_vars_anchor='{PORTAL_FRONTEND_URL:"https://portal.dummy",PORTAL_BACKEND_URL:"https://portal-backend.dummy",CENTRALIDP_URL:"https://centralidp.dummy/auth"}' +custom_env_vars_anchor='{PORTAL_FRONTEND_URL:"https://portal.dev.demo.catena-x.net",PORTAL_BACKEND_URL:"https://portal-backend.dev.demo.catena-x.net",CENTRALIDP_URL:"https://centralidp.dev.demo.catena-x.net/auth"}' index_html_reference=`cat /usr/share/nginx/html/index.html.reference` index_html=${index_html_reference//$custom_env_vars_anchor/$custom_env_vars} echo "$index_html" > /usr/share/nginx/html/index.html From 5e74cf86bef874d1e64e022550b5f4bc5e5979e0 Mon Sep 17 00:00:00 2001 From: evegufy Date: Wed, 18 Jan 2023 20:11:43 +0100 Subject: [PATCH 033/112] cplp-1874: remove message --- scripts/inject-dynamic-env.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/inject-dynamic-env.sh b/scripts/inject-dynamic-env.sh index c0a455be..3cbd2462 100644 --- a/scripts/inject-dynamic-env.sh +++ b/scripts/inject-dynamic-env.sh @@ -22,4 +22,3 @@ custom_env_vars_anchor='{PORTAL_FRONTEND_URL:"https://portal.dev.demo.catena-x.n index_html_reference=`cat /usr/share/nginx/html/index.html.reference` index_html=${index_html_reference//$custom_env_vars_anchor/$custom_env_vars} echo "$index_html" > /usr/share/nginx/html/index.html -echo "Environment config successfully injected into index.html" \ No newline at end of file From b3a6e4818c7bd7eced922d5a560197562e909d93 Mon Sep 17 00:00:00 2001 From: evegufy Date: Wed, 18 Jan 2023 20:16:21 +0100 Subject: [PATCH 034/112] cplp-1874: move comment --- public/index.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/index.html b/public/index.html index 353c3a1b..d8ec8afe 100644 --- a/public/index.html +++ b/public/index.html @@ -27,10 +27,11 @@ Catena-X - +
+ From 7c1b4ee993bff0a0e96c0ab925da3c5484ce5eb8 Mon Sep 17 00:00:00 2001 From: Evelyn Gurschler Date: Thu, 19 Jan 2023 11:22:07 +0100 Subject: [PATCH 035/112] cplp-1874: change from username back to uid --- .conf/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.conf/Dockerfile b/.conf/Dockerfile index 0e02bbe0..3d323f18 100644 --- a/.conf/Dockerfile +++ b/.conf/Dockerfile @@ -27,5 +27,5 @@ RUN chmod +x /docker-entrypoint.d/00-inject-dynamic-env.sh # Install bash for env variables inject script RUN apk update && apk add bash # Make nginx owner of /usr/share/nginx/html/ and change to nginx user -RUN chown -R nginx:nginx /usr/share/nginx/html/ -USER nginx +RUN chown -R 101:101 /usr/share/nginx/html/ +USER 101 From 90181021e1ec063717813a57a7b8283bb719d56e Mon Sep 17 00:00:00 2001 From: Evelyn Gurschler Date: Fri, 20 Jan 2023 15:53:19 +0100 Subject: [PATCH 036/112] cplp-1874: enable env config from index.html --- src/services/EnvironmentService.test.ts | 91 ------------------------- src/services/EnvironmentService.ts | 29 ++------ 2 files changed, 7 insertions(+), 113 deletions(-) delete mode 100644 src/services/EnvironmentService.test.ts diff --git a/src/services/EnvironmentService.test.ts b/src/services/EnvironmentService.test.ts deleted file mode 100644 index e240ceed..00000000 --- a/src/services/EnvironmentService.test.ts +++ /dev/null @@ -1,91 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2021,2022 BMW Group AG - * Copyright (c) 2021,2022 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 { - getApiBase, - getAssetBase, - getCentralIdp, - getHostname, - isLocal, -} from './EnvironmentService' - -const ENV = [ - { - name: 'localhost', - hostname: 'localhost', - origin: 'http://localhost', - assets: 'https://portal.dev.demo.catena-x.net/assets', - api: 'https://portal-backend.dev.demo.catena-x.net', - idp: 'https://centralidp.dev.demo.catena-x.net/auth', - }, - { - name: 'dev', - hostname: 'portal.dev.demo.catena-x.net', - origin: 'https://portal.dev.demo.catena-x.net', - assets: '/assets', - api: 'https://portal-backend.dev.demo.catena-x.net', - idp: 'https://centralidp.dev.demo.catena-x.net/auth', - }, - { - name: 'pen', - hostname: 'portal-pen.dev.demo.catena-x.net', - origin: 'https://portal-pen.dev.demo.catena-x.net', - assets: '/assets', - api: 'https://portal-backend-pen.dev.demo.catena-x.net', - idp: 'https://centralidp-pen.dev.demo.catena-x.net/auth', - }, - { - name: 'int', - hostname: 'portal.int.demo.catena-x.net', - origin: 'https://portal.int.demo.catena-x.net', - assets: '/assets', - api: 'https://portal-backend.int.demo.catena-x.net', - idp: 'https://centralidp.int.demo.catena-x.net/auth', - }, - { - name: 'prod', - hostname: 'portal.catena-x.net', - origin: 'https://portal.catena-x.net', - assets: '/assets', - api: 'https://portal-backend.catena-x.net', - idp: 'https://centralidp.catena-x.net/auth', - }, -] - -describe('EnvironmentService', () => { - beforeAll(() => { - global.window = Object.create(window) - }) - - ENV.forEach((env) => - it(`returns correct references for ${env.name}`, () => { - Object.defineProperty(window, 'location', { - configurable: true, - writable: true, - value: env, - }) - expect(getHostname()).toEqual(env.hostname) - expect(isLocal()).toEqual(env.hostname === 'localhost') - expect(getApiBase()).toEqual(env.api) - expect(getAssetBase()).toEqual(env.assets) - expect(getCentralIdp()).toEqual(env.idp) - }) - ) -}) diff --git a/src/services/EnvironmentService.ts b/src/services/EnvironmentService.ts index 2ef4e015..b9a442e7 100644 --- a/src/services/EnvironmentService.ts +++ b/src/services/EnvironmentService.ts @@ -18,35 +18,20 @@ * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ -const LOCAL_SERVICES_FRONTEND = 'https://portal.dev.demo.catena-x.net' -const LOCAL_SERVICES_BACKEND = 'https://portal-backend.dev.demo.catena-x.net' +declare let ENV: any; export const getHostname = () => window.location.hostname export const isLocal = () => getHostname() === 'localhost' -export const getApiBase = () => - isLocal() - ? LOCAL_SERVICES_BACKEND - : window.location.origin.replace('portal', 'portal-backend') +const PORTAL_FRONTEND_URL = () => ENV.PORTAL_FRONTEND_URL + +export const getApiBase = () => ENV.PORTAL_BACKEND_URL export const getAssetBase = () => - `${isLocal() ? LOCAL_SERVICES_FRONTEND : ''}/assets` - -export const getCentralIdp = () => { - const hostname = getHostname() - if (hostname === 'portal.int.demo.catena-x.net') - return 'https://centralidp.int.demo.catena-x.net/auth' - if (hostname === 'portal-pen.dev.demo.catena-x.net') - return 'https://centralidp-pen.dev.demo.catena-x.net/auth' - if (hostname === 'portal.beta.demo.catena-x.net') - return 'https://centralidp.beta.demo.catena-x.net/auth' - if (hostname === 'portal.pre-prod.demo.catena-x.net') - return 'https://centralidp.pre-prod.demo.catena-x.net/auth' - if (hostname === 'portal.catena-x.net') - return 'https://centralidp.catena-x.net/auth' - return 'https://centralidp.dev.demo.catena-x.net/auth' -} + `${isLocal() ? PORTAL_FRONTEND_URL : ''}/assets` + +export const getCentralIdp = () => typeof ENV === 'undefined' ? '' : ENV.CENTRALIDP_URL const EnvironmentService = { isLocal, From 0bb4280b635630df7af4c4985e9b046fb97a3905 Mon Sep 17 00:00:00 2001 From: Martin Rohrmeier Date: Fri, 20 Jan 2023 16:07:58 +0100 Subject: [PATCH 037/112] use environment variables in tests --- src/components/landing.test.tsx | 60 ------------------------------ src/services/EnvironmentService.ts | 15 ++------ 2 files changed, 3 insertions(+), 72 deletions(-) delete mode 100644 src/components/landing.test.tsx diff --git a/src/components/landing.test.tsx b/src/components/landing.test.tsx deleted file mode 100644 index 62639a74..00000000 --- a/src/components/landing.test.tsx +++ /dev/null @@ -1,60 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2021,2022 Microsoft and BMW Group AG - * Copyright (c) 2021,2022 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 React from 'react' -import { render, screen } from '@testing-library/react' -import Landing from './landing' -import { MemoryRouter } from 'react-router-dom' -import { Provider } from 'react-redux' -import { store } from '../state/store' -import i18n from '../i18n' - -describe('testSuite', () => { - beforeEach(() => { - i18n.init() - }) - - test('Render Landing Page', () => { - const { container } = render( - - - - - - ) - expect(container.querySelector('.container-body')).toBeInTheDocument() - expect(container.querySelector('.bullet-points')).toBeInTheDocument() - expect( - screen.getByText('Welcome to Catena-X - The Automotive Network') - ).toBeInTheDocument() - }) - - test('renders buttons', async () => { - render( - - - - - - ) - const items = await screen.findAllByRole('button') - expect(items).toHaveLength(2) - }) -}) diff --git a/src/services/EnvironmentService.ts b/src/services/EnvironmentService.ts index b9a442e7..4849d0bd 100644 --- a/src/services/EnvironmentService.ts +++ b/src/services/EnvironmentService.ts @@ -18,24 +18,15 @@ * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ -declare let ENV: any; +declare const ENV: any; -export const getHostname = () => window.location.hostname +export const getApiBase = () => typeof ENV === 'undefined' ? '' : ENV.PORTAL_BACKEND_URL -export const isLocal = () => getHostname() === 'localhost' - -const PORTAL_FRONTEND_URL = () => ENV.PORTAL_FRONTEND_URL - -export const getApiBase = () => ENV.PORTAL_BACKEND_URL - -export const getAssetBase = () => - `${isLocal() ? PORTAL_FRONTEND_URL : ''}/assets` +export const getAssetBase = () => `${typeof ENV === 'undefined' ? '' : ENV.PORTAL_FRONTEND_URL}/assets` export const getCentralIdp = () => typeof ENV === 'undefined' ? '' : ENV.CENTRALIDP_URL const EnvironmentService = { - isLocal, - getHostname, getApiBase, getAssetBase, getCentralIdp, From 67b2fee52d99640e370cd32d7cbf494b51f08add Mon Sep 17 00:00:00 2001 From: nidhi garg Date: Mon, 23 Jan 2023 12:14:01 +0530 Subject: [PATCH 038/112] unique identifier fn --- CHANGELOG.md | 1 + src/components/cax-companyData.tsx | 98 ++++++++++++++++++++--- src/helpers/utils.ts | 28 +++++++ src/locales/de/translations.json | 13 +++ src/locales/en/translations.json | 13 +++ src/state/features/application/actions.ts | 17 ++++ src/state/features/application/api.ts | 13 ++- src/state/features/application/slice.ts | 25 +++++- src/state/features/application/types.ts | 13 +++ 9 files changed, 209 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a63543f7..668baba7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ New features, fixed bugs, known defects and other noteworthy changes to each release of the Catena-X Portal Frontend Registration. ### Unreleased +* Feature - Look-up Unique Identifier ## 1.0.0-RC1 diff --git a/src/components/cax-companyData.tsx b/src/components/cax-companyData.tsx index 720ed2ca..5b39f7ed 100644 --- a/src/components/cax-companyData.tsx +++ b/src/components/cax-companyData.tsx @@ -34,6 +34,7 @@ import { DataErrorCodes } from '../helpers/DataError' import { toast } from 'react-toastify' import { getCompanyDetailsWithAddress, + getUniqueIdentifier, saveCompanyDetailsWithAddress, } from '../state/features/application/actions' import { applicationSelector } from '../state/features/application/slice' @@ -52,25 +53,26 @@ const initialErrors = { postalCode: '', city: '', country: '', + identifierNumber: '' } export const CompanyDataCax = ({ currentActiveStep, addCurrentStep, }: CompanyDataProps) => { - const { t } = useTranslation() + const { t, i18n } = useTranslation() const dispatch = useDispatch() const [nextClicked, setNextClicked] = useState(false) - const { status, error, loading, saveError, companyDetails } = useSelector(applicationSelector) + const { status, error, loading, saveError, companyDetails, identifierDetails } = useSelector(applicationSelector) - if(nextClicked && !loading){ - if(saveError){ + if (nextClicked && !loading) { + if (saveError) { toast.error(t('registrationStepOne.submitError')) - }else{ + } else { addCurrentStep(currentActiveStep + 1) - } + } } const obj = status[status.length - 1] //.find(o => o['applicationStatus'] === CREATED); @@ -91,8 +93,17 @@ export const CompanyDataCax = ({ setPostalCode(companyDetails?.zipCode) setCity(companyDetails?.city) setCountry(companyDetails?.countryAlpha2Code) + companyDetails?.countryAlpha2Code && dispatch(getUniqueIdentifier(companyDetails?.countryAlpha2Code)) + setIdentifierNumber(companyDetails?.uniqueIds?.[0]?.value) + setIdentifierType(companyDetails?.uniqueIds?.[0]?.type) }, [companyDetails]) + useEffect(() => { + if(identifierDetails.length > 0){ + setShowIdentifiers(true) + } + }, [identifierDetails]) + const [search, setSearch] = useState('') const [bpn, setBpn] = useState(companyDetails?.bpn) const [bpnErrorMsg, setBpnErrorMessage] = useState('') @@ -104,8 +115,16 @@ export const CompanyDataCax = ({ const [postalCode, setPostalCode] = useState(companyDetails.zipCode) const [city, setCity] = useState(companyDetails.city) const [country, setCountry] = useState(companyDetails.countryAlpha2Code) + const [showIdentifiers, setShowIdentifiers] = useState(false) + const [identifierNumber, setIdentifierNumber] = useState() const [errors, setErrors] = useState(initialErrors) + const [identifierType, setIdentifierType] = useState() + + useEffect(() => { + identifierNumber && identifierType && validateIdentifierNumber(identifierNumber) + }, [identifierType, identifierNumber]) + const fetchData = async (expr: string) => { const details = await getCompanyDetails(expr) setBpn(details?.[0]?.bpn) @@ -180,7 +199,7 @@ export const CompanyDataCax = ({ const validatePostalCode = (value: string) => { setPostalCode(value) - if(!value) return setErrors((prevState) => ({ ...prevState, postalCode: '' })) + if (!value) return setErrors((prevState) => ({ ...prevState, postalCode: '' })) if (!PATTERNS.postalCodePattern.test(value.trim())) { return setErrors((prevState) => ({ @@ -207,17 +226,32 @@ export const CompanyDataCax = ({ const validateCountry = (value: string) => { setCountry(value) - if (!PATTERNS.countryPattern.test(value.trim())) { + setShowIdentifiers(false) return setErrors((prevState) => ({ ...prevState, country: 'countryError', })) } - + dispatch(getUniqueIdentifier(value)) return setErrors((prevState) => ({ ...prevState, country: '' })) } + const validateIdentifierNumber = (value) => { + setIdentifierNumber(value) + if (!PATTERNS[i18n.language][identifierType].test(value.trim())) { + return setErrors((prevState) => ({ + ...prevState, + identifierNumber: identifierType, + })) + } + return setErrors((prevState) => ({ ...prevState, identifierNumber: '' })) + } + + const onIdentifierTypeChange = (e) => { + setIdentifierType(e.target.value) + } + const backClick = () => { addCurrentStep(currentActiveStep - 1) } @@ -231,6 +265,10 @@ export const CompanyDataCax = ({ companyData.city = city companyData.zipCode = postalCode companyData.countryAlpha2Code = country + companyData.uniqueIds = [{ + type: identifierType, + value: identifierNumber + }] //addCompanyData(companyData) dispatch(saveCompanyDetailsWithAddress({ applicationId, companyData })) setNextClicked(true) @@ -393,13 +431,52 @@ export const CompanyDataCax = ({ )} + + { + showIdentifiers && + <> + + + {t('registrationStepOne.countrytIdentifier')} + + + +
+ + +
+
+ +
+ + validateIdentifierNumber(e.target.value)} + /> + {errors.identifierNumber && ( + + )} +
+
+ + } backClick()} handleNextClick={() => nextClick()} - disabled={ !legalEntity || !registeredName || !streetHouseNumber || !city || !country || errors.streetHouseNumber !== '' || errors.country !== '' || errors.postalCode !== '' } + disabled={!legalEntity || !registeredName || !streetHouseNumber || !city || !country || errors.streetHouseNumber !== '' || errors.country !== '' || errors.postalCode !== '' || errors.identifierNumber !== ''} /> ) @@ -422,3 +499,4 @@ export default withRouter( mapDispatchToProps )(CompanyDataCax) ) + diff --git a/src/helpers/utils.ts b/src/helpers/utils.ts index 0f328976..6e459e0c 100644 --- a/src/helpers/utils.ts +++ b/src/helpers/utils.ts @@ -221,6 +221,34 @@ export const PATTERNS = { postalCodePattern: /^(?=[a-zA-Z0-9]*[-\s]?[a-zA-Z0-9]*$)[a-zA-Z0-9-\s]{2,10}$/, cityPattern: /^[A-Za-zÀ-ÿ]{3,20}$/, countryPattern: /^[A-Za-zÀ-ÿ]{2,3}$/, + en: { + COMMERCIAL_REG_NUMBER: /^[a-zA-Z0-9-]{6,21}$/, + VAT_ID: /^[a-zA-Z0-9-]{5,6}$/, + LEI_CODE: /^[a-zA-Z0-9]{20}$/, + VIES: /.*/, + EORI: /.*/ + }, + de: { + COMMERCIAL_REG_NUMBER: /^[a-zA-Z0-9-\s]{9}$/, + VAT_ID: /^DE[0-9]{9}$/, + LEI_CODE: /^[a-zA-Z0-9]{20}$/, + VIES: /.*/, + EORI: /.*/ + }, + fr: { + COMMERCIAL_REG_NUMBER: /^[a-zA-Z0-9\s]{14,17}$/, + VAT_ID: /^[a-zA-Z0-9-\s]{8,15}$/, + LEI_CODE: /^[a-zA-Z0-9]{20}$/, + VIES: /.*/, + EORI: /.*/ + }, + mx: { + COMMERCIAL_REG_NUMBER: /^[a-zA-Z0-9-]{6,21}$/, + VAT_ID: /^[a-zA-Z0-9-&]{12,13}$/, + LEI_CODE: /^[a-zA-Z0-9]{20}$/, + VIES: /.*/, + EORI: /.*/ + }, } export function download(file: Blob, fileType: string, fileName: string) { diff --git a/src/locales/de/translations.json b/src/locales/de/translations.json index 62091c60..8daa99ec 100644 --- a/src/locales/de/translations.json +++ b/src/locales/de/translations.json @@ -45,6 +45,16 @@ "postalCode": "Postleitzahl", "city": "Stadt", "country": "Ländercode (ISO 3166 Alpha 2 - z.B. DE)", + "countrytIdentifier": "Country Identifier", + "identifierType": "Identifier Type", + "identifierNumber": "Identifier Number", + "identifierTypes": { + "COMMERCIAL_REG_NUMBER": "Handelsregisternummer", + "VAT_ID": "Steuernummer", + "LEI_CODE": "LEI Code", + "VIES": "VIES", + "EORI": "EORI" + }, "bpnInvalidError": "The BPN is invalid, please enter a valid BPN or use the manual flow below. Hint: A BPN has 16-digits.", "bpnNotExistError": "This BPN doesn't exist, please enter a valid BPN or use the manual flow below.", "legalEntityError": "Bitte geben Sie einen gültigen Wert für die juristische Person ein.", @@ -53,6 +63,9 @@ "postalCodeError": "Bitte geben Sie eine gültige Postleitzahl ein.", "cityError": "Bitte geben Sie einen gültigen Städtenamen ein.", "countryError": "Please enter a valid country code. Country codes have a 2 digit alpha character.", + "COMMERCIAL_REG_NUMBER": "Please enter a valid number. Hint: Aplhanumeric with hyphen and space with exact 9 digits.", + "VAT_ID": "Please enter a valid number. Hint: Starting with DE and followed by 9 digit numbers", + "LEI_CODE": "Please enter a valid number. Hint: Aplhanumeric with exact 20 digits.", "submitError": "Something went wrong. Your entered data could not get saved. Please try again later or contact the administrator." }, "finish": { diff --git a/src/locales/en/translations.json b/src/locales/en/translations.json index 7c5d6b5e..5ec2b90c 100644 --- a/src/locales/en/translations.json +++ b/src/locales/en/translations.json @@ -45,6 +45,16 @@ "postalCode": "Postal Code", "city": "City", "country": "Country Code (ISO 3166 Alpha 2 - e.g. DE)", + "countrytIdentifier": "Country Identifier", + "identifierType": "Identifier Type", + "identifierNumber": "Identifier Number", + "identifierTypes": { + "COMMERCIAL_REG_NUMBER": "Commercial Registration Number", + "VAT_ID": "VAT ID", + "LEI_CODE": "LEI Code", + "VIES": "VIES", + "EORI": "EORI" + }, "bpnInvalidError": "The BPN is invalid, please enter a valid BPN or use the manual flow below. Hint: A BPN has 16-digits.", "bpnNotExistError": "This BPN doesn't exist, please enter a valid BPN or use the manual flow below.", "legalEntityError": "Please enter a valid legal entity name.", @@ -53,6 +63,9 @@ "postalCodeError": "Please enter a valid postal code", "cityError": "Please enter a valid city name", "countryError": "Please enter a valid country code. Hint: country codes are 2 alpha letters.", + "COMMERCIAL_REG_NUMBER": "Please enter a valid number. Hint: Aplhanumeric with hyphen with 6 to 21 digits.", + "VAT_ID": "Please enter a valid number. Hint: Aplhanumeric with hyphen with 5 to 6 digits.", + "LEI_CODE": "Please enter a valid number. Hint: Aplhanumeric with exact 20 digits.", "submitError": "Something went wrong. Your entered data could not get saved. Please try again later or contact the administrator." }, "finish": { diff --git a/src/state/features/application/actions.ts b/src/state/features/application/actions.ts index 4512a745..59b42ee4 100644 --- a/src/state/features/application/actions.ts +++ b/src/state/features/application/actions.ts @@ -75,6 +75,22 @@ const getCompanyDetailsWithAddress = createAsyncThunk( } ) +const getUniqueIdentifier = createAsyncThunk( + `${name}/uniqueIdentifier/get`, + async (alpha2Code: string) => { + try { + return await ApplicationApi.getInstance().getUniqueIdentifier( + alpha2Code + ) + } catch (error: unknown) { + console.error('api call error:', error) + throw Error( + 'No identifier found.' + ) + } + } +) + const saveCompanyDetailsWithAddress = createAsyncThunk( `${name}/companyDetailsWithAddress/save-address`, async ({ @@ -103,5 +119,6 @@ export { updateInvitation, updateStatus, getCompanyDetailsWithAddress, + getUniqueIdentifier, saveCompanyDetailsWithAddress, } diff --git a/src/state/features/application/api.ts b/src/state/features/application/api.ts index 76c875b4..c62718ee 100644 --- a/src/state/features/application/api.ts +++ b/src/state/features/application/api.ts @@ -21,7 +21,7 @@ import { HttpClient } from '../../../helpers/HttpClient' import UserService from '../../../services/UserService' import { getApiBase } from '../../../services/EnvironmentService' -import { ApplicationStatus, CompanyDetails } from './types' +import { ApplicationStatus, CompanyDetails, UniqueIdentifier } from './types' export class ApplicationApi extends HttpClient { private static classInstance?: ApplicationApi @@ -84,6 +84,17 @@ export class ApplicationApi extends HttpClient { ) } + public getUniqueIdentifier = (alpha2Code: string) => { + return this.instance.get( + `/api/registration/company/country/${alpha2Code}/uniqueidentifiers`, + { + headers: { + authorization: `Bearer ${UserService.getToken()}`, + }, + } + ) + } + public saveCompanyDetailsWithAddress = ( applicationId: string, companyData: CompanyDetails diff --git a/src/state/features/application/slice.ts b/src/state/features/application/slice.ts index a88bd8a7..a2675329 100644 --- a/src/state/features/application/slice.ts +++ b/src/state/features/application/slice.ts @@ -24,13 +24,15 @@ import { fetchId, updateInvitation, getCompanyDetailsWithAddress, - saveCompanyDetailsWithAddress + saveCompanyDetailsWithAddress, + getUniqueIdentifier } from './actions' import { ApplicationState, InitialCompanyDetail } from './types' const initialState: ApplicationState = { status: [], companyDetails: InitialCompanyDetail, + identifierDetails: [], loading: false, error: null, saveError: null @@ -95,6 +97,27 @@ const applicationSlice = createSlice({ loading: false, error: action.error.message as string, })) + builder.addCase(getUniqueIdentifier.pending, (state) => ({ + ...state, + identifierDetails: [], + loading: true, + error: null, + })) + builder.addCase( + getUniqueIdentifier.fulfilled, + (state, { payload }) => ({ + ...state, + identifierDetails: payload, + loading: false, + error: null, + }) + ) + builder.addCase(getUniqueIdentifier.rejected, (state, action) => ({ + ...state, + identifierDetails: [], + loading: false, + error: action.error.message as string, + })) builder.addCase(saveCompanyDetailsWithAddress.pending, (state) => ({ ...state, loading: true, diff --git a/src/state/features/application/types.ts b/src/state/features/application/types.ts index 4543d498..42c0e9f7 100644 --- a/src/state/features/application/types.ts +++ b/src/state/features/application/types.ts @@ -25,6 +25,11 @@ export type ApplicationStatus = { status: string } +export type Identifier = { + type: string + value: string +} + export type CompanyDetails = { companyId: string bpn: string @@ -39,6 +44,7 @@ export type CompanyDetails = { countryAlpha2Code: string countryDe: string taxId: string + uniqueIds: Identifier[] } export type ApplicationInvitedUsers = { @@ -56,11 +62,17 @@ export type ApplicationInvitedFormUsers = { export interface ApplicationState { status: Array companyDetails: CompanyDetails | null + identifierDetails: Array loading: boolean error: string saveError: string } +export type UniqueIdentifier = { + id: number + label: string +} + export const InitialCompanyDetail = { companyId: '', bpn: '', @@ -75,6 +87,7 @@ export const InitialCompanyDetail = { countryAlpha2Code: '', countryDe: '', taxId: '', + uniqueIds: [] } export const ADD_COMPANY_DATA = 'ADD_COMPANY_DATA' From fe34c88379bce5fe3e62242f542e1790f09cd6c3 Mon Sep 17 00:00:00 2001 From: nidhi garg Date: Mon, 23 Jan 2023 12:26:38 +0530 Subject: [PATCH 039/112] fix codesmells --- src/components/cax-companyData.tsx | 4 ++-- src/helpers/utils.ts | 32 +++++++++++++++--------------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/components/cax-companyData.tsx b/src/components/cax-companyData.tsx index 5b39f7ed..4b8df3c9 100644 --- a/src/components/cax-companyData.tsx +++ b/src/components/cax-companyData.tsx @@ -445,8 +445,8 @@ export const CompanyDataCax = ({ onIdentifierTypeChange(e)}> + {identifierDetails && identifierDetails.map((identifier) => (