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
0e9b5a28
Commit
0e9b5a28
authored
Apr 08, 2021
by
jerasmus
Committed by
Jacques Erasmus
Apr 08, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update default branch in contributors graph
Updated the default branch to whatever is set on the project
parent
5dcc79e3
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
9 deletions
+12
-9
app/assets/javascripts/contributors/index.js
app/assets/javascripts/contributors/index.js
+6
-3
app/assets/javascripts/contributors/stores/index.js
app/assets/javascripts/contributors/stores/index.js
+3
-3
app/assets/javascripts/contributors/stores/state.js
app/assets/javascripts/contributors/stores/state.js
+2
-2
app/views/projects/graphs/show.html.haml
app/views/projects/graphs/show.html.haml
+1
-1
No files found.
app/assets/javascripts/contributors/index.js
View file @
0e9b5a28
import
Vue
from
'
vue
'
;
import
ContributorsGraphs
from
'
./components/contributors.vue
'
;
import
store
from
'
./stores
'
;
import
{
createStore
}
from
'
./stores
'
;
export
default
()
=>
{
const
el
=
document
.
querySelector
(
'
.js-contributors-graph
'
);
if
(
!
el
)
return
null
;
const
{
projectGraphPath
,
projectBranch
,
defaultBranch
}
=
el
.
dataset
;
const
store
=
createStore
(
defaultBranch
);
return
new
Vue
({
el
,
store
,
...
...
@@ -14,8 +17,8 @@ export default () => {
render
(
createElement
)
{
return
createElement
(
ContributorsGraphs
,
{
props
:
{
endpoint
:
el
.
dataset
.
projectGraphPath
,
branch
:
el
.
dataset
.
projectBranch
,
endpoint
:
projectGraphPath
,
branch
:
projectBranch
,
},
});
},
...
...
app/assets/javascripts/contributors/stores/index.js
View file @
0e9b5a28
...
...
@@ -7,12 +7,12 @@ import state from './state';
Vue
.
use
(
Vuex
);
export
const
createStore
=
()
=>
export
const
createStore
=
(
defaultBranch
)
=>
new
Vuex
.
Store
({
actions
,
mutations
,
getters
,
state
:
state
(),
state
:
state
(
defaultBranch
),
});
export
default
createStore
()
;
export
default
createStore
;
app/assets/javascripts/contributors/stores/state.js
View file @
0e9b5a28
export
default
()
=>
({
export
default
(
branch
)
=>
({
loading
:
false
,
chartData
:
null
,
branch
:
'
master
'
,
branch
,
});
app/views/projects/graphs/show.html.haml
View file @
0e9b5a28
...
...
@@ -5,4 +5,4 @@
=
render
'shared/ref_switcher'
,
destination:
'graphs'
=
link_to
s_
(
'Commits|History'
),
project_commits_path
(
@project
,
current_ref
),
class:
'btn gl-button btn-default'
.js-contributors-graph
{
class:
container_class
,
'data-project-graph-path'
:
project_graph_path
(
@project
,
current_ref
,
format: :json
),
'data-project-branch'
:
current_ref
}
.js-contributors-graph
{
class:
container_class
,
data:
{
project_graph_path:
project_graph_path
(
@project
,
current_ref
,
format: :json
),
project_branch:
current_ref
,
default_branch:
@project
.
default_branch
}
}
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