summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2018-11-14 11:17:10 -0500
committerFilipa Lacerda <filipa@gitlab.com>2018-11-14 11:38:53 -0500
commitf2479e1987304fc7064de4b1f5e72320f958edd7 (patch)
tree175013f44779b90b5d8ae121752d5d3c7891ea90
parent63b4b4b2688fa4f068772026536b2250bce39070 (diff)
downloadgitlab-ce-54021-empty-button.tar.gz
Prevents empty button in jobs empty state54021-empty-button
Returns `null` instead of an empty object to make sure Vue doesn't render the button
-rw-r--r--app/assets/javascripts/jobs/store/getters.js2
-rw-r--r--changelogs/unreleased/54021-empty-button.yml5
-rw-r--r--spec/javascripts/jobs/components/empty_state_spec.js1
3 files changed, 7 insertions, 1 deletions
diff --git a/app/assets/javascripts/jobs/store/getters.js b/app/assets/javascripts/jobs/store/getters.js
index d440b2c9ef1..35e92b0b5d9 100644
--- a/app/assets/javascripts/jobs/store/getters.js
+++ b/app/assets/javascripts/jobs/store/getters.js
@@ -42,7 +42,7 @@ export const emptyStateIllustration = state =>
(state.job && state.job.status && state.job.status.illustration) || {};
export const emptyStateAction = state =>
- (state.job && state.job.status && state.job.status.action) || {};
+ (state.job && state.job.status && state.job.status.action) || null;
export const isScrollingDown = state => isScrolledToBottom() && !state.isTraceComplete;
diff --git a/changelogs/unreleased/54021-empty-button.yml b/changelogs/unreleased/54021-empty-button.yml
new file mode 100644
index 00000000000..3b03665cf95
--- /dev/null
+++ b/changelogs/unreleased/54021-empty-button.yml
@@ -0,0 +1,5 @@
+---
+title: Prevent empty button being rendered in empty state
+merge_request:
+author:
+type: fixed
diff --git a/spec/javascripts/jobs/components/empty_state_spec.js b/spec/javascripts/jobs/components/empty_state_spec.js
index 0a39709221c..a2df79bdda0 100644
--- a/spec/javascripts/jobs/components/empty_state_spec.js
+++ b/spec/javascripts/jobs/components/empty_state_spec.js
@@ -84,6 +84,7 @@ describe('Empty State', () => {
vm = mountComponent(Component, {
...props,
content,
+ action: null,
});
expect(vm.$el.querySelector('.js-job-empty-state-action')).toBeNull();