Skip to content

Commit

Permalink
Merge pull request #195 from open-formulieren/feature/4606-zgw-ux-imp…
Browse files Browse the repository at this point in the history
…rovements

Handle API serializer renames in the backend
  • Loading branch information
sergei-maertens authored Nov 25, 2024
2 parents 95d2eb9 + b04c074 commit 5fbac17
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ export interface SelectOption {
*/
export interface DocumentTypeOption {
backendLabel: string;
catalogusLabel: string;
catalogueLabel: string;
url: string;
omschrijving: string;
description: string;
}

/*
Expand Down
4 changes: 2 additions & 2 deletions src/registry/file/registration-tab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ interface DocumentTypeOptionsGroup {

const groupDocumentTypeOptions = (options: DocumentTypeOption[]): DocumentTypeOptionsGroup[] => {
const optionsWithGroupLabel = options.map(item => {
const groupLabel = [item.backendLabel, item.catalogusLabel].filter(Boolean).join(' > ');
const groupLabel = [item.backendLabel, item.catalogueLabel].filter(Boolean).join(' > ');
return {
groupLabel,
value: item.url,
label: item.omschrijving,
label: item.description,
};
});

Expand Down
16 changes: 8 additions & 8 deletions src/tests/sharedUtils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,28 +125,28 @@ export const DEFAULT_FILE_TYPES: SelectOption[] = [
export const DEFAULT_DOCUMENT_TYPES: DocumentTypeOption[] = [
{
backendLabel: '',
catalogusLabel: 'VTH (RSIN: 000000000)',
catalogueLabel: 'VTH (RSIN: 000000000)',
url: 'https://example.com/iotype/123',
omschrijving: 'Vergunning',
description: 'Vergunning',
},
{
backendLabel: 'Open Zaak',
catalogusLabel: 'VTH (RSIN: 000000000)',
catalogueLabel: 'VTH (RSIN: 000000000)',

url: 'https://example.com/iotype/456',
omschrijving: 'Vergunning',
description: 'Vergunning',
},
{
backendLabel: 'Open Zaak',
catalogusLabel: 'VTH (RSIN: 000000000)',
catalogueLabel: 'VTH (RSIN: 000000000)',
url: 'https://example.com/iotype/789',
omschrijving: 'Ontheffing',
description: 'Ontheffing',
},
{
backendLabel: 'Open Zaak',
catalogusLabel: 'Test catalogus name',
catalogueLabel: 'Test catalogus name',
url: 'https://example.com/iotype/abc',
omschrijving: 'Aanvraag',
description: 'Aanvraag',
},
];

Expand Down

0 comments on commit 5fbac17

Please sign in to comment.