From a1ea6ea62e615728f83d95ca22e5fba88cba0782 Mon Sep 17 00:00:00 2001 From: Florian Scholdei Date: Mon, 21 Sep 2020 09:58:49 +0200 Subject: [PATCH 1/3] Set default branch in branch selector if nothing is selected --- .../src/repos/components/changesets/ChangesetDetails.tsx | 2 +- scm-ui/ui-webapp/src/repos/containers/ChangesetsRoot.tsx | 3 ++- yarn.lock | 8 ++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/scm-ui/ui-webapp/src/repos/components/changesets/ChangesetDetails.tsx b/scm-ui/ui-webapp/src/repos/components/changesets/ChangesetDetails.tsx index ab691be69c..f6caa08c9b 100644 --- a/scm-ui/ui-webapp/src/repos/components/changesets/ChangesetDetails.tsx +++ b/scm-ui/ui-webapp/src/repos/components/changesets/ChangesetDetails.tsx @@ -102,7 +102,7 @@ const ContributorDetails = styled.div` const ContributorToggleLine = styled.p` cursor: pointer; - /** maring-bottom is inherit from content p **/ + /** margin-bottom is inherit from content p **/ margin-bottom: 0.5rem !important; `; diff --git a/scm-ui/ui-webapp/src/repos/containers/ChangesetsRoot.tsx b/scm-ui/ui-webapp/src/repos/containers/ChangesetsRoot.tsx index 5bc0e0d6e7..0a01e96b3a 100644 --- a/scm-ui/ui-webapp/src/repos/containers/ChangesetsRoot.tsx +++ b/scm-ui/ui-webapp/src/repos/containers/ChangesetsRoot.tsx @@ -76,12 +76,13 @@ class ChangesetsRoot extends React.Component { } const url = this.stripEndingSlash(match.url); + const defaultBranch = branches?.filter(b => b.defaultBranch === true)[0]; return ( <> diff --git a/yarn.lock b/yarn.lock index 552c9c455f..a7a1a693eb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11719,10 +11719,10 @@ mini-create-react-context@^0.4.0: "@babel/runtime" "^7.5.5" tiny-warning "^1.0.3" -mini-css-extract-plugin@^0.10.0: - version "0.10.1" - resolved "https://registry.yarnpkg.com/mini-css-extract-plugin/-/mini-css-extract-plugin-0.10.1.tgz#2592c891f965e15750da6a6c0b60740b5b0cb62d" - integrity sha512-9B10gZixtNjHerADBrMxPXM5G0uL0CRGMcLRV67I8nd1SKbwJrI0okKUzD+PxKsUZ9Dxt8/hPvtzF0DrRnrOyA== +mini-css-extract-plugin@^0.11.0: + version "0.11.2" + resolved "https://registry.yarnpkg.com/mini-css-extract-plugin/-/mini-css-extract-plugin-0.11.2.tgz#e3af4d5e04fbcaaf11838ab230510073060b37bf" + integrity sha512-h2LknfX4U1kScXxH8xE9LCOqT5B+068EAj36qicMb8l4dqdJoyHcmWmpd+ueyZfgu/POvIn+teoUnTtei2ikug== dependencies: loader-utils "^1.1.0" normalize-url "1.9.1" From 97a8211c750fad36c9d5f710edac851934e3d75a Mon Sep 17 00:00:00 2001 From: Florian Scholdei Date: Mon, 21 Sep 2020 10:08:22 +0200 Subject: [PATCH 2/3] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a4d7302356..903d02cc23 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Missing synchronization during repository creation ([#1328](https://github.com/scm-manager/scm-manager/pull/1328)) - Missing BranchCreatedEvent for mercurial ([#1334](https://github.com/scm-manager/scm-manager/pull/1334)) - Branch not found right after creation ([#1334](https://github.com/scm-manager/scm-manager/pull/1334)) +- Set default branch in branch selector if nothing is selected ([#1338](https://github.com/scm-manager/scm-manager/pull/1338)) ## [2.5.0] - 2020-09-10 ### Added From 2de30a2224bcfa686fe354586891b340388f81cc Mon Sep 17 00:00:00 2001 From: Florian Scholdei Date: Mon, 21 Sep 2020 11:01:22 +0200 Subject: [PATCH 3/3] Use array find instead of filter --- scm-ui/ui-webapp/src/repos/containers/ChangesetsRoot.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scm-ui/ui-webapp/src/repos/containers/ChangesetsRoot.tsx b/scm-ui/ui-webapp/src/repos/containers/ChangesetsRoot.tsx index 7646051b1b..b8dfd47544 100644 --- a/scm-ui/ui-webapp/src/repos/containers/ChangesetsRoot.tsx +++ b/scm-ui/ui-webapp/src/repos/containers/ChangesetsRoot.tsx @@ -70,7 +70,7 @@ class ChangesetsRoot extends React.Component { } const url = urls.stripEndingSlash(match.url); - const defaultBranch = branches?.filter(b => b.defaultBranch === true)[0]; + const defaultBranch = branches?.find(b => b.defaultBranch === true); return ( <>