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

Legacy Saved Object Import UI - Choices on the index patterns override page are reset #75797

Closed
lucabelluccini opened this issue Aug 24, 2020 · 5 comments · Fixed by #81621
Closed
Assignees
Labels
bug Fixes for quality problems that affect the customer experience Feature:Saved Objects Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc

Comments

@lucabelluccini
Copy link
Contributor

Kibana version: 7.8.1, 7.9.0

Elasticsearch version: aligned

Browser version: Version 84.0.4147.135 (Official Build) (64-bit)

Browser OS version: MacOS Mojave 10.14.6 (18G4032)

Describe the bug:

Importing several objects in Saved Objects UI and when the imported index patterns do not exist.
If there are multiple index patterns missing, the index patterns override UI is paginated.
If we select an index pattern in any page (except the first one), the UI seems to reset, losing all the selections done on previous pages.

Steps to reproduce:

  1. Create 6 visualizations, each one pointing to a different index pattern
  2. Export the 6 visualizations
  3. Delete the 6 index patterns
  4. Import the 6 visualizations, enabling Automatically overwrite all saved objects?
  5. Go to the 2nd page, trying to edit the 6th
  6. As soon as we choose an index pattern to use, the UI is reset and we go back to the first page
  7. Any selection done on the 1st page is lost

Workaround: increase the size of page to 25 rows per page (but only works for less than 25 index patterns).

Expected behavior:

Keep the choices on all the pages and do not reset the UI

Screenshots (if relevant):

override-indexpatterns

Errors in browser console (if relevant):

None in console.

@lucabelluccini lucabelluccini added bug Fixes for quality problems that affect the customer experience Feature:Saved Objects labels Aug 24, 2020
@mshustov mshustov added the Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc label Aug 25, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-platform (Team:Platform)

@pgayvallet
Copy link
Contributor

Note that this is only happening when importing in the legacy (json) format. ndjson imports are not using the inline table to choose indexPattern overrides and are not impacted.

That being said, this seems to be the combination of two things:

  1. We do no keep the override table state in the Flyout component. For instance, the value property of the select boxes is no set, causing any re-render to redisplay the default

return (
<EuiSelect
data-test-subj={`managementChangeIndexSelection-${id}`}
onChange={(e) => this.onIndexChanged(id, e)}
options={options}
/>
);

  1. We do not keep the pagination infos (pagination.initialPageIndex + onTableChange), causing any rerender to redisplay the first page due to component re-rendering.

These two things are causing the call to setState in

onIndexChanged = (id: string, e: any) => {
const value = e.target.value;
this.setState((state) => {

to rerender the flyout content and the underlying EuiInMemoryTable in its initial state when selecting an option in any selectbox.

@pgayvallet pgayvallet changed the title Saved Object Import UI - Choices on the index patterns override page are reset Legacy Saved Object Import UI - Choices on the index patterns override page are reset Sep 2, 2020
@pgayvallet
Copy link
Contributor

Blocked by elastic/eui#3982

@pgayvallet
Copy link
Contributor

Removing the regression tag, as it was not introduced by platform migration and was present for as long as we were using EuiInMemoryTable to display the index pattern override table.

@pgayvallet
Copy link
Contributor

elastic/eui#3982 has been addressed. the issue is unblocked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:Saved Objects Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
Projects
None yet
4 participants