mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-08 22:45:45 +01:00
Encode revision for extension point to fix breaking change (#1585)
Encode revision on extension points to fix a breaking change which slipped through with release 2.14.0.
This commit is contained in:
2
gradle/changelog/revision_encoding.yaml
Normal file
2
gradle/changelog/revision_encoding.yaml
Normal file
@@ -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))
|
||||||
@@ -66,7 +66,7 @@ const BreadcrumbNav = styled.nav`
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin: 1rem 1rem !important;
|
margin: 1rem 1rem !important;
|
||||||
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
/* move slash to end */
|
/* move slash to end */
|
||||||
@@ -182,10 +182,22 @@ const Breadcrumb: FC<Props> = ({
|
|||||||
prefixButtons = <PrefixButton>{preButtons}</PrefixButton>;
|
prefixButtons = <PrefixButton>{preButtons}</PrefixButton>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const extProps = {
|
||||||
|
baseUrl,
|
||||||
|
revision: revision ? encodeURIComponent(revision) : "",
|
||||||
|
branch: branch ? branch : defaultBranch,
|
||||||
|
path,
|
||||||
|
sources,
|
||||||
|
repository
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="is-flex is-align-items-center">
|
<div className="is-flex is-align-items-center">
|
||||||
<BreadcrumbNav className={classNames("breadcrumb", "sources-breadcrumb", "ml-1", "mb-0")} aria-label="breadcrumbs">
|
<BreadcrumbNav
|
||||||
|
className={classNames("breadcrumb", "sources-breadcrumb", "ml-1", "mb-0")}
|
||||||
|
aria-label="breadcrumbs"
|
||||||
|
>
|
||||||
{prefixButtons}
|
{prefixButtons}
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
@@ -207,18 +219,7 @@ const Breadcrumb: FC<Props> = ({
|
|||||||
</BreadcrumbNav>
|
</BreadcrumbNav>
|
||||||
{binder.hasExtension("repos.sources.actionbar") && (
|
{binder.hasExtension("repos.sources.actionbar") && (
|
||||||
<ActionBar>
|
<ActionBar>
|
||||||
<ExtensionPoint
|
<ExtensionPoint name="repos.sources.actionbar" props={extProps} renderAll={true} />
|
||||||
name="repos.sources.actionbar"
|
|
||||||
props={{
|
|
||||||
baseUrl,
|
|
||||||
revision,
|
|
||||||
branch: branch ? branch : defaultBranch,
|
|
||||||
path,
|
|
||||||
sources,
|
|
||||||
repository
|
|
||||||
}}
|
|
||||||
renderAll={true}
|
|
||||||
/>
|
|
||||||
</ActionBar>
|
</ActionBar>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ class Content extends React.Component<Props, State> {
|
|||||||
props={{
|
props={{
|
||||||
repository,
|
repository,
|
||||||
file,
|
file,
|
||||||
revision,
|
revision: revision ? encodeURIComponent(revision) : "",
|
||||||
handleExtensionError: this.handleExtensionError
|
handleExtensionError: this.handleExtensionError
|
||||||
}}
|
}}
|
||||||
renderAll={true}
|
renderAll={true}
|
||||||
|
|||||||
@@ -64,7 +64,15 @@ const SourceExtensions: FC<Props> = ({ repository, baseUrl }) => {
|
|||||||
return <Loading />;
|
return <Loading />;
|
||||||
}
|
}
|
||||||
|
|
||||||
const extprops = { extension, repository, revision, path, sources, baseUrl };
|
const extprops = {
|
||||||
|
extension,
|
||||||
|
repository,
|
||||||
|
revision: revision ? encodeURIComponent(revision) : "",
|
||||||
|
path,
|
||||||
|
sources,
|
||||||
|
baseUrl
|
||||||
|
};
|
||||||
|
|
||||||
if (!binder.hasExtension(extensionPointName, extprops)) {
|
if (!binder.hasExtension(extensionPointName, extprops)) {
|
||||||
return <Notification type="warning">{t("sources.extension.notBound")}</Notification>;
|
return <Notification type="warning">{t("sources.extension.notBound")}</Notification>;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user