diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-22 21:09:22 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-22 21:09:22 +0300 |
commit | eab22d334fd451ce793fde56f73568b0f7948ed2 (patch) | |
tree | 069fdd7e7e223e3a69e0192ee11de163d25f51c8 /app/assets/javascripts/jira_connect | |
parent | 4136fdda4ca0ec8de51c17efe48425ac35dee590 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/jira_connect')
7 files changed, 159 insertions, 111 deletions
diff --git a/app/assets/javascripts/jira_connect/subscriptions/components/app.vue b/app/assets/javascripts/jira_connect/subscriptions/components/app.vue index 51db3e784aa..9fdca530aee 100644 --- a/app/assets/javascripts/jira_connect/subscriptions/components/app.vue +++ b/app/assets/javascripts/jira_connect/subscriptions/components/app.vue @@ -7,8 +7,8 @@ import AccessorUtilities from '~/lib/utils/accessor'; import glFeatureFlagMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; import { I18N_DEFAULT_SIGN_IN_ERROR_MESSAGE } from '../constants'; import { SET_ALERT } from '../store/mutation_types'; -import SignInPage from '../pages/sign_in.vue'; -import SubscriptionsPage from '../pages/subscriptions.vue'; +import SignInPage from '../pages/sign_in/sign_in_page.vue'; +import SubscriptionsPage from '../pages/subscriptions_page.vue'; import UserLink from './user_link.vue'; import CompatibilityAlert from './compatibility_alert.vue'; import BrowserSupportAlert from './browser_support_alert.vue'; @@ -111,7 +111,6 @@ export default { <user-link :user-signed-in="userSignedIn" :has-subscriptions="hasSubscriptions" :user="user" /> - <h2 class="gl-text-center gl-mb-7">{{ s__('JiraService|GitLab for Jira Configuration') }}</h2> <div class="gl-layout-w-limited gl-mx-auto gl-px-5 gl-mb-7"> <sign-in-page v-if="!userSignedIn" diff --git a/app/assets/javascripts/jira_connect/subscriptions/pages/sign_in.vue b/app/assets/javascripts/jira_connect/subscriptions/pages/sign_in.vue deleted file mode 100644 index a24ee33b723..00000000000 --- a/app/assets/javascripts/jira_connect/subscriptions/pages/sign_in.vue +++ /dev/null @@ -1,65 +0,0 @@ -<script> -import { s__ } from '~/locale'; - -import glFeatureFlagMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; -import SubscriptionsList from '../components/subscriptions_list.vue'; - -export default { - name: 'SignInPage', - components: { - SubscriptionsList, - SignInLegacyButton: () => import('../components/sign_in_legacy_button.vue'), - SignInOauthButton: () => import('../components/sign_in_oauth_button.vue'), - }, - mixins: [glFeatureFlagMixin()], - inject: ['usersPath'], - props: { - hasSubscriptions: { - type: Boolean, - required: true, - }, - }, - computed: { - useSignInOauthButton() { - return this.glFeatures.jiraConnectOauth; - }, - }, - i18n: { - signInButtonTextWithSubscriptions: s__('Integrations|Sign in to add namespaces'), - signInText: s__('JiraService|Sign in to GitLab.com to get started.'), - }, - methods: { - onSignInError() { - this.$emit('error'); - }, - }, -}; -</script> - -<template> - <div v-if="hasSubscriptions"> - <div class="gl-display-flex gl-justify-content-end"> - <sign-in-oauth-button - v-if="useSignInOauthButton" - @sign-in="$emit('sign-in-oauth', $event)" - @error="onSignInError" - > - {{ $options.i18n.signInButtonTextWithSubscriptions }} - </sign-in-oauth-button> - <sign-in-legacy-button v-else :users-path="usersPath"> - {{ $options.i18n.signInButtonTextWithSubscriptions }} - </sign-in-legacy-button> - </div> - - <subscriptions-list /> - </div> - <div v-else class="gl-text-center"> - <p class="gl-mb-7">{{ $options.i18n.signInText }}</p> - <sign-in-oauth-button - v-if="useSignInOauthButton" - @sign-in="$emit('sign-in-oauth', $event)" - @error="onSignInError" - /> - <sign-in-legacy-button v-else class="gl-mb-7" :users-path="usersPath" /> - </div> -</template> diff --git a/app/assets/javascripts/jira_connect/subscriptions/pages/sign_in/sign_in_gitlab_com.vue b/app/assets/javascripts/jira_connect/subscriptions/pages/sign_in/sign_in_gitlab_com.vue new file mode 100644 index 00000000000..a1868e11b53 --- /dev/null +++ b/app/assets/javascripts/jira_connect/subscriptions/pages/sign_in/sign_in_gitlab_com.vue @@ -0,0 +1,68 @@ +<script> +import { s__ } from '~/locale'; + +import glFeatureFlagMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; +import SubscriptionsList from '../../components/subscriptions_list.vue'; + +export default { + name: 'SignInGitlabCom', + components: { + SubscriptionsList, + SignInLegacyButton: () => import('../../components/sign_in_legacy_button.vue'), + SignInOauthButton: () => import('../../components/sign_in_oauth_button.vue'), + }, + mixins: [glFeatureFlagMixin()], + inject: ['usersPath'], + props: { + hasSubscriptions: { + type: Boolean, + required: true, + }, + }, + computed: { + useSignInOauthButton() { + return this.glFeatures.jiraConnectOauth; + }, + }, + i18n: { + signInButtonTextWithSubscriptions: s__('Integrations|Sign in to add namespaces'), + signInText: s__('JiraService|Sign in to GitLab.com to get started.'), + }, + methods: { + onSignInError() { + this.$emit('error'); + }, + }, +}; +</script> + +<template> + <div> + <h2 class="gl-text-center gl-mb-7">{{ s__('JiraService|GitLab for Jira Configuration') }}</h2> + <div v-if="hasSubscriptions"> + <div class="gl-display-flex gl-justify-content-end"> + <sign-in-oauth-button + v-if="useSignInOauthButton" + @sign-in="$emit('sign-in-oauth', $event)" + @error="onSignInError" + > + {{ $options.i18n.signInButtonTextWithSubscriptions }} + </sign-in-oauth-button> + <sign-in-legacy-button v-else :users-path="usersPath"> + {{ $options.i18n.signInButtonTextWithSubscriptions }} + </sign-in-legacy-button> + </div> + + <subscriptions-list /> + </div> + <div v-else class="gl-text-center"> + <p class="gl-mb-7">{{ $options.i18n.signInText }}</p> + <sign-in-oauth-button + v-if="useSignInOauthButton" + @sign-in="$emit('sign-in-oauth', $event)" + @error="onSignInError" + /> + <sign-in-legacy-button v-else class="gl-mb-7" :users-path="usersPath" /> + </div> + </div> +</template> diff --git a/app/assets/javascripts/jira_connect/subscriptions/pages/sign_in/sign_in_gitlab_multiversion.vue b/app/assets/javascripts/jira_connect/subscriptions/pages/sign_in/sign_in_gitlab_multiversion.vue new file mode 100644 index 00000000000..1633a21ad8f --- /dev/null +++ b/app/assets/javascripts/jira_connect/subscriptions/pages/sign_in/sign_in_gitlab_multiversion.vue @@ -0,0 +1,11 @@ +<script> +export default { + name: 'SignInGitlabMultiversion', +}; +</script> + +<template> + <div> + <!-- TODO --> + </div> +</template> diff --git a/app/assets/javascripts/jira_connect/subscriptions/pages/sign_in/sign_in_page.vue b/app/assets/javascripts/jira_connect/subscriptions/pages/sign_in/sign_in_page.vue new file mode 100644 index 00000000000..ff6b7331c57 --- /dev/null +++ b/app/assets/javascripts/jira_connect/subscriptions/pages/sign_in/sign_in_page.vue @@ -0,0 +1,31 @@ +<script> +import glFeatureFlagMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; +import SignInGitlabCom from './sign_in_gitlab_com.vue'; +import SignInGitlabMultiversion from './sign_in_gitlab_multiversion.vue'; + +export default { + name: 'SignInPage', + components: { SignInGitlabCom, SignInGitlabMultiversion }, + mixins: [glFeatureFlagMixin()], + props: { + hasSubscriptions: { + type: Boolean, + required: true, + }, + }, + computed: { + isOauthSelfManagedEnabled() { + return this.glFeatures.jiraConnectOauth && this.glFeatures.jiraConnectOauthSelfManaged; + }, + }, +}; +</script> +<template> + <sign-in-gitlab-multiversion v-if="isOauthSelfManagedEnabled" /> + <sign-in-gitlab-com + v-else + :has-subscriptions="hasSubscriptions" + @sign-in-oauth="$emit('sign-in-oauth', $event)" + @error="$emit('error', $event)" + /> +</template> diff --git a/app/assets/javascripts/jira_connect/subscriptions/pages/subscriptions.vue b/app/assets/javascripts/jira_connect/subscriptions/pages/subscriptions.vue deleted file mode 100644 index 426f2999370..00000000000 --- a/app/assets/javascripts/jira_connect/subscriptions/pages/subscriptions.vue +++ /dev/null @@ -1,43 +0,0 @@ -<script> -import { GlEmptyState } from '@gitlab/ui'; -import SubscriptionsList from '../components/subscriptions_list.vue'; -import AddNamespaceButton from '../components/add_namespace_button.vue'; - -export default { - name: 'SubscriptionsPage', - components: { - GlEmptyState, - SubscriptionsList, - AddNamespaceButton, - }, - props: { - hasSubscriptions: { - type: Boolean, - required: true, - }, - }, -}; -</script> - -<template> - <div v-if="hasSubscriptions"> - <div class="gl-display-flex gl-justify-content-end"> - <add-namespace-button /> - </div> - - <subscriptions-list /> - </div> - <gl-empty-state - v-else - :title="s__('Integrations|No linked namespaces')" - :description=" - s__( - 'Integrations|Namespaces are the GitLab groups and subgroups you link to this Jira instance.', - ) - " - > - <template #actions> - <add-namespace-button /> - </template> - </gl-empty-state> -</template> diff --git a/app/assets/javascripts/jira_connect/subscriptions/pages/subscriptions_page.vue b/app/assets/javascripts/jira_connect/subscriptions/pages/subscriptions_page.vue new file mode 100644 index 00000000000..e49c764ebc5 --- /dev/null +++ b/app/assets/javascripts/jira_connect/subscriptions/pages/subscriptions_page.vue @@ -0,0 +1,47 @@ +<script> +import { GlEmptyState } from '@gitlab/ui'; +import SubscriptionsList from '../components/subscriptions_list.vue'; +import AddNamespaceButton from '../components/add_namespace_button.vue'; + +export default { + name: 'SubscriptionsPage', + components: { + GlEmptyState, + SubscriptionsList, + AddNamespaceButton, + }, + props: { + hasSubscriptions: { + type: Boolean, + required: true, + }, + }, +}; +</script> + +<template> + <div> + <h2 class="gl-text-center gl-mb-7">{{ s__('JiraService|GitLab for Jira Configuration') }}</h2> + + <div v-if="hasSubscriptions"> + <div class="gl-display-flex gl-justify-content-end"> + <add-namespace-button /> + </div> + + <subscriptions-list /> + </div> + <gl-empty-state + v-else + :title="s__('Integrations|No linked namespaces')" + :description=" + s__( + 'Integrations|Namespaces are the GitLab groups and subgroups you link to this Jira instance.', + ) + " + > + <template #actions> + <add-namespace-button /> + </template> + </gl-empty-state> + </div> +</template> |