implemented avatar and information extension point for svn, hg and git

This commit is contained in:
Sebastian Sdorra
2018-08-24 11:03:35 +02:00
parent c342e1d57c
commit 8fa1308169
22 changed files with 15316 additions and 534 deletions

View File

@@ -0,0 +1,28 @@
//@flow
import React from 'react';
// TODO flow types ???
type Props = {
repository: Object
}
class ProtocolInformation extends React.Component<Props> {
render() {
const { repository } = this.props;
if (!repository._links.httpProtocol) {
return null;
}
return (
<div>
<h4>Checkout the repository</h4>
<pre>
<code>svn checkout {repository._links.httpProtocol.href}</code>
</pre>
</div>
);
}
}
export default ProtocolInformation;

View File

@@ -0,0 +1,15 @@
//@flow
import React from 'react';
type Props = {
};
class SvnAvatar extends React.Component<Props> {
render() {
return <img src="/images/svn-logo.gif" alt="Subversion Logo" />;
}
}
export default SvnAvatar;

View File

@@ -0,0 +1,10 @@
import { binder } from "@scm-manager/ui-extensions";
import ProtocolInformation from './ProtocolInformation';
import SvnAvatar from './SvnAvatar';
const svnPredicate = (props: Object) => {
return props.repository && props.repository.type === "svn";
};
binder.bind("repos.repository-details.information", ProtocolInformation, svnPredicate);
binder.bind("repos.repository-avatar", SvnAvatar, svnPredicate);

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB