-
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
[App Search] API Logs: Add ApiLogsTable and NewApiEventsPrompt components #96008
Conversation
<EuiPageContent hasBorder> | ||
<EuiPageContentBody> | ||
<EuiFlexGroup gutterSize="m" alignItems="center" responsive={false} wrap> |
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.
Everything inside here is mostly the same as before, I just added EuipageContent
and EuiPageContentBody
wrappers - I recommend viewing with hidden whitespace changes for easier diffing
@@ -0,0 +1,3 @@ | |||
.apiLogDetailButton { | |||
height: $euiSizeL !important; |
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.
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.
If it were me, I'd say just let EUI do it's thing. However, if there's something unique about this table that is forcing the rows to be taller than usual, then I'd say this is a worthwhile change.
It's up to you though. Is it worthwhile to drop a comment in the CSS about why you have added that or nah?
To be clear, I'm good either way, I'll approve it regardless.
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.
The first screenshot more closely matches the row heights in all their examples in their docs. The main difference is that their buttons are all icon buttons and not empty buttons 🤷 It does seem odd that EUI wouldn't have any affordance OOTB for EuiEmptyButton matching the same line height as an EuiLink.
A comment makes a ton of sense! I'll add one here in a bit.
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.
padding: $euiSizeXS; | ||
padding-left: $euiSizeS; |
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.
FYI: without this custom padding, the height of the panel exceeds the height of the row height and causes the page to bounce around awkwardly, so I added it as a polish item
export const getStatusColor = (status: number) => { | ||
let color = ''; | ||
if (status >= 100 && status < 300) color = 'secondary'; | ||
if (status >= 300 && status < 400) color = 'primary'; | ||
if (status >= 400 && status < 500) color = 'warning'; | ||
if (status >= 500) color = 'danger'; | ||
return color; | ||
}; |
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.
I basically just copied this util over as-is from the standalone UI. Def. open to thoughts or suggestions if you have any changes you'd like to see
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.
Fine with me
...rise_search/public/applications/app_search/components/api_logs/components/api_logs_table.tsx
Show resolved
Hide resolved
@elasticmachine merge upstream |
+ add EuiPageContent wrapper (missed this originally)
} | ||
> | ||
TODO: API Logs Table | ||
{/* <ApiLogsTable hidePagination={true} /> */} | ||
<ApiLogsTable /> |
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.
It's really cool that we were able to reuse this in both places.
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, but I think it would be worthwhile to consider switching your test to mock FormattedRelative to avoid those console warnings.
wrapper.find('[data-test-subj="ApiLogsTableDetailsButton"]').first().simulate('click'); | ||
// TODO: API log details flyout |
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 it looks like you intend to test the flyout opening in the primary renders
test?
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.
Oops, just realized I forgot to respond to this - sorry Jason! Yeah the tables are a bit weird testing-wise and mount is a somewhat-expensive render so I figured just throw it in the main test. I can move it out though if we prefer
export const getStatusColor = (status: number) => { | ||
let color = ''; | ||
if (status >= 100 && status < 300) color = 'secondary'; | ||
if (status >= 300 && status < 400) color = 'primary'; | ||
if (status >= 400 && status < 500) color = 'warning'; | ||
if (status >= 500) color = 'danger'; | ||
return color; | ||
}; |
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.
Fine with me
...search/public/applications/app_search/components/api_logs/components/api_logs_table.test.tsx
Outdated
Show resolved
Hide resolved
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.
Great work Constance!
…ents (elastic#96008) * Set up getStatusColor util for upcoming EuiHealth components * Add ApiLogsTable component * Add NewApiEventsPrompt component * Update ApiLogs view with new components + add EuiPageContent wrapper (missed this originally) * Update EngineOverview with new components * PR feedback: Comments + mock FormattedRelative * Fix type error
…ents (#96008) (#96127) * Set up getStatusColor util for upcoming EuiHealth components * Add ApiLogsTable component * Add NewApiEventsPrompt component * Update ApiLogs view with new components + add EuiPageContent wrapper (missed this originally) * Update EngineOverview with new components * PR feedback: Comments + mock FormattedRelative * Fix type error Co-authored-by: Constance <[email protected]>
💔 Build Failed
Failed CI Steps
Test FailuresKibana Pipeline / general / Chrome X-Pack UI Functional Tests.x-pack/test/functional/apps/maps.maps app "before all" hook in "maps app"Standard Out
Stack Trace
Kibana Pipeline / general / Chrome X-Pack UI Functional Tests.x-pack/test/functional/apps/discover/feature_controls/discover_security·ts.discover feature controls discover feature controls security "before all" hook in "discover feature controls security"Standard Out
Stack Trace
Kibana Pipeline / general / Chrome X-Pack UI Functional Tests.x-pack/test/functional/apps/discover/feature_controls/discover_security·ts.discover feature controls discover feature controls security "after all" hook in "discover feature controls security"Standard Out
Stack Trace
and 16 more failures, only showing the first 3. Metrics [docs]
History
To update your PR or re-run it, just comment with: |
lmfao what??? |
Summary
Second-to-last PR in the series. The next one adds the "Details" view functionality.
Screencaps
Engine Overview:
QA
Checklist