From 4d78105acc8e8974f223efef6c3a16fba174d2fc Mon Sep 17 00:00:00 2001 From: Pablo Rosado Date: Thu, 12 Oct 2023 10:02:38 +0200 Subject: [PATCH] Add description key and description processing to sources tab --- .../core-table/src/CoreColumnDef.ts | 2 + .../grapher/src/core/LegacyToOwidTable.ts | 4 ++ .../grapher/src/sourcesTab/SourcesTab.tsx | 43 +++++++++++++++++++ 3 files changed, 49 insertions(+) diff --git a/packages/@ourworldindata/core-table/src/CoreColumnDef.ts b/packages/@ourworldindata/core-table/src/CoreColumnDef.ts index 3f48540f74a..8e15ede4c92 100644 --- a/packages/@ourworldindata/core-table/src/CoreColumnDef.ts +++ b/packages/@ourworldindata/core-table/src/CoreColumnDef.ts @@ -67,6 +67,8 @@ export interface CoreColumnDef extends ColumnColorScale { attributionShort?: string // The Metadata V2 title disambiguation fragment for the producer description?: string descriptionShort?: string + descriptionProcessing?: string + descriptionKey?: string[] descriptionFromProducer?: string note?: string // Any internal notes the author wants to record for display in admin interfaces diff --git a/packages/@ourworldindata/grapher/src/core/LegacyToOwidTable.ts b/packages/@ourworldindata/grapher/src/core/LegacyToOwidTable.ts index 4848f321ff5..7b5a436040e 100644 --- a/packages/@ourworldindata/grapher/src/core/LegacyToOwidTable.ts +++ b/packages/@ourworldindata/grapher/src/core/LegacyToOwidTable.ts @@ -555,6 +555,8 @@ const columnDefFromOwidVariable = ( datasetId, datasetName, descriptionShort, + descriptionProcessing, + descriptionKey, descriptionFromProducer, source, origins, @@ -578,6 +580,8 @@ const columnDefFromOwidVariable = ( shortUnit, description, descriptionShort, + descriptionProcessing, + descriptionKey, descriptionFromProducer, coverage, datasetId, diff --git a/packages/@ourworldindata/grapher/src/sourcesTab/SourcesTab.tsx b/packages/@ourworldindata/grapher/src/sourcesTab/SourcesTab.tsx index 78e27ca4daa..a71f5b439a2 100644 --- a/packages/@ourworldindata/grapher/src/sourcesTab/SourcesTab.tsx +++ b/packages/@ourworldindata/grapher/src/sourcesTab/SourcesTab.tsx @@ -139,6 +139,49 @@ export class SourcesTab extends React.Component<{ ) : null} + {column.def.descriptionKey && + column.def.descriptionKey.length === 1 ? ( + + Key information + + + + + ) : null} + {column.def.descriptionKey && + column.def.descriptionKey.length > 1 ? ( + + Key information + + + + + ) : null} + {column.def.descriptionProcessing ? ( + + Processing notes + + + + + ) : null} {coverage ? ( Variable geographic coverage