Skip to content

Commit

Permalink
✨ [open-formulieren/open-forms#5016] Display isGeldig instead of datu…
Browse files Browse the repository at this point in the history
…m for referentielijst tabellen
  • Loading branch information
stevenbal committed Feb 3, 2025
1 parent c7d840f commit 77c6828
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions src/components/builder/values/referentielijsten/code.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {BuilderContext} from '@/context';
export interface ReferentielijstenTabelOption {
code: string;
naam: string;
einddatumGeldigheid: string | null;
isGeldig: boolean;
}

function isTabelOptions(
Expand All @@ -20,10 +20,10 @@ function isTabelOptions(

function transformItems(items: ReferentielijstenTabelOption[]) {
return items.map(item => {
const {code, naam, einddatumGeldigheid} = item;
const {code, naam, isGeldig} = item;
return {
value: code,
label: einddatumGeldigheid ? `${naam} (${einddatumGeldigheid})` : naam,
label: !isGeldig ? `${naam} (niet meer geldig)` : naam,
};
});
}
Expand Down
6 changes: 3 additions & 3 deletions src/registry/radio/radio-referentielijsten.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export const StoreValuesInComponent: Story = {
await rsSelect(serviceInput, 'Referentielijsten');

const codeInput = canvas.getByLabelText('Referentielijsten table code');
await rsSelect(codeInput, 'Tabel 2 (2025-04-11T13:02:25Z)');
await rsSelect(codeInput, 'Tabel 2 (niet meer geldig)');

await userEvent.click(canvas.getByRole('button', {name: 'Save'}));

Expand Down Expand Up @@ -89,7 +89,7 @@ export const SwitchToVariableResetOptions: Story = {
await rsSelect(serviceInput, 'Referentielijsten');

const codeInput = canvas.getByLabelText('Referentielijsten table code');
await rsSelect(codeInput, 'Tabel 2 (2025-04-11T13:02:25Z)');
await rsSelect(codeInput, 'Tabel 2 (niet meer geldig)');

await rsSelect(dataSourceInput, 'From variable');

Expand Down Expand Up @@ -126,7 +126,7 @@ export const SwitchToManualResetOptions: Story = {
await rsSelect(serviceInput, 'Referentielijsten');

const codeInput = canvas.getByLabelText('Referentielijsten table code');
await rsSelect(codeInput, 'Tabel 2 (2025-04-11T13:02:25Z)');
await rsSelect(codeInput, 'Tabel 2 (niet meer geldig)');

await rsSelect(dataSourceInput, 'Manually fill in');

Expand Down
6 changes: 3 additions & 3 deletions src/registry/select/select-referentielijsten.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export const StoreValuesInComponent: Story = {
await rsSelect(serviceInput, 'Referentielijsten');

const codeInput = canvas.getByLabelText('Referentielijsten table code');
await rsSelect(codeInput, 'Tabel 2 (2025-04-11T13:02:25Z)');
await rsSelect(codeInput, 'Tabel 2 (niet meer geldig)');

await userEvent.click(canvas.getByRole('button', {name: 'Save'}));

Expand Down Expand Up @@ -89,7 +89,7 @@ export const SwitchToVariableResetOptions: Story = {
await rsSelect(serviceInput, 'Referentielijsten');

const codeInput = canvas.getByLabelText('Referentielijsten table code');
await rsSelect(codeInput, 'Tabel 2 (2025-04-11T13:02:25Z)');
await rsSelect(codeInput, 'Tabel 2 (niet meer geldig)');

await rsSelect(dataSourceInput, 'From variable');

Expand Down Expand Up @@ -126,7 +126,7 @@ export const SwitchToManualResetOptions: Story = {
await rsSelect(serviceInput, 'Referentielijsten');

const codeInput = canvas.getByLabelText('Referentielijsten table code');
await rsSelect(codeInput, 'Tabel 2 (2025-04-11T13:02:25Z)');
await rsSelect(codeInput, 'Tabel 2 (niet meer geldig)');

await rsSelect(dataSourceInput, 'Manually fill in');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const StoreValuesInComponent: Story = {
await rsSelect(serviceInput, 'Referentielijsten');

const codeInput = canvas.getByLabelText('Referentielijsten table code');
await rsSelect(codeInput, 'Tabel 2 (2025-04-11T13:02:25Z)');
await rsSelect(codeInput, 'Tabel 2 (niet meer geldig)');

await userEvent.click(canvas.getByRole('button', {name: 'Save'}));

Expand Down Expand Up @@ -86,7 +86,7 @@ export const SwitchToVariableResetOptions: Story = {
await rsSelect(serviceInput, 'Referentielijsten');

const codeInput = canvas.getByLabelText('Referentielijsten table code');
await rsSelect(codeInput, 'Tabel 2 (2025-04-11T13:02:25Z)');
await rsSelect(codeInput, 'Tabel 2 (niet meer geldig)');

await rsSelect(dataSourceInput, 'From variable');

Expand Down Expand Up @@ -123,7 +123,7 @@ export const SwitchToManualResetOptions: Story = {
await rsSelect(serviceInput, 'Referentielijsten');

const codeInput = canvas.getByLabelText('Referentielijsten table code');
await rsSelect(codeInput, 'Tabel 2 (2025-04-11T13:02:25Z)');
await rsSelect(codeInput, 'Tabel 2 (niet meer geldig)');

await rsSelect(dataSourceInput, 'Manually fill in');

Expand Down
4 changes: 2 additions & 2 deletions src/tests/sharedUtils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ export const DEFAULT_REFERENTIELIJSTEN_TABELLEN: ReferentielijstenTabelOption[]
{
code: 'tabel1',
naam: 'Tabel 1',
einddatumGeldigheid: null,
isGeldig: true,
},
{
code: 'tabel2',
naam: 'Tabel 2',
einddatumGeldigheid: '2025-04-11T13:02:25Z',
isGeldig: false,
},
];

Expand Down

0 comments on commit 77c6828

Please sign in to comment.