From 299657bf45fa4b90f933f27511b05dfd16082e81 Mon Sep 17 00:00:00 2001
From: himeshr
Date: Mon, 6 May 2024 14:17:17 +0530
Subject: [PATCH] #1133 | Modify display of errored media fetch message in
summary and edit page
---
src/adminApp/service/MediaService.js | 2 +-
src/dataEntryApp/components/MediaUploader.js | 4 +--
src/dataEntryApp/components/Observations.js | 29 +++++++++++++++-----
3 files changed, 25 insertions(+), 10 deletions(-)
diff --git a/src/adminApp/service/MediaService.js b/src/adminApp/service/MediaService.js
index 53967ed41..c78333b79 100644
--- a/src/adminApp/service/MediaService.js
+++ b/src/adminApp/service/MediaService.js
@@ -5,7 +5,7 @@ class MediaService {
try {
return await http.get(http.withParams(`/media/signedUrl`, { url: url })).then(res => res.data);
} catch (exception) {
- return "Unable to fetch media. Value: " + url;
+ return "Unable to fetch media";
}
}
}
diff --git a/src/dataEntryApp/components/MediaUploader.js b/src/dataEntryApp/components/MediaUploader.js
index a3fc5b62f..0dc18777d 100644
--- a/src/dataEntryApp/components/MediaUploader.js
+++ b/src/dataEntryApp/components/MediaUploader.js
@@ -156,7 +156,7 @@ function uploadMediaAndUpdateObservationValue(
});
}
-const MissingSignedMediaMessage = "Unable to fetch media. Value: ";
+const MissingSignedMediaMessage = "Unable to fetch media";
export const MediaUploader = ({ label, obsValue, mediaType, update, formElement }) => {
const classes = useStyles();
const Icon = iconMap[mediaType];
@@ -231,7 +231,7 @@ export const MediaUploader = ({ label, obsValue, mediaType, update, formElement
{preview[fileName]}
) : (
- mediaPreviewMap(preview[fileName], MissingSignedMediaMessage + fileName)[mediaType]
+ mediaPreviewMap(preview[fileName], MissingSignedMediaMessage)[mediaType]
)}