Skip to content

Commit

Permalink
facets: add missing namespacing
Browse files Browse the repository at this point in the history
  • Loading branch information
jrcastro2 authored and kpsherva committed Jan 26, 2023
1 parent 4199e20 commit e739eff
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const SearchAppFacets = ({ aggs, appName }) => {
<Overridable
id={buildOverridableUID("SearchApp.facets", "", appName)}
aggs={aggs}
appName={appName}
>
<>
{aggs.map((agg) => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ import {
} from "semantic-ui-react";
import Overridable from "react-overridable";
import PropTypes from "prop-types";
import { BucketAggregation, Toggle } from "react-searchkit";
import { BucketAggregation, Toggle, buildUID } from "react-searchkit";

export const ContribSearchAppFacets = ({ aggs, toogle, help }) => {
export const ContribSearchAppFacets = ({ aggs, toogle, help, appName }) => {
return (
<aside aria-label={i18next.t("filters")} id="search-filters">
{toogle && (
Expand All @@ -40,7 +40,7 @@ export const ContribSearchAppFacets = ({ aggs, toogle, help }) => {
<Card className="borderless facet mt-0">
<Card.Content>
<Card.Header as="h2">{i18next.t("Help")}</Card.Header>
<ContribSearchHelpLinks />
<ContribSearchHelpLinks appName={appName}/>
</Card.Content>
</Card>
)}
Expand All @@ -52,16 +52,19 @@ ContribSearchAppFacets.propTypes = {
aggs: PropTypes.array.isRequired,
toggle: PropTypes.bool,
help: PropTypes.bool,
appName: PropTypes.string,
};

ContribSearchAppFacets.defaultProps = {
toggle: false,
help: true,
appName: "",
};

export const ContribSearchHelpLinks = () => {
export const ContribSearchHelpLinks = (props) => {
const { appName } = props;
return (
<Overridable id="RdmSearch.SearchHelpLinks">
<Overridable id={buildUID("SearchHelpLinks", "", appName)}>
<List>
<List.Item>
<a href="/help/search">{i18next.t("Search guide")}</a>
Expand All @@ -71,6 +74,14 @@ export const ContribSearchHelpLinks = () => {
);
};

ContribSearchHelpLinks.propTypes = {
appName: PropTypes.string,
};

ContribSearchHelpLinks.defaultProps = {
appName: "",
};

export const ContribParentFacetValue = ({
bucket,
keyField,
Expand All @@ -83,7 +94,7 @@ export const ContribParentFacetValue = ({
return (
<Accordion>
<Accordion.Title
onClick={() => {}}
onClick={() => { }}
key={`panel-${bucket.label}`}
active={isActive}
className="facet-wrapper parent"
Expand Down

0 comments on commit e739eff

Please sign in to comment.