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

[Enterprise Search] Migrate shared Indexing Status component #84571

Conversation

scottybollinger
Copy link
Contributor

Summary

Migrate shared IndexingStatus components used by both App Search and Workplace Search.

The IndexingStatusFetcher component is a WIP, as there is no way to test it in the browser with out the components that use it. I have migrated the way I think it will work and will wait to backport this to 7.x until this has been verified once the Workplace Search Schema component, which depends on this, has been migrated.

Finally, the IndexingStatusPopover component is not being migrated as a part of this PR because it is only used in App Search and cannot be tested.

Checklist

This is needed to animate the loading progress bar in the Enterprise Search schema views
This is a straight copy/paste with only linting changes and tests added
This is a copy/paste with linting changes and tests added. Also changed out the Link component to our EuiLinkTo component for internal routing
This is a straight copy/paste with only linting changes and tests added
This is a copy/paste with some modifications. The http/axios code has been removed in favor of the HTTPLogic in Kibana.

This is a WIP that I am merging to master until I can get it working in the UI. Without either Schema component in the UIs for App Search or Workplace Search this is only a POC. Will not backport until this is verified working and have written tests.
@scottybollinger scottybollinger added Feature:Plugins v8.0.0 release_note:skip Skip the PR/issue when compiling release notes backport:skip This commit does not require backporting labels Nov 30, 2020
@scottybollinger scottybollinger requested a review from a team as a code owner November 30, 2020 18:35
package.json Outdated
@@ -278,6 +278,7 @@
"react-intl": "^2.8.0",
"react-is": "^16.8.0",
"react-moment-proptypes": "^1.7.0",
"react-motion": "^0.5.2",
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we should bring this library to Kibana. The latest version was released 3 years ago. The library seems to be abandoned: chenglou/react-motion#569

}, []);

return children(indexingStatus.percentageComplete, indexingStatus.numDocumentsWithErrors);
};
Copy link
Member

@cee-chen cee-chen Nov 30, 2020

Choose a reason for hiding this comment

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

Do we plan on writing a test for this file?

Also, just curious - not a blocking request for this PR of course (unless people really like the idea), but at some point do we think it would be worth it to rewrite this file as a Kea logic file instead of as a render prop, and have this be an actions.fetchIndexingStatus action that updates values.percentageComplete and values.numDocumentsWithErrors?

Doing so has the advantage of not requiring useRef for pollingInterval, for example.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I've been toying with doing that but wondered if I had the time. I think I'll just go ahead and do it. I want to get this merged in so I can test it in Kibana though. Everything but this file has tests and my changes will be a fast-follower to this PR

Copy link
Member

Choose a reason for hiding this comment

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

Sweet, sounds good - thanks Scotty!

Co-authored-by: Constance <constancecchen@users.noreply.github.com>
Copy link
Member

@cee-chen cee-chen left a comment

Choose a reason for hiding this comment

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

Sorry for jumping around so scatteredly today, these are my last set of comments. They're not blockers though so if you would strongly rather tackle CSS classes later, just LMK


export const IndexingStatusErrors: React.FC<IIndexingStatusErrorsProps> = ({ viewLinkPath }) => (
<EuiCallOut
className="c-stui-indexing-status-errors"
Copy link
Member

Choose a reason for hiding this comment

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

Are we using these CSS classes? If not, let's lose them for now and re-add them as needed and w/ correct casing

Suggested change
className="c-stui-indexing-status-errors"

return (
<IndexingStatusFetcher {...props}>
{(percentageComplete, numDocumentsWithErrors) => (
<div className="c-stui-indexing-status-wrapper">
Copy link
Member

Choose a reason for hiding this comment

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

Same question here re: CSS classes

Suggested change
<div className="c-stui-indexing-status-wrapper">
<div>

<IndexingStatusFetcher {...props}>
{(percentageComplete, numDocumentsWithErrors) => (
<div className="c-stui-indexing-status-wrapper">
{percentageComplete < 100 && statusPanel(percentageComplete)}
Copy link
Member

Choose a reason for hiding this comment

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

Very minor comment, but I don't see the advantage of pulling out statusPanel into a separate const since it's not repeated or anything - would suggest just leaving it inline

Suggested change
{percentageComplete < 100 && statusPanel(percentageComplete)}
{percentageComplete < 100 && (
<EuiPanel paddingSize="l" hasShadow>
<IndexingStatusContent percentageComplete={percentComplete} />
</EuiPanel>
)}

Also, do we just show nothing if percentageComplete is 100 with no errors? Like, we don't even show a completed bar?

- Remove stui classes
- Inline status
Copy link
Member

@cee-chen cee-chen left a comment

Choose a reason for hiding this comment

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

Thanks Scotty, sorry for the many minor comments!

@scottybollinger
Copy link
Contributor Author

Thanks Scotty, sorry for the many minor comments!

Thanks for the review! I'm going to ping you on the other PR as well, the one that adds the logic for IndexingStatus and tests. Hope to have that this week but definitely by next week. Will backport this along with that one, once completed.

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

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

@scottybollinger scottybollinger merged commit ae9df69 into elastic:master Dec 1, 2020
@scottybollinger scottybollinger deleted the scottybollinger/shared-indexing-status branch December 1, 2020 20:26
scottybollinger added a commit to scottybollinger/kibana that referenced this pull request Dec 1, 2020
…#84571)

* Add react-motion package

This is needed to animate the loading progress bar in the Enterprise Search schema views

* Add shared interface

* Migrate IndexingStatusContent component

This is a straight copy/paste with only linting changes and tests added

* Migrate IndexingStatusErrors component

This is a copy/paste with linting changes and tests added. Also changed out the Link component to our EuiLinkTo component for internal routing

* Migrate IndexingStatus component

This is a straight copy/paste with only linting changes and tests added

* Migrate IndexingStatusFetcher component

This is a copy/paste with some modifications. The http/axios code has been removed in favor of the HTTPLogic in Kibana.

This is a WIP that I am merging to master until I can get it working in the UI. Without either Schema component in the UIs for App Search or Workplace Search this is only a POC. Will not backport until this is verified working and have written tests.

* Add i18n

* Revert "Add react-motion package"

This reverts commit 92db929.

* Remove motion dependency

* Update copy

Co-authored-by: Constance <constancecchen@users.noreply.github.com>

* Refactor per code review

- Remove stui classes
- Inline status

Co-authored-by: Constance <constancecchen@users.noreply.github.com>
scottybollinger added a commit that referenced this pull request Dec 1, 2020
…#84706)

* Add react-motion package

This is needed to animate the loading progress bar in the Enterprise Search schema views

* Add shared interface

* Migrate IndexingStatusContent component

This is a straight copy/paste with only linting changes and tests added

* Migrate IndexingStatusErrors component

This is a copy/paste with linting changes and tests added. Also changed out the Link component to our EuiLinkTo component for internal routing

* Migrate IndexingStatus component

This is a straight copy/paste with only linting changes and tests added

* Migrate IndexingStatusFetcher component

This is a copy/paste with some modifications. The http/axios code has been removed in favor of the HTTPLogic in Kibana.

This is a WIP that I am merging to master until I can get it working in the UI. Without either Schema component in the UIs for App Search or Workplace Search this is only a POC. Will not backport until this is verified working and have written tests.

* Add i18n

* Revert "Add react-motion package"

This reverts commit 92db929.

* Remove motion dependency

* Update copy

Co-authored-by: Constance <constancecchen@users.noreply.github.com>

* Refactor per code review

- Remove stui classes
- Inline status

Co-authored-by: Constance <constancecchen@users.noreply.github.com>

Co-authored-by: Constance <constancecchen@users.noreply.github.com>
gmmorris added a commit to gmmorris/kibana that referenced this pull request Dec 2, 2020
* master:
  [Lens] Show color in flyout instead of auto (elastic#84532)
  [Lens] Use index pattern through service instead of reading saved object (elastic#84432)
  Make it possible to use Kibana anonymous authentication provider with ES anonymous access. (elastic#84074)
  TelemetryCollectionManager: Use X-Pack strategy as an OSS overwrite (elastic#84477)
  migrate away from rest_total_hits_as_int (elastic#84508)
  [Input Control] Custom renderer (elastic#84423)
  Attempt to more granularly separate App Search vs Workplace Search vs shared GitHub notifications (elastic#84713)
  [Security Solutino][Case] Case connector alert UI (elastic#82405)
  [Maps] Support runtime fields in tooltips (elastic#84377)
  [CCR] Fix row actions in follower index and auto-follow pattern tables (elastic#84433)
  [Enterprise Search] Migrate shared Indexing Status component (elastic#84571)
  [maps] remove fields from index-pattern test artifacts (elastic#84379)
  Add routes for use in Sources Schema (elastic#84579)
  Changes UI links for drilldowns (elastic#83971)
  endpoint telemetry cloned endpoint tests (elastic#81498)
  [Fleet] Handler api key creation errors when Fleet Admin is invalid (elastic#84576)
gmmorris added a commit to gmmorris/kibana that referenced this pull request Dec 2, 2020
* master: (72 commits)
  Make alert status fetching more resilient (elastic#84676)
  [APM] Refactor hooks and context (elastic#84615)
  Added word break styles to the texts in the item details card. (elastic#84654)
  [Search] Disable "send to background" when auto-refresh is enabled (elastic#84106)
  Add readme for new palette service (elastic#84512)
  Make all providers to preserve original URL when session expires. (elastic#84229)
  [Lens] Show color in flyout instead of auto (elastic#84532)
  [Lens] Use index pattern through service instead of reading saved object (elastic#84432)
  Make it possible to use Kibana anonymous authentication provider with ES anonymous access. (elastic#84074)
  TelemetryCollectionManager: Use X-Pack strategy as an OSS overwrite (elastic#84477)
  migrate away from rest_total_hits_as_int (elastic#84508)
  [Input Control] Custom renderer (elastic#84423)
  Attempt to more granularly separate App Search vs Workplace Search vs shared GitHub notifications (elastic#84713)
  [Security Solutino][Case] Case connector alert UI (elastic#82405)
  [Maps] Support runtime fields in tooltips (elastic#84377)
  [CCR] Fix row actions in follower index and auto-follow pattern tables (elastic#84433)
  [Enterprise Search] Migrate shared Indexing Status component (elastic#84571)
  [maps] remove fields from index-pattern test artifacts (elastic#84379)
  Add routes for use in Sources Schema (elastic#84579)
  Changes UI links for drilldowns (elastic#83971)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting Feature:Plugins release_note:skip Skip the PR/issue when compiling release notes v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants