Skip to content
代码片段 群组 项目
未验证 提交 8217585d 编辑于 作者: Vitali Tatarintev's avatar Vitali Tatarintev 提交者: GitLab
浏览文件

Merge branch 'aregnery/remove-cloud-licensing-promotion' into 'master'

No related branches found
No related tags found
无相关合并请求
显示
3 个添加215 个删除
......@@ -33,7 +33,7 @@ class Callout < MainClusterwide::ApplicationRecord
pipeline_needs_hover_tip: 30,
web_ide_ci_environments_guidance: 31,
security_configuration_upgrade_banner: 32,
cloud_licensing_subscription_activation_banner: 33, # EE-only
# 33 removed in https://gitlab.com/gitlab-org/gitlab/-/merge_requests/159243
trial_status_reminder_d14: 34, # EE-only
trial_status_reminder_d3: 35, # EE-only
security_configuration_devops_alert: 36, # EE-only
......
......@@ -36581,7 +36581,6 @@ Name of the feature that the callout is for.
| <a id="usercalloutfeaturenameenumbuy_pipeline_minutes_notification_dot"></a>`BUY_PIPELINE_MINUTES_NOTIFICATION_DOT` | Callout feature name for buy_pipeline_minutes_notification_dot. |
| <a id="usercalloutfeaturenameenumcanary_deployment"></a>`CANARY_DEPLOYMENT` | Callout feature name for canary_deployment. |
| <a id="usercalloutfeaturenameenumci_deprecation_warning_for_types_keyword"></a>`CI_DEPRECATION_WARNING_FOR_TYPES_KEYWORD` | Callout feature name for ci_deprecation_warning_for_types_keyword. |
| <a id="usercalloutfeaturenameenumcloud_licensing_subscription_activation_banner"></a>`CLOUD_LICENSING_SUBSCRIPTION_ACTIVATION_BANNER` | Callout feature name for cloud_licensing_subscription_activation_banner. |
| <a id="usercalloutfeaturenameenumcluster_security_warning"></a>`CLUSTER_SECURITY_WARNING` | Callout feature name for cluster_security_warning. |
| <a id="usercalloutfeaturenameenumdeployment_approvals_empty_state"></a>`DEPLOYMENT_APPROVALS_EMPTY_STATE` | Callout feature name for deployment_approvals_empty_state. |
| <a id="usercalloutfeaturenameenumdeployment_details_feedback"></a>`DEPLOYMENT_DETAILS_FEEDBACK` | Callout feature name for deployment_details_feedback. |
<script>
import { GlBanner, GlLink, GlSprintf } from '@gitlab/ui';
import {
addActivationCode,
subscriptionBannerBlogPostUrl,
subscriptionBannerText,
subscriptionBannerTitle,
} from '../constants';
export const ACTIVATE_SUBSCRIPTION_EVENT = 'activate-subscription';
export const CLOSE_ACTIVATE_SUBSCRIPTION_BANNER_EVENT = 'close';
export default {
name: 'SubscriptionActivationBanner',
subscriptionBannerBlogPostUrl,
i18n: {
bannerText: subscriptionBannerText,
buttonText: addActivationCode,
title: subscriptionBannerTitle,
},
components: {
GlBanner,
GlLink,
GlSprintf,
},
inject: ['congratulationSvgPath', 'customersPortalUrl'],
methods: {
handleClose() {
this.$emit(CLOSE_ACTIVATE_SUBSCRIPTION_BANNER_EVENT);
},
handlePrimary() {
this.$emit(ACTIVATE_SUBSCRIPTION_EVENT);
},
},
};
</script>
<template>
<gl-banner
:button-text="$options.i18n.buttonText"
:title="$options.i18n.title"
variant="promotion"
:svg-path="congratulationSvgPath"
@close="handleClose"
@primary="handlePrimary"
>
<p>
<gl-sprintf :message="$options.i18n.bannerText">
<template #blogPostLink="{ content }">
<gl-link :href="$options.subscriptionBannerBlogPostUrl" target="_blank">{{
content
}}</gl-link>
</template>
<template #portalLink="{ content }">
<gl-link :href="customersPortalUrl" target="_blank">{{ content }}</gl-link>
</template>
</gl-sprintf>
</p>
</gl-banner>
</template>
......@@ -6,7 +6,6 @@ import { uniqueId } from 'lodash';
import SafeHtml from '~/vue_shared/directives/safe_html';
import { createAlert } from '~/alert';
import { __, sprintf } from '~/locale';
import UserCalloutDismisser from '~/vue_shared/components/user_callout_dismisser.vue';
import SubscriptionDetailsHistory from 'jh_else_ee/admin/subscriptions/show/components/subscription_details_history.vue';
import {
addActivationCode,
......@@ -14,7 +13,6 @@ import {
subscriptionDetailsHeaderText,
subscriptionTypes,
} from '../constants';
import SubscriptionActivationBanner from './subscription_activation_banner.vue';
import SubscriptionActivationModal from './subscription_activation_modal.vue';
import SubscriptionDetailsCard from './subscription_details_card.vue';
import SubscriptionDetailsUserInfo from './subscription_details_user_info.vue';
......@@ -48,15 +46,13 @@ export default {
components: {
GlButton,
GlModal,
SubscriptionActivationBanner,
SubscriptionActivationModal,
SubscriptionDetailsCard,
SubscriptionDetailsHistory,
SubscriptionDetailsUserInfo,
SubscriptionSyncNotifications: () => import('./subscription_sync_notifications.vue'),
UserCalloutDismisser,
},
inject: ['licenseRemovePath', 'subscriptionActivationBannerCalloutName'],
inject: ['licenseRemovePath'],
props: {
subscription: {
type: Object,
......@@ -149,16 +145,6 @@ export default {
:modal-id="$options.activateSubscriptionModal.id"
v-on="$listeners"
/>
<user-callout-dismisser :feature-name="subscriptionActivationBannerCalloutName">
<template #default="{ dismiss, shouldShowCallout }">
<subscription-activation-banner
v-if="isLegacySubscription && shouldShowCallout"
class="mb-4"
@activate-subscription="showActivationModal"
@close="dismiss"
/>
</template>
</user-callout-dismisser>
<subscription-sync-notifications v-if="shouldShowNotifications" class="gl-mb-4" />
<div class="gl-grid sm:gl-grid-cols-2 gl-gap-5 gl-mb-5">
<subscription-details-card
......
......@@ -115,11 +115,6 @@ export const CONNECTIVITY_ERROR = 'CONNECTIVITY_ERROR';
export const INVALID_CODE_ERROR = 'INVALID_CODE_ERROR';
export const supportLink = `${PROMO_URL}/support/#contact-support`;
export const subscriptionBannerTitle = s__('SuperSonics|Cloud licensing');
export const subscriptionBannerText = s__(
"SuperSonics|Cloud licensing is now available. It's an easier way to activate instances and manage subscriptions. Read more about it in our %{blogPostLinkStart}blog post%{blogPostLinkEnd}. Activation codes are available in the %{portalLinkStart}Customers Portal%{portalLinkEnd}.",
);
export const subscriptionBannerBlogPostUrl = `${PROMO_URL}/blog/2021/07/20/improved-billing-and-subscription-management/`;
export const exportLicenseUsageBtnText = s__('SuperSonics|Export license usage file');
export const customersPortalBtnText = s__('SuperSonics|Customers Portal');
......
......@@ -26,7 +26,6 @@ export default () => {
freeTrialPath,
hasActiveLicense,
licenseRemovePath,
subscriptionActivationBannerCalloutName,
subscriptionSyncPath,
licenseUsageFilePath,
} = el.dataset;
......@@ -46,7 +45,6 @@ export default () => {
customersPortalUrl,
freeTrialPath,
licenseRemovePath,
subscriptionActivationBannerCalloutName,
subscriptionSyncPath,
},
render: (h) =>
......
......@@ -12,7 +12,6 @@ module CalloutsHelper
ULTIMATE_TRIAL = 'ultimate_trial'
NEW_USER_SIGNUPS_CAP_REACHED = 'new_user_signups_cap_reached'
PERSONAL_ACCESS_TOKEN_EXPIRY = 'personal_access_token_expiry'
CL_SUBSCRIPTION_ACTIVATION = 'cloud_licensing_subscription_activation_banner'
PROFILE_PERSONAL_ACCESS_TOKEN_EXPIRY = 'profile_personal_access_token_expiry'
JOINING_A_PROJECT_ALERT = 'joining_a_project_alert'
......
......@@ -64,7 +64,6 @@ def cloud_license_view_data
license_remove_path: admin_license_path,
subscription_sync_path: sync_seat_link_admin_license_path,
congratulation_svg_path: image_path('illustrations/cloud-check-sm.svg'),
subscription_activation_banner_callout_name: ::EE::Users::CalloutsHelper::CL_SUBSCRIPTION_ACTIVATION,
license_usage_file_path: admin_license_usage_export_path(format: :csv)
}
end
......
import { GlBanner, GlLink, GlSprintf } from '@gitlab/ui';
import { shallowMount } from '@vue/test-utils';
import SubscriptionActivationBanner, {
ACTIVATE_SUBSCRIPTION_EVENT,
CLOSE_ACTIVATE_SUBSCRIPTION_BANNER_EVENT,
} from 'ee/admin/subscriptions/show/components/subscription_activation_banner.vue';
import {
addActivationCode,
subscriptionBannerBlogPostUrl,
subscriptionBannerText,
subscriptionBannerTitle,
} from 'ee/admin/subscriptions/show/constants';
describe('SubscriptionActivationBanner', () => {
let wrapper;
const findBanner = () => wrapper.findComponent(GlBanner);
const findLink = (at) => wrapper.findAllComponents(GlLink).at(at);
const customersPortalUrl = 'customers.dot';
const congratulationSvgPath = '/path/to/svg';
const createComponent = () => {
wrapper = shallowMount(SubscriptionActivationBanner, {
provide: {
congratulationSvgPath,
customersPortalUrl,
},
stubs: {
GlSprintf,
},
});
};
beforeEach(() => {
createComponent();
});
it('provides the correct props to the banner', () => {
expect(findBanner().props()).toMatchObject({
buttonText: addActivationCode,
title: subscriptionBannerTitle,
svgPath: congratulationSvgPath,
});
});
it('contains help text', () => {
expect(findBanner().text()).toMatchInterpolatedText(subscriptionBannerText);
});
it('contains a link to the blog post', () => {
expect(findLink(0).attributes('href')).toBe(subscriptionBannerBlogPostUrl);
});
it('contains a link to the customers portal', () => {
expect(findLink(1).attributes('href')).toBe(customersPortalUrl);
});
it('emits an event when the primary button is clicked', () => {
expect(wrapper.emitted(ACTIVATE_SUBSCRIPTION_EVENT)).toBeUndefined();
findBanner().vm.$emit('primary');
expect(wrapper.emitted(ACTIVATE_SUBSCRIPTION_EVENT)).toHaveLength(1);
});
it('emits an event when the close button is clicked', () => {
expect(wrapper.emitted(CLOSE_ACTIVATE_SUBSCRIPTION_BANNER_EVENT)).toBeUndefined();
findBanner().vm.$emit('close');
expect(wrapper.emitted(CLOSE_ACTIVATE_SUBSCRIPTION_BANNER_EVENT)).toHaveLength(1);
});
});
// eslint-disable-next-line no-restricted-imports
import Vuex from 'vuex';
import { GlCard } from '@gitlab/ui';
import { mount, shallowMount } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import AxiosMockAdapter from 'axios-mock-adapter';
import { nextTick } from 'vue';
import { createAlert } from '~/alert';
import mutations from 'ee/admin/subscriptions/show/store/mutations';
import * as types from 'ee/admin/subscriptions/show/store/mutation_types';
import createState from 'ee/admin/subscriptions/show/store/state';
import SubscriptionActivationBanner, {
ACTIVATE_SUBSCRIPTION_EVENT,
} from 'ee/admin/subscriptions/show/components/subscription_activation_banner.vue';
import SubscriptionActivationModal from 'ee/admin/subscriptions/show/components/subscription_activation_modal.vue';
import SubscriptionBreakdown, {
licensedToFields,
......@@ -43,7 +40,6 @@ describe('Subscription Breakdown', () => {
const congratulationSvgPath = '/path/to/svg';
const connectivityHelpURL = 'connectivity/help/url';
const licenseRemovePath = '/license/remove/';
const subscriptionActivationBannerCalloutName = 'banner_callout_name';
const subscriptionSyncPath = '/sync/path/';
const findDetailsCards = () => wrapper.findAllComponents(SubscriptionDetailsCard);
......@@ -53,8 +49,6 @@ describe('Subscription Breakdown', () => {
const findRemoveLicenseButton = () => wrapper.findByTestId('remove-license-button');
const findActivateSubscriptionAction = () =>
wrapper.findByTestId('subscription-activate-subscription-action');
const findSubscriptionActivationBanner = () =>
wrapper.findComponent(SubscriptionActivationBanner);
const findSubscriptionActivationModal = () => wrapper.findComponent(SubscriptionActivationModal);
const findSubscriptionSyncNotifications = () =>
wrapper.findComponent(SubscriptionSyncNotifications);
......@@ -104,7 +98,6 @@ describe('Subscription Breakdown', () => {
congratulationSvgPath,
connectivityHelpURL,
licenseRemovePath,
subscriptionActivationBannerCalloutName,
subscriptionSyncPath,
...provide,
},
......@@ -186,10 +179,6 @@ describe('Subscription Breakdown', () => {
expect(findSubscriptionActivationModal().props('visible')).toBe(true);
});
it('does not present a subscription activation banner', () => {
expect(findSubscriptionActivationBanner().exists()).toBe(false);
});
describe('footer buttons', () => {
it.each`
url | type | shouldShow
......@@ -252,42 +241,6 @@ describe('Subscription Breakdown', () => {
});
});
describe('subscription activation banner', () => {
beforeEach(() => {
createComponent({
props: { subscription: licenseFile },
});
});
it('presents a subscription activation banner', () => {
expect(findSubscriptionActivationBanner().exists()).toBe(true);
});
it('calls the dismiss callback when closing the banner', () => {
findSubscriptionActivationBanner().vm.$emit('close');
expect(userCalloutDismissSpy).toHaveBeenCalledTimes(1);
});
it('shows a modal', async () => {
expect(findSubscriptionActivationModal().props('visible')).toBe(false);
await findSubscriptionActivationBanner().vm.$emit(ACTIVATE_SUBSCRIPTION_EVENT);
expect(findSubscriptionActivationModal().props('visible')).toBe(true);
});
it('hides the banner when the proper condition applies', () => {
createComponent({
mountMethod: mount,
props: { subscription: licenseFile },
shouldShowCallout: false,
});
expect(findSubscriptionActivationBanner().exists()).toBe(false);
});
});
describe('showAlert', () => {
let state;
......
......@@ -98,7 +98,6 @@ def stub_default_url_options(host: "localhost", protocol: "http", port: nil, scr
subscription_sync_path: sync_seat_link_admin_license_path,
license_remove_path: admin_license_path,
congratulation_svg_path: helper.image_path('illustrations/cloud-check-sm.svg'),
subscription_activation_banner_callout_name: ::EE::Users::CalloutsHelper::CL_SUBSCRIPTION_ACTIVATION,
license_usage_file_path: admin_license_usage_export_path(format: :csv) })
end
end
......@@ -114,7 +113,6 @@ def stub_default_url_options(host: "localhost", protocol: "http", port: nil, scr
subscription_sync_path: sync_seat_link_admin_license_path,
license_remove_path: admin_license_path,
congratulation_svg_path: helper.image_path('illustrations/cloud-check-sm.svg'),
subscription_activation_banner_callout_name: ::EE::Users::CalloutsHelper::CL_SUBSCRIPTION_ACTIVATION,
license_usage_file_path: admin_license_usage_export_path(format: :csv) })
end
end
......
......@@ -52205,12 +52205,6 @@ msgstr ""
msgid "SuperSonics|Cannot activate instance due to a connectivity issue"
msgstr ""
 
msgid "SuperSonics|Cloud licensing"
msgstr ""
msgid "SuperSonics|Cloud licensing is now available. It's an easier way to activate instances and manage subscriptions. Read more about it in our %{blogPostLinkStart}blog post%{blogPostLinkEnd}. Activation codes are available in the %{portalLinkStart}Customers Portal%{portalLinkEnd}."
msgstr ""
msgid "SuperSonics|Customers Portal"
msgstr ""
 
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册