Skip to content

Commit

Permalink
✨ [open-formulieren/open-forms#4813] Added prefill to number configur…
Browse files Browse the repository at this point in the history
…ation
  • Loading branch information
robinmolen committed Nov 11, 2024
1 parent 8b48584 commit 624b893
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/components/ComponentConfiguration.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,11 @@ export const NumberField: Story = {
max: '',
},
},
prefill: {
attribute: '',
identifierRole: 'main',
plugin: '',
},
registration: {
attribute: '',
},
Expand Down
12 changes: 12 additions & 0 deletions src/registry/number/edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
IsSensitiveData,
Key,
Label,
Prefill,
PresentationConfig,
Registration,
SimpleConditional,
Expand Down Expand Up @@ -58,6 +59,7 @@ const EditForm: EditFormDefinition<NumberComponentSchema> = () => {
<BuilderTabs.Advanced hasErrors={hasAnyError('conditional')} />
<BuilderTabs.Validation hasErrors={hasAnyError('validate')} />
<BuilderTabs.Registration hasErrors={hasAnyError('registration')} />
<BuilderTabs.Prefill hasErrors={hasAnyError('prefill')} />
<BuilderTabs.Translations hasErrors={hasAnyError('openForms.translations')} />
</TabList>

Expand Down Expand Up @@ -96,6 +98,11 @@ const EditForm: EditFormDefinition<NumberComponentSchema> = () => {
<Registration.RegistrationAttributeSelect />
</TabPanel>

{/* Prefill tab */}
<TabPanel>
<Prefill.PrefillConfiguration />
</TabPanel>

{/* Translations */}
<TabPanel>
<Translations.ComponentTranslations<NumberComponentSchema>
Expand Down Expand Up @@ -148,6 +155,11 @@ EditForm.defaultValues = {
registration: {
attribute: '',
},
prefill: {
plugin: '',
attribute: '',
identifierRole: 'main',
},
};

const DefaultValue: React.FC = () => {
Expand Down

0 comments on commit 624b893

Please sign in to comment.