Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions frontend/components/Search/AdvancedSearch/FacetOptionList.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { useState } from 'react';

import styles from '../../../styles/advancedsearch.module.css';
import { condenseLabel } from '../../../utilities/condenseLabel';
import { getFacetDotColor } from '../../../utilities/facetColor';
import Loading from '../../Reusable/MiniLoading';

Expand All @@ -18,17 +19,6 @@ export const toggleOption = (value, isMulti, option) => {
: [...value, option];
};

// drops the "prefix:" and/or "category/" from a short name for display
// (so:engineered_region -> engineered_region, partType/RBS -> RBS)
export const condenseLabel = label => {
const afterPrefix = label.includes(':')
? label.slice(label.lastIndexOf(':') + 1)
: label;
return afterPrefix.includes('/')
? afterPrefix.slice(afterPrefix.lastIndexOf('/') + 1)
: afterPrefix;
};

const getVisibleOptions = (data, search) =>
search
? data.filter(option =>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { shortName } from '../../../namespace/namespace';
import styles from '../../../styles/standardsearch.module.css';
import { condenseLabel } from '../../../utilities/condenseLabel';
import { getFacetDotColor } from '../../../utilities/facetColor';
import { condenseLabel } from '../AdvancedSearch/FacetOptionList';

const buildSingleChips = properties => {
const filters = [
Expand Down
Loading
Loading