Skip to content

Commit

Permalink
Convert filter bar content filter to an accept list. #856.
Browse files Browse the repository at this point in the history
  • Loading branch information
Fran McDade authored and MillenniumFalconMechanic committed Feb 24, 2021
1 parent 8dc3cff commit fe1dc94
Showing 1 changed file with 20 additions and 14 deletions.
34 changes: 20 additions & 14 deletions src/components/searchBrowser/searchBrowser.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,25 @@ import compStyles from './searchBrowser.module.css';

const classNames = require('classnames');

// Facet blacklist - exclude from autosuggest
const FACET_BLACKLIST = [
"assayType",
"contactName",
"effectiveOrgan",
"laboratory",
"organ",
"organPart",
"organismAge",
"organismAgeUnit",
"project",
"projectDescription",
"projectId"
// Facet search allow list
const ALLOW_SEARCH_FACETS = [
"biologicalSex",
"developmentStage",
"donorDisease",
"fileFormat",
"genusSpecies",
"instrumentManufacturerModel",
"libraryConstructionApproach",
"modelOrgan",
"nucleicAcidSource",
"pairedEnd",
"preservationMethod",
"sampleEntityType",
"selectedCellType",
"specimenDisease",
"specimenOrgan",
"specimenOrganPart",
"workflow"
];

// Facet display names
Expand Down Expand Up @@ -155,7 +161,7 @@ class SearchBrowser extends React.Component {

return termFacets.filter(termFacet => {

return FACET_BLACKLIST.indexOf(termFacet.facetName) === -1;
return ALLOW_SEARCH_FACETS.indexOf(termFacet.facetName) >= 0;
});
};

Expand Down

0 comments on commit fe1dc94

Please sign in to comment.