From c7b7b3f73b4ee30557a7fdd4c4c17febc68cf206 Mon Sep 17 00:00:00 2001 From: Florian Scholdei Date: Sat, 20 Apr 2019 15:42:35 +0200 Subject: [PATCH 1/2] fixed sources and changeset view for svn repos --- scm-ui/src/repos/branches/modules/branches.js | 23 +++++++++++------- scm-ui/src/repos/containers/ChangesetsRoot.js | 24 +++++++++---------- .../src/repos/sources/containers/Sources.js | 20 +++++++++------- 3 files changed, 37 insertions(+), 30 deletions(-) diff --git a/scm-ui/src/repos/branches/modules/branches.js b/scm-ui/src/repos/branches/modules/branches.js index 7f8c45932a..0efabcc90c 100644 --- a/scm-ui/src/repos/branches/modules/branches.js +++ b/scm-ui/src/repos/branches/modules/branches.js @@ -304,17 +304,22 @@ const reduceByBranchesSuccess = (state, payload) => { const byName = repoState.byName || {}; repoState.byName = byName; - const branches = response._embedded.branches; - const names = branches.map(b => b.name); - response._embedded.branches = names; - for (let branch of branches) { - byName[branch.name] = branch; + if(response._embedded) { + const branches = response._embedded.branches; + const names = branches.map(b => b.name); + response._embedded.branches = names; + for (let branch of branches) { + byName[branch.name] = branch; + } + return { + [key]: { + list: response, + byName + } + }; } return { - [key]: { - list: response, - byName - } + [key]: [] }; }; diff --git a/scm-ui/src/repos/containers/ChangesetsRoot.js b/scm-ui/src/repos/containers/ChangesetsRoot.js index c4c310d94d..8e0b44afbe 100644 --- a/scm-ui/src/repos/containers/ChangesetsRoot.js +++ b/scm-ui/src/repos/containers/ChangesetsRoot.js @@ -80,19 +80,17 @@ class ChangesetsRoot extends React.Component { return ; } - if (!repository || !branches) { + if (!repository) { return null; } const url = this.stripEndingSlash(match.url); - const branch = this.findSelectedBranch(); + const branch = branches ? this.findSelectedBranch() : null; const changesets = ; return (
-
{this.renderBranchSelector()} -
changesets} />
); @@ -102,14 +100,16 @@ class ChangesetsRoot extends React.Component { const { repository, branches, selected, t } = this.props; if (repository._links.branches) { return ( - { - this.branchSelected(b); - }} - /> +
+ { + this.branchSelected(b); + }} + /> +
); } return null; diff --git a/scm-ui/src/repos/sources/containers/Sources.js b/scm-ui/src/repos/sources/containers/Sources.js index 2d7e1ca468..5cbf66c032 100644 --- a/scm-ui/src/repos/sources/containers/Sources.js +++ b/scm-ui/src/repos/sources/containers/Sources.js @@ -94,7 +94,7 @@ class Sources extends React.Component { if (currentFileIsDirectory) { return (
-
{this.renderBranchSelector()}
+ {this.renderBranchSelector()} { if (branches) { return ( - { - this.branchSelected(b); - }} - /> +
+ { + this.branchSelected(b); + }} + /> +
); } return null; From 50c8806bad8e25ce92bfa224388d9e4b0448a624 Mon Sep 17 00:00:00 2001 From: Rene Pfeuffer Date: Wed, 24 Apr 2019 11:39:10 +0000 Subject: [PATCH 2/2] Close branch bugfix/svn_no_branches