Skip to content

Commit

Permalink
Add description key and description processing to sources tab
Browse files Browse the repository at this point in the history
  • Loading branch information
pabloarosado committed Oct 12, 2023
1 parent e41354f commit 4d78105
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/@ourworldindata/core-table/src/CoreColumnDef.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,8 @@ const columnDefFromOwidVariable = (
datasetId,
datasetName,
descriptionShort,
descriptionProcessing,
descriptionKey,
descriptionFromProducer,
source,
origins,
Expand All @@ -578,6 +580,8 @@ const columnDefFromOwidVariable = (
shortUnit,
description,
descriptionShort,
descriptionProcessing,
descriptionKey,
descriptionFromProducer,
coverage,
datasetId,
Expand Down
43 changes: 43 additions & 0 deletions packages/@ourworldindata/grapher/src/sourcesTab/SourcesTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,49 @@ export class SourcesTab extends React.Component<{
</td>
</tr>
) : null}
{column.def.descriptionKey &&
column.def.descriptionKey.length === 1 ? (
<tr>
<td>Key information</td>
<td>
<MarkdownTextWrap
text={column.def.descriptionKey[0]}
fontSize={12}
/>
</td>
</tr>
) : null}
{column.def.descriptionKey &&
column.def.descriptionKey.length > 1 ? (
<tr>
<td>Key information</td>
<td>
<ul>
{column.def.descriptionKey.map(
(info: string, index: number) => (
<li key={index}>
<MarkdownTextWrap
text={info}
fontSize={12}
/>
</li>
)
)}
</ul>
</td>
</tr>
) : null}
{column.def.descriptionProcessing ? (
<tr>
<td>Processing notes</td>
<td>
<MarkdownTextWrap
text={column.def.descriptionProcessing}
fontSize={12}
/>
</td>
</tr>
) : null}
{coverage ? (
<tr>
<td>Variable geographic coverage</td>
Expand Down

0 comments on commit 4d78105

Please sign in to comment.