Skip to content

Commit

Permalink
✨ Add the file component registration fields to the builder form
Browse files Browse the repository at this point in the history
  • Loading branch information
sergei-maertens committed Oct 26, 2023
1 parent e9a3900 commit 9864f0a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .storybook/decorators.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export const DEFAULT_FILE_TYPES = [
},
];

const DEFAULT_DOCUMENT_TYPES: DocumentTypeOption[] = [
export const DEFAULT_DOCUMENT_TYPES: DocumentTypeOption[] = [
{
backendLabel: '',
catalogus: {
Expand Down Expand Up @@ -184,7 +184,7 @@ const DEFAULT_DOCUMENT_TYPES: DocumentTypeOption[] = [
},
];

const CONFIDENTIALITY_LEVELS = [
export const CONFIDENTIALITY_LEVELS = [
{label: 'Openbaar', value: 'openbaar'},
{label: 'Beperkt openbaar', value: 'beperkt_openbaar'},
{label: 'Intern', value: 'intern'},
Expand Down
8 changes: 7 additions & 1 deletion src/components/ComponentConfiguration.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ import {Meta, StoryFn, StoryObj} from '@storybook/react';
import {fireEvent, userEvent, waitFor, within} from '@storybook/testing-library';
import React from 'react';

import {DEFAULT_FILE_TYPES} from '@/../.storybook/decorators';
import {
CONFIDENTIALITY_LEVELS,
DEFAULT_DOCUMENT_TYPES,
DEFAULT_FILE_TYPES,
} from '@/../.storybook/decorators';
import {AnyComponentSchema} from '@/types';

import ComponentConfiguration from './ComponentConfiguration';
Expand Down Expand Up @@ -116,6 +120,8 @@ const Template: StoryFn<TemplateArgs> = ({
getPrefillAttributes={async (plugin: string) => prefillAttributes[plugin]}
getFileTypes={async () => fileTypes}
serverUploadLimit="50MB"
getDocumentTypes={async () => DEFAULT_DOCUMENT_TYPES}
getConfidentialityLevels={async () => CONFIDENTIALITY_LEVELS}
component={component}
isNew={isNew}
builderInfo={builderInfo}
Expand Down
5 changes: 4 additions & 1 deletion src/registry/file/edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {getErrorNames} from '@/utils/errors';

import {EditFormDefinition} from '../types';
import FileTabFields from './file-tab';
import RegistrationTabFields from './registration-tab';

/**
* Form to configure a Formio 'file' type component.
Expand Down Expand Up @@ -114,7 +115,9 @@ const EditForm: EditFormDefinition<FileComponentSchema> = () => {
</TabPanel>

{/* Registration tab */}
<TabPanel>TODO</TabPanel>
<TabPanel>
<RegistrationTabFields />
</TabPanel>

{/* Translations */}
<TabPanel>
Expand Down
1 change: 1 addition & 0 deletions src/registry/file/registration-tab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ const SourceOrganisation = () => {
/>
}
tooltip={tooltip}
inputMode="numeric"
/>
);
};
Expand Down

0 comments on commit 9864f0a

Please sign in to comment.