Commit ec37b1b2 authored by Phil Hughes's avatar Phil Hughes

added empty state

parent b9928718
<script> <script>
import { mapActions, mapState } from 'vuex'; import { mapActions, mapState } from 'vuex';
import _ from 'underscore'; import _ from 'underscore';
import { __ } from '../../../locale';
import tooltip from '../../../vue_shared/directives/tooltip'; import tooltip from '../../../vue_shared/directives/tooltip';
import Icon from '../../../vue_shared/components/icon.vue'; import Icon from '../../../vue_shared/components/icon.vue';
import ScrollButton from './detail/scroll_button.vue'; import ScrollButton from './detail/scroll_button.vue';
...@@ -33,6 +34,9 @@ export default { ...@@ -33,6 +34,9 @@ export default {
isScrolledToTop() { isScrolledToTop() {
return this.scrollPos === scrollPositions.top; return this.scrollPos === scrollPositions.top;
}, },
jobOutput() {
return this.detailJob.output || __('No messages were logged');
},
}, },
mounted() { mounted() {
this.getTrace(); this.getTrace();
...@@ -119,7 +123,7 @@ export default { ...@@ -119,7 +123,7 @@ export default {
> >
<code <code
class="bash" class="bash"
v-html="detailJob.output" v-html="jobOutput"
> >
</code> </code>
<div <div
......
...@@ -32,6 +32,7 @@ export default { ...@@ -32,6 +32,7 @@ export default {
/> />
<div class="ml-auto align-self-center"> <div class="ml-auto align-self-center">
<button <button
v-if="job.started"
type="button" type="button"
class="btn btn-default btn-sm" class="btn btn-default btn-sm"
@click="clickViewLog" @click="clickViewLog"
......
...@@ -1207,7 +1207,7 @@ ...@@ -1207,7 +1207,7 @@
margin-left: -$gl-padding; margin-left: -$gl-padding;
} }
.top-bar { &.build-page .top-bar {
top: 0; top: 0;
font-size: 12px; font-size: 12px;
border-top-right-radius: $border-radius-default; border-top-right-radius: $border-radius-default;
......
...@@ -47,6 +47,16 @@ describe('IDE jobs detail view', () => { ...@@ -47,6 +47,16 @@ describe('IDE jobs detail view', () => {
expect(vm.$el.querySelector('.bash').textContent).toContain('testing'); expect(vm.$el.querySelector('.bash').textContent).toContain('testing');
}); });
it('renders empty message output', done => {
vm.$store.state.pipelines.detailJob.output = '';
vm.$nextTick(() => {
expect(vm.$el.querySelector('.bash').textContent).toContain('No messages were logged');
done();
});
});
it('renders loading icon', () => { it('renders loading icon', () => {
expect(vm.$el.querySelector('.build-loader-animation')).not.toBe(null); expect(vm.$el.querySelector('.build-loader-animation')).not.toBe(null);
expect(vm.$el.querySelector('.build-loader-animation').style.display).toBe(''); expect(vm.$el.querySelector('.build-loader-animation').style.display).toBe('');
......
...@@ -26,4 +26,14 @@ describe('IDE jobs item', () => { ...@@ -26,4 +26,14 @@ describe('IDE jobs item', () => {
it('renders CI icon', () => { it('renders CI icon', () => {
expect(vm.$el.querySelector('.ic-status_passed_borderless')).not.toBe(null); expect(vm.$el.querySelector('.ic-status_passed_borderless')).not.toBe(null);
}); });
it('does not render view logs button if not started', done => {
vm.job.started = false;
vm.$nextTick(() => {
expect(vm.$el.querySelector('.btn')).toBe(null);
done();
});
});
}); });
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