mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-09 23:15:43 +01:00
fixed branch selection urls and styles branch selector
This commit is contained in:
@@ -19,6 +19,8 @@ type Props = {
|
||||
repository: Repository,
|
||||
baseUrl: string,
|
||||
selected: string,
|
||||
baseUrlWithBranch: string,
|
||||
baseUrlWithoutBranch: string,
|
||||
|
||||
// State props
|
||||
branches: Branch[],
|
||||
@@ -49,15 +51,16 @@ class BranchRoot extends React.Component<Props> {
|
||||
return url;
|
||||
};
|
||||
|
||||
matchedUrl = () => {
|
||||
return this.stripEndingSlash(this.props.baseUrl);
|
||||
};
|
||||
|
||||
branchSelected = (branch: Branch) => {
|
||||
const url = this.matchedUrl();
|
||||
this.props.history.push(
|
||||
`${url}/${encodeURIComponent(branch.name)}/changesets/`
|
||||
);
|
||||
branchSelected = (branch?: Branch) => {
|
||||
let url;
|
||||
if (branch) {
|
||||
url = `${this.props.baseUrlWithBranch}/${encodeURIComponent(
|
||||
branch.name
|
||||
)}/changesets/`;
|
||||
} else {
|
||||
url = `${this.props.baseUrlWithoutBranch}/`;
|
||||
}
|
||||
this.props.history.push(url);
|
||||
};
|
||||
|
||||
findSelectedBranch = () => {
|
||||
|
||||
Reference in New Issue
Block a user