Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-04-10 03:09:11 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-04-10 03:09:11 +0300
commit89cb3fa7748cad1d71417bcd5b69bf30b94c25b5 (patch)
treed1109effbce81cadbb3009b937f629be94113795 /app/assets/javascripts/contributors
parent017841e3c03105efd0b94e730652c5774f2c136f (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/contributors')
-rw-r--r--app/assets/javascripts/contributors/index.js9
-rw-r--r--app/assets/javascripts/contributors/stores/index.js6
-rw-r--r--app/assets/javascripts/contributors/stores/state.js4
3 files changed, 11 insertions, 8 deletions
diff --git a/app/assets/javascripts/contributors/index.js b/app/assets/javascripts/contributors/index.js
index b6063589734..f66133a074d 100644
--- a/app/assets/javascripts/contributors/index.js
+++ b/app/assets/javascripts/contributors/index.js
@@ -1,12 +1,15 @@
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,
},
});
},
diff --git a/app/assets/javascripts/contributors/stores/index.js b/app/assets/javascripts/contributors/stores/index.js
index 38259f46d4c..a4d0004cee5 100644
--- a/app/assets/javascripts/contributors/stores/index.js
+++ b/app/assets/javascripts/contributors/stores/index.js
@@ -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;
diff --git a/app/assets/javascripts/contributors/stores/state.js b/app/assets/javascripts/contributors/stores/state.js
index 1dc1a3c7b75..9c6b993e5cb 100644
--- a/app/assets/javascripts/contributors/stores/state.js
+++ b/app/assets/javascripts/contributors/stores/state.js
@@ -1,5 +1,5 @@
-export default () => ({
+export default (branch) => ({
loading: false,
chartData: null,
- branch: 'master',
+ branch,
});