Skip to content

Commit

Permalink
🎉 (grapher) make charts inherit indicator-level settings
Browse files Browse the repository at this point in the history
  • Loading branch information
sophiamersmann committed Jul 18, 2024
1 parent c878cdd commit de54456
Show file tree
Hide file tree
Showing 11 changed files with 671 additions and 189 deletions.
11 changes: 11 additions & 0 deletions adminSiteClient/AdminApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,17 @@ export class AdminApp extends React.Component<{
path="/charts"
component={ChartIndexPage}
/>
{/* TODO(inheritance) */}
{/* <Route
exact
path="/indicator-charts/create"
component={ChartEditorPage}
/>
<Route
exact
path="/indicator-charts/:indicatorId/edit"
component={ChartEditorPage}
/> */}
<Route
exact
path={`/${EXPLORERS_ROUTE_FOLDER}/:slug`}
Expand Down
13 changes: 13 additions & 0 deletions adminSiteClient/ChartEditorPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,19 @@ export class ChartEditorPage
datasets: groupedByNamespace[namespace] as Dataset[],
})
}

const usageData = (await this.context.admin.getJSON(
`/api/variables.usages.json`
)) as {
variableId: number
usageCount: number
}[]
this.database.variableUsageCounts = new Map(
usageData.map(({ variableId, usageCount }) => [
variableId,
+usageCount,
])
)
}

async fetchLogs(): Promise<void> {
Expand Down
Loading

0 comments on commit de54456

Please sign in to comment.