Commit 6721c424 authored by Andrew Fontaine's avatar Andrew Fontaine

Merge branch 'dfosco/remove-env-survey' into 'master'

Remove environments survey alert

See merge request gitlab-org/gitlab!69765
parents 08f47493 e6ad51fd
<script> <script>
import { GlBadge, GlButton, GlModalDirective, GlTab, GlTabs, GlAlert } from '@gitlab/ui'; import { GlBadge, GlButton, GlModalDirective, GlTab, GlTabs } from '@gitlab/ui';
import createFlash from '~/flash'; import createFlash from '~/flash';
import { setCookie, getCookie, parseBoolean } from '~/lib/utils/common_utils';
import { s__ } from '~/locale'; import { s__ } from '~/locale';
import { ENVIRONMENTS_SURVEY_DISMISSED_COOKIE_NAME } from '../constants';
import eventHub from '../event_hub'; import eventHub from '../event_hub';
import environmentsMixin from '../mixins/environments_mixin'; import environmentsMixin from '../mixins/environments_mixin';
import EnvironmentsPaginationApiMixin from '../mixins/environments_pagination_api_mixin'; import EnvironmentsPaginationApiMixin from '../mixins/environments_pagination_api_mixin';
...@@ -17,12 +15,6 @@ export default { ...@@ -17,12 +15,6 @@ export default {
i18n: { i18n: {
newEnvironmentButtonLabel: s__('Environments|New environment'), newEnvironmentButtonLabel: s__('Environments|New environment'),
reviewAppButtonLabel: s__('Environments|Enable review app'), reviewAppButtonLabel: s__('Environments|Enable review app'),
surveyAlertTitle: s__('Environments|Help us improve environments'),
surveyAlertText: s__(
'Environments|Your feedback helps GitLab make environments better for you and other users. Participate and enter a sweepstake to win a USD 30 gift card.',
),
surveyAlertButtonLabel: s__('Environments|Take the survey'),
surveyDismissButtonLabel: s__('Environments|Dismiss'),
}, },
modal: { modal: {
id: 'enable-review-app-info', id: 'enable-review-app-info',
...@@ -33,7 +25,6 @@ export default { ...@@ -33,7 +25,6 @@ export default {
EnableReviewAppModal, EnableReviewAppModal,
GlBadge, GlBadge,
GlButton, GlButton,
GlAlert,
GlTab, GlTab,
GlTabs, GlTabs,
StopEnvironmentModal, StopEnvironmentModal,
...@@ -61,13 +52,6 @@ export default { ...@@ -61,13 +52,6 @@ export default {
required: true, required: true,
}, },
}, },
data() {
return {
environmentsSurveyAlertDismissed: parseBoolean(
getCookie(ENVIRONMENTS_SURVEY_DISMISSED_COOKIE_NAME),
),
};
},
created() { created() {
eventHub.$on('toggleFolder', this.toggleFolder); eventHub.$on('toggleFolder', this.toggleFolder);
...@@ -117,11 +101,6 @@ export default { ...@@ -117,11 +101,6 @@ export default {
openFolders.forEach((folder) => this.fetchChildEnvironments(folder)); openFolders.forEach((folder) => this.fetchChildEnvironments(folder));
} }
}, },
onSurveyAlertDismiss() {
setCookie(ENVIRONMENTS_SURVEY_DISMISSED_COOKIE_NAME, 'true');
this.environmentsSurveyAlertDismissed = true;
},
}, },
}; };
</script> </script>
...@@ -152,19 +131,6 @@ export default { ...@@ -152,19 +131,6 @@ export default {
>{{ $options.i18n.newEnvironmentButtonLabel }}</gl-button >{{ $options.i18n.newEnvironmentButtonLabel }}</gl-button
> >
</div> </div>
<gl-alert
v-if="!environmentsSurveyAlertDismissed"
class="gl-my-4"
:title="$options.i18n.surveyAlertTitle"
:primary-button-text="$options.i18n.surveyAlertButtonLabel"
variant="info"
dismissible
:dismiss-label="$options.i18n.surveyDismissButtonLabel"
primary-button-link="https://gitlab.fra1.qualtrics.com/jfe/form/SV_a2xyFsAA4D0w0Jg"
@dismiss="onSurveyAlertDismiss"
>
{{ $options.i18n.surveyAlertText }}
</gl-alert>
<gl-tabs :value="activeTab" content-class="gl-display-none"> <gl-tabs :value="activeTab" content-class="gl-display-none">
<gl-tab <gl-tab
v-for="(tab, idx) in tabs" v-for="(tab, idx) in tabs"
......
...@@ -38,5 +38,3 @@ export const CANARY_STATUS = { ...@@ -38,5 +38,3 @@ export const CANARY_STATUS = {
}; };
export const CANARY_UPDATE_MODAL = 'confirm-canary-change'; export const CANARY_UPDATE_MODAL = 'confirm-canary-change';
export const ENVIRONMENTS_SURVEY_DISMISSED_COOKIE_NAME = 'environments_survey_alert_dismissed';
...@@ -12853,9 +12853,6 @@ msgstr "" ...@@ -12853,9 +12853,6 @@ msgstr ""
msgid "Environments|Deployment %{status}" msgid "Environments|Deployment %{status}"
msgstr "" msgstr ""
msgid "Environments|Dismiss"
msgstr ""
msgid "Environments|Enable review app" msgid "Environments|Enable review app"
msgstr "" msgstr ""
...@@ -12868,9 +12865,6 @@ msgstr "" ...@@ -12868,9 +12865,6 @@ msgstr ""
msgid "Environments|Environments are places where code gets deployed, such as staging or production." msgid "Environments|Environments are places where code gets deployed, such as staging or production."
msgstr "" msgstr ""
msgid "Environments|Help us improve environments"
msgstr ""
msgid "Environments|Install Elastic Stack on your cluster to enable advanced querying capabilities such as full text search." msgid "Environments|Install Elastic Stack on your cluster to enable advanced querying capabilities such as full text search."
msgstr "" msgstr ""
...@@ -12946,9 +12940,6 @@ msgstr "" ...@@ -12946,9 +12940,6 @@ msgstr ""
msgid "Environments|Stopping %{environmentName}" msgid "Environments|Stopping %{environmentName}"
msgstr "" msgstr ""
msgid "Environments|Take the survey"
msgstr ""
msgid "Environments|There was an error fetching the logs. Please try again." msgid "Environments|There was an error fetching the logs. Please try again."
msgstr "" msgstr ""
...@@ -12970,9 +12961,6 @@ msgstr "" ...@@ -12970,9 +12961,6 @@ msgstr ""
msgid "Environments|You don't have any environments right now" msgid "Environments|You don't have any environments right now"
msgstr "" msgstr ""
msgid "Environments|Your feedback helps GitLab make environments better for you and other users. Participate and enter a sweepstake to win a USD 30 gift card."
msgstr ""
msgid "Environments|by %{avatar}" msgid "Environments|by %{avatar}"
msgstr "" msgstr ""
......
import { GlTabs, GlAlert } from '@gitlab/ui'; import { GlTabs } from '@gitlab/ui';
import { mount, shallowMount } from '@vue/test-utils'; import { mount, shallowMount } from '@vue/test-utils';
import MockAdapter from 'axios-mock-adapter'; import MockAdapter from 'axios-mock-adapter';
import { extendedWrapper } from 'helpers/vue_test_utils_helper'; import { extendedWrapper } from 'helpers/vue_test_utils_helper';
...@@ -7,9 +7,7 @@ import DeployBoard from '~/environments/components/deploy_board.vue'; ...@@ -7,9 +7,7 @@ import DeployBoard from '~/environments/components/deploy_board.vue';
import EmptyState from '~/environments/components/empty_state.vue'; import EmptyState from '~/environments/components/empty_state.vue';
import EnableReviewAppModal from '~/environments/components/enable_review_app_modal.vue'; import EnableReviewAppModal from '~/environments/components/enable_review_app_modal.vue';
import EnvironmentsApp from '~/environments/components/environments_app.vue'; import EnvironmentsApp from '~/environments/components/environments_app.vue';
import { ENVIRONMENTS_SURVEY_DISMISSED_COOKIE_NAME } from '~/environments/constants';
import axios from '~/lib/utils/axios_utils'; import axios from '~/lib/utils/axios_utils';
import { setCookie, getCookie, removeCookie } from '~/lib/utils/common_utils';
import * as urlUtils from '~/lib/utils/url_utility'; import * as urlUtils from '~/lib/utils/url_utility';
import { environment, folder } from './mock_data'; import { environment, folder } from './mock_data';
...@@ -49,7 +47,6 @@ describe('Environment', () => { ...@@ -49,7 +47,6 @@ describe('Environment', () => {
const findNewEnvironmentButton = () => wrapper.findByTestId('new-environment'); const findNewEnvironmentButton = () => wrapper.findByTestId('new-environment');
const findEnvironmentsTabAvailable = () => wrapper.find('.js-environments-tab-available > a'); const findEnvironmentsTabAvailable = () => wrapper.find('.js-environments-tab-available > a');
const findEnvironmentsTabStopped = () => wrapper.find('.js-environments-tab-stopped > a'); const findEnvironmentsTabStopped = () => wrapper.find('.js-environments-tab-stopped > a');
const findSurveyAlert = () => wrapper.find(GlAlert);
beforeEach(() => { beforeEach(() => {
mock = new MockAdapter(axios); mock = new MockAdapter(axios);
...@@ -282,49 +279,4 @@ describe('Environment', () => { ...@@ -282,49 +279,4 @@ describe('Environment', () => {
expect(wrapper.findComponent(GlTabs).attributes('value')).toBe('1'); expect(wrapper.findComponent(GlTabs).attributes('value')).toBe('1');
}); });
}); });
describe('survey alert', () => {
beforeEach(async () => {
mockRequest(200, { environments: [] });
await createWrapper(true);
});
afterEach(() => {
removeCookie(ENVIRONMENTS_SURVEY_DISMISSED_COOKIE_NAME);
});
describe('when the user has not dismissed the alert', () => {
it('shows the alert', () => {
expect(findSurveyAlert().exists()).toBe(true);
});
describe('when the user dismisses the alert', () => {
beforeEach(() => {
findSurveyAlert().vm.$emit('dismiss');
});
it('hides the alert', () => {
expect(findSurveyAlert().exists()).toBe(false);
});
it('persists the dismisal using a cookie', () => {
const cookieValue = getCookie(ENVIRONMENTS_SURVEY_DISMISSED_COOKIE_NAME);
expect(cookieValue).toBe('true');
});
});
});
describe('when the user has previously dismissed the alert', () => {
beforeEach(async () => {
setCookie(ENVIRONMENTS_SURVEY_DISMISSED_COOKIE_NAME, 'true');
await createWrapper(true);
});
it('does not show the alert', () => {
expect(findSurveyAlert().exists()).toBe(false);
});
});
});
}); });
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