Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
c2fc9e8e
Commit
c2fc9e8e
authored
Apr 08, 2021
by
jerasmus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update default branch name in divergence graph
Updated the default branch name in the divergence graph
parent
724e6da4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
6 deletions
+16
-6
app/assets/javascripts/branches/divergence_graph.js
app/assets/javascripts/branches/divergence_graph.js
+4
-4
app/assets/javascripts/pages/projects/branches/index/index.js
...assets/javascripts/pages/projects/branches/index/index.js
+6
-1
app/views/projects/branches/index.html.haml
app/views/projects/branches/index.html.haml
+1
-1
changelogs/unreleased/324100-update-default-initial-branch-name.yml
.../unreleased/324100-update-default-initial-branch-name.yml
+5
-0
No files found.
app/assets/javascripts/branches/divergence_graph.js
View file @
c2fc9e8e
...
...
@@ -4,13 +4,13 @@ import axios from '../lib/utils/axios_utils';
import
{
__
}
from
'
../locale
'
;
import
DivergenceGraph
from
'
./components/divergence_graph.vue
'
;
export
function
createGraphVueApp
(
el
,
data
,
maxCommits
)
{
export
function
createGraphVueApp
(
el
,
data
,
maxCommits
,
defaultBranch
)
{
return
new
Vue
({
el
,
render
(
h
)
{
return
h
(
DivergenceGraph
,
{
props
:
{
defaultBranch
:
'
master
'
,
defaultBranch
,
distance
:
data
.
distance
?
parseInt
(
data
.
distance
,
10
)
:
null
,
aheadCount
:
parseInt
(
data
.
ahead
,
10
),
behindCount
:
parseInt
(
data
.
behind
,
10
),
...
...
@@ -21,7 +21,7 @@ export function createGraphVueApp(el, data, maxCommits) {
});
}
export
default
(
endpoint
)
=>
{
export
default
(
endpoint
,
defaultBranch
)
=>
{
const
names
=
[...
document
.
querySelectorAll
(
'
.js-branch-item
'
)].
map
(
({
dataset
})
=>
dataset
.
name
,
);
...
...
@@ -47,7 +47,7 @@ export default (endpoint) => {
if
(
!
el
)
return
;
createGraphVueApp
(
el
,
val
,
maxCommits
);
createGraphVueApp
(
el
,
val
,
maxCommits
,
defaultBranch
);
});
})
.
catch
(()
=>
...
...
app/assets/javascripts/pages/projects/branches/index/index.js
View file @
c2fc9e8e
...
...
@@ -5,5 +5,10 @@ import initDiverganceGraph from '~/branches/divergence_graph';
AjaxLoadingSpinner
.
init
();
new
DeleteModal
();
// eslint-disable-line no-new
initDiverganceGraph
(
document
.
querySelector
(
'
.js-branch-list
'
).
dataset
.
divergingCountsEndpoint
);
const
{
divergingCountsEndpoint
,
defaultBranch
}
=
document
.
querySelector
(
'
.js-branch-list
'
,
).
dataset
;
initDiverganceGraph
(
divergingCountsEndpoint
,
defaultBranch
);
BranchSortDropdown
();
app/views/projects/branches/index.html.haml
View file @
c2fc9e8e
...
...
@@ -49,7 +49,7 @@
=
render_if_exists
'projects/commits/mirror_status'
.js-branch-list
{
data:
{
diverging_counts_endpoint:
diverging_commit_counts_namespace_project_branches_path
(
@project
.
namespace
,
@project
,
format: :json
)
}
}
.js-branch-list
{
data:
{
diverging_counts_endpoint:
diverging_commit_counts_namespace_project_branches_path
(
@project
.
namespace
,
@project
,
format: :json
)
,
default_branch:
@project
.
default_branch
}
}
-
if
can?
(
current_user
,
:admin_project
,
@project
)
-
project_settings_link
=
link_to
s_
(
'Branches|project settings'
),
project_protected_branches_path
(
@project
)
.row-content-block
...
...
changelogs/unreleased/324100-update-default-initial-branch-name.yml
0 → 100644
View file @
c2fc9e8e
---
title
:
Update default branch in divergence graph
merge_request
:
58871
author
:
type
:
changed
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment