@@ -16,7 +16,9 @@ import {
16
16
} from "../lib/fieldSelection/fieldSelection" ;
17
17
import { formatDate } from "../lib/format/date" ;
18
18
import { FIELD_SELECTION_STORAGE_KEY } from "../pages/constants" ;
19
- import { ExpandZaak , Zaak } from "../types" ;
19
+ import { Zaak } from "../types" ;
20
+ import { useBehandelendAfdelingChoices } from "./useBehandelendAfdelingChoices" ;
21
+ import { useInternalResultaatTypeChoices } from "./useListInternalResultaatTypeChoices" ;
20
22
import { useSelectielijstKlasseChoices } from "./useSelectielijstKlasseChoices" ;
21
23
import { useZaaktypeChoices } from "./useZaaktypeChoices" ;
22
24
@@ -66,7 +68,9 @@ export function useFields<T extends Zaak = Zaak>(
66
68
review ,
67
69
searchParams ,
68
70
) ;
69
-
71
+ const behandelenAfdelingChoices = useBehandelendAfdelingChoices ( ) ;
72
+ const resultaattypeChoices = useInternalResultaatTypeChoices ( ) ;
73
+ console . log ( resultaattypeChoices ) ;
70
74
// The raw, unfiltered configuration of the available base fields.
71
75
// Both filterLookup AND filterLookups will be used for clearing filters.
72
76
// NOTE: This get filtered by `getActiveFields()`.
@@ -133,25 +137,8 @@ export function useFields<T extends Zaak = Zaak>(
133
137
name : "Behandelende afdeling" ,
134
138
type : "string" ,
135
139
filterLookup : "behandelend_afdeling__icontains" ,
136
- valueTransform : ( rowData : object ) => {
137
- const rollen = ( rowData as ExpandZaak ) . _expand ?. rollen || [ ] ;
138
- if ( ! rollen . length ) return "" ;
139
- const behandelendAfdeling : string [ ] = [ ] ;
140
- // TODO - Understand why the ExpandZaak type doesn't work
141
- rollen . map ( ( role ) => {
142
- if (
143
- // @ts -expect-error The type of role is 'never' for some reason
144
- role . betrokkeneType === "organisatorische_eenheid" &&
145
- // @ts -expect-error The type of role is 'never' for some reason
146
- role . betrokkeneIdentificatie ?. identificatie
147
- )
148
- behandelendAfdeling . push (
149
- // @ts -expect-error The type of role is 'never' for some reason
150
- role . betrokkeneIdentificatie ?. identificatie ,
151
- ) ;
152
- } ) ;
153
- return behandelendAfdeling . join ( ", " ) ;
154
- } ,
140
+ valueLookup : "_expand.behandelend_afdeling" ,
141
+ options : behandelenAfdelingChoices ,
155
142
width : "150px" ,
156
143
} ,
157
144
{
@@ -167,11 +154,11 @@ export function useFields<T extends Zaak = Zaak>(
167
154
} ,
168
155
{
169
156
name : "resultaat" ,
170
- filterLookup : "resultaat__resultaattype__omschrijving__icontains " ,
157
+ filterLookup : "resultaat__resultaattype__url__icontains " ,
171
158
filterValue :
172
- searchParams . get ( "resultaat__resultaattype__omschrijving__icontains " ) ||
173
- " ",
174
- valueLookup : "_expand.resultaat._expand.resultaattype.omschrijving" ,
159
+ searchParams . get ( "resultaat__resultaattype__url__icontains " ) || "" ,
160
+ valueLookup : "_expand.resultaat._expand.resultaattype.url ",
161
+ options : resultaattypeChoices ,
175
162
type : "string" ,
176
163
width : "150px" ,
177
164
} ,
0 commit comments