From f9f3d6aa8c799efc28f2c562d30a3ae12e9fd0a9 Mon Sep 17 00:00:00 2001 From: sniedzielski <52816247+sniedzielski@users.noreply.github.com> Date: Tue, 27 Feb 2024 16:33:05 +0100 Subject: [PATCH] CM-729: added user upload and sort by date created DESC (#50) * CM-729: added individual upload history dialog * CM-729: added adjustments to the frontend * CM-729: added improvements for history dialog upload --- src/actions.js | 1 + .../dialogs/IndividualsHistoryUploadDialog.js | 18 +++++++++++++++--- src/translations/en.json | 3 ++- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/actions.js b/src/actions.js index 1eea91e..1410119 100644 --- a/src/actions.js +++ b/src/actions.js @@ -78,6 +78,7 @@ const UPLOAD_HISTORY_FULL_PROJECTION = () => [ 'uuid', 'workflow', 'dataUpload {uuid, dateCreated, dateUpdated, sourceName, sourceType, status, error }', + 'userCreated {username}', ]; export function fetchIndividualEnrollmentSummary(params) { diff --git a/src/components/dialogs/IndividualsHistoryUploadDialog.js b/src/components/dialogs/IndividualsHistoryUploadDialog.js index 79dffc9..262a73c 100644 --- a/src/components/dialogs/IndividualsHistoryUploadDialog.js +++ b/src/components/dialogs/IndividualsHistoryUploadDialog.js @@ -60,7 +60,9 @@ function IndividualsUploadHistoryDialog({ useEffect(() => { if (isOpen) { - const params = []; + const params = [ + 'orderBy: ["-dateCreated"]', + ]; fetchUploadHistory(params); } }, [isOpen]); @@ -85,8 +87,8 @@ function IndividualsUploadHistoryDialog({ top: '50%', left: '50%', transform: 'translate(-50%,-50%)', - width: '75%', - maxWidth: '75%', + width: '85%', + maxWidth: '85%', }, }} > @@ -141,6 +143,13 @@ function IndividualsUploadHistoryDialog({ 'individual.upload.uploadHistoryTable.status', )} + + {formatMessage( + intl, + 'individual', + 'individual.upload.uploadHistoryTable.userCreated', + )} + {formatMessage( intl, @@ -170,6 +179,9 @@ function IndividualsUploadHistoryDialog({ { item.dataUpload.status} + + {item.userCreated.username} + diff --git a/src/translations/en.json b/src/translations/en.json index 87190ef..a79d15b 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -44,7 +44,8 @@ "status": "Status", "error": "Error", "buttonLabel": "UPLOAD HISTORY", - "label": "Upload History Table" + "label": "Upload History Table", + "userCreated": "User Created" } }, "enrollment": {