@@ -268,11 +268,11 @@ function FilterBarWithVariantManagement() {
268268 const hasChanged = Object .entries (initialVariantValues .current [selectedVariant ]).some (([key , val ]) => {
269269 if (key === ' selectedCodes' ) {
270270 const selectedCodesLength = Object .keys (filters .selectedCodes ).length ;
271- if (selectedCodesLength > 0 && Object .keys (val ).length !== selectedCodesLength ) {
271+ if (Object .keys (val ).length !== selectedCodesLength ) {
272272 return true ;
273273 }
274274 return Object .entries (filters .selectedCodes ).some (([code , bool ]) => {
275- return val [code ] !== bool ;
275+ return val ?. [code ] !== bool ;
276276 });
277277 }
278278 return filters [key ] !== val ;
@@ -319,7 +319,7 @@ function FilterBarWithVariantManagement() {
319319 </VariantManagement >
320320 }
321321 >
322- <FilterGroupItem label = " Countries" >
322+ <FilterGroupItem label = " Countries" filterKey = { 0 } >
323323 <Select onChange = { handleSelectChange } >
324324 <Option selected = { selectedCountry === ' Indonesia' } >Indonesia</Option >
325325 <Option selected = { selectedCountry === ' Costa Rica' } >Costa Rica</Option >
@@ -331,10 +331,10 @@ function FilterBarWithVariantManagement() {
331331 <Option selected = { selectedCountry === ' Austria' } >Austria</Option >
332332 </Select >
333333 </FilterGroupItem >
334- <FilterGroupItem label = " Date" >
334+ <FilterGroupItem label = " Date" filterKey = { 1 } >
335335 <DatePicker value = { date } onChange = { handleDateChange } />
336336 </FilterGroupItem >
337- <FilterGroupItem label = " Company Code" >
337+ <FilterGroupItem label = " Company Code" filterKey = { 2 } >
338338 <MultiComboBox onSelectionChange = { handleSelectedCodesChange } >
339339 <MultiComboBoxItem text = " 001" selected = { selectedCodes [' 001' ]} data-code = " 001" />
340340 <MultiComboBoxItem text = " 002" selected = { selectedCodes [' 002' ]} data-code = " 002" />
@@ -344,27 +344,20 @@ function FilterBarWithVariantManagement() {
344344 </MultiComboBox >
345345 </FilterGroupItem >
346346 </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 >} >
362355 <Text >{ selectedCountry } </Text >
363356 </FormItem >
364- <FormItem label = " Selected Date" >
357+ <FormItem labelContent = { < Label showColon > Selected Date</ Label > } >
365358 <Text >{ date } </Text >
366359 </FormItem >
367- <FormItem label = " Selected Company Codes" >
360+ <FormItem labelContent = { < Label showColon > Selected Company Codes</ Label > } >
368361 <Text >{ Object .keys (selectedCodes ).join (' , ' )} </Text >
369362 </FormItem >
370363 </FormGroup >
0 commit comments