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

new_board.js « boards « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 34f2fea79a967ffdcc2452686b75e09693ce9c92 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import Vue from 'vue';
import { parseBoolean } from '~/lib/utils/common_utils';
import { getExperimentVariant } from '~/experimentation/utils';
import { CANDIDATE_VARIANT } from '~/experimentation/constants';
import NewBoardButton from './components/new_board_button.vue';

export default () => {
  if (getExperimentVariant('prominent_create_board_btn') !== CANDIDATE_VARIANT) {
    return;
  }

  const el = document.querySelector('.js-new-board');

  if (!el) {
    return;
  }

  // eslint-disable-next-line no-new
  new Vue({
    el,
    provide: {
      multipleIssueBoardsAvailable: parseBoolean(el.dataset.multipleIssueBoardsAvailable),
      canAdminBoard: parseBoolean(el.dataset.canAdminBoard),
    },
    render(h) {
      return h(NewBoardButton);
    },
  });
};