Skip to content
Snippets Groups Projects
Commit 5d20bc01 authored by esikkala's avatar esikkala
Browse files

Update full text search layout

parent 4ebea634
No related branches found
No related tags found
No related merge requests found
import React from 'react' import React from 'react'
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
import { Route, Redirect } from 'react-router-dom' import { Route, Redirect } from 'react-router-dom'
import { makeStyles } from '@material-ui/core/styles'
import PerspectiveTabs from '../../main_layout/PerspectiveTabs' import PerspectiveTabs from '../../main_layout/PerspectiveTabs'
import ReactVirtualizedTable from '../../facet_results/ReactVirtualizedTable' import ReactVirtualizedTable from '../../facet_results/ReactVirtualizedTable'
import CalendarViewDayIcon from '@material-ui/icons/CalendarViewDay' import CalendarViewDayIcon from '@material-ui/icons/CalendarViewDay'
const rootStyle = { const useStyles = makeStyles(theme => ({
height: 'calc(100% - 8px)', root: props => ({
marginTop: 8, marginTop: theme.spacing(0.5),
marginLeft: 8, height: `calc(100% - ${props.layoutConfig.tabHeight - 18}px)`
marginRight: 8 })
} }))
/** /**
* A component for displaying full text search results. * A component for displaying full text search results.
*/ */
const FullTextSearch = props => { const FullTextSearch = props => {
const { rootUrl } = props const { rootUrl, layoutConfig, screenSize } = props
const classes = useStyles(props)
const perspectiveUrl = `${rootUrl}/full-text-search` const perspectiveUrl = `${rootUrl}/full-text-search`
return ( return (
<div style={rootStyle}> <div className={classes.root}>
<PerspectiveTabs <PerspectiveTabs
routeProps={props.routeProps} routeProps={props.routeProps}
screenSize={props.screenSize}
tabs={[{ tabs={[{
id: 'table', id: 'table',
label: 'table', label: 'table',
icon: <CalendarViewDayIcon />, icon: <CalendarViewDayIcon />,
value: 0 value: 0
}]} }]}
screenSize={screenSize}
layoutConfig={layoutConfig}
/> />
<Route <Route
exact path={perspectiveUrl} exact path={perspectiveUrl}
...@@ -41,6 +44,7 @@ const FullTextSearch = props => { ...@@ -41,6 +44,7 @@ const FullTextSearch = props => {
<ReactVirtualizedTable <ReactVirtualizedTable
fullTextSearch={props.fullTextSearch} fullTextSearch={props.fullTextSearch}
sortFullTextResults={props.sortFullTextResults} sortFullTextResults={props.sortFullTextResults}
layoutConfig={props.layoutConfig}
/> />
) )
}} }}
......
...@@ -294,18 +294,14 @@ const SemanticPortal = props => { ...@@ -294,18 +294,14 @@ const SemanticPortal = props => {
<Route <Route
path={`${rootUrlWithLang}/full-text-search`} path={`${rootUrlWithLang}/full-text-search`}
render={routeProps => render={routeProps =>
<Grid container spacing={1} className={classes.mainContainer}> <FullTextSearch
<Grid item xs={12} className={classes.resultsContainer}> fullTextSearch={props.fullTextSearch}
<FullTextSearch sortFullTextResults={props.sortFullTextResults}
fullTextSearch={props.fullTextSearch} routeProps={routeProps}
sortFullTextResults={props.sortFullTextResults} screenSize={screenSize}
routeProps={routeProps} rootUrl={rootUrlWithLang}
screenSize={screenSize} layoutConfig={layoutConfig}
rootUrl={rootUrlWithLang} />}
layoutConfig={layoutConfig}
/>
</Grid>
</Grid>}
/> />
{/* routes for faceted search perspectives */} {/* routes for faceted search perspectives */}
{perspectiveConfig.map(perspective => { {perspectiveConfig.map(perspective => {
......
...@@ -173,6 +173,19 @@ ...@@ -173,6 +173,19 @@
} }
}, },
"perspectives": { "perspectives": {
"fullTextSearch": {
"properties": {
"prefLabel": {
"label": "Label"
},
"type": {
"label": "Type"
},
"note": {
"label": "Note"
}
}
},
"perspective1": { "perspective1": {
"label": "Perspective 1", "label": "Perspective 1",
"facetResultsType": "manuscripts", "facetResultsType": "manuscripts",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment