Commit da6af70a authored by Filipa Lacerda's avatar Filipa Lacerda

Changes after review

parent f0c4fbea
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
shouldRenderContent() { shouldRenderContent() {
return !this.isLoading && Object.keys(this.job).length; return !this.isLoading && Object.keys(this.job).length;
}, },
wasTriggered() { jobStarted() {
return this.job.started; return this.job.started;
}, },
}, },
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
:user="job.user" :user="job.user"
:actions="actions" :actions="actions"
:has-sidebar-button="true" :has-sidebar-button="true"
:triggered="wasTriggered" :should-render-triggered-label="jobStarted"
/> />
<loading-icon <loading-icon
v-if="isLoading" v-if="isLoading"
......
...@@ -45,7 +45,7 @@ export default { ...@@ -45,7 +45,7 @@ export default {
required: false, required: false,
default: false, default: false,
}, },
triggered: { shouldRenderTriggeredLabel: {
type: Boolean, type: Boolean,
required: false, required: false,
default: true, default: true,
...@@ -87,7 +87,7 @@ export default { ...@@ -87,7 +87,7 @@ export default {
{{itemName}} #{{itemId}} {{itemName}} #{{itemId}}
</strong> </strong>
<template v-if="triggered"> <template v-if="shouldRenderTriggeredLabel">
triggered triggered
</template> </template>
<template v-else> <template v-else>
......
- illustration = locals.fetch(:illustration)
- illustration_size = locals.fetch(:illustration_size)
- title = locals.fetch(:title)
- content = locals.fetch(:content)
- action = locals.fetch(:action)
.row.empty-state
.col-xs-12
.svg-content{ class: illustration_size }
= image_tag illustration
.col-xs-12
.text-content
%h4.text-center= title
%p= content
- if action?
.text-center
= action
...@@ -88,22 +88,19 @@ ...@@ -88,22 +88,19 @@
%pre.build-trace#build-trace %pre.build-trace#build-trace
%code.bash.js-build-output %code.bash.js-build-output
.build-loader-animation.js-build-refresh .build-loader-animation.js-build-refresh
- elsif @build.playable?
= render 'empty_state',
illustration: 'illustrations/manual_action.svg',
illustration_size: 'svg-394',
title: _('This job requires a manual action'),
content: _('This job depends on a user to trigger its process. Often they are used to deploy code to production environments.'),
action: ( link_to _('Trigger this manual action'), play_project_job_path(@project, @build), class: 'btn btn-primary', title: _('Trigger this manual action') )
- else - else
- illustration = @build.playable? ? 'illustrations/manual_action.svg' : 'illustrations/job_not_triggered.svg' = render 'empty_state',
- illustration_size = @build.playable? ? 'svg-394' : 'svg-306' illustration: 'illustrations/job_not_triggered.svg',
- title = @build.playable? ? _('This job requires a manual action') : _('This job has not been triggered yet') illustration_size: 'svg-306',
- content = @build.playable? ? _('This job depends on a user to trigger its process. Often they are used to deploy code to production environments.') : _('This job depends on upstream jobs that need to succeed in order for this job to be triggered.') title: _('This job has not been triggered yet'),
.row.empty-state content: _('This job has not been triggered yet')
.col-xs-12
.svg-content{ class: illustration_size }
= image_tag illustration
.col-xs-12
.text-content
%h4.text-center= title
%p= content
- if @build.playable?
.text-center
= link_to _('Trigger this manual action'), play_project_job_path(@project, @build), class: 'btn btn-primary', title: _('Trigger this manual action')
= render "sidebar" = render "sidebar"
......
...@@ -98,9 +98,9 @@ describe('Header CI Component', () => { ...@@ -98,9 +98,9 @@ describe('Header CI Component', () => {
}); });
}); });
describe('triggered', () => { describe('shouldRenderTriggeredLabel', () => {
it('should rendered created keyword when the triggered is false', () => { it('should rendered created keyword when the shouldRenderTriggeredLabel is false', () => {
vm = mountComponent(HeaderCi, { ...props, triggered: false }); vm = mountComponent(HeaderCi, { ...props, shouldRenderTriggeredLabel: false });
expect(vm.$el.textContent).toContain('created'); expect(vm.$el.textContent).toContain('created');
expect(vm.$el.textContent).not.toContain('triggered'); expect(vm.$el.textContent).not.toContain('triggered');
......
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