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

[Drilldowns] Preserve state when switching between action factories #65074

Merged
merged 3 commits into from
May 7, 2020

Conversation

Dosant
Copy link
Contributor

@Dosant Dosant commented May 4, 2020

Summary

Part of: #42845

Chore UX improvement.

When switching between action factories state is preserved now.
State is stored inside "create drilldown" component. So closing Drilldowns panel and getting back won't preserve state. (I think this is expected)

May-04-2020 14-45-42

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@streamich streamich mentioned this pull request May 4, 2020
47 tasks
@Dosant Dosant changed the base branch from drilldowns to master May 4, 2020 14:14
@Dosant
Copy link
Contributor Author

Dosant commented May 4, 2020

@elasticmachine merge upstream

@elasticmachine
Copy link
Contributor

merge conflict between base and head

@Dosant Dosant force-pushed the dev/preserve-state-in-action-wizard branch from ebe3d62 to 09599fd Compare May 4, 2020 14:42
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app-arch (Team:AppArch)

@Dosant Dosant added v7.8.0 v8.0.0 release_note:skip Skip the PR/issue when compiling release notes labels May 4, 2020
@Dosant Dosant marked this pull request as ready for review May 4, 2020 14:46
@Dosant Dosant requested a review from a team as a code owner May 4, 2020 14:46
@Dosant
Copy link
Contributor Author

Dosant commented May 6, 2020

@elasticmachine merge upstream

@Dosant Dosant requested a review from streamich May 6, 2020 08:26
@botelastic botelastic bot added the Feature:Drilldowns Embeddable panel Drilldowns label May 6, 2020
Copy link
Contributor

@streamich streamich left a comment

Choose a reason for hiding this comment

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

See comment about reusing existing state below, otherwise LGTM.

name: '',
}
);
const [actionConfigCache, setActionConfigCache] = useState<Record<string, object>>(
Copy link
Contributor

Choose a reason for hiding this comment

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

What do you think about having all configs in DrilldownWizardConfig instead of introducing actionConfigCache?

export interface DrilldownWizardConfig {
  name: string;
  actionFactory?: ActionFactory;
  configs?: Record<string, object>;
}

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 think I like the current version more, because we leave api of this component simpler, but still have this nice UX touch of not losing changes when switching between factories.

I wouldn't do it unless we really want to preserve those internal states longer then component lifecycle.

@Dosant
Copy link
Contributor Author

Dosant commented May 7, 2020

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

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

@Dosant Dosant added v7.9.0 and removed v7.8.0 labels May 7, 2020
@Dosant Dosant merged commit 3604f5d into elastic:master May 7, 2020
@Dosant Dosant deleted the dev/preserve-state-in-action-wizard branch May 7, 2020 11:19
Dosant added a commit to Dosant/kibana that referenced this pull request May 7, 2020
Dosant added a commit that referenced this pull request May 7, 2020
gmmorris added a commit to gmmorris/kibana that referenced this pull request May 7, 2020
* master:
  [ML] Transforms: Fix API error message display for edit flyout. (elastic#65494)
  [SIEM][Detection Engine] Fixes import bug with non existent signals index (elastic#65595)
  [Lens] Use rules of hooks with linting (elastic#65593)
  [ML] Migrate server side Mocha tests to Jest. (elastic#65651)
  Fixes the client to setup SSL with the CA certificates for testing (elastic#65598)
  reduce uptime plugin initial bundle size (elastic#65257)
  [ML] Consolidating shared types and util functions (elastic#65247)
  [Drilldowns] Preserve state when selecting different action factory (elastic#65074)
  Migrate test plugins ⇒ NP (kbn_tp_embeddable_explorer) (elastic#64756)
  Move remaining home assets to the new platform (elastic#65053)
  Change the copy and the id from blacklist to block list for consistency (elastic#65419)
  [ML] Hide selector helper in Anomaly Explorer swimlane (elastic#65522)
  [ML] Fix the limit control on the Anomaly explorer page (elastic#65459)
  [Mappings editor] Add component integration tests (elastic#63853)
  [Logs + Metrics UI] Prevent component errors from breaking the whole UI (elastic#65456)
  [Logs UI] Disable search bar when live stream is on. (elastic#65491)
gmmorris added a commit to gmmorris/kibana that referenced this pull request May 7, 2020
…ponents

* alerting/lazy-load-actions:
  align and style loading indicator
  [ML] Transforms: Fix API error message display for edit flyout. (elastic#65494)
  [SIEM][Detection Engine] Fixes import bug with non existent signals index (elastic#65595)
  [Lens] Use rules of hooks with linting (elastic#65593)
  [ML] Migrate server side Mocha tests to Jest. (elastic#65651)
  Fixes the client to setup SSL with the CA certificates for testing (elastic#65598)
  reduce uptime plugin initial bundle size (elastic#65257)
  [ML] Consolidating shared types and util functions (elastic#65247)
  [Drilldowns] Preserve state when selecting different action factory (elastic#65074)
  Migrate test plugins ⇒ NP (kbn_tp_embeddable_explorer) (elastic#64756)
  Move remaining home assets to the new platform (elastic#65053)
  Change the copy and the id from blacklist to block list for consistency (elastic#65419)
  [ML] Hide selector helper in Anomaly Explorer swimlane (elastic#65522)
  [ML] Fix the limit control on the Anomaly explorer page (elastic#65459)
  [Mappings editor] Add component integration tests (elastic#63853)
  [Logs + Metrics UI] Prevent component errors from breaking the whole UI (elastic#65456)
  [Logs UI] Disable search bar when live stream is on. (elastic#65491)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Drilldowns Embeddable panel Drilldowns release_note:skip Skip the PR/issue when compiling release notes v7.9.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants