fixed sources and changeset view for svn repos

This commit is contained in:
Florian Scholdei
2019-04-20 15:42:35 +02:00
parent ba3557fbb6
commit c7b7b3f73b
3 changed files with 37 additions and 30 deletions

View File

@@ -304,6 +304,7 @@ const reduceByBranchesSuccess = (state, payload) => {
const byName = repoState.byName || {}; const byName = repoState.byName || {};
repoState.byName = byName; repoState.byName = byName;
if(response._embedded) {
const branches = response._embedded.branches; const branches = response._embedded.branches;
const names = branches.map(b => b.name); const names = branches.map(b => b.name);
response._embedded.branches = names; response._embedded.branches = names;
@@ -316,6 +317,10 @@ const reduceByBranchesSuccess = (state, payload) => {
byName byName
} }
}; };
}
return {
[key]: []
};
}; };
const reduceByBranchSuccess = (state, payload) => { const reduceByBranchSuccess = (state, payload) => {

View File

@@ -80,19 +80,17 @@ class ChangesetsRoot extends React.Component<Props> {
return <Loading />; return <Loading />;
} }
if (!repository || !branches) { if (!repository) {
return null; return null;
} }
const url = this.stripEndingSlash(match.url); const url = this.stripEndingSlash(match.url);
const branch = this.findSelectedBranch(); const branch = branches ? this.findSelectedBranch() : null;
const changesets = <Changesets repository={repository} branch={branch} />; const changesets = <Changesets repository={repository} branch={branch} />;
return ( return (
<div className="panel"> <div className="panel">
<div className="panel-heading">
{this.renderBranchSelector()} {this.renderBranchSelector()}
</div>
<Route path={`${url}/:page?`} component={() => changesets} /> <Route path={`${url}/:page?`} component={() => changesets} />
</div> </div>
); );
@@ -102,6 +100,7 @@ class ChangesetsRoot extends React.Component<Props> {
const { repository, branches, selected, t } = this.props; const { repository, branches, selected, t } = this.props;
if (repository._links.branches) { if (repository._links.branches) {
return ( return (
<div className="panel-heading">
<BranchSelector <BranchSelector
label={t("changesets.branchSelectorLabel")} label={t("changesets.branchSelectorLabel")}
branches={branches} branches={branches}
@@ -110,6 +109,7 @@ class ChangesetsRoot extends React.Component<Props> {
this.branchSelected(b); this.branchSelected(b);
}} }}
/> />
</div>
); );
} }
return null; return null;

View File

@@ -94,7 +94,7 @@ class Sources extends React.Component<Props> {
if (currentFileIsDirectory) { if (currentFileIsDirectory) {
return ( return (
<div className="panel"> <div className="panel">
<div className="panel-heading">{this.renderBranchSelector()}</div> {this.renderBranchSelector()}
<FileTree <FileTree
repository={repository} repository={repository}
revision={revision} revision={revision}
@@ -115,6 +115,7 @@ class Sources extends React.Component<Props> {
if (branches) { if (branches) {
return ( return (
<div className="panel-heading">
<BranchSelector <BranchSelector
branches={branches} branches={branches}
selectedBranch={revision} selectedBranch={revision}
@@ -123,6 +124,7 @@ class Sources extends React.Component<Props> {
this.branchSelected(b); this.branchSelected(b);
}} }}
/> />
</div>
); );
} }
return null; return null;