From 282953759280eeed27615df0342ab00e43b79793 Mon Sep 17 00:00:00 2001 From: Kasper Fabricius Kristensen <45367945+kasperkristensen@users.noreply.github.com> Date: Tue, 9 May 2023 12:13:54 +0200 Subject: [PATCH] fix(admin-ui): Template download path (#4050) * pin react-router-dom * fix template download path * add changeset --- .changeset/fresh-poems-tease.md | 5 +++++ .../components/organisms/upload-modal/index.tsx | 15 +++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) create mode 100644 .changeset/fresh-poems-tease.md diff --git a/.changeset/fresh-poems-tease.md b/.changeset/fresh-poems-tease.md new file mode 100644 index 0000000000..32aa40df54 --- /dev/null +++ b/.changeset/fresh-poems-tease.md @@ -0,0 +1,5 @@ +--- +"@medusajs/admin-ui": patch +--- + +fix(admin-ui): Make download path respect **BASE** in UploadModal. diff --git a/packages/admin-ui/ui/src/components/organisms/upload-modal/index.tsx b/packages/admin-ui/ui/src/components/organisms/upload-modal/index.tsx index 0cbdbd94ff..243eea2b06 100644 --- a/packages/admin-ui/ui/src/components/organisms/upload-modal/index.tsx +++ b/packages/admin-ui/ui/src/components/organisms/upload-modal/index.tsx @@ -1,15 +1,16 @@ -import { ReactNode, useState } from "react" import clsx from "clsx" +import { ReactNode, useState } from "react" +import { useHref } from "react-router-dom" +import Tooltip from "../../atoms/tooltip" import Button from "../../fundamentals/button" import CheckCircleIcon from "../../fundamentals/icons/check-circle-icon" import CrossIcon from "../../fundamentals/icons/cross-icon" import DownloadIcon from "../../fundamentals/icons/download-icon" import FileIcon from "../../fundamentals/icons/file-icon" -import Modal from "../../molecules/modal" import TrashIcon from "../../fundamentals/icons/trash-icon" import WarningCircleIcon from "../../fundamentals/icons/warning-circle" -import Tooltip from "../../atoms/tooltip" +import Modal from "../../molecules/modal" type FileSummaryProps = { name: string @@ -215,6 +216,8 @@ function UploadModal(props: UploadModalProps) { onFileRemove() } + const download = useHref(templateLink) + return ( @@ -272,11 +275,7 @@ function UploadModal(props: UploadModalProps) { name="medusa-template.csv" size={2967} action={ - + }