From f5bf2b7137119cd68661f8584b4af13751199a01 Mon Sep 17 00:00:00 2001 From: Robert Stupp Date: Thu, 11 May 2023 16:02:04 +0200 Subject: [PATCH] UI: Handle reference names with `/` Fixes #6802 --- ui/src/App.tsx | 2 +- ui/src/CommitLog/CommitLog.tsx | 4 ++-- ui/src/TableHead/TableHead.tsx | 21 +++++++++++++-------- ui/src/TableListing/TableListing.tsx | 2 +- 4 files changed, 17 insertions(+), 12 deletions(-) diff --git a/ui/src/App.tsx b/ui/src/App.tsx index 6bf3125d08a..5ec75dc47bb 100644 --- a/ui/src/App.tsx +++ b/ui/src/App.tsx @@ -155,7 +155,7 @@ const updateRef = ( const view = locationParts[0]; if (view === "commits" || view === "tree" || view === "content") { - const branch = locationParts[1]; + const branch = decodeURIComponent(locationParts[1]); const slug = locationParts.length > 2 ? locationParts.slice(2).join("/") : ""; diff --git a/ui/src/CommitLog/CommitLog.tsx b/ui/src/CommitLog/CommitLog.tsx index 5c419f1ab1e..7515c9ee1f2 100644 --- a/ui/src/CommitLog/CommitLog.tsx +++ b/ui/src/CommitLog/CommitLog.tsx @@ -77,7 +77,7 @@ const CommitLog = ({
{ return ( Tags {tags.map((tag) => { return ( - + {tag.name} @@ -129,7 +134,7 @@ const TreeTableHead = ({
{ return ( - nessie + nessie {path.map((p, index) => { return ( @@ -164,7 +169,7 @@ const PathTableHead = ({ {p} @@ -182,9 +187,9 @@ const PathCommitTableHead = ({ }: PathTableHeadProps): React.ReactElement => { return ( - nessie + nessie / - + commits {path.map((p, index) => { @@ -195,7 +200,7 @@ const PathCommitTableHead = ({ diff --git a/ui/src/TableListing/TableListing.tsx b/ui/src/TableListing/TableListing.tsx index 5add49d9f60..2e718d2bcf6 100644 --- a/ui/src/TableListing/TableListing.tsx +++ b/ui/src/TableListing/TableListing.tsx @@ -33,7 +33,7 @@ const groupItem = ( return (