fetch changesets for selected branch // fetch changesets for default branch if trying to fetch changesets for specific revision

This commit is contained in:
Eduard Heimbuch
2020-01-13 14:49:17 +01:00
parent 3011b4d3e8
commit 0e544d694f
2 changed files with 39 additions and 11 deletions

View File

@@ -82,7 +82,7 @@ class CodeOverview extends React.Component<Props> {
};
render() {
const { repository, baseUrl, branches, error, loading, t } = this.props;
const { repository, baseUrl, branches, selectedBranch, error, loading, t } = this.props;
const url = baseUrl;
if (loading) {
@@ -103,11 +103,11 @@ class CodeOverview extends React.Component<Props> {
<BranchSelector
label={t("code.branchSelector")}
branches={branches}
selectedBranch={this.props.selectedBranch}
selectedBranch={selectedBranch}
onSelectBranch={this.branchSelected}
/>
}
right={<CodeViewSwitcher url={this.props.location.pathname} branches={branches} />}
right={<CodeViewSwitcher baseUrl={url} currentUrl={this.props.location.pathname} branches={branches} selectedBranch={selectedBranch}/>}
/>
</CodeActionBar>
<Route
@@ -125,7 +125,13 @@ class CodeOverview extends React.Component<Props> {
/>
<Route
path={`${url}/branch/:branch/changesets/`}
render={() => <ChangesetsRoot repository={repository} baseUrl={`${url}/changesets`} />}
render={() => (
<ChangesetsRoot
repository={repository}
baseUrl={`${url}/changesets`}
selectedBranch={branches && branches.filter(b => b.name === this.props.selectedBranch)[0]}
/>
)}
/>
</div>
);