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

[Code] Export integration components #47636

Merged
merged 6 commits into from
Oct 10, 2019

Conversation

rylnd
Copy link
Contributor

@rylnd rylnd commented Oct 8, 2019

Summary

  • Abstracts a decorated CodeBlockPanel component from our existing CodeBlock component, as the APM team seems more likely to need the simpler, non-styled version.
  • Exports the CodeBlock and CodeIntegration components, along with their props/types, from a newly-created shared.ts manifest
  • our main public/index.ts now re-exports the shared.ts file

Addresses elastic/code#1677.
Also addresses elastic/code#1679.

@rylnd rylnd added Team:Code release_note:skip Skip the PR/issue when compiling release notes v7.5.0 labels Oct 8, 2019
@rylnd rylnd requested a review from mw-ding October 8, 2019 21:12
@elasticmachine
Copy link
Contributor

Pinging @elastic/code (Team:Code)

@rylnd
Copy link
Contributor Author

rylnd commented Oct 8, 2019

@mw-ding thoughts here? CI is currently failing due to some part of the CI/build process not liking the import * as monaco that we've got in monaco/monaco.ts, which is now implicitly part of the main index.ts file.

@elasticmachine

This comment has been minimized.

@rylnd
Copy link
Contributor Author

rylnd commented Oct 9, 2019

retest

@tylersmalley
Copy link
Contributor

@elasticmachine merge upstream

@elasticmachine

This comment has been minimized.

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

rylnd added 6 commits October 10, 2019 10:21
This separates the current CodeBlock component into two:
* BareCodeBlock, which simply renders the code view without
padding/margin
* CodeBlock, which wraps the BareCodeBlock in an EUIPanel and allows
overrides

It seems like APM will want to use the former for their integration,
while the latter is currently used internally by Code. It's very simple,
though, and could absolutely be inlined.
This has no styling, and so a header could go right against it, it
could be shown/hidden distinct from the header, etc.
Adds a 'shared' manifest that does all the reaching in; the main one
just re-exports that.
This was incorrectly placed a level too high, in the plugin itself.
CodeBlockPanel = EuiPanel + CodeBlock
@rylnd rylnd force-pushed the export-integration-components branch from 04acfa2 to 53d4b03 Compare October 10, 2019 15:22
@rylnd rylnd requested a review from a team as a code owner October 10, 2019 15:22
@rylnd rylnd requested review from daveyholler and cchaos October 10, 2019 15:27
@@ -1,4 +1,4 @@
.codeContainer__root {
.codeContainer__monaco {
Copy link
Contributor Author

@rylnd rylnd Oct 10, 2019

Choose a reason for hiding this comment

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

@daveyholler @cchaos I renamed this because it was doing double duty: it applied both the monaco fixes here and also applied some layout rules in a layout file. .codeContainer__monaco is now solely for monaco fixes, and .codeContainer__root is for the layout stuff.

Additionally, our two uses of monaco, in our CodeBlock and EditorComponent components, both have the codeContainer__monaco class applied internally so that consumers don't need to worry about it.

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Copy link
Contributor

@mw-ding mw-ding left a comment

Choose a reason for hiding this comment

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

LGTM. Cool, let's update the doc in the code repository and then let the APM folk know in the channel.

@rylnd rylnd merged commit 5836691 into elastic:master Oct 10, 2019
@rylnd rylnd deleted the export-integration-components branch October 10, 2019 18:43
rylnd added a commit to rylnd/kibana that referenced this pull request Oct 10, 2019
* Expose CodeBlockPanel component

This separates the current CodeBlock component into two:
* CodeBlock, which simply renders the code view without
padding/margin
* CodeBlockPanel which wraps the CodeBlock in an EUIPanel and allows
overrides

It seems like APM will want to use the former for their integration,
while the latter is currently used internally by Code. It's very simple,
though, and could absolutely be inlined.

* Update demo page to use CodeBlock

This has no styling, and so a header could go right against it, it
could be shown/hidden distinct from the header, etc.

* Export our current integration components from main index

Adds a 'shared' manifest that does all the reaching in; the main one
just re-exports that.

* Move shared exports to the frontend manifest

This was incorrectly placed a level too high, in the plugin itself.

* Rename to better reflect relationship

CodeBlockPanel = EuiPanel + CodeBlock

* Distinguish monaco CSS overrides with page-specific layout
rylnd added a commit that referenced this pull request Oct 10, 2019
* Expose CodeBlockPanel component

This separates the current CodeBlock component into two:
* CodeBlock, which simply renders the code view without
padding/margin
* CodeBlockPanel which wraps the CodeBlock in an EUIPanel and allows
overrides

It seems like APM will want to use the former for their integration,
while the latter is currently used internally by Code. It's very simple,
though, and could absolutely be inlined.

* Update demo page to use CodeBlock

This has no styling, and so a header could go right against it, it
could be shown/hidden distinct from the header, etc.

* Export our current integration components from main index

Adds a 'shared' manifest that does all the reaching in; the main one
just re-exports that.

* Move shared exports to the frontend manifest

This was incorrectly placed a level too high, in the plugin itself.

* Rename to better reflect relationship

CodeBlockPanel = EuiPanel + CodeBlock

* Distinguish monaco CSS overrides with page-specific layout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes v7.5.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants