Skip to content
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

Merged
merged 11 commits into from
Apr 5, 2021

Conversation

cee-chen
Copy link
Contributor

@cee-chen cee-chen commented Apr 2, 2021

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.

flyout

Checklist

@cee-chen cee-chen added Feature:Plugins release_note:skip Skip the PR/issue when compiling release notes v7.13.0 auto-backport Deprecated - use backport:version if exact versions are needed labels Apr 2, 2021
@cee-chen cee-chen requested a review from a team April 2, 2021 19:51
closeFlyout(): void;
}

export const ApiLogLogic = kea<MakeLogicType<ApiLogValues, ApiLogActions>>({
Copy link
Contributor Author

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

Comment on lines +133 to +137
export const ApiLogHeading: React.FC = ({ children }) => (
<EuiTitle size="xs">
<h3>{children}</h3>
</EuiTitle>
);
Copy link
Contributor Author

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

Copy link
Contributor

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

Comment on lines 88 to +90
expect(wrapper.find(EuiButtonEmpty)).toHaveLength(3);
wrapper.find('[data-test-subj="ApiLogsTableDetailsButton"]').first().simulate('click');
// TODO: API log details flyout
expect(actions.openFlyout).toHaveBeenCalled();
Copy link
Contributor Author

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 🤔

Comment on lines 23 to 29
export const safeJsonParseAndStringify = (json: string) => {
try {
return JSON.stringify(JSON.parse(json), null, 2);
} catch (e) {
return json;
}
};
Copy link
Contributor Author

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 🤷

Comment on lines 78 to +79
<ApiLogsTable hasPagination />
<ApiLogFlyout />
Copy link
Contributor Author

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

Copy link
Contributor

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

@byronhulcher byronhulcher self-requested a review April 5, 2021 14:26
Copy link
Contributor

@byronhulcher byronhulcher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking great @constancecchen

Comment on lines +133 to +137
export const ApiLogHeading: React.FC = ({ children }) => (
<EuiTitle size="xs">
<h3>{children}</h3>
</EuiTitle>
);
Copy link
Contributor

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

Comment on lines 78 to +79
<ApiLogsTable hasPagination />
<ApiLogFlyout />
Copy link
Contributor

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

Co-authored-by: Byron Hulcher <[email protected]>
@cee-chen
Copy link
Contributor Author

cee-chen commented Apr 5, 2021

@elasticmachine merge upstream

@cee-chen
Copy link
Contributor Author

cee-chen commented Apr 5, 2021

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

@cee-chen cee-chen enabled auto-merge (squash) April 5, 2021 16:11
@cee-chen
Copy link
Contributor Author

cee-chen commented Apr 5, 2021

Oh snap, I didn't see the suggestion had a name change - fixing

@cee-chen
Copy link
Contributor Author

cee-chen commented Apr 5, 2021

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
enterpriseSearch 1315 1318 +3

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
enterpriseSearch 1.9MB 1.9MB +5.4KB

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@cee-chen cee-chen merged commit 56d9f3d into elastic:master Apr 5, 2021
@cee-chen cee-chen deleted the api-logs-4 branch April 5, 2021 20:48
kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Apr 5, 2021
* 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]>
@kibanamachine
Copy link
Contributor

💚 Backport successful

7.x / #96258

This backport PR will be merged automatically after passing CI.

kibanamachine added a commit that referenced this pull request Apr 5, 2021
* 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]>
jloleysens added a commit to jloleysens/kibana that referenced this pull request Apr 6, 2021
…-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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed Feature:Plugins release_note:skip Skip the PR/issue when compiling release notes v7.13.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants