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 4a49e69 commit ec6c35d
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 42 deletions.
13 changes: 0 additions & 13 deletions searchlib/components/SearchApp/BasicSearchApp.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import useDeepCompareEffect from 'use-deep-compare-effect';
import { AppConfigContext, SearchContext } from '@eeacms/search/lib/hocs';
import { bindOnAutocomplete, bindOnSearch } from '@eeacms/search/lib/request';
import useSearchApp from './useSearchApp';
// import useWhyDidYouUpdate from '@eeacms/search/lib/hocs/useWhyDidYouUpdate';

function SearchWrappers(SearchViewComponent) {
function Wrapper(props) {
Expand Down Expand Up @@ -80,7 +79,6 @@ export default function BasicSearchApp(props) {
});

useDeepCompareEffect(() => {
console.log('reset stable context');
setStableContext({ appConfig, registry });
}, [appConfig, registry]);

Expand All @@ -90,17 +88,6 @@ export default function BasicSearchApp(props) {
);
}, [mapContextToProps, searchViewComponent, children]);

// useWhyDidYouUpdate('BasicSearchapp', {
// mapContextToProps,
// searchViewComponent,
// appConfig,
// registry,
// driverInstance,
// elasticConfig,
// facetOptions,
// stableContext,
// });

return driverInstance ? (
<SearchProvider config={elasticConfig} driver={driverInstance}>
<WrappedSearchView
Expand Down
8 changes: 0 additions & 8 deletions searchlib/components/SearchApp/FacetApp.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ function BoostrapFacetView(props) {
const activeFilter = filters?.find((filter) => filter.field === field);
if (value && !activeFilter) {
const sortedFilters = [...filters, value].sort(sorter);
// console.log('initializing', sortedFilters);
driver._setState({ filters: sortedFilters });
}
}, [value, filters, field, setFilter, driver]); // searchContext
Expand All @@ -61,16 +60,10 @@ function BoostrapFacetView(props) {
const { filters } = driver.state;
const activeValue = filters.find((f) => f.field === field);
if (!activeValue) {
// console.log('onChange null', field);
onChange(null);
return;
}
if (!isEqual(activeValue, value)) {
// console.log('onChange', {
// activeValue,
// value,
// filters: driver.state.filters,
// });
onChange(activeValue);
}
}
Expand All @@ -81,7 +74,6 @@ function BoostrapFacetView(props) {
}

return () => {
// console.log('unsubscribe', field);
driver.events.plugins = driver.events.plugins.filter(
(plug) => plug.id !== plugId,
);
Expand Down
7 changes: 0 additions & 7 deletions searchlib/components/SearchApp/SearchResultsApp.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@ import BasicSearchApp from './BasicSearchApp';
function BootstrapSearchResultsView(props) {
const { appConfig, registry } = props;

React.useEffect(
() => () => {
console.log('unmount BootstrapSearchResultsView');
},
[],
);

const searchContext = useSearchContext();
const { results = [] } = searchContext;
const { resultViews } = appConfig;
Expand Down
6 changes: 0 additions & 6 deletions src/SearchBlock/SearchBlockView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { SearchBlockSchema } from './schema';
import { applySchemaEnhancer, withBlockExtensions } from '@plone/volto/helpers';
import { applyBlockSettings } from './utils';
import { useDebouncedStableData } from './hocs';
import useWhyDidYouUpdate from '@eeacms/search/lib/hocs/useWhyDidYouUpdate';

import './less/styles.less';

Expand Down Expand Up @@ -46,14 +45,9 @@ function SearchBlockView(props) {

const Variation = variation.view;

useWhyDidYouUpdate('Variation', { Variation });

// TODO: why the double rendering?

return (
<div>
{mode !== 'view' && 'EEA Semantic Search block'}
{JSON.stringify(data)}
<Variation
registry={registry}
appName={appName}
Expand Down
8 changes: 0 additions & 8 deletions src/SearchBlock/templates/SearchResultsView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,6 @@ const overlayStyle = {
export default function SearchResultsView(props) {
const { appName, mode } = props;

React.useEffect(
() => () => {
console.log('unmount SRV');
},
[],
);

return (
<BodyClass className={`${appName}-view searchlib-page`}>
<div className="searchlib-block">
Expand Down Expand Up @@ -72,7 +65,6 @@ const setFacetWidgetProps = (appConfig, registry, appName) => {
schema.properties.value.appName = appName;
schema.properties.value.registry = registry;

// console.log('setfacet', { schema, appConfig, data });
return schema;
};
};
Expand Down

0 comments on commit ec6c35d

Please sign in to comment.