Skip to content

Commit

Permalink
Fix pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
tiberiuichim committed Feb 28, 2023
1 parent 0c93c8a commit f0311d6
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
3 changes: 2 additions & 1 deletion searchlib/components/SearchView/FilterAsideContentView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export const FilterAsideContentView = (props) => {
const isLoading = useAtomValue(loadingAtom);

const { showFilters, showFacets, showClusters, showSorting } = appConfig;
const showPaging = appConfig.showLandingPage === false ? true : wasInteracted;

return (
<>
Expand Down Expand Up @@ -124,7 +125,7 @@ export const FilterAsideContentView = (props) => {
<Grid centered>
<Grid.Column textAlign="center">
<div className="prev-next-paging">
{!!wasInteracted && <Paging />}
{!!showPaging && <Paging />}
</div>
</Grid.Column>
</Grid>
Expand Down
4 changes: 2 additions & 2 deletions searchlib/components/SearchView/SearchView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import React from 'react';

import { Link, useLocation } from 'react-router-dom';
import { Link } from 'react-router-dom';
import { withAppConfig } from '@eeacms/search/lib/hocs';
import { Icon } from 'semantic-ui-react';
import {
Expand Down Expand Up @@ -85,7 +85,7 @@ export const SearchView = (props) => {
const { landingPageURL } = appConfig;
let backToHome = landingPageURL;

if (landingPageURL) {
if (landingPageURL && landingPageURL.startsWith('http')) {
const url = new URL(landingPageURL);
if (url.host === domain) {
backToHome = url.pathname;
Expand Down
2 changes: 1 addition & 1 deletion src/SearchBlock/templates/FullView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ FullView.schemaEnhancer = (props) => {
const schema = searchResultsSchemaEnhancer(props);
schema.fieldsets[1].fields.push('showLandingPage');
schema.properties.showLandingPage = {
title: 'Show landing page?',
title: 'Show intro statistics?',
type: 'boolean',
default: true,
configPath: 'showLandingPage',
Expand Down
6 changes: 5 additions & 1 deletion src/SearchBlock/templates/SearchResultsView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,8 @@ export default function SearchResultsView(props) {
);
}

SearchResultsView.schemaEnhancer = searchResultsSchemaEnhancer;
SearchResultsView.schemaEnhancer = (props) => {
const schema = searchResultsSchemaEnhancer(props);
// schema.fieldsets[0].fields.push('url');
return schema;
};
1 change: 0 additions & 1 deletion src/SearchBlock/templates/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ export const searchResultsSchemaEnhancer = ({ schema, formData }) => {
configPath: 'landingPageURL',
},
};
schema.fieldsets[0].fields.push('url');

if (appConfig) {
const { resultViews } = appConfig;
Expand Down

0 comments on commit f0311d6

Please sign in to comment.