diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-21 02:50:22 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-21 02:50:22 +0300 |
commit | 9dc93a4519d9d5d7be48ff274127136236a3adb3 (patch) | |
tree | 70467ae3692a0e35e5ea56bcb803eb512a10bedb /app/assets/javascripts/contributors | |
parent | 4b0f34b6d759d6299322b3a54453e930c6121ff0 (diff) |
Add latest changes from gitlab-org/gitlab@13-11-stable-eev13.11.0-rc43
Diffstat (limited to 'app/assets/javascripts/contributors')
4 files changed, 18 insertions, 12 deletions
diff --git a/app/assets/javascripts/contributors/components/contributors.vue b/app/assets/javascripts/contributors/components/contributors.vue index 7426e570864..25ce6500094 100644 --- a/app/assets/javascripts/contributors/components/contributors.vue +++ b/app/assets/javascripts/contributors/components/contributors.vue @@ -201,11 +201,12 @@ export default { </div> <div v-else-if="showChart" class="contributors-charts"> - <h4>{{ __('Commits to') }} {{ branch }}</h4> + <h4 class="gl-mb-2 gl-mt-5">{{ __('Commits to') }} {{ branch }}</h4> <span>{{ __('Excluding merge commits. Limited to 6,000 commits.') }}</span> <resizable-chart-container> <gl-area-chart slot-scope="{ width }" + class="gl-mb-5" :width="width" :data="masterChartData" :option="masterChartOptions" @@ -218,10 +219,12 @@ export default { <div v-for="(contributor, index) in individualChartsData" :key="index" - class="col-lg-6 col-12" + class="col-lg-6 col-12 gl-my-5" > - <h4>{{ contributor.name }}</h4> - <p>{{ n__('%d commit', '%d commits', contributor.commits) }} ({{ contributor.email }})</p> + <h4 class="gl-mb-2 gl-mt-0">{{ contributor.name }}</h4> + <p class="gl-mb-3"> + {{ n__('%d commit', '%d commits', contributor.commits) }} ({{ contributor.email }}) + </p> <resizable-chart-container> <gl-area-chart slot-scope="{ width }" 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, }); |