From 86328a675688458c35ac24b957c330c28e50ab57 Mon Sep 17 00:00:00 2001 From: Dennis Benz Date: Wed, 31 Jul 2024 16:34:29 +0200 Subject: [PATCH 1/2] Add test system checkbox in adopter registration --- src/components/shared/RegistrationModal.tsx | 21 +++++++++++++++++++ .../adminui/languages/lang-en_US.json | 2 ++ src/utils/adopterRegistrationUtils.ts | 2 ++ 3 files changed, 25 insertions(+) diff --git a/src/components/shared/RegistrationModal.tsx b/src/components/shared/RegistrationModal.tsx index 4b3feb7f41..a12d36d45a 100644 --- a/src/components/shared/RegistrationModal.tsx +++ b/src/components/shared/RegistrationModal.tsx @@ -31,6 +31,7 @@ const RegistrationModal = ({ // initial values for Formik const [initialValues, setInitialValues] = useState({ contactMe: false, + isTestSystem: false, allowsStatistics: false, allowsErrorReports: false, organisationName: "", @@ -565,6 +566,26 @@ const RegistrationModal = ({ +
+ + {t( + "ADOPTER_REGISTRATION.MODAL.FORM_STATE.TEST_SYSTEM_HEADLINE" + )} + +
+ + +
+
{t( diff --git a/src/i18n/org/opencastproject/adminui/languages/lang-en_US.json b/src/i18n/org/opencastproject/adminui/languages/lang-en_US.json index 9e0ef80d5a..1921fd606e 100644 --- a/src/i18n/org/opencastproject/adminui/languages/lang-en_US.json +++ b/src/i18n/org/opencastproject/adminui/languages/lang-en_US.json @@ -422,6 +422,8 @@ "ADDITIONAL_ADRESS_INFO": "Add. adress information", "MAIL": "Email", "CONTACT_ME": "Contact me for updates and secruity issues", + "TEST_SYSTEM_HEADLINE": "Is this a test system?", + "TEST_SYSTEM": "This is a test system", "WHICH_DATA_TO_SHARE": "Which data do you want to share?", "POLICY_HEADLINE": "Privacy policy and terms of use", "USAGE_STATISTICS": "Usage statistcs", diff --git a/src/utils/adopterRegistrationUtils.ts b/src/utils/adopterRegistrationUtils.ts index 76ffad6644..36ac271bcf 100644 --- a/src/utils/adopterRegistrationUtils.ts +++ b/src/utils/adopterRegistrationUtils.ts @@ -17,6 +17,7 @@ export const fetchAdopterStatisticsSummary = async () => { export type Registration = { contactMe: boolean, + isTestSystem: boolean, allowsStatistics: boolean, allowsErrorReports: boolean, organisationName: string, @@ -39,6 +40,7 @@ export const postRegistration = async ( // build body let body = new URLSearchParams(); body.append("contactMe", values.contactMe.toString()); + body.append("isTestSystem", values.isTestSystem.toString()); body.append("allowsStatistics", values.allowsStatistics.toString()); body.append("allowsErrorReports", values.allowsErrorReports.toString()); body.append("organisationName", values.organisationName); From c1f0a7159d20297c98dc8543a702fc67973d4b48 Mon Sep 17 00:00:00 2001 From: Dennis Benz Date: Thu, 1 Aug 2024 15:46:53 +0200 Subject: [PATCH 2/2] Add Dropdown for system type Replaces the test system checkbox --- src/components/shared/RegistrationModal.tsx | 46 +++++++++++++------ src/configs/adopterRegistrationConfig.ts | 11 +++++ .../adminui/languages/lang-en_US.json | 6 ++- src/utils/adopterRegistrationUtils.ts | 4 +- 4 files changed, 48 insertions(+), 19 deletions(-) diff --git a/src/components/shared/RegistrationModal.tsx b/src/components/shared/RegistrationModal.tsx index a12d36d45a..d999a730c6 100644 --- a/src/components/shared/RegistrationModal.tsx +++ b/src/components/shared/RegistrationModal.tsx @@ -3,7 +3,7 @@ import { useTranslation } from "react-i18next"; import { Formik } from "formik"; import { Field } from "./Field"; import TermsOfUsePage from "./modals/TermsOfUsePage"; -import { countries, states } from "../../configs/adopterRegistrationConfig"; +import { countries, states, systemTypes } from "../../configs/adopterRegistrationConfig"; import cn from "classnames"; import { AdopterRegistrationSchema } from "../../utils/validate"; import { @@ -31,7 +31,7 @@ const RegistrationModal = ({ // initial values for Formik const [initialValues, setInitialValues] = useState({ contactMe: false, - isTestSystem: false, + systemType: "", allowsStatistics: false, allowsErrorReports: false, organisationName: "", @@ -569,21 +569,37 @@ const RegistrationModal = ({
{t( - "ADOPTER_REGISTRATION.MODAL.FORM_STATE.TEST_SYSTEM_HEADLINE" + "ADOPTER_REGISTRATION.MODAL.FORM_STATE.SYSTEM_TYPE_HEADLINE" )} -
- - +
+
+ + + ))} + + +
diff --git a/src/configs/adopterRegistrationConfig.ts b/src/configs/adopterRegistrationConfig.ts index 4fa5a191cd..486e8edc99 100644 --- a/src/configs/adopterRegistrationConfig.ts +++ b/src/configs/adopterRegistrationConfig.ts @@ -154,6 +154,17 @@ export const states = { }, }; +export const systemTypes = [ + { + value: "production", + name: "ADOPTER_REGISTRATION.MODAL.FORM_STATE.SYSTEM_TYPE_PRODUCTION", + }, + { + value: "test", + name: "ADOPTER_REGISTRATION.MODAL.FORM_STATE.SYSTEM_TYPE_TEST", + }, +]; + // countries that an adopter can choose as country of origin export const countries = [ { diff --git a/src/i18n/org/opencastproject/adminui/languages/lang-en_US.json b/src/i18n/org/opencastproject/adminui/languages/lang-en_US.json index 1921fd606e..c09593e0f4 100644 --- a/src/i18n/org/opencastproject/adminui/languages/lang-en_US.json +++ b/src/i18n/org/opencastproject/adminui/languages/lang-en_US.json @@ -422,8 +422,10 @@ "ADDITIONAL_ADRESS_INFO": "Add. adress information", "MAIL": "Email", "CONTACT_ME": "Contact me for updates and secruity issues", - "TEST_SYSTEM_HEADLINE": "Is this a test system?", - "TEST_SYSTEM": "This is a test system", + "SYSTEM_TYPE_HEADLINE": "For what purpose do you use this system?", + "SYSTEM_TYPE": "System Type", + "SYSTEM_TYPE_PRODUCTION": "Production System", + "SYSTEM_TYPE_TEST": "Test System", "WHICH_DATA_TO_SHARE": "Which data do you want to share?", "POLICY_HEADLINE": "Privacy policy and terms of use", "USAGE_STATISTICS": "Usage statistcs", diff --git a/src/utils/adopterRegistrationUtils.ts b/src/utils/adopterRegistrationUtils.ts index 36ac271bcf..844d52cf4b 100644 --- a/src/utils/adopterRegistrationUtils.ts +++ b/src/utils/adopterRegistrationUtils.ts @@ -17,7 +17,7 @@ export const fetchAdopterStatisticsSummary = async () => { export type Registration = { contactMe: boolean, - isTestSystem: boolean, + systemType: string, allowsStatistics: boolean, allowsErrorReports: boolean, organisationName: string, @@ -40,7 +40,7 @@ export const postRegistration = async ( // build body let body = new URLSearchParams(); body.append("contactMe", values.contactMe.toString()); - body.append("isTestSystem", values.isTestSystem.toString()); + body.append("systemType", values.systemType); body.append("allowsStatistics", values.allowsStatistics.toString()); body.append("allowsErrorReports", values.allowsErrorReports.toString()); body.append("organisationName", values.organisationName);