Skip to content
Snippets Groups Projects
Unverified Commit 935f9593 authored by Ezekiel Kigbo's avatar Ezekiel Kigbo Committed by GitLab
Browse files

Merge branch '497751-remove-incubation-alert-component' into 'master'

Remove no longer used incubation alert component

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169389



Merged-by: default avatarEzekiel Kigbo <3397881-ekigbo@users.noreply.gitlab.com>
Approved-by: default avatarEduardo Bonet <ebonet@gitlab.com>
Co-authored-by: default avatarEzekiel Kigbo <ekigbo@gitlab.com>
parents e38311e3 68ecb0dc
No related branches found
No related tags found
No related merge requests found
<script>
import { GlAlert } from '@gitlab/ui';
import { s__, sprintf } from '~/locale';
import PromoPageLink from '~/vue_shared/components/promo_page_link/promo_page_link.vue';
export default {
name: 'IncubationAlert',
components: { GlAlert, PromoPageLink },
props: {
featureName: {
type: String,
required: true,
},
linkToFeedbackIssue: {
type: String,
required: true,
},
},
data() {
return {
isAlertDismissed: false,
};
},
computed: {
shouldShowAlert() {
return !this.isAlertDismissed;
},
titleLabel() {
return sprintf(this.$options.i18n.titleLabel, { featureName: this.featureName });
},
},
methods: {
dismissAlert() {
this.isAlertDismissed = true;
},
},
i18n: {
titleLabel: s__('Incubation|%{featureName} is in incubating phase'),
contentLabel: s__(
'Incubation|GitLab incubates features to explore new use cases. These features are updated regularly, and support is limited.',
),
learnMoreLabel: s__('Incubation|Learn more about incubating features'),
feedbackLabel: s__('Incubation|Give feedback on this feature'),
},
learnMorePath: '/handbook/engineering/incubation/',
};
</script>
<template>
<gl-alert
v-if="shouldShowAlert"
:title="titleLabel"
variant="warning"
:primary-button-text="$options.i18n.feedbackLabel"
:primary-button-link="linkToFeedbackIssue"
@dismiss="dismissAlert"
>
{{ $options.i18n.contentLabel }}
<promo-page-link :path="$options.learnMorePath" target="_blank">
{{ $options.i18n.learnMoreLabel }}
</promo-page-link>
</gl-alert>
</template>
Loading
Loading
@@ -28872,18 +28872,6 @@ msgstr ""
msgid "Increment suggestion line start"
msgstr ""
 
msgid "Incubation|%{featureName} is in incubating phase"
msgstr ""
msgid "Incubation|GitLab incubates features to explore new use cases. These features are updated regularly, and support is limited."
msgstr ""
msgid "Incubation|Give feedback on this feature"
msgstr ""
msgid "Incubation|Learn more about incubating features"
msgstr ""
msgid "Indent line"
msgstr ""
 
import { mount } from '@vue/test-utils';
import { GlAlert, GlButton } from '@gitlab/ui';
import IncubationAlert from '~/vue_shared/components/incubation/incubation_alert.vue';
describe('IncubationAlert', () => {
let wrapper;
const findAlert = () => wrapper.findComponent(GlAlert);
const findButton = () => wrapper.findComponent(GlButton);
beforeEach(() => {
wrapper = mount(IncubationAlert, {
propsData: {
featureName: 'some feature',
linkToFeedbackIssue: 'some_link',
},
});
});
it('displays the feature name in the title', () => {
expect(wrapper.html()).toContain('some feature is in incubating phase');
});
it('displays link to issue', () => {
expect(findButton().attributes().href).toBe('some_link');
});
it('is removed if dismissed', async () => {
await wrapper.find('[aria-label="Dismiss"]').trigger('click');
expect(findAlert().exists()).toBe(false);
});
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment