@@ -93,31 +93,6 @@ export default function SampleListViewContainer() {
93
93
displayTaskForm ( 'AddSample' ) ;
94
94
}
95
95
96
- /**
97
- * Mapping between a input and a filter option value
98
- *
99
- * @param {string } id - id of input in DOM
100
- * @return {? } the value for the input
101
- */
102
- function getFilterOptionValue ( id ) {
103
- let value = false ;
104
-
105
- const optionMap = {
106
- inQueue : filterOptions . inQueue ,
107
- notInQueue : filterOptions . notInQueue ,
108
- collected : filterOptions . collected ,
109
- notCollected : filterOptions . notCollected ,
110
- limsSamples : filterOptions . limsSamples ,
111
- text : filterOptions . text ,
112
- cellFilter : filterOptions . cellFilter ,
113
- puckFilter : filterOptions . puckFilter ,
114
- } ;
115
-
116
- value = optionMap [ id ] ;
117
-
118
- return value ;
119
- }
120
-
121
96
function getCellFilterOptions ( ) {
122
97
let options = [ ] ;
123
98
@@ -390,7 +365,14 @@ export default function SampleListViewContainer() {
390
365
limsSamples : { limsSamples : e . target . checked } ,
391
366
text : { text : e . target . value . trim ( ) } ,
392
367
} ;
393
- dispatch ( filterAction ( optionMap [ e . target . id ] ) ) ;
368
+
369
+ let filterValue = e . target . value . trim ( ) ;
370
+ if ( e . target . type === 'checkbox' ) {
371
+ filterValue = e . target . checked ;
372
+ }
373
+ debugger ;
374
+
375
+ dispatch ( filterAction ( [ e . target . id ] ) ) ;
394
376
if ( Number ( e . target . value ) > 2 ) {
395
377
window . scroll ( {
396
378
top : 1 ,
@@ -669,7 +651,7 @@ export default function SampleListViewContainer() {
669
651
< Col sm = "6" >
670
652
< Form . Select
671
653
id = "cellFilter"
672
- value = { getFilterOptionValue ( ' cellFilter' ) }
654
+ value = { filterOptions . cellFilter }
673
655
onChange = { sampleGridFilter }
674
656
>
675
657
{ getCellFilterOptions ( ) }
@@ -688,7 +670,7 @@ export default function SampleListViewContainer() {
688
670
< Col sm = "6" >
689
671
< Form . Select
690
672
id = "puckFilter"
691
- value = { getFilterOptionValue ( ' puckFilter' ) }
673
+ value = { filterOptions . puckFilter }
692
674
onChange = { sampleGridFilter }
693
675
>
694
676
{ getPuckFilterOptions ( ) }
@@ -701,7 +683,7 @@ export default function SampleListViewContainer() {
701
683
type = "checkbox"
702
684
id = "inQueue"
703
685
inline
704
- checked = { getFilterOptionValue ( ' inQueue' ) }
686
+ checked = { filterOptions . inQueue }
705
687
onChange = { sampleGridFilter }
706
688
label = "In Queue"
707
689
/>
@@ -711,7 +693,7 @@ export default function SampleListViewContainer() {
711
693
type = "checkbox"
712
694
inline
713
695
id = "notInQueue"
714
- checked = { getFilterOptionValue ( ' notInQueue' ) }
696
+ checked = { filterOptions . notInQueue }
715
697
onChange = { sampleGridFilter }
716
698
label = "Not in Queue"
717
699
/>
@@ -723,7 +705,7 @@ export default function SampleListViewContainer() {
723
705
type = "checkbox"
724
706
inline
725
707
id = "collected"
726
- checked = { getFilterOptionValue ( ' collected' ) }
708
+ checked = { filterOptions . collected }
727
709
onChange = { sampleGridFilter }
728
710
label = "Collected"
729
711
/>
@@ -733,7 +715,7 @@ export default function SampleListViewContainer() {
733
715
type = "checkbox"
734
716
inline
735
717
id = "notCollected"
736
- checked = { getFilterOptionValue ( ' notCollected' ) }
718
+ checked = { filterOptions . notCollected }
737
719
onChange = { ( ) => sampleGridFilter ( ) }
738
720
label = "Not Collected"
739
721
/>
@@ -745,7 +727,7 @@ export default function SampleListViewContainer() {
745
727
type = "checkbox"
746
728
inline
747
729
id = "limsSamples"
748
- checked = { getFilterOptionValue ( ' limsSamples' ) }
730
+ checked = { filterOptions . limsSamples }
749
731
onChange = { sampleGridFilter }
750
732
label = "LIMS Samples"
751
733
/>
@@ -860,7 +842,7 @@ export default function SampleListViewContainer() {
860
842
style = { { borderColor : '#CCC' } }
861
843
id = "text"
862
844
type = "text"
863
- value = { getFilterOptionValue ( ' text' ) }
845
+ value = { filterOptions . text }
864
846
onChange = { sampleGridFilter }
865
847
/>
866
848
{ innerSearchIcon ( ) }
0 commit comments