summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/analytics/devops_report/devops_score_disabled_service_ping.js
blob: eb2992422a4704344db3b0ed30b6e3a927ecffe7 (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
import Vue from 'vue';
import { parseBoolean } from '~/lib/utils/common_utils';
import UserCallout from '~/user_callout';
import ServicePingDisabled from './components/service_ping_disabled.vue';

export default () => {
  // eslint-disable-next-line no-new
  new UserCallout();

  const emptyStateContainer = document.getElementById('js-devops-service-ping-disabled');

  if (!emptyStateContainer) return false;

  const { isAdmin, emptyStateSvgPath, enableServicePingPath } = emptyStateContainer.dataset;

  return new Vue({
    el: emptyStateContainer,
    provide: {
      isAdmin: parseBoolean(isAdmin),
      svgPath: emptyStateSvgPath,
      primaryButtonPath: enableServicePingPath,
    },
    render(h) {
      return h(ServicePingDisabled);
    },
  });
};