diff --git a/backend/benefit/applications/services/change_history.py b/backend/benefit/applications/services/change_history.py index 3fc4b7662c..e06dfa99d3 100644 --- a/backend/benefit/applications/services/change_history.py +++ b/backend/benefit/applications/services/change_history.py @@ -10,7 +10,6 @@ DISABLE_DE_MINIMIS_AIDS = True EXCLUDED_APPLICATION_FIELDS = ( "application_step", - "status", "pay_subsidy_percent", ) @@ -194,6 +193,6 @@ def get_application_change_history(application: Application) -> list: } ] attachment_diffs.append(change_set_base) - change_sets += attachment_diffs - + change_sets = change_sets + attachment_diffs + change_sets.sort(key=lambda x: x["date"], reverse=True) return change_sets diff --git a/backend/benefit/applications/tests/test_application_change_sets.py b/backend/benefit/applications/tests/test_application_change_sets.py index e74b22957a..4aeff9be3a 100755 --- a/backend/benefit/applications/tests/test_application_change_sets.py +++ b/backend/benefit/applications/tests/test_application_change_sets.py @@ -91,9 +91,7 @@ def _flatten_dict(d, parent_key="", sep="."): ] -def test_application_history_change_sets_for_handler( - request, handler_api_client, application -): +def test_application_history_change_sets(request, handler_api_client, application): # Setup application to handling status with freeze_time("2021-01-01") as frozen_datetime: add_attachments_to_application(request, application) @@ -143,6 +141,9 @@ def update_application(application_payload): # Add a mock row which gets inserted when application status changes to "handling" update_payloads.append({"change_reason": None, "handler": "Unknown user"}) + update_payloads.append( + {"change_reason": None, "status": ApplicationStatus.HANDLING} + ) assert len(changes) == len(update_payloads) diff --git a/frontend/benefit/handler/public/locales/en/common.json b/frontend/benefit/handler/public/locales/en/common.json index b30e17843b..6c56699577 100644 --- a/frontend/benefit/handler/public/locales/en/common.json +++ b/frontend/benefit/handler/public/locales/en/common.json @@ -1812,6 +1812,9 @@ }, "handledByAhjoAutomation": { "label": "Käsitelty Ahjo automaatiolla" + }, + "status": { + "label": "Tila" } } } diff --git a/frontend/benefit/handler/public/locales/fi/common.json b/frontend/benefit/handler/public/locales/fi/common.json index a557755219..ad05d1cead 100644 --- a/frontend/benefit/handler/public/locales/fi/common.json +++ b/frontend/benefit/handler/public/locales/fi/common.json @@ -1811,6 +1811,9 @@ }, "handledByAhjoAutomation": { "label": "Käsitelty Ahjo automaatiolla" + }, + "status": { + "label": "Tila" } } } diff --git a/frontend/benefit/handler/public/locales/sv/common.json b/frontend/benefit/handler/public/locales/sv/common.json index b30e17843b..6c56699577 100644 --- a/frontend/benefit/handler/public/locales/sv/common.json +++ b/frontend/benefit/handler/public/locales/sv/common.json @@ -1812,6 +1812,9 @@ }, "handledByAhjoAutomation": { "label": "Käsitelty Ahjo automaatiolla" + }, + "status": { + "label": "Tila" } } } diff --git a/frontend/benefit/handler/src/components/applicationForm/reviewChanges/utils.ts b/frontend/benefit/handler/src/components/applicationForm/reviewChanges/utils.ts index 8e1e8e66d4..60e7fb6874 100644 --- a/frontend/benefit/handler/src/components/applicationForm/reviewChanges/utils.ts +++ b/frontend/benefit/handler/src/components/applicationForm/reviewChanges/utils.ts @@ -1,5 +1,6 @@ import { APPLICATION_FIELD_KEYS } from 'benefit/handler/constants'; import { + APPLICATION_STATUSES, ATTACHMENT_TYPES, EMPLOYEE_KEYS, PAY_SUBSIDY_GRANTED, @@ -61,6 +62,20 @@ export const formatOrTranslateValue = ( )}` ); } + + if ( + [ + APPLICATION_STATUSES.HANDLING, + APPLICATION_STATUSES.RECEIVED, + APPLICATION_STATUSES.INFO_REQUIRED, + APPLICATION_STATUSES.ACCEPTED, + APPLICATION_STATUSES.REJECTED, + APPLICATION_STATUSES.CANCELLED, + ].includes(value as APPLICATION_STATUSES) + ) { + return t(`common:applications.list.columns.applicationStatuses.${value}`); + } + return value; }