summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/commit
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2017-03-17 23:07:37 +0000
committerFilipa Lacerda <filipa@gitlab.com>2017-03-17 23:07:37 +0000
commit9d1ab1e9bd474e467c75cf7a1f7b728d6832075c (patch)
treea8e052d65088d92c8dac1b96d16bf425689d51dc /app/assets/javascripts/commit
parent016602099b83dd23160748907d0dde08188c269f (diff)
downloadgitlab-ce-9d1ab1e9bd474e467c75cf7a1f7b728d6832075c.tar.gz
Add error state to commits and merge requests pipelines table
Diffstat (limited to 'app/assets/javascripts/commit')
-rw-r--r--app/assets/javascripts/commit/pipelines/pipelines_table.js17
1 files changed, 11 insertions, 6 deletions
diff --git a/app/assets/javascripts/commit/pipelines/pipelines_table.js b/app/assets/javascripts/commit/pipelines/pipelines_table.js
index 832c4b1bd2a..29ee3e5e67b 100644
--- a/app/assets/javascripts/commit/pipelines/pipelines_table.js
+++ b/app/assets/javascripts/commit/pipelines/pipelines_table.js
@@ -5,6 +5,7 @@ import PipelinesTableComponent from '../../vue_shared/components/pipelines_table
import PipelinesService from '../../vue_pipelines_index/services/pipelines_service';
import PipelineStore from '../../vue_pipelines_index/stores/pipelines_store';
import eventHub from '../../vue_pipelines_index/event_hub';
+import ErrorState from '../../vue_pipelines_index/components/error_state';
import '../../lib/utils/common_utils';
import '../../vue_shared/vue_resource_interceptor';
@@ -22,6 +23,7 @@ import '../../vue_shared/vue_resource_interceptor';
export default Vue.component('pipelines-table', {
components: {
'pipelines-table-component': PipelinesTableComponent,
+ 'error-state': ErrorState,
},
/**
@@ -39,9 +41,16 @@ export default Vue.component('pipelines-table', {
store,
state: store.state,
isLoading: false,
+ hasError: false,
};
},
+ computed: {
+ shouldRenderErrorState() {
+ return this.hasError && !this.pageRequest;
+ },
+ },
+
/**
* When the component is about to be mounted, tell the service to fetch the data
*
@@ -80,6 +89,7 @@ export default Vue.component('pipelines-table', {
this.isLoading = false;
})
.catch(() => {
+ this.hasError = true;
this.isLoading = false;
new Flash('An error occurred while fetching the pipelines, please reload the page again.');
});
@@ -92,12 +102,7 @@ export default Vue.component('pipelines-table', {
<i class="fa fa-spinner fa-spin"></i>
</div>
- <div class="blank-state blank-state-no-icon"
- v-if="!isLoading && state.pipelines.length === 0">
- <h2 class="blank-state-title js-blank-state-title">
- No pipelines to show
- </h2>
- </div>
+ <error-state v-if="shouldRenderErrorState" />
<div class="table-holder pipelines"
v-if="!isLoading && state.pipelines.length > 0">