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

index.js « job_details « ci « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7748b6e83efe174036f6840c1f7ab1db74265029 (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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import { GlToast } from '@gitlab/ui';
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import createDefaultClient from '~/lib/graphql';
import { parseBoolean } from '~/lib/utils/common_utils';
import JobApp from './job_app.vue';
import createStore from './store';

Vue.use(VueApollo);
Vue.use(GlToast);

const apolloProvider = new VueApollo({
  defaultClient: createDefaultClient(),
});

export const initJobDetails = () => {
  const el = document.getElementById('js-job-page');
  if (!el) {
    return null;
  }

  const {
    jobEndpoint,
    logEndpoint,
    pagePath,
    projectPath,
    artifactHelpUrl,
    deploymentHelpUrl,
    runnerSettingsUrl,
    subscriptionsMoreMinutesUrl,
    retryOutdatedJobDocsUrl,
    aiRootCauseAnalysisAvailable,
    testReportSummaryUrl,
    pipelineTestReportUrl,
  } = el.dataset;

  // init store to start fetching log
  const store = createStore();
  store.dispatch('init', { jobEndpoint, logEndpoint, testReportSummaryUrl });

  return new Vue({
    el,
    apolloProvider,
    store,
    provide: {
      pagePath,
      projectPath,
      retryOutdatedJobDocsUrl,
      aiRootCauseAnalysisAvailable: parseBoolean(aiRootCauseAnalysisAvailable),
      pipelineTestReportUrl,
    },
    render(h) {
      return h(JobApp, {
        props: {
          artifactHelpUrl,
          deploymentHelpUrl,
          runnerSettingsUrl,
          subscriptionsMoreMinutesUrl,
        },
      });
    },
  });
};