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

index.js « general « settings « organizations « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 3ac1243ff0f643697ea9317385efdcbf85ad8bfc (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
import Vue from 'vue';
import VueApollo from 'vue-apollo';

import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
import createDefaultClient from '~/lib/graphql';
import App from './components/app.vue';

export const initOrganizationsSettingsGeneral = () => {
  const el = document.getElementById('js-organizations-settings-general');

  if (!el) return false;

  const {
    dataset: { appData },
  } = el;
  const {
    organization,
    organizationsPath,
    rootUrl,
    previewMarkdownPath,
  } = convertObjectPropsToCamelCase(JSON.parse(appData));

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

  return new Vue({
    el,
    name: 'OrganizationSettingsGeneralRoot',
    apolloProvider,
    provide: {
      organization,
      organizationsPath,
      rootUrl,
      previewMarkdownPath,
    },
    render(createElement) {
      return createElement(App);
    },
  });
};