Commit fa2054d4 authored by Jose Ivan Vargas's avatar Jose Ivan Vargas

Merge branch 'migrate-terminal-alert' into 'master'

Update terminal empty state alert to gl component

See merge request gitlab-org/gitlab!47340
parents dac4364e 24b5e290
<script> <script>
/* eslint-disable vue/no-v-html */ import { GlLoadingIcon, GlButton, GlAlert, GlSafeHtmlDirective } from '@gitlab/ui';
import { GlLoadingIcon, GlButton } from '@gitlab/ui';
export default { export default {
components: { components: {
GlLoadingIcon, GlLoadingIcon,
GlButton, GlButton,
GlAlert,
},
directives: {
SafeHtml: GlSafeHtmlDirective,
}, },
props: { props: {
isLoading: { isLoading: {
...@@ -59,7 +62,9 @@ export default { ...@@ -59,7 +62,9 @@ export default {
{{ __('Start Web Terminal') }} {{ __('Start Web Terminal') }}
</gl-button> </gl-button>
</p> </p>
<div v-if="!isValid && message" class="bs-callout gl-text-left" v-html="message"></div> <gl-alert v-if="!isValid && message" variant="tip" :dismissible="false">
<span v-safe-html="message"></span>
</gl-alert>
<p v-else> <p v-else>
<a <a
v-if="helpPath" v-if="helpPath"
......
---
title: Update terminal empty state alert to gl component
merge_request: 47340
author:
type: other
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import { GlLoadingIcon, GlButton } from '@gitlab/ui'; import { GlLoadingIcon, GlButton, GlAlert } from '@gitlab/ui';
import { TEST_HOST } from 'spec/test_constants'; import { TEST_HOST } from 'spec/test_constants';
import TerminalEmptyState from '~/ide/components/terminal/empty_state.vue'; import TerminalEmptyState from '~/ide/components/terminal/empty_state.vue';
...@@ -101,6 +101,6 @@ describe('IDE TerminalEmptyState', () => { ...@@ -101,6 +101,6 @@ describe('IDE TerminalEmptyState', () => {
}); });
expect(wrapper.find(GlButton).props('disabled')).toBe(true); expect(wrapper.find(GlButton).props('disabled')).toBe(true);
expect(wrapper.find('.bs-callout').element.innerHTML).toBe(TEST_HTML_MESSAGE); expect(wrapper.find(GlAlert).html()).toContain(TEST_HTML_MESSAGE);
}); });
}); });
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