mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-05-07 16:05:34 +02:00
implemented avatar and information extension point for svn, hg and git
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
<module>scm-svn-plugin</module>
|
||||
<module>scm-legacy-plugin</module>
|
||||
</modules>
|
||||
|
||||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
@@ -30,16 +30,16 @@
|
||||
<version>${servlet.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>sonia.scm</groupId>
|
||||
<artifactId>scm-core</artifactId>
|
||||
<version>2.0.0-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- annotation processors -->
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>sonia.scm</groupId>
|
||||
<artifactId>scm-annotation-processor</artifactId>
|
||||
@@ -60,7 +60,7 @@
|
||||
<artifactId>lombok</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- test scope -->
|
||||
|
||||
<dependency>
|
||||
@@ -107,9 +107,9 @@
|
||||
</resource>
|
||||
|
||||
</resources>
|
||||
|
||||
|
||||
<plugins>
|
||||
|
||||
|
||||
<plugin>
|
||||
<groupId>sonia.scm.maven</groupId>
|
||||
<artifactId>smp-maven-plugin</artifactId>
|
||||
@@ -135,7 +135,40 @@
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
|
||||
<plugin>
|
||||
<groupId>com.github.sdorra</groupId>
|
||||
<artifactId>buildfrontend-maven-plugin</artifactId>
|
||||
<version>2.0.1</version>
|
||||
<configuration>
|
||||
<node>
|
||||
<version>8.11.3</version>
|
||||
</node>
|
||||
<pkgManager>
|
||||
<type>YARN</type>
|
||||
<version>1.7.0</version>
|
||||
</pkgManager>
|
||||
<failOnMissingPackageJson>false</failOnMissingPackageJson>
|
||||
<script>build</script>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>install</id>
|
||||
<phase>process-resources</phase>
|
||||
<goals>
|
||||
<goal>install</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>build</id>
|
||||
<phase>compile</phase>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
"name": "@scm-manager/scm-git-plugin",
|
||||
"main": "src/main/js/index.js",
|
||||
"scripts": {
|
||||
"build": "ui-bundler build"
|
||||
"build": "ui-bundler plugin"
|
||||
},
|
||||
"dependencies": {
|
||||
"@scm-manager/ui-extensions": "^0.0.3"
|
||||
"@scm-manager/ui-extensions": "^0.0.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@scm-manager/ui-bundler": "^0.0.2"
|
||||
"@scm-manager/ui-bundler": "^0.0.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,38 +61,6 @@
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>com.github.sdorra</groupId>
|
||||
<artifactId>buildfrontend-maven-plugin</artifactId>
|
||||
<version>2.0.1</version>
|
||||
<configuration>
|
||||
<node>
|
||||
<version>8.11.3</version>
|
||||
</node>
|
||||
<pkgManager>
|
||||
<type>YARN</type>
|
||||
<version>1.7.0</version>
|
||||
</pkgManager>
|
||||
<script>build</script>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>install</id>
|
||||
<phase>process-resources</phase>
|
||||
<goals>
|
||||
<goal>install</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>build</id>
|
||||
<phase>compile</phase>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
//@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;
|
||||
15
scm-plugins/scm-git-plugin/src/main/js/GitAvatar.js
Normal file
15
scm-plugins/scm-git-plugin/src/main/js/GitAvatar.js
Normal file
@@ -0,0 +1,15 @@
|
||||
//@flow
|
||||
import React from 'react';
|
||||
|
||||
type Props = {
|
||||
};
|
||||
|
||||
class GitAvatar extends React.Component<Props> {
|
||||
|
||||
render() {
|
||||
return <img src="/images/git-logo.png" alt="Git Logo" />;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default GitAvatar;
|
||||
@@ -0,0 +1,54 @@
|
||||
//@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>Clone the repository</h4>
|
||||
<pre>
|
||||
<code>git clone {repository._links.httpProtocol.href}</code>
|
||||
</pre>
|
||||
<h4>Create a new repository</h4>
|
||||
<pre>
|
||||
<code>
|
||||
git init {repository.name}
|
||||
<br />
|
||||
echo "# {repository.name}" > README.md
|
||||
<br />
|
||||
git add README.md
|
||||
<br />
|
||||
git commit -m "added readme"
|
||||
<br />
|
||||
git remote add origin {repository._links.httpProtocol.href}
|
||||
<br />
|
||||
git push -u origin master
|
||||
<br />
|
||||
</code>
|
||||
</pre>
|
||||
<h4>Push an existing repository</h4>
|
||||
<pre>
|
||||
<code>
|
||||
git remote add origin {repository._links.httpProtocol.href}
|
||||
<br />
|
||||
git push -u origin master
|
||||
<br />
|
||||
</code>
|
||||
</pre>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default ProtocolInformation;
|
||||
@@ -1,4 +1,10 @@
|
||||
import { binder } from "@scm-manager/ui-extensions";
|
||||
import CloneInformation from './CloneInformation';
|
||||
import ProtocolInformation from './ProtocolInformation';
|
||||
import GitAvatar from './GitAvatar';
|
||||
|
||||
binder.bind("repos.repository-details.informations", CloneInformation);
|
||||
const gitPredicate = (props: Object) => {
|
||||
return props.repository && props.repository.type === "git";
|
||||
};
|
||||
|
||||
binder.bind("repos.repository-details.information", ProtocolInformation, gitPredicate);
|
||||
binder.bind("repos.repository-avatar", GitAvatar, gitPredicate);
|
||||
|
||||
BIN
scm-plugins/scm-git-plugin/src/main/webapp/images/git-logo.png
Normal file
BIN
scm-plugins/scm-git-plugin/src/main/webapp/images/git-logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
File diff suppressed because it is too large
Load Diff
13
scm-plugins/scm-hg-plugin/package.json
Normal file
13
scm-plugins/scm-hg-plugin/package.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "@scm-manager/scm-hg-plugin",
|
||||
"main": "src/main/js/index.js",
|
||||
"scripts": {
|
||||
"build": "ui-bundler plugin"
|
||||
},
|
||||
"dependencies": {
|
||||
"@scm-manager/ui-extensions": "^0.0.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@scm-manager/ui-bundler": "^0.0.3"
|
||||
}
|
||||
}
|
||||
15
scm-plugins/scm-hg-plugin/src/main/js/HgAvatar.js
Normal file
15
scm-plugins/scm-hg-plugin/src/main/js/HgAvatar.js
Normal file
@@ -0,0 +1,15 @@
|
||||
//@flow
|
||||
import React from 'react';
|
||||
|
||||
type Props = {
|
||||
};
|
||||
|
||||
class HgAvatar extends React.Component<Props> {
|
||||
|
||||
render() {
|
||||
return <img src="/images/hg-logo.png" alt="Mercurial Logo" />;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default HgAvatar;
|
||||
60
scm-plugins/scm-hg-plugin/src/main/js/ProtocolInformation.js
Normal file
60
scm-plugins/scm-hg-plugin/src/main/js/ProtocolInformation.js
Normal file
@@ -0,0 +1,60 @@
|
||||
//@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>Clone the repository</h4>
|
||||
<pre>
|
||||
<code>hg clone {repository._links.httpProtocol.href}</code>
|
||||
</pre>
|
||||
<h4>Create a new repository</h4>
|
||||
<pre>
|
||||
<code>
|
||||
hg init {repository.name}
|
||||
<br />
|
||||
echo "[paths]" > .hg/hgrc
|
||||
<br />
|
||||
echo "default = {repository._links.httpProtocol.href}" > .hg/hgrc
|
||||
<br />
|
||||
echo "# {repository.name}" > README.md
|
||||
<br />
|
||||
hg add README.md
|
||||
<br />
|
||||
hg commit -m "added readme"
|
||||
<br />
|
||||
<br />
|
||||
hg push
|
||||
<br />
|
||||
</code>
|
||||
</pre>
|
||||
<h4>Push an existing repository</h4>
|
||||
<pre>
|
||||
<code>
|
||||
# add the repository url as default to your .hg/hgrc e.g:
|
||||
<br />
|
||||
default = {repository._links.httpProtocol.href}
|
||||
<br />
|
||||
# push to remote repository
|
||||
<br />
|
||||
hg push
|
||||
</code>
|
||||
</pre>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default ProtocolInformation;
|
||||
10
scm-plugins/scm-hg-plugin/src/main/js/index.js
Normal file
10
scm-plugins/scm-hg-plugin/src/main/js/index.js
Normal file
@@ -0,0 +1,10 @@
|
||||
import { binder } from "@scm-manager/ui-extensions";
|
||||
import ProtocolInformation from './ProtocolInformation';
|
||||
import HgAvatar from './HgAvatar';
|
||||
|
||||
const hgPredicate = (props: Object) => {
|
||||
return props.repository && props.repository.type === "hg";
|
||||
};
|
||||
|
||||
binder.bind("repos.repository-details.information", ProtocolInformation, hgPredicate);
|
||||
binder.bind("repos.repository-avatar", HgAvatar, hgPredicate);
|
||||
BIN
scm-plugins/scm-hg-plugin/src/main/webapp/images/hg-logo.png
Normal file
BIN
scm-plugins/scm-hg-plugin/src/main/webapp/images/hg-logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.5 KiB |
5585
scm-plugins/scm-hg-plugin/yarn.lock
Normal file
5585
scm-plugins/scm-hg-plugin/yarn.lock
Normal file
File diff suppressed because it is too large
Load Diff
13
scm-plugins/scm-svn-plugin/package.json
Normal file
13
scm-plugins/scm-svn-plugin/package.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "@scm-manager/scm-svn-plugin",
|
||||
"main": "src/main/js/index.js",
|
||||
"scripts": {
|
||||
"build": "ui-bundler plugin"
|
||||
},
|
||||
"dependencies": {
|
||||
"@scm-manager/ui-extensions": "^0.0.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@scm-manager/ui-bundler": "^0.0.3"
|
||||
}
|
||||
}
|
||||
@@ -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 |
5585
scm-plugins/scm-svn-plugin/yarn.lock
Normal file
5585
scm-plugins/scm-svn-plugin/yarn.lock
Normal file
File diff suppressed because it is too large
Load Diff
@@ -39,6 +39,8 @@
|
||||
-->
|
||||
<script src="vendor.bundle.js"></script>
|
||||
<script src="scm-ui.bundle.js"></script>
|
||||
<!--script src="scm-git-plugin.bundle.js"></script-->
|
||||
<script src="scm-git-plugin.bundle.js"></script>
|
||||
<script src="scm-hg-plugin.bundle.js"></script>
|
||||
<script src="scm-svn-plugin.bundle.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user