Skip to content

Commit

Permalink
#1178 | fix: coded file urls are showing in DEA
Browse files Browse the repository at this point in the history
  • Loading branch information
vedfordev committed Dec 6, 2024
1 parent 995e0ec commit 9ca5b72
Showing 1 changed file with 19 additions and 11 deletions.
30 changes: 19 additions & 11 deletions src/dataEntryApp/components/Observations.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) ? (
<TextField>MediaData.MissingSignedMediaMessage</TextField>
) : (
<Link
to={"#"}
onClick={event => {
event.preventDefault();
window.open(signedURL, "_blank");
}}
>
{t("View/Download File")}
</Link>
<>
{signedURLS.map((signedURL, index) => (
<>
<Link
to={"#"}
onClick={event => {
event.preventDefault();
window.open(signedURL, "_blank");
}}
key={index}
>
{t("View/Download File")}
</Link>
<br />
</>
))}
</>
);
};

Expand Down

0 comments on commit 9ca5b72

Please sign in to comment.