Skip to content

Commit

Permalink
👽 [open-formulieren/open-forms#4606] Handle API serializer renames in…
Browse files Browse the repository at this point in the history
… backend

The backend makes the API serializers more uniformly English in 3.0
  • Loading branch information
sergei-maertens committed Nov 12, 2024
1 parent 2b5adeb commit b04c074
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 b04c074

Please sign in to comment.