diff --git a/gradle/changelog/revision_encoding.yaml b/gradle/changelog/revision_encoding.yaml new file mode 100644 index 0000000000..fc987967a8 --- /dev/null +++ b/gradle/changelog/revision_encoding.yaml @@ -0,0 +1,2 @@ +- type: fixed + description: Encode revision on extension points to fix breaking change ([#1585](https://github.com/scm-manager/scm-manager/pull/1585)) diff --git a/scm-ui/ui-components/src/Breadcrumb.tsx b/scm-ui/ui-components/src/Breadcrumb.tsx index 5cf6ee4b20..259c79248e 100644 --- a/scm-ui/ui-components/src/Breadcrumb.tsx +++ b/scm-ui/ui-components/src/Breadcrumb.tsx @@ -66,7 +66,7 @@ const BreadcrumbNav = styled.nav` display: flex; align-items: center; margin: 1rem 1rem !important; - + width: 100%; /* move slash to end */ @@ -182,10 +182,22 @@ const Breadcrumb: FC = ({ prefixButtons = {preButtons}; } + const extProps = { + baseUrl, + revision: revision ? encodeURIComponent(revision) : "", + branch: branch ? branch : defaultBranch, + path, + sources, + repository + }; + return ( <>
- + {prefixButtons}
  • @@ -207,18 +219,7 @@ const Breadcrumb: FC = ({ {binder.hasExtension("repos.sources.actionbar") && ( - + )}
diff --git a/scm-ui/ui-webapp/src/repos/sources/containers/Content.tsx b/scm-ui/ui-webapp/src/repos/sources/containers/Content.tsx index 6ac9d6af76..560bb58379 100644 --- a/scm-ui/ui-webapp/src/repos/sources/containers/Content.tsx +++ b/scm-ui/ui-webapp/src/repos/sources/containers/Content.tsx @@ -141,7 +141,7 @@ class Content extends React.Component { props={{ repository, file, - revision, + revision: revision ? encodeURIComponent(revision) : "", handleExtensionError: this.handleExtensionError }} renderAll={true} diff --git a/scm-ui/ui-webapp/src/repos/sources/containers/SourceExtensions.tsx b/scm-ui/ui-webapp/src/repos/sources/containers/SourceExtensions.tsx index 3cedb7da5a..62d0c550e6 100644 --- a/scm-ui/ui-webapp/src/repos/sources/containers/SourceExtensions.tsx +++ b/scm-ui/ui-webapp/src/repos/sources/containers/SourceExtensions.tsx @@ -64,7 +64,15 @@ const SourceExtensions: FC = ({ repository, baseUrl }) => { return ; } - const extprops = { extension, repository, revision, path, sources, baseUrl }; + const extprops = { + extension, + repository, + revision: revision ? encodeURIComponent(revision) : "", + path, + sources, + baseUrl + }; + if (!binder.hasExtension(extensionPointName, extprops)) { return {t("sources.extension.notBound")}; }