Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
tiberiuichim committed Dec 26, 2022
1 parent ec6c35d commit b8591c6
Show file tree
Hide file tree
Showing 9 changed files with 0 additions and 30 deletions.
2 changes: 0 additions & 2 deletions searchlib/components/Facets/DropdownFacetsList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ import { sidebarState, liveSearchState } from './state';
import { useAtom } from 'jotai';

const DropdownFacetsList = ({ defaultWrapper }) => {
// console.log('redraw dropdownfacetslist');

const { appConfig } = useAppConfig();
const rawSearchContext = useSearchContext();
const { filters } = rawSearchContext; // clearFilters
Expand Down
2 changes: 0 additions & 2 deletions searchlib/components/Facets/Facet.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ const FacetContainer = (props) => {

const facetsForField = facets[field];

// console.log('view', facets, field, props);

if (!facetsForField) return null;

// By using `[0]`, we are currently assuming only 1 facet per field. This
Expand Down
2 changes: 0 additions & 2 deletions searchlib/components/Facets/Unconnected/MultiTermFacet.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@ const MultiTermFacetViewComponent = (props) => {
filterType = 'any',
} = props;

// console.log('optiosn', options);

const filterTypes = [
{ key: 2, text: 'Match any', value: 'any' },
{ key: 1, text: 'Match all', value: 'all' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ const MultiTermListFacet = (props) => {
enableExact = false,
availableOptions,
} = props;
console.log('MTLF', props);

const { appConfig } = useAppConfig();
const facetConfig = appConfig.facets.find((f) => f.field === field);
Expand Down
1 change: 0 additions & 1 deletion searchlib/components/SearchApp/useFacetsWithAllOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ function useFacetsWithAllOptions(appConfig) {
.map((f) => f.field);
const facetOptions = await getFacetOptions(appConfig, facetNames);
if (isMountedRef.current) {
// console.log('setFacetOptions');
setFacetOptions(facetOptions);
}
},
Expand Down
16 changes: 0 additions & 16 deletions searchlib/components/SearchApp/useSearchApp.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from 'react';

// import useWhyDidYouUpdate from '@eeacms/search/lib/hocs/useWhyDidYouUpdate';
import { useAtom, useAtomValue } from 'jotai';

import {
Expand Down Expand Up @@ -115,21 +114,6 @@ export default function useSearchApp({
[appConfig, driverInstance, facetOptions],
);

// useWhyDidYouUpdate('useSearchApp', {
// driverInstance,
// facetOptions,
// mapContextToProps,
// appConfig,
// registry,
// });
//
// React.useEffect(
// () => () => {
// console.log('unmount useSearchApp');
// },
// [],
// );

return {
facetOptions,
mapContextToProps,
Expand Down
3 changes: 0 additions & 3 deletions searchlib/lib/hocs/useProxiedSearchContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ export default function useProxiedSearchContext(
new Set([...(dirtyFiltersMap[searchContextId] || []), filter]),
);
dirtyFiltersMap[searchContextId] = dirtyFilters;
// console.log('call', func_name, arguments);
return action.apply(driver, arguments);
},
};
Expand All @@ -83,7 +82,6 @@ export default function useProxiedSearchContext(
// searchContext.setSort(driver.state.sortField, driver.state.sortDirection);
// searchContext.setResultsPerPage(driver.state.resultsPerPage);
// searchContext.setSearchTerm(driver.state.searchTerm);
// console.log(driver.state.filters, driver.filters);
if (driver) {
const dirtyFilters = dirtyFiltersMap[searchContextId] || [];
dirtyFilters.forEach(({ field, type }) => {
Expand All @@ -101,7 +99,6 @@ export default function useProxiedSearchContext(
// this is updated async. The state update with Date is used to force refresh
sc.facets = searchContext.facets;
}
// console.log('filters', sc.filters);

const res = {
searchContext: sc,
Expand Down
2 changes: 0 additions & 2 deletions searchlib/lib/search/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ export function markSelectedFacetValuesFromFilters(
const facetValues = facet.data;
const filterValuesForField =
findFilterValues(filters, fieldName, filterType) || [];
// console.log({ facetValues, filterValuesForField });
return {
...facet,
data: facetValues.map((facetValue) => {
Expand Down Expand Up @@ -99,7 +98,6 @@ function getFilterValueDisplay(filterValue) {
* @param {FilterValue} filterValue2
*/
export function doFilterValuesMatch(filterValue1, filterValue2) {
// console.log({ filterValue1, filterValue2 });
if (filterValue1?.name || filterValue2?.name)
// If two filters have matching names, then they are the same filter, there
// is no need to do a more expensive deep equal comparison.
Expand Down
1 change: 0 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ const applyConfig = (config) => {
config.widgets.id.qa_queryTypes = SelectWidget;
config.widgets.widget.facet_value = FacetValueWidget;
config.widgets.widget.sort_widget = SortWidget;
// config.widgets.widget.searchlib_facets = FacetsWidget;
config.settings.searchlib = registry;

config.blocks.blocksConfig.searchlib = {
Expand Down

0 comments on commit b8591c6

Please sign in to comment.