Skip to content

Commit

Permalink
Normalization fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
terotik committed Nov 29, 2024
1 parent 93c67b6 commit 64c37df
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 9 deletions.
1 change: 0 additions & 1 deletion components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ function Header() {

const googleAnalyticsId = theme.settings?.googleAnalyticsId;

console.log('navlinks', navLinks);
return (
<header style={{ position: 'relative' }}>
<SkipToContent />
Expand Down
5 changes: 3 additions & 2 deletions components/paths/InventoryNodeSummary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ type PathsBasicNodeContentProps = {
node: CausalGridNodeFragment;
onLoaded: (id: string, impact: number) => void;
displayGoals: InstanceGoalEntry[];
refetching: boolean;
};

type EmissionDisplay = {
Expand All @@ -86,7 +87,7 @@ type Emissions = {
};

const InventoryNodeSummary = (props: PathsBasicNodeContentProps) => {
const { categoryId, node, onLoaded, displayGoals } = props;
const { categoryId, node, onLoaded, displayGoals, refetching } = props;
const yearRange = useReactiveVar(yearRangeVar);
const format = useFormatter();

Expand Down Expand Up @@ -197,7 +198,7 @@ const InventoryNodeSummary = (props: PathsBasicNodeContentProps) => {
onLoaded(categoryId, 100);
// using exhausive deps here causes an infinite loop
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [yearRange[1]]);
}, [yearRange[1], refetching]);

return (
<>
Expand Down
1 change: 1 addition & 0 deletions components/paths/PathsNodeSummary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ const PathsNodeSummary = React.memo((props: PathsNodeContentProps) => {
node={data.node}
onLoaded={onLoaded ? onLoaded : () => void 0}
displayGoals={displayGoals}
refetching={refetching}
/>
);
}
Expand Down
5 changes: 0 additions & 5 deletions components/paths/toolbar/CompleteSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,6 @@ const CompleteSettings = (props) => {
<h5>{t('change-scenario')}</h5>
<ScenarioSelector />
</Widget>
<Widget>
<h5>{t('actions')}</h5>
{/*<ActionsSummary activeScenario={activeScenario} />*/}
(coming soon)
</Widget>
<Widget>
{hasGlobalParameters && (
<>
Expand Down
2 changes: 1 addition & 1 deletion components/paths/toolbar/GoalOutcomeBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ const outcomeAsText = (
) => {
if (isForecast)
return t.markup('outcome-bar-summary-forecast', {
scenarioName: 'sfsdfsd',
scenarioName: scenarioName,
goalType: goalType,
selectedYear: selectedYear,
selectedYearValue: selectedYearValue,
Expand Down
2 changes: 2 additions & 0 deletions utils/paths/PathsActionNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ export default class PathsActionNode {

getUnit(): string | null | undefined {
return (
this.data.metricDim?.unit?.htmlShort ||
this.data.metricDim?.unit?.short ||
this.data.unit?.htmlShort ||
this.data.unit?.htmlLong ||
this.data.unit?.short ||
Expand Down

0 comments on commit 64c37df

Please sign in to comment.