• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

CBIIT / INS-WebPortal / 21258801861

22 Jan 2026 05:46PM UTC coverage: 2.85% (+0.5%) from 2.314%
21258801861

Pull #488

github

web-flow
Merge b1a495e36 into ca62eea5a
Pull Request #488: INS-1517 Design 508 Fixes

49 of 1788 branches covered (2.74%)

Branch coverage included in aggregate %.

9 of 22 new or added lines in 8 files covered. (40.91%)

1 existing line in 1 file now uncovered.

95 of 3264 relevant lines covered (2.91%)

11.82 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/pages/dashTemplate/filterQueryBar/QueryBarView.js
1
import React from 'react';
×
2
import { connect, useDispatch } from 'react-redux';
×
3
import {
×
4
  clearAllFilters, clearFacetSection, clearSliderSection, toggleCheckBox,
5
} from '@bento-core/facet-filter';
6
import { resetAllData, resetUploadData, updateAutocompleteData } from '@bento-core/local-find';
×
7
import { QueryBarGenerator } from '@bento-core/query-bar';
×
8
import { facetsConfig } from '../../../bento/dashTemplate';
×
NEW
9
import QueryBarStyles from './QueryBarStyles';
×
10

11
/**
12
 * Generate the Explore Tab Query Bar
13
 *
14
 * @param {object} props
15
 * @param {object} props.data API search resultset
16
 * @param {object} props.statusReducer Facet Filter State
17
 * @param {object} props.localFind Local Find State
18
 * @returns {JSX.Element}
19
 */
20
const QueryBarView = ({ data, statusReducer, localFind }) => {
×
21
  const dispatch = useDispatch();
×
22

23
  const sectionOrder = facetsConfig.map((v) => v.datafield);
×
24
  const mappedFilterState = Object.keys(statusReducer || {}).map((facet) => {
×
25
    const config = facetsConfig.find((configg) => configg.datafield === facet);
×
26

27
    return {
×
28
      ...config,
29
      items: statusReducer[facet],
30
      data: data[config.apiForFiltering],
31
    };
32
  });
33
  // eslint-disable-next-line max-len
34
  mappedFilterState.sort((a, b) => sectionOrder.indexOf(a.datafield) - sectionOrder.indexOf(b.datafield));
×
35

36
  const { QueryBar } = QueryBarGenerator({
×
37
    functions: {
38
      clearAll: () => {
39
        dispatch(resetAllData());
×
40
        dispatch(clearAllFilters());
×
41
      },
42
      clearUpload: () => {
43
        dispatch(resetUploadData());
×
44
      },
45
      clearAutocomplete: () => {
46
        dispatch(updateAutocompleteData([]));
×
47
      },
48
      deleteAutocompleteItem: (title) => {
49
        const { autocomplete } = localFind;
×
50
        const newdata = [...autocomplete];
×
51
        const index = newdata.findIndex((v) => v.title === title);
×
52

53
        if (index > -1) {
×
54
          newdata.splice(index, 1);
×
55
          dispatch(updateAutocompleteData(newdata));
×
56
        }
57
      },
58
      resetFacetSection: (section) => {
59
        dispatch(clearFacetSection(section));
×
60
      },
61
      resetFacetSlider: (section) => {
62
        dispatch(clearSliderSection(section));
×
63
      },
64
      resetFacetCheckbox: (section, checkbox) => {
65
        dispatch(toggleCheckBox({
×
66
          datafield: section.datafield,
67
          isChecked: false,
68
          name: checkbox,
69
        }));
70
      },
71
    },
72
    customStyles: QueryBarStyles(),
73
  });
74

75
  return (
×
76
    <QueryBar
77
      statusReducer={mappedFilterState}
78
      localFind={localFind}
79
    />
80
  );
81
};
82

83
const mapStateToProps = (state) => ({
×
84
  statusReducer: state.statusReducer.filterState,
85
  localFind: state.localFind,
86
});
×
87

88
export default connect(mapStateToProps, null)(QueryBarView);
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc