diff --git a/src/core_modules/capture-core/components/D2Form/FormFieldPlugin/FormFieldPlugin.container.js b/src/core_modules/capture-core/components/D2Form/FormFieldPlugin/FormFieldPlugin.container.js index 7f4b193646..65e4cf82e8 100644 --- a/src/core_modules/capture-core/components/D2Form/FormFieldPlugin/FormFieldPlugin.container.js +++ b/src/core_modules/capture-core/components/D2Form/FormFieldPlugin/FormFieldPlugin.container.js @@ -6,11 +6,13 @@ import { usePluginMessages } from './hooks/usePluginMessages'; import { usePluginCallbacks } from './hooks/usePluginCallbacks'; import { usePluginValues } from './hooks/usePluginValues'; import { formatPluginConfig } from './formatPluginConfig'; +import { useLocationQuery } from '../../../utils/routing'; export const FormFieldPlugin = (props: ContainerProps) => { const { pluginSource, fieldsMetadata, formId, onUpdateField, pluginContext } = props; const metadataByPluginId = useMemo(() => Object.fromEntries(fieldsMetadata), [fieldsMetadata]); const configuredPluginIds = useMemo(() => Object.keys(metadataByPluginId), [metadataByPluginId]); + const { orgUnitId } = useLocationQuery(); // Plugin related functionality and feedback const { pluginValues } = usePluginValues(formId, metadataByPluginId, pluginContext); @@ -39,6 +41,7 @@ export const FormFieldPlugin = (props: ContainerProps) => { return ( { /> ); }; + diff --git a/src/core_modules/capture-core/components/D2Form/FormFieldPlugin/FormFieldPlugin.types.js b/src/core_modules/capture-core/components/D2Form/FormFieldPlugin/FormFieldPlugin.types.js index 3aa8638400..9a97d2e42a 100644 --- a/src/core_modules/capture-core/components/D2Form/FormFieldPlugin/FormFieldPlugin.types.js +++ b/src/core_modules/capture-core/components/D2Form/FormFieldPlugin/FormFieldPlugin.types.js @@ -64,6 +64,7 @@ export type ComponentProps = {| fieldsMetadata: MetadataByPluginId, formSubmitted: boolean, values: { [id: string]: any }, + orgUnitId: string, setFieldValue: (SetFieldValueProps) => void, errors: { [id: string]: Array }, warnings: { [id: string]: Array },