mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 07:25:44 +01:00
add repository to source actionbar extensionPoint
This commit is contained in:
@@ -1,13 +1,14 @@
|
|||||||
//@flow
|
//@flow
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import type { Branch } from "@scm-manager/ui-types";
|
import type { Branch, Repository } from "@scm-manager/ui-types";
|
||||||
import injectSheet from "react-jss";
|
import injectSheet from "react-jss";
|
||||||
import { ExtensionPoint, binder } from "@scm-manager/ui-extensions";
|
import { ExtensionPoint, binder } from "@scm-manager/ui-extensions";
|
||||||
import {ButtonGroup} from "./buttons";
|
import {ButtonGroup} from "./buttons";
|
||||||
import classNames from "classnames";
|
import classNames from "classnames";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
|
repository: Repository,
|
||||||
branch: Branch,
|
branch: Branch,
|
||||||
defaultBranch: Branch,
|
defaultBranch: Branch,
|
||||||
branches: Branch[],
|
branches: Branch[],
|
||||||
@@ -63,7 +64,7 @@ class Breadcrumb extends React.Component<Props> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { classes, baseUrl, branch, defaultBranch, branches, revision, path } = this.props;
|
const { classes, baseUrl, branch, defaultBranch, branches, revision, path, repository } = this.props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -77,7 +78,14 @@ class Breadcrumb extends React.Component<Props> {
|
|||||||
<ButtonGroup>
|
<ButtonGroup>
|
||||||
<ExtensionPoint
|
<ExtensionPoint
|
||||||
name="repos.sources.actionbar"
|
name="repos.sources.actionbar"
|
||||||
props={{ baseUrl, branch: branch ? branch : defaultBranch, path, isBranchUrl: branches && branches.filter(b => b.name === revision).length > 0 }}
|
props={{
|
||||||
|
baseUrl,
|
||||||
|
branch: branch ? branch : defaultBranch,
|
||||||
|
path,
|
||||||
|
isBranchUrl: branches &&
|
||||||
|
branches.filter(b => b.name.replace("/", "%2F") === revision).length > 0,
|
||||||
|
repository
|
||||||
|
}}
|
||||||
renderAll={true}
|
renderAll={true}
|
||||||
/>
|
/>
|
||||||
</ButtonGroup>
|
</ButtonGroup>
|
||||||
|
|||||||
@@ -157,6 +157,7 @@ class Sources extends React.Component<Props, State> {
|
|||||||
branches && branches.filter(b => b.defaultBranch === true)[0]
|
branches && branches.filter(b => b.defaultBranch === true)[0]
|
||||||
}
|
}
|
||||||
branches={branches && branches}
|
branches={branches && branches}
|
||||||
|
repository={repository}
|
||||||
/>
|
/>
|
||||||
<FileTree
|
<FileTree
|
||||||
repository={repository}
|
repository={repository}
|
||||||
|
|||||||
Reference in New Issue
Block a user