-
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 log detail flyout #96162
Conversation
closeFlyout(): void; | ||
} | ||
|
||
export const ApiLogLogic = kea<MakeLogicType<ApiLogValues, ApiLogActions>>({ |
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.
Maybe a little extra to split this out from the ApiLogsLogic, but I'm a fan of modularity, and arguably ApiLogsLogic is complicated enough w/ the extra polling business logic to be kept as focused on polling as possible
export const ApiLogHeading: React.FC = ({ children }) => ( | ||
<EuiTitle size="xs"> | ||
<h3>{children}</h3> | ||
</EuiTitle> | ||
); |
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.
This is also probably a little extra but I figured if Davey ever wants to change the size of all the titles at once this would make it easier? lol.
That being said I can get rid of this if people aren't a fan, just let me know
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.
Wouldn't be my style but doesn't offend me
expect(wrapper.find(EuiButtonEmpty)).toHaveLength(3); | ||
wrapper.find('[data-test-subj="ApiLogsTableDetailsButton"]').first().simulate('click'); | ||
// TODO: API log details flyout | ||
expect(actions.openFlyout).toHaveBeenCalled(); |
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.
Follow-up to #96008 (comment) - @JasonStoltz feel free to yell if you'd like this to be in its own test block and not in the main renders
test 🤔
export const safeJsonParseAndStringify = (json: string) => { | ||
try { | ||
return JSON.stringify(JSON.parse(json), null, 2); | ||
} catch (e) { | ||
return json; | ||
} | ||
}; |
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 I migrated this entirely as-is from App Search, I'm not a super huge fan of the name but I can't really think of a better one? Feel free to shout if you have any ideas 🤷
x-pack/plugins/enterprise_search/public/applications/app_search/components/api_logs/utils.ts
Outdated
Show resolved
Hide resolved
<ApiLogsTable hasPagination /> | ||
<ApiLogFlyout /> |
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 debated putting ApiLogFlyout
within ApiLogsTable
but opted not to in the end. I don't feel super strongly either way, but I landed on this side of the fence because:
- I like our
<Table />
components just being self contained modular tables/components, and it definitely simplifies tests for the table component - It's nice having an 'overview' of what's on the page from the view itself
That being said in the end I don't think it super matters either way so happy to be convinced otherwise
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 agree it should be separate from ApiLogsTable
…h/components/api_logs/utils.ts
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.
Looking great @constancecchen
export const ApiLogHeading: React.FC = ({ children }) => ( | ||
<EuiTitle size="xs"> | ||
<h3>{children}</h3> | ||
</EuiTitle> | ||
); |
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.
Wouldn't be my style but doesn't offend me
<ApiLogsTable hasPagination /> | ||
<ApiLogFlyout /> |
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 agree it should be separate from ApiLogsTable
x-pack/plugins/enterprise_search/public/applications/app_search/components/api_logs/utils.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Byron Hulcher <[email protected]>
@elasticmachine merge upstream |
Thanks a ton for the great feedback Byron! 🙌 Enabling auto-merge for now but feel free to yell @JasonStoltz if you see any issues or change requests, or as always I can follow up on any later comments in a follow-up PR |
Oh snap, I didn't see the suggestion had a name change - fixing |
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
History
To update your PR or re-run it, just comment with: |
* Set up helper for showing JSON request/response bodies * Set up mock API log obj for tests to use * Add ApiLogLogic file for flyout handling * Add ApiLogFlyout component * Update views to load flyout * Update table to open flyout * Update x-pack/plugins/enterprise_search/public/applications/app_search/components/api_logs/utils.ts * PR feedback: comments Co-authored-by: Byron Hulcher <[email protected]> Co-authored-by: Byron Hulcher <[email protected]> Co-authored-by: Kibana Machine <[email protected]>
* Set up helper for showing JSON request/response bodies * Set up mock API log obj for tests to use * Add ApiLogLogic file for flyout handling * Add ApiLogFlyout component * Update views to load flyout * Update table to open flyout * Update x-pack/plugins/enterprise_search/public/applications/app_search/components/api_logs/utils.ts * PR feedback: comments Co-authored-by: Byron Hulcher <[email protected]> Co-authored-by: Byron Hulcher <[email protected]> Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: Constance <[email protected]> Co-authored-by: Byron Hulcher <[email protected]>
…-nav * 'master' of github.com:elastic/kibana: (106 commits) [Lens] don't use eui variables for zindex (elastic#96117) Remove /src/legacy (elastic#95510) skip flaky suite (elastic#95899) [Dashboard] Fix Lens and TSVB chart tooltip positioning relative to global headers (elastic#94247) fixes a skipped management x-pack test (elastic#96178) [App Search] API logs: Add log detail flyout (elastic#96162) [tech-debt] Remove defunct opacity parameters from EUI shadow functions (elastic#96191) Add Input Controls project configuration (elastic#96238) [file upload] document file upload privileges and provide actionable UI when failures occur (elastic#95883) Revert "TS Incremental build exclude test files (elastic#95610)" (elastic#96223) [App Search] Added Sample Response section to Result Settings (elastic#95971) [Maps] Safe-erase text-field (elastic#94873) [RAC][Alert Triage][TGrid] Update the Alerts Table (TGrid) API to implement `renderCellValue` (elastic#96098) [Maps] Enable all zoom levels for all users (elastic#96093) Use plugin version in its publicPath (elastic#95945) [Enterprise Search] Expose core.chrome.setIsVisible for use in Workplace Search (elastic#95984) [Workplace Search] Add sub nav and fix rendering bugs in Personal dashboard (elastic#96100) [OBS]home page is showing incorrect value of APM throughput (tpm) (elastic#95991) [Observability] Exploratory View initial skeleton (elastic#94426) [KQL] Fixed styles of KQL textarea for the K8 theme (elastic#96190) ... # Conflicts: # x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/restore_snapshot.helpers.ts
Summary
Final PR for API logs. This adds the Detail flyout (previously a modal in the standalone UI). The UI within the flyout remains mostly the same as before.
Checklist