correct error throwing in apiclient and add extension point

This commit is contained in:
Maren Süwer
2018-12-10 15:36:52 +01:00
parent 3d36d07e1d
commit e636d409ed
4 changed files with 72 additions and 16 deletions

View File

@@ -0,0 +1,55 @@
//@flow
import React from "react";
import type { Repository } from "@scm-manager/ui-types";
import { translate } from "react-i18next";
type Props = {
repository: Repository,
target: string,
source: string,
t: string => string
};
class GitMergeInformation extends React.Component<Props> {
render() {
const { source, target, t } = this.props;
return (
<div>
<h4>{t("scm-git-plugin.information.merge.heading")}</h4>
<h5>{t("scm-git-plugin.information.merge.subheading")}</h5>
{t("scm-git-plugin.information.merge.clean")}
{t("scm-git-plugin.information.merge.checkout")}
<pre>
<code>git checkout {target}</code>
</pre>
{t("scm-git-plugin.information.merge.update")}
<pre>
<code>
git pull
</code>
</pre>
{t("scm-git-plugin.information.merge.merge")}
<pre>
<code>
git merge {source}
</code>
</pre>
{t("scm-git-plugin.information.merge.resolve")}
<pre>
<code>
git add &lt;conflict file&gt;
</code>
</pre>
{t("scm-git-plugin.information.merge.commit")}
<pre>
<code>
git commit -m "Merge {source} into {target}"
</code>
</pre>
</div>
);
}
}
export default translate("plugins")(GitMergeInformation);

View File

@@ -5,6 +5,7 @@ import GitAvatar from "./GitAvatar";
import { ConfigurationBinder as cfgBinder } from "@scm-manager/ui-components";
import GitGlobalConfiguration from "./GitGlobalConfiguration";
import GitMergeInformation from "./GitMergeInformation";
// repository
@@ -13,6 +14,7 @@ const gitPredicate = (props: Object) => {
};
binder.bind("repos.repository-details.information", ProtocolInformation, gitPredicate);
binder.bind("repos.repository-merge.information", GitMergeInformation, gitPredicate);
binder.bind("repos.repository-avatar", GitAvatar, gitPredicate);
// global config

View File

@@ -3,7 +3,17 @@
"information": {
"clone" : "Clone the repository",
"create" : "Create a new repository",
"replace" : "Push an existing repository"
"replace" : "Push an existing repository",
"merge": {
"heading": "How to merge pull request",
"subheading": "Pull Request cannot be merged automatically - please follow these steps:",
"clean": "1. Make sure your workspace is clean",
"checkout": "2. Checkout target branch",
"update": "3. Update workspace",
"merge": "4. Merge source branch",
"resolve": "5. Resolve merge conflicts and add corrected files to index",
"commit": "6. Commit"
}
},
"config": {
"link": "Git",