mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-12-22 00:09:47 +01:00
implemented avatar and information extension point for svn, hg and git
This commit is contained in:
@@ -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;
|
||||
15
scm-plugins/scm-svn-plugin/src/main/js/SvnAvatar.js
Normal file
15
scm-plugins/scm-svn-plugin/src/main/js/SvnAvatar.js
Normal 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;
|
||||
10
scm-plugins/scm-svn-plugin/src/main/js/index.js
Normal file
10
scm-plugins/scm-svn-plugin/src/main/js/index.js
Normal 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);
|
||||
BIN
scm-plugins/scm-svn-plugin/src/main/webapp/images/svn-logo.gif
Normal file
BIN
scm-plugins/scm-svn-plugin/src/main/webapp/images/svn-logo.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.8 KiB |
Reference in New Issue
Block a user