Skip to content

Commit

Permalink
visualize the (event) coverage status (Planned, On Merit) (#2027)
Browse files Browse the repository at this point in the history
  • Loading branch information
dzonidoo authored Jul 24, 2024
1 parent 3945157 commit 31451e7
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
1 change: 1 addition & 0 deletions client/components/Coverages/CoverageIcons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ export function getAvatarForCoverage(
displayName: user.display_name,
icon: icon,
customContent: getCustomAvatarContent(user),
statusDot: {color: planningUtils.getNewsCoverageStatusDotColor(coverage)},
};

return avatar;
Expand Down
16 changes: 16 additions & 0 deletions client/utils/planning.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1270,6 +1270,21 @@ function getCoverageWorkflowIcon(coverage: IPlanningCoverageItem): string | null
}
}

function getNewsCoverageStatusDotColor(coverage: DeepPartial<IPlanningCoverageItem>): string | null {
if (coverage.news_coverage_status == null) {
return undefined;
}

switch (coverage.news_coverage_status.qcode) {
case 'ncostat:notdec':
return 'var(--sd-colour-coverage-state--on-merit)';
case 'ncostat:notint':
return 'var(--sd-colour-coverage-state--not-covering)';
default:
return null;
}
}

function getCoverageContentType(
coverage: IPlanningCoverageItem,
contentTypes: Array<IG2ContentType> = []
Expand Down Expand Up @@ -1686,6 +1701,7 @@ const self = {
getCoverageIcon,
getCoverageIconColor,
getCoverageWorkflowIcon,
getNewsCoverageStatusDotColor,
shouldLockPlanningForEdit,
modifyForClient,
modifyForServer,
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 31451e7

Please sign in to comment.