Skip to content

Commit

Permalink
Merge pull request #1037 from Eastern-Research-Group/feature/849_alga…
Browse files Browse the repository at this point in the history
…l-toxins

Feature/849 algal toxins
  • Loading branch information
cschwinderg authored Nov 21, 2024
2 parents 928f5d1 + f642412 commit 1826dbe
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 20 deletions.
20 changes: 3 additions & 17 deletions app/client/src/components/shared/PastWaterConditionsFilters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import { css } from '@emotion/react';
import { useCallback, useContext, useEffect, useMemo, useState } from 'react';

import { GlossaryTerm } from 'components/shared/GlossaryPanel';
import { HelpTooltip } from 'components/shared/HelpTooltip';
import LoadingSpinner from 'components/shared/LoadingSpinner';
import Slider from 'components/shared/Slider';
Expand Down Expand Up @@ -446,30 +445,17 @@ export function PastWaterConditionsFilters({
locationCount++;
}
});
const mapping = configFiles.data.characteristicGroupMappings.find(
(mapping) => mapping.label === group.label,
);
const groupLabelId = `${group.label.replaceAll(' ', '-')}-label`;

return (
<tr key={group.label}>
<td>
<div css={toggleStyles}>
<label css={toggleStyles}>
<Switch
checked={group.toggled}
onChange={groupToggleHandlers?.[group.label]}
ariaLabelledBy={groupLabelId}
/>
<span id={groupLabelId}>
{mapping?.glossaryTerm ? (
<GlossaryTerm term={mapping.glossaryTerm}>
{group.label}
</GlossaryTerm>
) : (
group.label
)}
</span>
</div>
<span>{group.label}</span>
</label>
</td>
<td colSpan={2}>{locationCount.toLocaleString()}</td>
<td>{measurementCount.toLocaleString()}</td>
Expand Down
1 change: 0 additions & 1 deletion app/client/src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ export interface ChangeLocationAttributes {

export type CharacteristicGroupMappings = {
label: string;
glossaryTerm?: string;
groupNames: string[];
}[];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
},
{
"label": "Algal Toxins",
"groupNames": ["Cyanotoxins, Phytotoxins"],
"glossaryTerm": "Algal Toxins"
"groupNames": ["Cyanotoxins, Phytotoxins"]
},
{
"label": "Nutrients",
Expand Down

0 comments on commit 1826dbe

Please sign in to comment.