From 6886edf033f422131246e878ae82aea48932200c Mon Sep 17 00:00:00 2001 From: Phil Renaud Date: Wed, 15 May 2024 13:57:48 -0400 Subject: [PATCH] Makes it so an empty state query blocks and changes the style to be more Nomadic (#20588) --- ui/app/adapters/job.js | 7 ++++++- ui/app/styles/components/empty-message.scss | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ui/app/adapters/job.js b/ui/app/adapters/job.js index 076603b11227..fbf87f234cd2 100644 --- a/ui/app/adapters/job.js +++ b/ui/app/adapters/job.js @@ -246,7 +246,12 @@ export default class JobAdapter extends WatchableNamespaceIDs { result.meta.nextToken = headers['x-nomad-nexttoken']; } if (headers['x-nomad-index']) { - result.meta.index = headers['x-nomad-index']; + // Query won't block if the index is 0 (see also watch-list.getIndexFor for prior art) + if (headers['x-nomad-index'] === '0') { + result.meta.index = 1; + } else { + result.meta.index = headers['x-nomad-index']; + } } } return result; diff --git a/ui/app/styles/components/empty-message.scss b/ui/app/styles/components/empty-message.scss index 02908fcc7faa..1f46ce93a583 100644 --- a/ui/app/styles/components/empty-message.scss +++ b/ui/app/styles/components/empty-message.scss @@ -3,7 +3,8 @@ * SPDX-License-Identifier: BUSL-1.1 */ -.empty-message { +.empty-message, +.hds-application-state { padding: 1.5rem; background: $white-ter; border-radius: $radius; @@ -48,3 +49,7 @@ } } } + +.section .hds-application-state { + width: 100%; +}