From 63203109e676b05e6f4fadc00435a6abb35d3c2d Mon Sep 17 00:00:00 2001
From: lavanya-bmw <106523828+lavanya-bmw@users.noreply.github.com>
Date: Mon, 29 Apr 2024 14:13:20 +0530
Subject: [PATCH 1/7] feat(technical setup): connector registration overlay
(#724)
https://github.com/eclipse-tractusx/portal-frontend/issues/694
---
src/assets/locales/de/main.json | 2 +-
src/assets/locales/en/main.json | 10 +--
.../overlays/AppMarketplaceRequest/index.tsx | 2 +-
.../overlays/ServiceRequest/index.tsx | 2 +-
.../CompanySubscriptions.scss | 6 +-
.../components/ConnectorInsertForm.tsx | 13 ++--
.../AddConnectorOverlay/index.tsx | 68 +++++++++----------
src/types/Patterns.ts | 5 +-
8 files changed, 54 insertions(+), 54 deletions(-)
diff --git a/src/assets/locales/de/main.json b/src/assets/locales/de/main.json
index 8725eeab9..e48cf3ef4 100644
--- a/src/assets/locales/de/main.json
+++ b/src/assets/locales/de/main.json
@@ -1317,7 +1317,7 @@
}
},
"serviceMarketplace": {
- "headline": "Purchase Service Request",
+ "headline": "Service-Abonnement",
"desc1": "Wenn Sie unten „Bestätigen“ auswählen, benachrichtigen Sie den App-Anbieter umgehend über Ihr Interesse an seinem Dienst und er beginnt mit dem Abonnementverfahren. Sollte der Anbieter weitere Einzelheiten benötigen, um fortzufahren, wird er sich direkt an Sie wenden.",
"desc2": "Sobald alle notwendigen Informationen bestätigt und alle Fragen geklärt sind, wird der App-Anbieter mit der Aktivierung Ihres App-Mandanten fortfahren. Sie erhalten eine Benachrichtigung, die Sie durch alle weiteren Schritte führt, die Ihrerseits erforderlich sind.",
"desc3": "WICHTIGER HINWEIS:WICHTIGER HINWEIS:",
diff --git a/src/assets/locales/en/main.json b/src/assets/locales/en/main.json
index f06a9411f..ac1b821c1 100644
--- a/src/assets/locales/en/main.json
+++ b/src/assets/locales/en/main.json
@@ -684,7 +684,9 @@
"tooltipMsg": "Description for new technical user",
"mandatoryError": "Description is mandatory",
"patternError": "Username should start with a letter. Allowed special characters are #. '!=()&” along with numbers and spaces"
- }
+ },
+ "minLength": "Minlength is",
+ "maxLength": "Maxlength is"
},
"create": {
"successTitle": "Create connector successfully completed",
@@ -697,9 +699,7 @@
"successDescription": "Delete connector successfully completed.",
"errorTitle": "Something went wrong",
"errorDescription": "Something went wrong. Please try it later again or contact your administrator."
- },
- "minLength": "Minlength is",
- "maxLength": "Maxlength is"
+ }
}
},
"partnernetwork": {
@@ -1279,7 +1279,7 @@
}
},
"serviceMarketplace": {
- "headline": "Purchase Service Request",
+ "headline": "Service Subscription",
"desc1": "By selecting 'Confirm' below, you will promptly notify the app provider of your interest in their service, and they will commence the subscription procedure. Should the provider require further details to proceed, they will reach out to you directly.",
"desc2": "Once all necessary information has been confirmed and any queries resolved, the app provider will proceed to activate your app tenant. You will receive a notification to guide you through any subsequent steps required on your part.",
"desc3": "IMPORTANT NOTICE:",
diff --git a/src/components/overlays/AppMarketplaceRequest/index.tsx b/src/components/overlays/AppMarketplaceRequest/index.tsx
index 1fd5a391f..7ecbe46ab 100644
--- a/src/components/overlays/AppMarketplaceRequest/index.tsx
+++ b/src/components/overlays/AppMarketplaceRequest/index.tsx
@@ -131,7 +131,7 @@ export default function AppMarketplaceRequest({ id }: { id: string }) {
{t('content.appMarketplace.desc2')}
-
+
{t('content.appMarketplace.desc3')}
diff --git a/src/components/overlays/ServiceRequest/index.tsx b/src/components/overlays/ServiceRequest/index.tsx
index e00f15a1c..106aa1041 100644
--- a/src/components/overlays/ServiceRequest/index.tsx
+++ b/src/components/overlays/ServiceRequest/index.tsx
@@ -112,7 +112,7 @@ export default function ServiceRequest({ id }: { id: string }) {
{t('content.serviceMarketplace.desc2')}
-
+
{t('content.serviceMarketplace.desc3')}
diff --git a/src/components/pages/CompanySubscriptions/CompanySubscriptions.scss b/src/components/pages/CompanySubscriptions/CompanySubscriptions.scss
index 9974a8599..50985721c 100644
--- a/src/components/pages/CompanySubscriptions/CompanySubscriptions.scss
+++ b/src/components/pages/CompanySubscriptions/CompanySubscriptions.scss
@@ -50,7 +50,7 @@
}
.statusButton {
- text-transform: none;
- pointer-events: 'none';
- padding-left: 0;
+ text-transform: none !important;
+ pointer-events: none !important;
+ padding-left: 0 !important;
}
diff --git a/src/components/pages/EdcConnector/AddConnectorOverlay/components/ConnectorInsertForm.tsx b/src/components/pages/EdcConnector/AddConnectorOverlay/components/ConnectorInsertForm.tsx
index a34e587d1..42e3d7bee 100644
--- a/src/components/pages/EdcConnector/AddConnectorOverlay/components/ConnectorInsertForm.tsx
+++ b/src/components/pages/EdcConnector/AddConnectorOverlay/components/ConnectorInsertForm.tsx
@@ -37,6 +37,7 @@ import { ConnectType } from 'features/connector/connectorApiSlice'
import { Dropzone } from '../../../../shared/basic/Dropzone'
import { useEffect, useState } from 'react'
import './EdcComponentStyles.scss'
+import { ConnectorFormFields } from '..'
const ConnectorFormInput = ({
control,
@@ -216,7 +217,7 @@ any) => {
placeholder={placeholder}
onChangeItem={(e) => {
onChange(
- name === 'ConnectorTechnicalUser'
+ name === ConnectorFormFields.ConnectorTechnicalUser
? e.serviceAccountId
: e.subscriptionId
)
@@ -358,7 +359,7 @@ any) => {
trigger,
errors,
type: 'select',
- name: 'ConnectorTechnicalUser',
+ name: ConnectorFormFields.ConnectorTechnicalUser,
rules: {
required: true,
},
@@ -499,7 +500,7 @@ any) => {
trigger,
errors,
type: 'input',
- name: 'ConnectorName',
+ name: ConnectorFormFields.ConnectorName,
minLength: 2,
maxLength: 20,
pattern: Patterns.connectors.NAME,
@@ -530,7 +531,7 @@ any) => {
trigger,
errors,
type: 'input',
- name: 'ConnectorURL',
+ name: ConnectorFormFields.ConnectorURL,
pattern: Patterns.URL,
rules: {
required: t(
@@ -555,7 +556,7 @@ any) => {
trigger,
errors,
type: 'input',
- name: 'ConnectorLocation',
+ name: ConnectorFormFields.ConnectorLocation,
pattern: Patterns.connectors.COUNTRY,
rules: {
required: t(
@@ -582,7 +583,7 @@ any) => {
trigger,
errors,
type: 'select',
- name: 'ConnectorSubscriptionId',
+ name: ConnectorFormFields.ConnectorSubscriptionId,
rules: {
required: true,
},
diff --git a/src/components/pages/EdcConnector/AddConnectorOverlay/index.tsx b/src/components/pages/EdcConnector/AddConnectorOverlay/index.tsx
index 1338bed48..e2e6488a4 100644
--- a/src/components/pages/EdcConnector/AddConnectorOverlay/index.tsx
+++ b/src/components/pages/EdcConnector/AddConnectorOverlay/index.tsx
@@ -74,6 +74,14 @@ const formFields = {
TechnicalUserDescription: '',
}
+export enum ConnectorFormFields {
+ ConnectorSubscriptionId = 'ConnectorSubscriptionId',
+ ConnectorTechnicalUser = 'ConnectorTechnicalUser',
+ ConnectorLocation = 'ConnectorLocation',
+ ConnectorURL = 'ConnectorURL',
+ ConnectorName = 'ConnectorName',
+}
+
const AddConnectorOverlay = ({
openDialog = false,
connectorStep,
@@ -115,11 +123,11 @@ const AddConnectorOverlay = ({
newTechnicalUSer && !newUserSuccess
? await trigger(['TechnicalUserName', 'TechnicalUserDescription'])
: await trigger([
- 'ConnectorName',
- 'ConnectorURL',
- 'ConnectorLocation',
- 'ConnectorSubscriptionId',
- 'ConnectorTechnicalUser',
+ ConnectorFormFields.ConnectorName,
+ ConnectorFormFields.ConnectorURL,
+ ConnectorFormFields.ConnectorLocation,
+ ConnectorFormFields.ConnectorSubscriptionId,
+ ConnectorFormFields.ConnectorTechnicalUser,
])
if (validateFields) {
newTechnicalUSer && !newUserSuccess
@@ -132,35 +140,12 @@ const AddConnectorOverlay = ({
setSelected(service)
}
- const getTitle = () => {
- if (connectorStep === 1 && selected.type === 'MANAGED_CONNECTOR')
- return t('content.edcconnector.modal.managed.title')
- else if (
- connectorStep === 1 &&
- selected.type === ConnectType.COMPANY_CONNECTOR
- ) {
- return t('content.edcconnector.modal.company.title')
- } else return t('content.edcconnector.modal.title')
- }
- const getIntro = () => {
- if (
- connectorStep === 1 &&
- selected.type === ConnectType.MANAGED_CONNECTOR
- ) {
- return t('content.edcconnector.modal.managed.intro')
- } else if (
- connectorStep === 1 &&
- selected.type === ConnectType.COMPANY_CONNECTOR
- ) {
- return (
-
- {t('content.edcconnector.modal.company.intro')}
-
- )
- } else {
- return t('content.edcconnector.modal.intro')
- }
+ const getTypeKey = (type: ConnectType | undefined) => {
+ if (connectorStep === 1) {
+ return type === ConnectType.MANAGED_CONNECTOR ? 'managed.' : 'company.'
+ } else return ''
}
+
return (