Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle API serializer renames in the backend #195

Merged
merged 1 commit into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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