Skip to content

Commit

Permalink
Removed other and missing from filter lists (#273)
Browse files Browse the repository at this point in the history
  • Loading branch information
bklaing2 authored Aug 1, 2023
1 parent e23debb commit a721fd6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/WorkFacets/WorkFacets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ interface Facet {
count: number
}

function removeOtherAndMissing(facet: Facet) {
return facet.id !== '__other__' && facet.id !== '__missing__'
}

const WorkFacets: React.FunctionComponent<Props> = ({
data,
model,
Expand Down Expand Up @@ -118,7 +122,7 @@ const WorkFacets: React.FunctionComponent<Props> = ({
<div className="panel-body">
<h4>Work Type</h4>
<ul id="work-type-facets">
{data.resourceTypes.map((facet) => (
{data.resourceTypes.filter(removeOtherAndMissing).map((facet) => (
<li key={facet.id}>
{facetLink('resource-type', facet.id)}
<div className="facet-title">{facet.title}</div>
Expand All @@ -138,7 +142,7 @@ const WorkFacets: React.FunctionComponent<Props> = ({
<div className="panel-body">
<h4>License</h4>
<ul id="license-facets">
{data.licenses.map((facet) => (
{data.licenses.filter(removeOtherAndMissing).map((facet) => (
<li key={facet.id}>
{facetLink('license', facet.id)}
<div className="facet-title">{facet.title}</div>
Expand Down

0 comments on commit a721fd6

Please sign in to comment.