From 2ded26f622b56fc42ea986325bf8a28d98adfdc0 Mon Sep 17 00:00:00 2001 From: Filipa Lacerda Date: Thu, 20 Apr 2017 19:36:45 +0100 Subject: Guarantee only one state is shown at a time --- .../commit/pipelines/pipelines_table.js | 23 +++++++++++++++++----- .../pipelines/components/empty_state.vue | 2 +- .../javascripts/commit/pipelines/pipelines_spec.js | 7 ++++++- 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/app/assets/javascripts/commit/pipelines/pipelines_table.js b/app/assets/javascripts/commit/pipelines/pipelines_table.js index 7438faeadf4..68a1c1de1df 100644 --- a/app/assets/javascripts/commit/pipelines/pipelines_table.js +++ b/app/assets/javascripts/commit/pipelines/pipelines_table.js @@ -55,7 +55,15 @@ export default Vue.component('pipelines-table', { }, shouldRenderEmptyState() { - return !this.state.pipelines.length && !this.isLoading; + return !this.state.pipelines.length && + !this.isLoading && + !this.hasError; + }, + + shouldRenderTable() { + return !this.isLoading && + this.state.pipelines.length > 0 && + !this.hasError; }, }, @@ -145,8 +153,12 @@ export default Vue.component('pipelines-table', { template: `
-
- +
+