Skip to content

Commit

Permalink
Merge pull request #321 from georgetown-cset/234-na-jobs-when-no-link…
Browse files Browse the repository at this point in the history
…edin

Display 'n/a' for jobs when no LinkedIn page available
  • Loading branch information
jmelot authored May 7, 2024
2 parents 5fa79ae + 2bed65f commit 4a24fe0
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 21 deletions.
42 changes: 25 additions & 17 deletions web/gui-v2/src/components/DetailViewWorkforce.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import React from 'react';

import { Alert } from '@eto/eto-ui-components';

import HeaderWithLink from './HeaderWithLink';
import StatBox from './StatBox';
import StatWrapper from './StatWrapper';
Expand All @@ -17,23 +19,29 @@ const DetailViewWorkforce = ({
<>
<HeaderWithLink title="Workforce" />

<StatWrapper>
{ otherMetricsWorkforceKeys.map((key) => (
<StatBox
description={
<>
From {yearSpanText}, {data.name} here is some explanatory text
describing how they had NUMBER jobs of the specified type
(#{data.other_metrics[key].rank} rank in PARAT
{data.in_sandp_500 && <>, #NUMBER in the S&P500</>})
</>
}
key={key}
label={otherMetricMap[key]}
value={data.other_metrics[key].total}
/>
))}
</StatWrapper>
{data.linkedin.length > 0 ?
<StatWrapper>
{ otherMetricsWorkforceKeys.map((key) => (
<StatBox
description={
<>
From {yearSpanText}, {data.name} here is some explanatory text
describing how they had NUMBER jobs of the specified type
(#{data.other_metrics[key].rank} rank in PARAT
{data.in_sandp_500 && <>, #NUMBER in the S&P500</>})
</>
}
key={key}
label={otherMetricMap[key]}
value={data.other_metrics[key].total}
/>
))}
</StatWrapper>
:
<Alert>
ZACH_TKTK Note about no jobs due to no LinkedIn data
</Alert>
}
</>
);
};
Expand Down
29 changes: 25 additions & 4 deletions web/gui-v2/src/static_data/table_columns.js
Original file line number Diff line number Diff line change
Expand Up @@ -581,19 +581,40 @@ const columnDefinitions = [
...generateSliderColDef("patents", "Transportation"),
tooltip: "Zach_tktk",
},

{
title: "AI jobs",
key: "ai_jobs",
aggregateType: "median",
...generateSliderColDef("other_metrics", "ai_jobs"),
tooltip: "Zach_tktk",
...generateSliderColDef(
"other_metrics",
"ai_jobs",
undefined, // Use default extract function
(_val, row) => {
if ( row?._group || row.linkedin.length > 0 ) {
return <CellStat data={row.other_metrics.ai_jobs} />;
} else {
return <CellStat data={{ total: null }} />
}
},
),
tooltip: "Zach_tktk"
},
{
title: "Tech Tier 1 jobs",
key: "tt1_jobs",
aggregateType: "median",
...generateSliderColDef("other_metrics", "tt1_jobs"),
...generateSliderColDef(
"other_metrics",
"tt1_jobs",
undefined, // Use default extract function
(_val, row) => {
if ( row?._group || row.linkedin.length > 0 ) {
return <CellStat data={row.other_metrics.tt1_jobs} />;
} else {
return <CellStat data={{ total: null }} />
}
},
),
initialCol: true,
tooltip: "Zach_tktk",
},
Expand Down

0 comments on commit 4a24fe0

Please sign in to comment.