Skip to content

Commit

Permalink
Pass down searchlib-page class
Browse files Browse the repository at this point in the history
  • Loading branch information
tiberiuichim committed Oct 19, 2021
1 parent 3b8ffc9 commit 9b562c4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
19 changes: 14 additions & 5 deletions src/SearchBlock/SearchBlockView.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import React from 'react';
import config from '@plone/volto/registry';
// import { cloneDeep } from 'lodash';
import { cloneDeep } from 'lodash';
import { SearchApp } from '@eeacms/search';
import { SearchBlockSchema } from './schema';
import { BodyClass } from '@plone/volto/helpers';

import '@elastic/react-search-ui-views/lib/styles/styles.css';
import './styles.less';
Expand All @@ -20,7 +21,7 @@ import './styles.less';
const applyBlockSettings = (config, appName, data, schema) => {
// apply mutations inline to the config

// config = cloneDeep(config);
config = cloneDeep(config);
// TODO: this has the side-effect that it mutates the global config
// Viewing this block will also "fix" the global config for the middleware
const settings = config.searchui[appName];
Expand Down Expand Up @@ -59,9 +60,17 @@ export default function SearchBlockView(props) {
data,
schema,
);
registry.searchui.globalsearch.requestParams = {
params: {
index: data.rawIndex,
},
};
// console.log('registry', registry);
return (
<div className="searchlib-block">
<SearchApp registry={registry} appName={appName} mode={mode} />
</div>
<BodyClass className="searchlib-page">
<div className="searchlib-block">
<SearchApp registry={registry} appName={appName} mode={mode} />
</div>
</BodyClass>
);
}
4 changes: 2 additions & 2 deletions src/middleware/elasticsearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function handleSearchRequest(req, res, params) {
delete body.params.config;
}

log('handle search', url, urlES);
console.log('handle search', url, urlES);

superagent
.post(url)
Expand Down Expand Up @@ -73,7 +73,7 @@ const handleSearch = (req, res, next, params) => {
if (typeof body === 'string') body = JSON.parse(body);
const { requestType } = body;

console.log('requestType', requestType, body);
// console.log('requestType', requestType, body);

if (requestType) delete body.requestType; // TODO: is this safe?

Expand Down

0 comments on commit 9b562c4

Please sign in to comment.