From 9ca5b720b52bd6a996ade959f3e1b9216c3f1620 Mon Sep 17 00:00:00 2001 From: vedfordev Date: Fri, 6 Dec 2024 15:03:40 +0530 Subject: [PATCH] avniproject/avni-webapp#1178 | fix: coded file urls are showing in DEA --- src/dataEntryApp/components/Observations.js | 30 +++++++++++++-------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/src/dataEntryApp/components/Observations.js b/src/dataEntryApp/components/Observations.js index 804c1a737..8a3d5a4fe 100644 --- a/src/dataEntryApp/components/Observations.js +++ b/src/dataEntryApp/components/Observations.js @@ -298,19 +298,27 @@ const Observations = ({ observations, additionalRows, form, customKey, highlight }; const fileOptions = conceptName => { - const signedURL = get(find(mediaDataList, ({ altTag }) => altTag === conceptName), "url"); - return _.isNil(signedURL) ? ( + const signedURLS = mediaDataList.filter(mediaData => mediaData.altTag === conceptName).map(mediaData => mediaData.url); + return _.isNil(signedURLS) ? ( MediaData.MissingSignedMediaMessage ) : ( - { - event.preventDefault(); - window.open(signedURL, "_blank"); - }} - > - {t("View/Download File")} - + <> + {signedURLS.map((signedURL, index) => ( + <> + { + event.preventDefault(); + window.open(signedURL, "_blank"); + }} + key={index} + > + {t("View/Download File")} + +
+ + ))} + ); };