mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-07 14:05:44 +01:00
create bundle for git plugin
This commit is contained in:
31
scm-plugins/scm-git-plugin/src/main/js/CloneInformation.js
Normal file
31
scm-plugins/scm-git-plugin/src/main/js/CloneInformation.js
Normal file
@@ -0,0 +1,31 @@
|
||||
//@flow
|
||||
import React from 'react';
|
||||
|
||||
// TODO flow types ???
|
||||
type Props = {
|
||||
repository: Object
|
||||
}
|
||||
|
||||
class CloneInformation extends React.Component<Props> {
|
||||
|
||||
render() {
|
||||
const { repository } = this.repository;
|
||||
if (repository.type !== "git") {
|
||||
return null;
|
||||
}
|
||||
if (!repository._links.httpProtocol) {
|
||||
return null;
|
||||
}
|
||||
return (
|
||||
<div>
|
||||
<h2>Git</h2>
|
||||
<pre><code>
|
||||
git clone { repository._links.httpProtocol }
|
||||
</code></pre>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default CloneInformation;
|
||||
4
scm-plugins/scm-git-plugin/src/main/js/index.js
Normal file
4
scm-plugins/scm-git-plugin/src/main/js/index.js
Normal file
@@ -0,0 +1,4 @@
|
||||
import { binder } from "@scm-manager/ui-extensions";
|
||||
import CloneInformation from './CloneInformation';
|
||||
|
||||
binder.bind("repos.repository-details.informations", CloneInformation);
|
||||
Reference in New Issue
Block a user