From 31451e7e0fe4690070564186b3cb7d3d959b82ed Mon Sep 17 00:00:00 2001 From: Nikola Stojanovic <68916411+dzonidoo@users.noreply.github.com> Date: Wed, 24 Jul 2024 10:16:38 +0200 Subject: [PATCH] visualize the (event) coverage status (Planned, On Merit) (#2027) --- client/components/Coverages/CoverageIcons.tsx | 1 + client/utils/planning.ts | 16 ++++++++++++++++ package-lock.json | 8 ++++---- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/client/components/Coverages/CoverageIcons.tsx b/client/components/Coverages/CoverageIcons.tsx index 08aa5ce11..a24bb7582 100644 --- a/client/components/Coverages/CoverageIcons.tsx +++ b/client/components/Coverages/CoverageIcons.tsx @@ -80,6 +80,7 @@ export function getAvatarForCoverage( displayName: user.display_name, icon: icon, customContent: getCustomAvatarContent(user), + statusDot: {color: planningUtils.getNewsCoverageStatusDotColor(coverage)}, }; return avatar; diff --git a/client/utils/planning.ts b/client/utils/planning.ts index c3a46712b..3aa1464be 100644 --- a/client/utils/planning.ts +++ b/client/utils/planning.ts @@ -1270,6 +1270,21 @@ function getCoverageWorkflowIcon(coverage: IPlanningCoverageItem): string | null } } +function getNewsCoverageStatusDotColor(coverage: DeepPartial): 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 = [] @@ -1686,6 +1701,7 @@ const self = { getCoverageIcon, getCoverageIconColor, getCoverageWorkflowIcon, + getNewsCoverageStatusDotColor, shouldLockPlanningForEdit, modifyForClient, modifyForServer, diff --git a/package-lock.json b/package-lock.json index 1494e28a3..a96fa855b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12207,7 +12207,7 @@ "sass-loader": "6.0.6", "shortid": "2.2.8", "style-loader": "0.20.2", - "superdesk-ui-framework": "3.1.9", + "superdesk-ui-framework": "^3.1.15", "ts-loader": "3.5.0", "typescript": "4.9.5", "uuid": "8.3.1", @@ -12297,9 +12297,9 @@ } }, "superdesk-ui-framework": { - "version": "3.1.9", - "resolved": "https://registry.npmjs.org/superdesk-ui-framework/-/superdesk-ui-framework-3.1.9.tgz", - "integrity": "sha512-mgBkdsv/mvG02WUNt+7szbw+V0xDK0BtG5nuZag/GuvHjJmTGW0s0OhuC/Q+/SGkwg/iR+C7DLYqUY4l+7TQXQ==", + "version": "3.1.16", + "resolved": "https://registry.npmjs.org/superdesk-ui-framework/-/superdesk-ui-framework-3.1.16.tgz", + "integrity": "sha512-6v2/DtCmENh+n4pfq0W2cVg9Hrrs/7wKNIZnzzKDFwblEbquklwCbC9Rju1e0fnkxxcNZxXOHCo6PqoUe4fDLA==", "dev": true, "requires": { "@popperjs/core": "^2.4.0",