Skip to content

Commit

Permalink
updates indicator names to their short version
Browse files Browse the repository at this point in the history
  • Loading branch information
andresgnlez committed May 21, 2024
1 parent 0208043 commit e9adf7b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ const AnalysisTable = () => {
const name =
isParentRow(original) &&
depth === 0 &&
indicators.find((i) => i.id === original.indicatorId)?.name;
indicators.find((i) => i.id === original.indicatorId)?.metadata?.short_name;

return (
<div className="flex gap-4 py-5">
Expand Down
2 changes: 1 addition & 1 deletion client/src/containers/interventions/form/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1061,7 +1061,7 @@ const InterventionForm: React.FC<InterventionFormProps> = ({
'text-gray-300': indicator.status === 'inactive',
})}
>
{indicator.name}
{indicator?.metadata?.short_name}
</label>
<Input
// @ts-expect-error not sure how to solve this dynamic typing
Expand Down
2 changes: 1 addition & 1 deletion client/src/hooks/layers/impact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export const useImpactLayer = () => {
legend: {
id: `impact-${indicator.id}-${isComparisonEnabled || 'compare'}`,
type: 'basic',
name: `${indicator.name} in ${year}`,
name: `${indicator?.metadata?.short_name} in ${year}`,
unit: data.metadata.unit,
min: !!data.metadata.quantiles.length && formatNumber(data.metadata.quantiles[0]),
items: data.metadata.quantiles
Expand Down
4 changes: 2 additions & 2 deletions client/src/pages/data/targets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ const AdminTargetsPage: React.FC = () => {
if (indicators) {
return indicators.map((indicator) => ({
id: indicator.id,
name: indicator.name.toString(),
unit: indicator.metadata.units,
name: indicator?.metadata?.short_name,
unit: indicator?.metadata?.units,
indicatorId: indicator.id,
baselineYear: 2020,
baselineValue: 1,
Expand Down

0 comments on commit e9adf7b

Please sign in to comment.