From 4795361988b825a4af57b12fe2302d50d84f3e9b Mon Sep 17 00:00:00 2001 From: Eugene Dyudyunov Date: Fri, 29 Mar 2024 13:48:12 +0200 Subject: [PATCH] [BACKPORT] fix: internal routing ignores public path (#313) * fix: internal routing ignores public path Add a new util function for constructing the correct internal route URL. * test: add tests for createCorrectInternalRoute --- .../ProgramRecord/ProgramRecord.jsx | 3 +- .../ProgramRecordsList/ProgramRecordsList.jsx | 7 ++- src/utils.js | 20 +++++++++ src/utils.test.js | 43 +++++++++++++++++++ 4 files changed, 71 insertions(+), 2 deletions(-) create mode 100644 src/utils.js create mode 100644 src/utils.test.js diff --git a/src/components/ProgramRecord/ProgramRecord.jsx b/src/components/ProgramRecord/ProgramRecord.jsx index bb881cd..478a528 100644 --- a/src/components/ProgramRecord/ProgramRecord.jsx +++ b/src/components/ProgramRecord/ProgramRecord.jsx @@ -21,6 +21,7 @@ import ProgramRecordTable from './ProgramRecordTable'; import RecordsHelp from './RecordsHelp'; import ProgramRecordAlert from '../ProgramRecordAlert'; import SendLearnerRecordModal from '../ProgramRecordSendModal'; +import createCorrectInternalRoute from '../../utils'; import getProgramDetails from './data/service'; @@ -81,7 +82,7 @@ function ProgramRecord({ isPublic }) { className="back-to-records" >