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] Code Integrator Component #47180

Merged
merged 3 commits into from
Oct 5, 2019
Merged

Conversation

rylnd
Copy link
Contributor

@rylnd rylnd commented Oct 2, 2019

Summary

This is a followup to #46402. It addresses part of elastic/code#1637. It is based upon #47183. As such, here is the diff for just this branch.

  • Moves shared ImportModal to separate component
  • Adds new CodeIntegrator component that allows consumers to either select a repo or import a new one, with appropriate callback props

Checklist

Use strikethroughs to remove checklist items you don't feel are applicable to this PR.

For maintainers

@rylnd rylnd added Team:Code release_note:skip Skip the PR/issue when compiling release notes v7.6.0 labels Oct 2, 2019
@rylnd rylnd requested a review from a team as a code owner October 2, 2019 23:52
@elasticmachine
Copy link
Contributor

Pinging @elastic/code (Team:Code)

@rylnd
Copy link
Contributor Author

rylnd commented Oct 3, 2019

@mw-ding here are the remaining items (or things to defer until APM has bandwidth) as I see them:

  • adding translation keys for copy
  • revisiting keyboard accessibility (e.g. integrator popover does not draw focus)
  • documentation
  • tests
  • wiring up to API data: fetching snippets, POSTing to import new repos

Also, CodeIntegrator doesn't currently show an indicator for the repo import status. Design for this was somewhat in flux when I started this work, and I'm still not sure if the component should do this, or whether this should be the caller's concern (you could do this with the existing callbacks).

@rylnd rylnd changed the title [Code] Code integrator Component [Code] Code Integrator Component Oct 3, 2019
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

const handleSelect = (codeId: string) => {
onRepoSelect(codeId);
setShowSelector(false);
// TODO: show success
Copy link
Contributor

Choose a reason for hiding this comment

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

are we going to implement the success notification in this PR. do you think it's currently blocked by the case that we haven't decided on if we should issue the REST API inside the component or not?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Currently, the import calls are stubbed out, but the components are written under the assumption that they'll be making the calls themselves.

We could certainly allow the consumer to make the call themselves with a simpler callback, but then CodeIntegrator's not doing much besides generating HTML.

We should discuss both approaches with APM and go with whatever they think is best, but I think both will need the simpler component that is callback-agnostic.

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@mw-ding
Copy link
Contributor

mw-ding commented Oct 4, 2019

@mw-ding here are the remaining items (or things to defer until APM has bandwidth) as I see them:

  • adding translation keys for copy
  • revisiting keyboard accessibility (e.g. integrator popover does not draw focus)
  • documentation
  • tests
  • wiring up to API data: fetching snippets, POSTing to import new repos

Also, CodeIntegrator doesn't currently show an indicator for the repo import status. Design for this was somewhat in flux when I started this work, and I'm still not sure if the component should do this, or whether this should be the caller's concern (you could do this with the existing callbacks).

It's great to have some follow up items. Let's have a chat on them. But not quite necessary for this PR.

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.

overall, LGTM. Let get this checked in first. @daveyholler can you take a look on the design's end?

please remember to flip the flag here if you want to try it out locally. https://github.com/elastic/kibana/pull/47180/files#diff-95a72659e4d8aff5a859fc873de1b710R54

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

rylnd added 3 commits October 4, 2019 19:04
* Abstracts shared ImportModal component
* Uses placeholder data and callbacks in lieu of real integration
Integrations is too generic.
This got lost in the rebase, whoops.
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@daveyholler daveyholler self-requested a review October 5, 2019 01:25
@rylnd rylnd merged commit 67d026e into elastic:master Oct 5, 2019
@rylnd rylnd deleted the code-integrator branch October 5, 2019 01:27
jloleysens added a commit to jloleysens/kibana that referenced this pull request Oct 7, 2019
… into console-token-iterator

* 'console-token-iterator' of github.com:jloleysens/kibana: (184 commits)
  [functional/services] update webdriver lib and types (elastic#47381)
  Standardizing IconField implementation across the app (elastic#47196)
  Move ui/value_suggestions ⇒ NP data plugin (elastic#45762)
  Remove ui/persisted_log - Part 2 (elastic#47236)
  Update gulp related packages (elastic#47421)
  Update dependency idx to ^2.5.6 (elastic#47399)
  try running fewer jobs in parallel on the same worker (elastic#47403)
  Update webpack related packages (elastic#47402)
  Update jsonwebtoken related packages (elastic#47400)
  Update gulp related packages (major) (elastic#46665)
  Update dependency prettier to ^1.18.2 (elastic#47340)
  Update dependency @types/puppeteer to ^1.20.1 (elastic#47339)
  Update dependency @elastic/elasticsearch to ^7.4.0 (elastic#47338)
  Update dependency tar-fs to ^1.16.3 (elastic#47341)
  [Code] Code Integrator Component (elastic#47180)
  [Canvas][i18n] Sidebar (elastic#46090)
  Generate uuid in task Manager as Kibana uuid may not yet have been initialised
  [Code] Embedded Code Snippet Component (elastic#47183)
  Revert "Add pipeline for flaky test runner job (elastic#46740)"
  SearchSource: fix docvalue_fields and fields intersection logic (elastic#46724)
  ...
rylnd added a commit to rylnd/kibana that referenced this pull request Oct 7, 2019
* Add CodeIntegrator component

* Abstracts shared ImportModal component
* Uses placeholder data and callbacks in lieu of real integration
rylnd added a commit that referenced this pull request Oct 7, 2019
* Add CodeIntegrator component

* Abstracts shared ImportModal component
* Uses placeholder data and callbacks in lieu of real integration
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.6.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants