Commit aacdc35d authored by Paul Slaughter's avatar Paul Slaughter Committed by Phil Hughes

Add empty and disabled web terminal tab

parent bd0ecc71
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
@import 'bootstrap_migration'; @import 'bootstrap_migration';
@import 'framework/layout'; @import 'framework/layout';
@import 'framework/alerts';
@import 'framework/animations'; @import 'framework/animations';
@import 'framework/vue_transitions'; @import 'framework/vue_transitions';
@import 'framework/avatar'; @import 'framework/avatar';
......
.alert-tip {
background-color: $theme-gray-100;
color: $theme-gray-900;
}
<script> <script>
import { __ } from '~/locale';
import RightPane from '~/ide/components/panes/right.vue'; import RightPane from '~/ide/components/panes/right.vue';
import TerminalView from '../terminal/view.vue';
export default { export default {
name: 'EERightPane', name: 'EERightPane',
components: { components: {
RightPane, RightPane,
}, },
data() {
return {
// this will come from Vuex store in https://gitlab.com/gitlab-org/gitlab-ee/issues/5426
isTerminalEnabled: false,
};
},
computed: { computed: {
extensionTabs() { extensionTabs() {
// This is empty for now, but it will be used in: https://gitlab.com/gitlab-org/gitlab-ee/issues/5426 return [
return []; {
show: this.isTerminalEnabled,
title: __('Terminal'),
views: [{ name: 'terminal', keepAlive: true, component: TerminalView }],
icon: 'terminal',
},
];
}, },
}, },
}; };
......
<script>
export default {
props: {
illustrationPath: {
type: String,
required: false,
default: '',
},
},
};
</script>
<template>
<div class="text-center">
<div v-if="illustrationPath" class="svg-content svg-130"><img :src="illustrationPath" /></div>
<h4>{{ __('Web Terminal') }}</h4>
<p>{{ __('Run tests against your code live using the Web Terminal') }}</p>
<div class="bs-callout text-left">The Web Terminal is coming soon. Stay tuned!</div>
</div>
</template>
<script>
import { mapState } from 'vuex';
import EmptyState from './empty_state.vue';
export default {
components: {
EmptyState,
},
computed: {
...mapState(['emptyStateSvgPath']),
},
};
</script>
<template>
<div class="h-100">
<div class="h-100 d-flex flex-column justify-content-center">
<empty-state :illustration-path="emptyStateSvgPath" />
</div>
</div>
</template>
import { shallowMount, createLocalVue } from '@vue/test-utils';
import { TEST_HOST } from 'spec/test_constants';
import TerminalEmptyState from 'ee/ide/components/terminal/empty_state.vue';
const TEST_PATH = `${TEST_HOST}/home.png`;
describe('TerminalEmptyState', () => {
const factory = (options = {}) => {
const localVue = createLocalVue();
return shallowMount(TerminalEmptyState, {
localVue,
...options,
});
};
it('does not show illustration, if no path specified', () => {
const wrapper = factory();
expect(wrapper.find('.svg-content').exists()).toBe(false);
});
it('shows illustration with path', () => {
const wrapper = factory({
propsData: {
illustrationPath: TEST_PATH,
},
});
const img = wrapper.find('.svg-content img');
expect(img.exists()).toBe(true);
expect(img.attributes('src')).toEqual(TEST_PATH);
});
});
import { shallowMount, createLocalVue } from '@vue/test-utils';
import Vuex from 'vuex';
import { TEST_HOST } from 'spec/test_constants';
import TerminalView from 'ee/ide/components/terminal/view.vue';
import TerminalEmptyState from 'ee/ide/components/terminal/empty_state.vue';
const TEST_SVG_PATH = `${TEST_HOST}/illustration.svg`;
const localVue = createLocalVue();
localVue.use(Vuex);
describe('TerminalView', () => {
const factory = () => {
const store = new Vuex.Store({
state: {
emptyStateSvgPath: TEST_SVG_PATH,
},
});
return shallowMount(TerminalView, { localVue, store });
};
it('renders empty state', () => {
const wrapper = factory();
expect(wrapper.find(TerminalEmptyState).props()).toEqual({
illustrationPath: TEST_SVG_PATH,
});
});
});
...@@ -7226,6 +7226,9 @@ msgstr "" ...@@ -7226,6 +7226,9 @@ msgstr ""
msgid "Run CI/CD pipelines for external repositories" msgid "Run CI/CD pipelines for external repositories"
msgstr "" msgstr ""
msgid "Run tests against your code live using the Web Terminal"
msgstr ""
msgid "Run untagged jobs" msgid "Run untagged jobs"
msgstr "" msgstr ""
...@@ -8202,6 +8205,9 @@ msgstr "" ...@@ -8202,6 +8205,9 @@ msgstr ""
msgid "Templates" msgid "Templates"
msgstr "" msgstr ""
msgid "Terminal"
msgstr ""
msgid "Terminal for environment" msgid "Terminal for environment"
msgstr "" msgstr ""
...@@ -9316,6 +9322,9 @@ msgstr "" ...@@ -9316,6 +9322,9 @@ msgstr ""
msgid "Web IDE" msgid "Web IDE"
msgstr "" msgstr ""
msgid "Web Terminal"
msgstr ""
msgid "Web terminal" msgid "Web terminal"
msgstr "" msgstr ""
......
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