Commit 1f86c0b0 authored by Jarka Košanová's avatar Jarka Košanová

Merge branch 'remove-canary-deployment-callout' into 'master'

Remove canary deployment callout

See merge request gitlab-org/gitlab!51297
parents 9f243c48 02f21503
<script>
import { GlButton, GlLink, GlIcon } from '@gitlab/ui';
import PersistentUserCallout from '~/persistent_user_callout';
export default {
components: {
GlButton,
GlLink,
GlIcon,
},
props: {
canaryDeploymentFeatureId: {
type: String,
required: true,
},
userCalloutsPath: {
type: String,
required: true,
},
lockPromotionSvgPath: {
type: String,
required: true,
},
helpCanaryDeploymentsPath: {
type: String,
required: true,
},
},
mounted() {
const callout = this.$refs['canary-deployment-callout'];
PersistentUserCallout.factory(callout);
},
};
</script>
<template>
<div
ref="canary-deployment-callout"
class="p-3 canary-deployment-callout"
:data-dismiss-endpoint="userCalloutsPath"
:data-feature-id="canaryDeploymentFeatureId"
>
<img class="canary-deployment-callout-lock pr-3" :src="lockPromotionSvgPath" />
<div class="pl-3">
<p class="font-weight-bold mb-1">
{{ __('Upgrade plan to unlock Canary Deployments feature') }}
</p>
<p class="canary-deployment-callout-message">
{{
__(
'Canary Deployments is a popular CI strategy, where a small portion of the fleet is updated to the new version of your application.',
)
}}
<gl-link :href="helpCanaryDeploymentsPath">{{ __('Read more') }}</gl-link>
</p>
<gl-button href="https://about.gitlab.com/sales/" category="secondary" variant="info">{{
__('Contact sales to upgrade')
}}</gl-button>
</div>
<div class="ml-auto pr-2 canary-deployment-callout-close js-close">
<gl-icon name="close" />
</div>
</div>
</template>
......@@ -10,11 +10,6 @@ export default {
GlLoadingIcon,
},
props: {
canaryDeploymentFeatureId: {
type: String,
required: false,
default: null,
},
isLoading: {
type: Boolean,
required: true,
......@@ -46,11 +41,6 @@ export default {
required: false,
default: '',
},
showCanaryDeploymentCallout: {
type: Boolean,
required: false,
default: false,
},
userCalloutsPath: {
type: String,
required: false,
......@@ -75,8 +65,6 @@ export default {
<environment-table
:environments="environments"
:can-read-environment="canReadEnvironment"
:canary-deployment-feature-id="canaryDeploymentFeatureId"
:show-canary-deployment-callout="showCanaryDeploymentCallout"
:user-callouts-path="userCalloutsPath"
:lock-promotion-svg-path="lockPromotionSvgPath"
:help-canary-deployments-path="helpCanaryDeploymentsPath"
......
......@@ -39,11 +39,6 @@ export default {
type: String,
required: true,
},
canaryDeploymentFeatureId: {
type: String,
required: false,
default: '',
},
canCreateEnvironment: {
type: Boolean,
required: true,
......@@ -75,11 +70,6 @@ export default {
required: false,
default: '',
},
showCanaryDeploymentCallout: {
type: Boolean,
required: false,
default: false,
},
userCalloutsPath: {
type: String,
required: false,
......@@ -205,8 +195,6 @@ export default {
:environments="state.environments"
:pagination="state.paginationInformation"
:can-read-environment="canReadEnvironment"
:canary-deployment-feature-id="canaryDeploymentFeatureId"
:show-canary-deployment-callout="showCanaryDeploymentCallout"
:user-callouts-path="userCalloutsPath"
:lock-promotion-svg-path="lockPromotionSvgPath"
:help-canary-deployments-path="helpCanaryDeploymentsPath"
......
......@@ -8,14 +8,12 @@ import { s__ } from '~/locale';
import EnvironmentItem from './environment_item.vue';
import DeployBoard from './deploy_board.vue';
import CanaryUpdateModal from './canary_update_modal.vue';
import CanaryDeploymentCallout from './canary_deployment_callout.vue';
export default {
components: {
EnvironmentItem,
GlLoadingIcon,
DeployBoard,
CanaryDeploymentCallout,
EnvironmentAlert: () => import('ee_component/environments/components/environment_alert.vue'),
CanaryUpdateModal,
},
......@@ -35,11 +33,6 @@ export default {
required: false,
default: false,
},
canaryDeploymentFeatureId: {
type: String,
required: false,
default: '',
},
helpCanaryDeploymentsPath: {
type: String,
required: false,
......@@ -50,11 +43,6 @@ export default {
required: false,
default: '',
},
showCanaryDeploymentCallout: {
type: Boolean,
required: false,
default: false,
},
userCalloutsPath: {
type: String,
required: false,
......@@ -123,9 +111,6 @@ export default {
shouldRenderFolderContent(env) {
return env.isFolder && env.isOpen && env.children && env.children.length > 0;
},
shouldShowCanaryCallout(env) {
return env.showCanaryCallout && this.showCanaryDeploymentCallout;
},
shouldRenderAlert(env) {
return env?.has_opened_alert;
},
......@@ -243,17 +228,6 @@ export default {
</div>
</template>
</template>
<template v-if="shouldShowCanaryCallout(model)">
<canary-deployment-callout
:key="`canary-promo-${i}`"
:canary-deployment-feature-id="canaryDeploymentFeatureId"
:user-callouts-path="userCalloutsPath"
:lock-promotion-svg-path="lockPromotionSvgPath"
:help-canary-deployments-path="helpCanaryDeploymentsPath"
:data-js-canary-promo-key="i"
/>
</template>
</template>
</div>
</template>
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import canaryCalloutMixin from '../mixins/canary_callout_mixin';
import environmentsFolderApp from './environments_folder_view.vue';
import { parseBoolean } from '../../lib/utils/common_utils';
import Translate from '../../vue_shared/translate';
......@@ -21,7 +20,6 @@ export default () => {
components: {
environmentsFolderApp,
},
mixins: [canaryCalloutMixin],
apolloProvider,
provide: {
projectPath: el.dataset.projectPath,
......@@ -43,7 +41,6 @@ export default () => {
folderName: this.folderName,
cssContainerClass: this.cssContainerClass,
canReadEnvironment: this.canReadEnvironment,
...this.canaryCalloutProps,
},
});
},
......
......@@ -34,16 +34,6 @@ export default {
type: Boolean,
required: true,
},
canaryDeploymentFeatureId: {
type: String,
required: false,
default: '',
},
showCanaryDeploymentCallout: {
type: Boolean,
required: false,
default: false,
},
userCalloutsPath: {
type: String,
required: false,
......@@ -98,8 +88,6 @@ export default {
:environments="state.environments"
:pagination="state.paginationInformation"
:can-read-environment="canReadEnvironment"
:canary-deployment-feature-id="canaryDeploymentFeatureId"
:show-canary-deployment-callout="showCanaryDeploymentCallout"
:user-callouts-path="userCalloutsPath"
:lock-promotion-svg-path="lockPromotionSvgPath"
:help-canary-deployments-path="helpCanaryDeploymentsPath"
......
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import canaryCalloutMixin from './mixins/canary_callout_mixin';
import environmentsComponent from './components/environments_app.vue';
import { parseBoolean } from '../lib/utils/common_utils';
import Translate from '../vue_shared/translate';
......@@ -20,7 +19,6 @@ export default () => {
components: {
environmentsComponent,
},
mixins: [canaryCalloutMixin],
apolloProvider,
provide: {
projectPath: el.dataset.projectPath,
......@@ -46,7 +44,6 @@ export default () => {
deployBoardsHelpPath: this.deployBoardsHelpPath,
canCreateEnvironment: this.canCreateEnvironment,
canReadEnvironment: this.canReadEnvironment,
...this.canaryCalloutProps,
},
});
},
......
import { parseBoolean } from '~/lib/utils/common_utils';
export default {
data() {
const data = this.$options.el.dataset;
return {
canaryDeploymentFeatureId: data.environmentsDataCanaryDeploymentFeatureId,
showCanaryDeploymentCallout: parseBoolean(data.environmentsDataShowCanaryDeploymentCallout),
userCalloutsPath: data.environmentsDataUserCalloutsPath,
lockPromotionSvgPath: data.environmentsDataLockPromotionSvgPath,
helpCanaryDeploymentsPath: data.environmentsDataHelpCanaryDeploymentsPath,
};
},
computed: {
canaryCalloutProps() {
return {
canaryDeploymentFeatureId: this.canaryDeploymentFeatureId,
showCanaryDeploymentCallout: this.showCanaryDeploymentCallout,
userCalloutsPath: this.userCalloutsPath,
lockPromotionSvgPath: this.lockPromotionSvgPath,
helpCanaryDeploymentsPath: this.helpCanaryDeploymentsPath,
};
},
},
};
......@@ -81,17 +81,6 @@ export default class EnvironmentsStore {
this.state.environments = filteredEnvironments;
/**
* Add the canary callout banner underneath the second environment listed.
*
* If there is only one environment, then add to it underneath the first.
*/
if (this.state.environments.length >= 2) {
this.state.environments[1].showCanaryCallout = true;
} else if (this.state.environments.length === 1) {
this.state.environments[0].showCanaryCallout = true;
}
return filteredEnvironments;
}
......
......@@ -218,57 +218,3 @@
padding-right: 10px;
}
}
.canary-deployment-callout {
border-bottom: 1px solid var(--gray-500, $gray-500);
display: flex;
@include media-breakpoint-down(sm) {
display: none;
}
&-lock {
height: 82px;
width: 92px;
}
&-message {
max-width: 600px;
color: var(--gray-500, $gray-500);
}
&-close {
color: var(--gray-500, $gray-500);
cursor: pointer;
}
&-button {
border-color: var(--blue-500, $blue-500);
color: var(--blue-500, $blue-500);
&:not(:disabled):not(.disabled):active {
background-color: var(--blue-200, $blue-200);
border: 2px solid var(--blue-600, $blue-600);
color: var(--blue-700, $blue-700);
height: 34px;
padding: 5px 9px;
}
&:focus {
background-color: var(--blue-500, $blue-500);
border: 2px solid var(--blue-500, $blue-500);
box-shadow: 0 0 4px 1px var(--blue-200, $blue-200);
color: var(--blue-600, $blue-600);
height: 34px;
padding: 5px 9px;
}
&:hover {
background-color: var(--blue-500, $blue-500);
border: 2px solid var(--blue-500, $blue-500);
color: var(--blue-600, $blue-600);
height: 34px;
padding: 5px 9px;
}
}
}
......@@ -7,8 +7,6 @@ module EE
override :environments_list_data
def environments_list_data
ee_environments_list_data = {
"canary_deployment_feature_id" => UserCalloutsHelper::CANARY_DEPLOYMENT,
"show_canary_deployment_callout" => show_canary_deployment_callout?(@project).to_s,
"user_callouts_path" => user_callouts_path,
"lock_promotion_svg_path" => image_path('illustrations/lock_promotion.svg'),
"help_canary_deployments_path" => help_page_path('user/project/canary_deployments')
......@@ -20,8 +18,6 @@ module EE
override :environments_folder_list_view_data
def environments_folder_list_view_data
ee_environments_folder_list_view_data = {
"canary_deployment_feature_id" => UserCalloutsHelper::CANARY_DEPLOYMENT,
"show_canary_deployment_callout" => show_canary_deployment_callout?(@project).to_s,
"user_callouts_path" => user_callouts_path,
"lock_promotion_svg_path" => image_path('illustrations/lock_promotion.svg'),
"help_canary_deployments_path" => help_page_path('user/project/canary_deployments')
......
......@@ -6,7 +6,6 @@ module EE
ACCOUNT_RECOVERY_REGULAR_CHECK = 'account_recovery_regular_check'
ACTIVE_USER_COUNT_THRESHOLD = 'active_user_count_threshold'
CANARY_DEPLOYMENT = 'canary_deployment'
GEO_ENABLE_HASHED_STORAGE = 'geo_enable_hashed_storage'
GEO_MIGRATE_HASHED_STORAGE = 'geo_migrate_hashed_storage'
GOLD_TRIAL = 'gold_trial'
......@@ -15,10 +14,6 @@ module EE
PERSONAL_ACCESS_TOKEN_EXPIRY = 'personal_access_token_expiry'
THREAT_MONITORING_INFO = 'threat_monitoring_info'
def show_canary_deployment_callout?(project)
false
end
def render_enable_hashed_storage_warning
return unless show_enable_hashed_storage_warning?
......
import { mount } from '@vue/test-utils';
import MockAdapter from 'axios-mock-adapter';
import CanaryDeploymentBoard from '~/environments/components/canary_deployment_callout.vue';
import DeployBoard from '~/environments/components/deploy_board.vue';
import EnvironmentsComponent from '~/environments/components/environments_app.vue';
import axios from '~/lib/utils/axios_utils';
......@@ -11,7 +10,6 @@ describe('Environment', () => {
let wrapper;
const mockData = {
canaryDeploymentFeatureId: 'canary_deployment',
canCreateEnvironment: true,
canReadEnvironment: true,
endpoint: 'environments.json',
......@@ -19,13 +17,9 @@ describe('Environment', () => {
helpPagePath: 'help',
lockPromotionSvgPath: '/assets/illustrations/lock-promotion.svg',
newEnvironmentPath: 'environments/new',
showCanaryDeploymentCallout: true,
userCalloutsPath: '/callouts',
};
const canaryPromoKeyValue = () =>
wrapper.find(CanaryDeploymentBoard).attributes('data-js-canary-promo-key');
const createWrapper = () => {
wrapper = mount(EnvironmentsComponent, { propsData: mockData });
return axios.waitForAll();
......@@ -88,22 +82,5 @@ describe('Environment', () => {
);
});
});
describe('canary callout with one environment', () => {
it('should render banner underneath first environment', () => {
expect(canaryPromoKeyValue()).toBe('0');
});
});
describe('canary callout with multiple environments', () => {
beforeEach(() => {
mockRequest([environment, environment, environment]);
return createWrapper();
});
it('should render banner underneath second environment', () => {
expect(canaryPromoKeyValue()).toBe('1');
});
});
});
});
......@@ -37,8 +37,6 @@ describe('Environment table', () => {
propsData: {
environments: [mockItem],
canReadEnvironment: true,
canaryDeploymentFeatureId: 'canary_deployment',
showCanaryDeploymentCallout: true,
userCalloutsPath: '/callouts',
lockPromotionSvgPath: '/assets/illustrations/lock-promotion.svg',
helpCanaryDeploymentsPath: 'help/canary-deployments',
......
......@@ -131,34 +131,6 @@ RSpec.describe EE::UserCalloutsHelper do
end
end
describe '.show_canary_deployment_callout?' do
let(:project) { build(:project) }
subject { helper.show_canary_deployment_callout?(project) }
before do
allow(helper).to receive(:show_promotions?).and_return(true)
end
context 'when user needs to upgrade to canary deployments' do
context 'when user has dismissed' do
before do
allow(helper).to receive(:user_dismissed?).and_return(true)
end
it { is_expected.to be_falsey }
end
context 'when user has not dismissed' do
before do
allow(helper).to receive(:user_dismissed?).and_return(false)
end
it { is_expected.to be_falsey }
end
end
end
describe '#render_dashboard_gold_trial' do
let_it_be(:namespace) { create(:namespace) }
let_it_be(:gold_plan) { create(:gold_plan) }
......
......@@ -5071,9 +5071,6 @@ msgstr ""
msgid "Canary"
msgstr ""
msgid "Canary Deployments is a popular CI strategy, where a small portion of the fleet is updated to the new version of your application."
msgstr ""
msgid "Canary Ingress does not exist in the environment."
msgstr ""
......@@ -7476,9 +7473,6 @@ msgstr ""
msgid "Contact Sales to upgrade"
msgstr ""
msgid "Contact sales to upgrade"
msgstr ""
msgid "Contact support"
msgstr ""
......@@ -30536,9 +30530,6 @@ msgstr ""
msgid "Updating"
msgstr ""
msgid "Upgrade plan to unlock Canary Deployments feature"
msgstr ""
msgid "Upgrade your plan"
msgstr ""
......
......@@ -6,8 +6,6 @@ import CanaryUpdateModal from '~/environments/components/canary_update_modal.vue
import { folder, deployBoardMockData } from './mock_data';
const eeOnlyProps = {
canaryDeploymentFeatureId: 'canary_deployment',
showCanaryDeploymentCallout: true,
userCalloutsPath: '/callouts',
lockPromotionSvgPath: '/assets/illustrations/lock-promotion.svg',
helpCanaryDeploymentsPath: 'help/canary-deployments',
......@@ -53,8 +51,6 @@ describe('Environment table', () => {
propsData: {
environments: [mockItem],
canReadEnvironment: true,
canaryDeploymentFeatureId: 'canary_deployment',
showCanaryDeploymentCallout: true,
userCalloutsPath: '/callouts',
lockPromotionSvgPath: '/assets/illustrations/lock-promotion.svg',
helpCanaryDeploymentsPath: 'help/canary-deployments',
......@@ -83,8 +79,6 @@ describe('Environment table', () => {
environments: [mockItem],
canCreateDeployment: false,
canReadEnvironment: true,
canaryDeploymentFeatureId: 'canary_deployment',
showCanaryDeploymentCallout: true,
userCalloutsPath: '/callouts',
lockPromotionSvgPath: '/assets/illustrations/lock-promotion.svg',
helpCanaryDeploymentsPath: 'help/canary-deployments',
......@@ -122,8 +116,6 @@ describe('Environment table', () => {
propsData: {
environments: [mockItem],
canReadEnvironment: true,
canaryDeploymentFeatureId: 'canary_deployment',
showCanaryDeploymentCallout: true,
userCalloutsPath: '/callouts',
lockPromotionSvgPath: '/assets/illustrations/lock-promotion.svg',
helpCanaryDeploymentsPath: 'help/canary-deployments',
......@@ -152,8 +144,6 @@ describe('Environment table', () => {
environments: [mockItem],
canCreateDeployment: false,
canReadEnvironment: true,
canaryDeploymentFeatureId: 'canary_deployment',
showCanaryDeploymentCallout: true,
userCalloutsPath: '/callouts',
lockPromotionSvgPath: '/assets/illustrations/lock-promotion.svg',
helpCanaryDeploymentsPath: 'help/canary-deployments',
......@@ -169,32 +159,6 @@ describe('Environment table', () => {
});
});
it('should render canary callout', async () => {
const mockItem = {
name: 'review',
folderName: 'review',
size: 3,
isFolder: true,
environment_path: 'url',
showCanaryCallout: true,
};
await factory({
propsData: {
environments: [mockItem],
canCreateDeployment: false,
canReadEnvironment: true,
canaryDeploymentFeatureId: 'canary_deployment',
showCanaryDeploymentCallout: true,
userCalloutsPath: '/callouts',
lockPromotionSvgPath: '/assets/illustrations/lock-promotion.svg',
helpCanaryDeploymentsPath: 'help/canary-deployments',
},
});
expect(wrapper.find('.canary-deployment-callout').exists()).toBe(true);
});
describe('sortEnvironments', () => {
it('should sort environments by last updated', () => {
const mockItems = [
......
......@@ -6,7 +6,6 @@ import Container from '~/environments/components/container.vue';
import EmptyState from '~/environments/components/empty_state.vue';
import EnvironmentsApp from '~/environments/components/environments_app.vue';
import DeployBoard from '~/environments/components/deploy_board.vue';
import CanaryDeploymentBoard from '~/environments/components/canary_deployment_callout.vue';
import axios from '~/lib/utils/axios_utils';
import { environment, folder } from './mock_data';
......@@ -20,8 +19,6 @@ describe('Environment', () => {
canReadEnvironment: true,
newEnvironmentPath: 'environments/new',
helpPagePath: 'help',
canaryDeploymentFeatureId: 'canary_deployment',
showCanaryDeploymentCallout: true,
userCalloutsPath: '/callouts',
lockPromotionSvgPath: '/assets/illustrations/lock-promotion.svg',
helpCanaryDeploymentsPath: 'help/canary-deployments',
......@@ -38,9 +35,6 @@ describe('Environment', () => {
});
};
const canaryPromoKeyValue = () =>
wrapper.find(CanaryDeploymentBoard).attributes('data-js-canary-promo-key');
const createWrapper = (shallow = false, props = {}) => {
const fn = shallow ? shallowMount : mount;
wrapper = extendedWrapper(fn(EnvironmentsApp, { propsData: { ...mockData, ...props } }));
......@@ -148,28 +142,6 @@ describe('Environment', () => {
).toBe(true);
});
});
describe('canary callout with one environment', () => {
it('should render banner underneath first environment', () => {
expect(canaryPromoKeyValue()).toBe('0');
});
});
describe('canary callout with multiple environments', () => {
beforeEach(() => {
mockRequest(200, {
environments: [environment, environment],
stopped_count: 1,
available_count: 0,
});
return createWrapper();
});
it('should render banner underneath second environment', () => {
expect(canaryPromoKeyValue()).toBe('1');
});
});
});
});
......
......@@ -13,8 +13,6 @@ describe('Environments Folder View', () => {
folderName: 'review',
canReadEnvironment: true,
cssContainerClass: 'container',
canaryDeploymentFeatureId: 'canary_deployment',
showCanaryDeploymentCallout: true,
userCalloutsPath: '/callouts',
lockPromotionSvgPath: '/assets/illustrations/lock-promotion.svg',
helpCanaryDeploymentsPath: 'help/canary-deployments',
......
......@@ -214,18 +214,4 @@ describe('Store', () => {
expect(store.state.environments[0].deployBoardData).toEqual(deployBoardMockData);
});
});
describe('canaryCallout', () => {
it('should add banner underneath the second environment', () => {
store.storeEnvironments(serverData);
expect(store.state.environments[1].showCanaryCallout).toEqual(true);
});
it('should add banner underneath first environment when only one environment', () => {
store.storeEnvironments(serverData.slice(0, 1));
expect(store.state.environments[0].showCanaryCallout).toEqual(true);
});
});
});
......@@ -16,8 +16,6 @@ describe('Environments Folder View', () => {
folderName: 'review',
canReadEnvironment: true,
cssContainerClass: 'container',
canaryDeploymentFeatureId: 'canary_deployment',
showCanaryDeploymentCallout: true,
userCalloutsPath: '/callouts',
lockPromotionSvgPath: '/assets/illustrations/lock-promotion.svg',
helpCanaryDeploymentsPath: 'help/canary-deployments',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment