summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/commit/pipelines/pipelines_table.js
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2017-03-20 15:36:02 +0000
committerFilipa Lacerda <filipa@gitlab.com>2017-03-20 16:16:19 +0000
commit446b59dd4ee88f8ef86272c39408560a0107c48a (patch)
treedc6eef4b89111775dd4176f6db08fd95af57c293 /app/assets/javascripts/commit/pipelines/pipelines_table.js
parent2c85a20482c2e33f307ad8faf60e41e199aa25b8 (diff)
downloadgitlab-ce-446b59dd4ee88f8ef86272c39408560a0107c48a.tar.gz
Adds tests to new empty and error states
Diffstat (limited to 'app/assets/javascripts/commit/pipelines/pipelines_table.js')
-rw-r--r--app/assets/javascripts/commit/pipelines/pipelines_table.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/assets/javascripts/commit/pipelines/pipelines_table.js b/app/assets/javascripts/commit/pipelines/pipelines_table.js
index 29ee3e5e67b..189dd2c7dce 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 EmptyState from '../../vue_pipelines_index/components/empty_state';
import ErrorState from '../../vue_pipelines_index/components/error_state';
import '../../lib/utils/common_utils';
import '../../vue_shared/vue_resource_interceptor';
@@ -24,6 +25,7 @@ export default Vue.component('pipelines-table', {
components: {
'pipelines-table-component': PipelinesTableComponent,
'error-state': ErrorState,
+ 'empty-state': EmptyState,
},
/**
@@ -38,6 +40,7 @@ export default Vue.component('pipelines-table', {
return {
endpoint: pipelinesTableData.endpoint,
+ helpPagePath: pipelinesTableData.helpPagePath,
store,
state: store.state,
isLoading: false,
@@ -49,6 +52,10 @@ export default Vue.component('pipelines-table', {
shouldRenderErrorState() {
return this.hasError && !this.pageRequest;
},
+
+ shouldRenderEmptyState() {
+ return !this.state.pipelines.length && !this.pageRequest;
+ },
},
/**
@@ -102,6 +109,8 @@ export default Vue.component('pipelines-table', {
<i class="fa fa-spinner fa-spin"></i>
</div>
+ <empty-state v-if="shouldRenderEmptyState" :helpPagePath="helpPagePath" />
+
<error-state v-if="shouldRenderErrorState" />
<div class="table-holder pipelines"