Skip to content

Commit

Permalink
10434: Fix typing;
Browse files Browse the repository at this point in the history
  • Loading branch information
John Cruz committed Dec 6, 2024
1 parent 856c8c0 commit 345c727
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export type TrialLocationDataFormatted = TrialLocationData & {
type TrialSessionPlanningReportViewHelperResults = {
citiesNotCalendaredInTwoPreviousTerms: string[][];
trialSessionPlanningReportHeader: string;
previousTermsFormatted: { termDisplayFormatted }[];
previousTermsFormatted: { termDisplayFormatted: string }[];
trialLocationDataFormatted: TrialLocationDataFormatted[];
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ function TrialSessionPlanningReportHeader({

type TrialSessionPlanningReportTableParams = {
locationData: TrialLocationDataFormatted[];
previousTerms: { termDisplayFormatted }[];
previousTerms: { termDisplayFormatted: string }[];
};

function TrialSessionPlanningReportTable({
Expand All @@ -108,22 +108,26 @@ function TrialSessionPlanningReportTable({
<th>All</th>
<th>Small</th>
<th>Regular</th>
{previousTerms.map((term, index) => {
return <th key={`th-${index}`}>{term.termDisplayFormatted}</th>;
{previousTerms.map(term => {
return (
<th key={`th-${term.termDisplayFormatted}`}>
{term.termDisplayFormatted}
</th>
);
})}
<th>Special</th>
<th>Blocked</th>
</tr>
</thead>
<tbody>
{locationData &&
locationData.map((trialLocation, idx) => {
locationData.map(trialLocation => {
return (
<tr
className={
trialLocation.hasNotBeenCalendared ? 'bg-yellow' : undefined
}
key={`row-${idx}`}
key={`row-${trialLocation.trialCityState}`}
>
<td>
{trialLocation.hasNotBeenCalendared && (
Expand All @@ -139,27 +143,32 @@ function TrialSessionPlanningReportTable({
<td>{trialLocation.allCaseCount}</td>
<td>{trialLocation.smallCaseCount}</td>
<td>{trialLocation.regularCaseCount}</td>
{trialLocation.previousTermsData &&
trialLocation.previousTermsData.map((prevTerm, index) => {
const hasData =
Array.isArray(prevTerm) && prevTerm.length > 0;
{trialLocation.previousTermsData.map(prevTerm => {
const hasData =
Array.isArray(prevTerm) && prevTerm.length > 0;

return (
<td key={`${idx}-${index}`}>
{hasData ? (
prevTerm.map(data => (
<div key={`datum-${idx}`}>{data}</div>
))
) : (
<FontAwesomeIcon
className="padding-1px"
icon={['far', 'calendar-times']}
size="lg"
/>
)}
</td>
);
})}
return (
<td
key={`${trialLocation.trialCityState}-previous-term-col`}
>
{hasData ? (
prevTerm.map(data => (
<div
key={`${trialLocation.trialCityState}-previous-term-${data}`}
>
{data}
</div>
))
) : (
<FontAwesomeIcon
className="padding-1px"
icon={['far', 'calendar-times']}
size="lg"
/>
)}
</td>
);
})}
<td>{trialLocation.specialCaseCount}</td>
<td>{trialLocation.blockedCaseCount}</td>
</tr>
Expand Down

0 comments on commit 345c727

Please sign in to comment.