From b861c082b60b2eb1a61efb90611b371d0409ee87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20A=CC=8Ahsberg?= Date: Sat, 12 Jun 2021 14:41:48 +0000 Subject: [PATCH] Support jenkins build details for branches that contains slashes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mathias Åhsberg --- .changeset/honest-pianos-smell.md | 5 +++++ .../src/components/BuildWithStepsPage/BuildWithStepsPage.tsx | 4 +++- .../src/components/BuildsPage/lib/CITable/CITable.tsx | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 .changeset/honest-pianos-smell.md diff --git a/.changeset/honest-pianos-smell.md b/.changeset/honest-pianos-smell.md new file mode 100644 index 0000000000..56b87ce72d --- /dev/null +++ b/.changeset/honest-pianos-smell.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-jenkins': patch +--- + +Support showing build details for branches with slashes in their names diff --git a/plugins/jenkins/src/components/BuildWithStepsPage/BuildWithStepsPage.tsx b/plugins/jenkins/src/components/BuildWithStepsPage/BuildWithStepsPage.tsx index 1b7ccb8121..192f84458d 100644 --- a/plugins/jenkins/src/components/BuildWithStepsPage/BuildWithStepsPage.tsx +++ b/plugins/jenkins/src/components/BuildWithStepsPage/BuildWithStepsPage.tsx @@ -50,7 +50,9 @@ const BuildWithStepsView = () => { const projectName = useProjectSlugFromEntity(); const { branch, buildNumber } = useRouteRefParams(buildRouteRef); const classes = useStyles(); - const buildPath = `${projectName}/${branch}/${buildNumber}`; + const buildPath = `${projectName}/${encodeURIComponent( + branch, + )}/${buildNumber}`; const [{ value }] = useBuildWithSteps(buildPath); return ( diff --git a/plugins/jenkins/src/components/BuildsPage/lib/CITable/CITable.tsx b/plugins/jenkins/src/components/BuildsPage/lib/CITable/CITable.tsx index 57ffe48649..12d221d928 100644 --- a/plugins/jenkins/src/components/BuildsPage/lib/CITable/CITable.tsx +++ b/plugins/jenkins/src/components/BuildsPage/lib/CITable/CITable.tsx @@ -118,7 +118,7 @@ const generatedColumns: TableColumn[] = [