@@ -268,11 +268,11 @@ function FilterBarWithVariantManagement() {
268
268
const hasChanged = Object .entries (initialVariantValues .current [selectedVariant ]).some (([key , val ]) => {
269
269
if (key === ' selectedCodes' ) {
270
270
const selectedCodesLength = Object .keys (filters .selectedCodes ).length ;
271
- if (selectedCodesLength > 0 && Object .keys (val ).length !== selectedCodesLength ) {
271
+ if (Object .keys (val ).length !== selectedCodesLength ) {
272
272
return true ;
273
273
}
274
274
return Object .entries (filters .selectedCodes ).some (([code , bool ]) => {
275
- return val [code ] !== bool ;
275
+ return val ?. [code ] !== bool ;
276
276
});
277
277
}
278
278
return filters [key ] !== val ;
@@ -319,7 +319,7 @@ function FilterBarWithVariantManagement() {
319
319
</VariantManagement >
320
320
}
321
321
>
322
- <FilterGroupItem label = " Countries" >
322
+ <FilterGroupItem label = " Countries" filterKey = { 0 } >
323
323
<Select onChange = { handleSelectChange } >
324
324
<Option selected = { selectedCountry === ' Indonesia' } >Indonesia</Option >
325
325
<Option selected = { selectedCountry === ' Costa Rica' } >Costa Rica</Option >
@@ -331,10 +331,10 @@ function FilterBarWithVariantManagement() {
331
331
<Option selected = { selectedCountry === ' Austria' } >Austria</Option >
332
332
</Select >
333
333
</FilterGroupItem >
334
- <FilterGroupItem label = " Date" >
334
+ <FilterGroupItem label = " Date" filterKey = { 1 } >
335
335
<DatePicker value = { date } onChange = { handleDateChange } />
336
336
</FilterGroupItem >
337
- <FilterGroupItem label = " Company Code" >
337
+ <FilterGroupItem label = " Company Code" filterKey = { 2 } >
338
338
<MultiComboBox onSelectionChange = { handleSelectedCodesChange } >
339
339
<MultiComboBoxItem text = " 001" selected = { selectedCodes [' 001' ]} data-code = " 001" />
340
340
<MultiComboBoxItem text = " 002" selected = { selectedCodes [' 002' ]} data-code = " 002" />
@@ -344,27 +344,20 @@ function FilterBarWithVariantManagement() {
344
344
</MultiComboBox >
345
345
</FilterGroupItem >
346
346
</FilterBar >
347
- <Form
348
- style = { { marginBlockStart: ' 2rem' }}
349
- columnsS = { 1 }
350
- columnsM = { 1 }
351
- columnsL = { 1 }
352
- columnsXL = { 1 }
353
- labelSpanM = { 2 }
354
- labelSpanL = { 2 }
355
- labelSpanXL = { 2 }
356
- >
357
- <FormItem label = " Current View" >
358
- <Text >{ selectedVariant } </Text >
359
- </FormItem >
360
- <FormGroup titleText = " Filters" >
361
- <FormItem label = " Selected Country" >
347
+ <Form style = { { marginBlockStart: ' 2rem' }} layout = { ' S1 M1 L1 XL1' } labelSpan = { ' S3 M3 L3 XL3' } >
348
+ <FormGroup headerText = " Variant" >
349
+ <FormItem labelContent = { <Label showColon >Current View</Label >} >
350
+ <Text >{ selectedVariant } </Text >
351
+ </FormItem >
352
+ </FormGroup >
353
+ <FormGroup headerText = " Filters" >
354
+ <FormItem labelContent = { <Label showColon >Selected Country</Label >} >
362
355
<Text >{ selectedCountry } </Text >
363
356
</FormItem >
364
- <FormItem label = " Selected Date" >
357
+ <FormItem labelContent = { < Label showColon > Selected Date</ Label > } >
365
358
<Text >{ date } </Text >
366
359
</FormItem >
367
- <FormItem label = " Selected Company Codes" >
360
+ <FormItem labelContent = { < Label showColon > Selected Company Codes</ Label > } >
368
361
<Text >{ Object .keys (selectedCodes ).join (' , ' )} </Text >
369
362
</FormItem >
370
363
</FormGroup >
0 commit comments