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

divergence_graph.js « branches « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 670e8e9eb60ca115a340c828101c3eb558ca3e20 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import Vue from 'vue';
import DivergenceGraph from './components/divergence_graph.vue';

export default () => {
  document.querySelectorAll('.js-branch-divergence-graph').forEach(el => {
    const { distance, aheadCount, behindCount, defaultBranch, maxCommits } = el.dataset;

    return new Vue({
      el,
      render(h) {
        return h(DivergenceGraph, {
          props: {
            defaultBranch,
            distance: distance ? parseInt(distance, 10) : null,
            aheadCount: parseInt(aheadCount, 10),
            behindCount: parseInt(behindCount, 10),
            maxCommits: parseInt(maxCommits, 10),
          },
        });
      },
    });
  });
};