Commit 679b2cda authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Hide domain prefixed in searchbar. Renamed DFT to CMS.

parent 06c9239a
Pipeline #75234 passed with stages
in 12 minutes and 15 seconds
......@@ -12,8 +12,8 @@ import EMSVisualizations from './ems/EMSVisualizations'
export const domains = ({
dft: {
name: 'DFT',
label: 'Computational material science data (DFT)',
name: 'CMS',
label: 'Computational material science data (CMS)',
key: 'dft',
about: 'This include data from many computational material science codes',
entryLabel: 'entry',
......
......@@ -24,6 +24,10 @@ const Options = {
}
}
function getOptionLabel(option) {
return option.substring(option.indexOf('.') + 1)
}
/**
* This searchbar component shows a searchbar with autocomplete functionality. The
* searchbar also includes a status line about the current results. It uses the
......@@ -158,7 +162,7 @@ export default function SearchBar() {
if (value) {
setInputValue('')
} else {
setInputValue(`${entry}=`)
setInputValue(`${getOptionLabel(entry)}=`)
loadOptions(quantity)
}
}
......@@ -210,6 +214,7 @@ export default function SearchBar() {
onChange={handleChange}
onInputChange={handleInputChange}
getOptionSelected={(option, value) => option === value}
getOptionLabel={getOptionLabel}
options={options}
loading={loading}
filterOptions={filterOptions}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment