diff --git a/src/components/SettingForms/BearerType/BearerTypeCard.tsx b/src/components/SettingForms/BearerType/BearerTypeCard.tsx index 0435c54..2e42a60 100644 --- a/src/components/SettingForms/BearerType/BearerTypeCard.tsx +++ b/src/components/SettingForms/BearerType/BearerTypeCard.tsx @@ -2,15 +2,11 @@ import Card from "../../UI/Card"; import CardHeader from "../../UI/CardHeader"; import BearerTypeFields from "./BearerTypeFields"; -type BearerTypeCardProps = { - options: string[]; -}; - -const BearerTypeCard = ({ options }: BearerTypeCardProps) => { +const BearerTypeCard = () => { return ( - + ); }; diff --git a/src/components/SettingForms/BearerType/BearerTypeFields.tsx b/src/components/SettingForms/BearerType/BearerTypeFields.tsx index 64d7fe9..c20fa0a 100644 --- a/src/components/SettingForms/BearerType/BearerTypeFields.tsx +++ b/src/components/SettingForms/BearerType/BearerTypeFields.tsx @@ -3,11 +3,7 @@ import FormToggle from "../components/FormToggle"; import FormGroup from "../components/FormGroup"; import type { BearerTypeFieldType, InitialValuesForm } from "../../../types/types"; -type BearerTypeFieldsProps = { - options: string[]; -}; - -const BearerTypeFields = ({ options }: BearerTypeFieldsProps) => { +const BearerTypeFields = () => { useFormikContext(); return ( @@ -20,11 +16,12 @@ const BearerTypeFields = ({ options }: BearerTypeFieldsProps) => { id="format" className="p-2 border border-gray-400 rounded-lg text-white bg-[#253445] w-full md:w-60" > - {options?.map((option: string) => ( - - ))} + + diff --git a/src/components/SettingForms/Channel1-JSON/ChannelFields.tsx b/src/components/SettingForms/Channel1-JSON/ChannelFields.tsx index f2f191e..1c8dbaa 100644 --- a/src/components/SettingForms/Channel1-JSON/ChannelFields.tsx +++ b/src/components/SettingForms/Channel1-JSON/ChannelFields.tsx @@ -31,146 +31,165 @@ const ChannelFields = ({ touched, isSubmitting, format }: ChannelFieldsProps) => return ( <> -
- - - - - - - - - - - -
- - setShowPwd((s) => !s)} - icon={showPwd ? faEyeSlash : faEye} - /> -
-
- - - - - - - - - - {format?.toLowerCase() === "bof2" && ( - <> -
-

{values.format} Constants

+ {format?.toLowerCase() !== "bof2" && format?.toLowerCase() !== "json" ? ( + <> +
+
+ Format coming soon
+ +

+ Output configuration currently supports JSON or{" "} + BOF2.
More formats will be added in future + updates. +

+
+ + ) : ( + <> +
- + + + + + + + + + +
+ + setShowPwd((s) => !s)} + icon={showPwd ? faEyeSlash : faEye} + /> +
+
+ + + + + + + + - - - - + {format?.toLowerCase() === "bof2" && ( + <> +
+

{values.format} Constants

+
+ + + + - - - - - - - - - - - - - - - - - - )} -
+ + + + - - + + + + + + + + + + + + + + + + + + )} +
+ + + + + )} ); }; diff --git a/src/components/SettingForms/SettingForms/SettingForms.tsx b/src/components/SettingForms/SettingForms/SettingForms.tsx index e0517c7..54f3534 100644 --- a/src/components/SettingForms/SettingForms/SettingForms.tsx +++ b/src/components/SettingForms/SettingForms/SettingForms.tsx @@ -8,7 +8,6 @@ import type { InitialValuesFormErrors, OptionalBOF2Constants, } from "../../../types/types"; -import { cleanArray } from "../../../utils/utils"; import { useQueryClient } from "@tanstack/react-query"; import { useUpdateBackOfficeConfig } from "../../../hooks/useBackOfficeConfig"; import { useState } from "react"; @@ -21,7 +20,6 @@ const SettingForms = () => { const { bof2ConstantsQuery } = useGetDispatcherConfig(); const format = dispatcherQuery?.data?.propFormat?.value; - const rawOptions = dispatcherQuery?.data?.propFormat?.accepted; const enabled = dispatcherQuery?.data?.propEnabled?.value; const FFID = bof2ConstantsQuery?.data?.propFeedIdentifier?.value; @@ -29,8 +27,6 @@ const SettingForms = () => { const GPSFormat = bof2ConstantsQuery?.data?.propGpsFormat?.value; const timestampSource = bof2ConstantsQuery?.data?.propTimeZoneType?.value; - const options = cleanArray(rawOptions); - const initialValues: BearerTypeFieldType & InitialValuesForm & OptionalBOF2Constants = { format: format ?? "JSON", enabled: enabled === "true", @@ -109,7 +105,7 @@ const SettingForms = () => { {({ isSubmitting, touched }) => (
- +