-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Uptime] Fix "last updated" field #28720
[Uptime] Fix "last updated" field #28720
Conversation
Pinging @elastic/uptime |
💚 Build Succeeded |
💚 Build Succeeded |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
</EuiPanel> | ||
<StatusBar |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So much cleaner :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On second thought these need aria labels.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
💚 Build Succeeded |
* Update MonitorStatusBar to not reference undefined value. * Add sort to top_hits aggregation. * Add default and loading state for status bar. * Change bool check. * Add aria-labels for monitor status bar.
* [Uptime] Fix "last updated" field (#28720) * Update MonitorStatusBar to not reference undefined value. * Add sort to top_hits aggregation. * Add default and loading state for status bar. * Change bool check. * Add aria-labels for monitor status bar. * Update expected test result Fix test because of significant digit limitations. * Remove unused code. * Fix bug.
Summary
In #28090 we specified that the
Last update
field on the Monitors Page does not display values consistent with the time since the last update when a monitor is stopped. This happened for a number of reasons.Firstly - when Apollo Query objects receive the same data, by default it gets cached. Also, we weren't sorting the top hits value to ensure the latest doc would always be returned. To top it off - the component was referencing a key on the query result that is always
undefined
! To help prevent this from happening in the future I added a reference to the GQL type expected by the query object.In addition to fixing these problems, I also extracted a large portion of this query component into a functional component. I provided a default/loading state for it as well.
Before:

The above image was captured 13 minutes after the last check was received.
After:

Testing this PR
To test this PR: