+
+ {label}
+
+
+ Placeholder for drag-and-drop of objects
+
+
+
+ )
+}
+
+export default withJsonFormsArrayLayoutProps(JsonFormsArrayControl)
diff --git a/apps/studio/src/features/editing-experience/components/form-builder/renderers/controls/JsonFormsDropdownControl.tsx b/apps/studio/src/features/editing-experience/components/form-builder/renderers/controls/JsonFormsDropdownControl.tsx
index f3a04dd12a..a51295338d 100644
--- a/apps/studio/src/features/editing-experience/components/form-builder/renderers/controls/JsonFormsDropdownControl.tsx
+++ b/apps/studio/src/features/editing-experience/components/form-builder/renderers/controls/JsonFormsDropdownControl.tsx
@@ -23,10 +23,11 @@ export function JsonFormsDropdownControl({
description,
required,
options,
+ schema,
}: ControlProps & OwnPropsOfEnum) {
const [dropdownValue, setDropdownValue] = useState(data || '')
- if (!options) {
+ if (!options || (options.length === 1 && !!schema.default)) {
return null
}
diff --git a/apps/studio/src/features/editing-experience/components/form-builder/renderers/controls/JsonFormsOneOfControl.tsx b/apps/studio/src/features/editing-experience/components/form-builder/renderers/controls/JsonFormsOneOfControl.tsx
new file mode 100644
index 0000000000..8c3033db6c
--- /dev/null
+++ b/apps/studio/src/features/editing-experience/components/form-builder/renderers/controls/JsonFormsOneOfControl.tsx
@@ -0,0 +1,74 @@
+import { Box, FormControl } from '@chakra-ui/react'
+import {
+ createCombinatorRenderInfos,
+ isOneOfControl,
+ rankWith,
+ type CombinatorRendererProps,
+ type RankedTester,
+} from '@jsonforms/core'
+import { JsonFormsDispatch, withJsonFormsOneOfProps } from '@jsonforms/react'
+import { FormLabel, SingleSelect } from '@opengovsg/design-system-react'
+import { useState } from 'react'
+
+export const jsonFormsOneOfControlTester: RankedTester = rankWith(
+ 3,
+ isOneOfControl,
+)
+
+export function JsonFormsOneOfControl({
+ schema,
+ path,
+ renderers,
+ cells,
+ rootSchema,
+ uischema,
+ uischemas,
+ label,
+ description,
+}: CombinatorRendererProps) {
+ const oneOfRenderInfos = createCombinatorRenderInfos(
+ schema.oneOf || [],
+ rootSchema,
+ 'oneOf',
+ uischema,
+ path,
+ uischemas,
+ )
+ const variants = oneOfRenderInfos.map((oneOfRenderInfo) => ({
+ label: oneOfRenderInfo.label,
+ value: oneOfRenderInfo.label,
+ }))
+
+ const [variant, setVariant] = useState(oneOfRenderInfos[0]?.label || '')
+
+ return (
+