diff options
Diffstat (limited to 'app/assets/javascripts/ci/pipeline_schedules/components/pipeline_schedules.vue')
-rw-r--r-- | app/assets/javascripts/ci/pipeline_schedules/components/pipeline_schedules.vue | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/app/assets/javascripts/ci/pipeline_schedules/components/pipeline_schedules.vue b/app/assets/javascripts/ci/pipeline_schedules/components/pipeline_schedules.vue index 0700d9e5439..c993b65f6c0 100644 --- a/app/assets/javascripts/ci/pipeline_schedules/components/pipeline_schedules.vue +++ b/app/assets/javascripts/ci/pipeline_schedules/components/pipeline_schedules.vue @@ -94,6 +94,7 @@ export default { return { schedules: { list: [], + currentUser: {}, }, scope, hasError: false, @@ -135,6 +136,14 @@ export default { }, ]; }, + onAllTab() { + // scope is undefined on first load, scope is only defined + // after tab switching + return this.scope === ALL_SCOPE || !this.scope; + }, + showEmptyState() { + return !this.isLoading && this.schedulesCount === 0 && this.onAllTab; + }, }, watch: { // this watcher ensures that the count on the all tab @@ -258,8 +267,10 @@ export default { </gl-sprintf> </gl-alert> + <pipeline-schedule-empty-state v-if="showEmptyState" /> + <gl-tabs - v-if="isLoading || schedulesCount > 0" + v-else sync-active-tab-with-query-params query-param-name="scope" nav-class="gl-flex-grow-1 gl-align-items-center gl-mt-2" @@ -284,6 +295,7 @@ export default { </template> <gl-loading-icon v-if="isLoading" size="lg" /> + <pipeline-schedules-table v-else :schedules="schedules.list" @@ -306,8 +318,6 @@ export default { </template> </gl-tabs> - <pipeline-schedule-empty-state v-else-if="!isLoading && schedulesCount === 0" /> - <take-ownership-modal :visible="showTakeOwnershipModal" @takeOwnership="takeOwnership" |