Skip to content

Commit

Permalink
Merge pull request #701 from UKHSA-Internal/COVP-173_fix_metrics_name…
Browse files Browse the repository at this point in the history
…_search

COVP-173 Fix metrics name search
  • Loading branch information
jaro-m authored Nov 2, 2023
2 parents 6010651 + 2f67b75 commit 548abcd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/pages/MetricDocs/Sections/MetricName.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,12 @@ const Metrics: ComponentType<*> = ({ metrics, setUri }) => {
userInput
? (
item.metric.toLowerCase().indexOf(userInput.replace(/[^a-z6028\s]/gi, "")) > -1 ||
item.metric_name.toLowerCase().indexOf(userInput.replace(/[^a-z6028\s]/gi, "")) > -1
// metric_name can be null, in that case don't use it in search
(
item.metric_name == null
? false
: item.metric_name.toLowerCase().indexOf(userInput.replace(/[^a-z6028\s]/gi, "")) > -1
)
)
: true
) &&
Expand Down

0 comments on commit 548abcd

Please sign in to comment.