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

index.vue « sign_in_gitlab_multiversion « sign_in « pages « subscriptions « jira_connect « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 4f5aa4c255cf636b6c3a891a56fb4ba18bb5c33b (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
64
65
66
67
68
69
70
71
72
<script>
import { GlButton } from '@gitlab/ui';
import { s__ } from '~/locale';
import SignInOauthButton from '../../../components/sign_in_oauth_button.vue';
import VersionSelectForm from './version_select_form.vue';

export default {
  name: 'SignInGitlabMultiversion',
  components: {
    GlButton,
    SignInOauthButton,
    VersionSelectForm,
  },
  data() {
    return {
      gitlabBasePath: null,
    };
  },
  computed: {
    hasSelectedVersion() {
      return this.gitlabBasePath !== null;
    },
    subtitle() {
      return this.hasSelectedVersion
        ? this.$options.i18n.signInSubtitle
        : this.$options.i18n.versionSelectSubtitle;
    },
  },
  methods: {
    resetGitlabBasePath() {
      this.gitlabBasePath = null;
    },
    onVersionSelect(gitlabBasePath) {
      this.gitlabBasePath = gitlabBasePath;
    },
    onSignInError() {
      this.$emit('error');
    },
  },
  i18n: {
    title: s__('JiraService|Welcome to GitLab for Jira'),
    signInSubtitle: s__('JiraService|Sign in to GitLab to link namespaces.'),
    versionSelectSubtitle: s__('JiraService|What version of GitLab are you using?'),
    changeVersionButtonText: s__('JiraService|Change GitLab version'),
  },
};
</script>

<template>
  <div>
    <div class="gl-text-center">
      <h2>{{ $options.i18n.title }}</h2>
      <p data-testid="subtitle">{{ subtitle }}</p>
    </div>

    <version-select-form v-if="!hasSelectedVersion" class="gl-mt-7" @submit="onVersionSelect" />

    <div v-else class="gl-text-center">
      <sign-in-oauth-button
        class="gl-mb-5"
        @sign-in="$emit('sign-in-oauth', $event)"
        @error="onSignInError"
      />

      <div>
        <gl-button category="tertiary" variant="confirm" @click="resetGitlabBasePath">
          {{ $options.i18n.changeVersionButtonText }}
        </gl-button>
      </div>
    </div>
  </div>
</template>