From 8722d90145473211fccd883582dd2f71378a9b9c Mon Sep 17 00:00:00 2001 From: Mats Eriksson Date: Thu, 14 Nov 2024 01:35:40 +0200 Subject: [PATCH] fix: misc observed bugs in applications - status labels styling, categories and translations - the notification box about handling is rendered only when viewing applications that are in handling --- .../application/ViewApplication.tsx | 31 +++++++++++-------- apps/ui/components/application/styled.tsx | 1 + .../applications/ApplicationCard.tsx | 9 ++---- .../ui/public/locales/fi/applicationCard.json | 2 +- 4 files changed, 22 insertions(+), 21 deletions(-) diff --git a/apps/ui/components/application/ViewApplication.tsx b/apps/ui/components/application/ViewApplication.tsx index 6ced95711..9d20d2c11 100644 --- a/apps/ui/components/application/ViewApplication.tsx +++ b/apps/ui/components/application/ViewApplication.tsx @@ -1,10 +1,11 @@ import React from "react"; import { Checkbox } from "hds-react"; import { useTranslation } from "next-i18next"; -import type { - ApplicationQuery, - Maybe, - TermsOfUseTextFieldsFragment, +import { + type ApplicationQuery, + ApplicationStatusChoice, + type Maybe, + type TermsOfUseTextFieldsFragment, } from "@gql/gql-types"; import { getTranslation } from "@/modules/util"; import { ApplicantInfoPreview } from "./ApplicantInfoPreview"; @@ -34,7 +35,9 @@ export function ViewApplication({ const { t } = useTranslation(); const tos2 = application.applicationRound?.termsOfUse; - + const shouldShowNotification = + application.status !== ApplicationStatusChoice.ResultsSent && + application.status !== ApplicationStatusChoice.Draft; return ( <> @@ -79,14 +82,16 @@ export function ViewApplication({ )} -
- {/* Wrap the notification in a div, since HDS-notification has
as the root element and we need section:last-of-type to hit the last ApplicationSection */} - - {t("application:preview.notification.body")} - -
+ {shouldShowNotification && ( +
+ {/* Wrap the notification in a div, since HDS-notification has
as the root element and we need section:last-of-type to hit the last ApplicationSection */} + + {t("application:preview.notification.body")} + +
+ )} ); } diff --git a/apps/ui/components/application/styled.tsx b/apps/ui/components/application/styled.tsx index 8deaf3715..787316416 100644 --- a/apps/ui/components/application/styled.tsx +++ b/apps/ui/components/application/styled.tsx @@ -51,6 +51,7 @@ export const ApplicationSectionHeader = styled.h2` [class*="statusLabel__"] { position: relative; transform: translateY(-4px); + ${fontRegular}; } `; diff --git a/apps/ui/components/applications/ApplicationCard.tsx b/apps/ui/components/applications/ApplicationCard.tsx index 655906e99..16e536c4b 100644 --- a/apps/ui/components/applications/ApplicationCard.tsx +++ b/apps/ui/components/applications/ApplicationCard.tsx @@ -7,7 +7,6 @@ import { IconCheck, IconCogwheel, IconCross, - IconEnvelope, IconPen, IconQuestionCircle, } from "hds-react"; @@ -101,17 +100,13 @@ function getApplicationStatusLabelProps( type: "success", icon: