Skip to content
This repository was archived by the owner on Feb 10, 2025. It is now read-only.

Commit 8722d90

Browse files
committed
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
1 parent b47b8ce commit 8722d90

4 files changed

Lines changed: 22 additions & 21 deletions

File tree

apps/ui/components/application/ViewApplication.tsx

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import React from "react";
22
import { Checkbox } from "hds-react";
33
import { useTranslation } from "next-i18next";
4-
import type {
5-
ApplicationQuery,
6-
Maybe,
7-
TermsOfUseTextFieldsFragment,
4+
import {
5+
type ApplicationQuery,
6+
ApplicationStatusChoice,
7+
type Maybe,
8+
type TermsOfUseTextFieldsFragment,
89
} from "@gql/gql-types";
910
import { getTranslation } from "@/modules/util";
1011
import { ApplicantInfoPreview } from "./ApplicantInfoPreview";
@@ -34,7 +35,9 @@ export function ViewApplication({
3435
const { t } = useTranslation();
3536

3637
const tos2 = application.applicationRound?.termsOfUse;
37-
38+
const shouldShowNotification =
39+
application.status !== ApplicationStatusChoice.ResultsSent &&
40+
application.status !== ApplicationStatusChoice.Draft;
3841
return (
3942
<>
4043
<ApplicationSection>
@@ -79,14 +82,16 @@ export function ViewApplication({
7982
</CheckboxContainer>
8083
</Accordion>
8184
)}
82-
<div>
83-
{/* Wrap the notification in a div, since HDS-notification has <section> as the root element and we need section:last-of-type to hit the last ApplicationSection */}
84-
<StyledNotification
85-
label={t("application:preview.notification.processing")}
86-
>
87-
{t("application:preview.notification.body")}
88-
</StyledNotification>
89-
</div>
85+
{shouldShowNotification && (
86+
<div>
87+
{/* Wrap the notification in a div, since HDS-notification has <section> as the root element and we need section:last-of-type to hit the last ApplicationSection */}
88+
<StyledNotification
89+
label={t("application:preview.notification.processing")}
90+
>
91+
{t("application:preview.notification.body")}
92+
</StyledNotification>
93+
</div>
94+
)}
9095
</>
9196
);
9297
}

apps/ui/components/application/styled.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ export const ApplicationSectionHeader = styled.h2`
5151
[class*="statusLabel__"] {
5252
position: relative;
5353
transform: translateY(-4px);
54+
${fontRegular};
5455
}
5556
`;
5657

apps/ui/components/applications/ApplicationCard.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {
77
IconCheck,
88
IconCogwheel,
99
IconCross,
10-
IconEnvelope,
1110
IconPen,
1211
IconQuestionCircle,
1312
} from "hds-react";
@@ -101,17 +100,13 @@ function getApplicationStatusLabelProps(
101100
type: "success",
102101
icon: <IconCheck aria-hidden="true" />,
103102
};
104-
case ApplicationStatusChoice.InAllocation:
105103
case ApplicationStatusChoice.Handled:
104+
case ApplicationStatusChoice.InAllocation:
105+
case ApplicationStatusChoice.Received:
106106
return {
107107
type: "info",
108108
icon: <IconCogwheel aria-hidden="true" />,
109109
};
110-
case ApplicationStatusChoice.Received:
111-
return {
112-
type: "alert",
113-
icon: <IconEnvelope aria-hidden="true" />,
114-
};
115110
// These two should never be shown to the client, so they are shown as any other unexpected status
116111
case ApplicationStatusChoice.Cancelled:
117112
case ApplicationStatusChoice.Expired:

apps/ui/public/locales/fi/applicationCard.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"EXPIRED": "Rauennut",
1616
"HANDLED": "Käsittelyssä",
1717
"IN_ALLOCATION": "Käsittelyssä",
18-
"RECEIVED": "Lähetetty",
18+
"RECEIVED": "Käsittelyssä",
1919
"RESULTS_SENT": "Käsitelty"
2020
},
2121
"reservations": "Varaukset",

0 commit comments

Comments
 (0)