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

[Graph] Type persistence #44985

Merged
merged 57 commits into from
Sep 11, 2019
Merged

Conversation

flash1293
Copy link
Contributor

@flash1293 flash1293 commented Sep 6, 2019

Summary

Move logic to load and save workspaces to typescript and provide types for persisted and runtime business objects.

This PR shouldn't change any functionality. It's a preparation to move over the UI elements of the Graph bar to React.

Some types has been carried over from #44587 because they are also needed here.

Checklist

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

For maintainers

@flash1293 flash1293 added Feature:Graph Graph application feature v8.0.0 release_note:skip Skip the PR/issue when compiling release notes v7.5.0 labels Sep 6, 2019
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@flash1293 flash1293 marked this pull request as ready for review September 10, 2019 13:06
@flash1293 flash1293 added the Team:Visualizations Visualization editors, elastic-charts and infrastructure label Sep 10, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app

@flash1293 flash1293 mentioned this pull request Sep 10, 2019
31 tasks
@elasticmachine
Copy link
Contributor

💔 Build Failed

@flash1293
Copy link
Contributor Author

@kertal Changes can be reviewed, but I'm planning to clean up the naming a bit tomorrow.

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Copy link
Member

@kertal kertal left a comment

Choose a reason for hiding this comment

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

Code LGTM 🏆 , added just tiny remarks and ideas as comments

x-pack/legacy/plugins/graph/public/services/save_modal.tsx Outdated Show resolved Hide resolved
x-pack/legacy/plugins/graph/public/services/url.ts Outdated Show resolved Hide resolved
export interface SerializedField extends Omit<WorkspaceField, 'icon'> {
iconClass: string;
}

Copy link
Member

Choose a reason for hiding this comment

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

Just an idea for future simplification: you could just use 1 interface for SerializedTemplate|UrlTemplate, SerializedField|WorkspaceField, by e.g. using a helper function for settings the encoder or icon when needed, so no assignment when deserializing would be necessary.

export type WorkspaceOptions = Partial<{
indexName: string;
vertex_fields: WorkspaceField[];
nodeLabeller: (newNodes: WorkspaceNode[]) => void;
Copy link
Member

Choose a reason for hiding this comment

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

When continue with refactoring the code nodeLabeller could be renamed to 'nodeLabeler' and vertex_fields -> vertextFields

* Flatten grouped nodes and return a flat array of nodes
* @param nodes List of nodes probably containing grouped nodes
*/
returnUnpackedGroupeds(nodes: WorkspaceNode[]): WorkspaceNode[];
Copy link
Member

Choose a reason for hiding this comment

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

Out of scope, but just a note for future refactoring, I think
returnUnpackedGroupeds -> returnUnpackedGroupeds

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@flash1293 flash1293 merged commit 8b97caf into elastic:master Sep 11, 2019
@flash1293 flash1293 deleted the graph/type-persistence branch September 11, 2019 14:41
flash1293 added a commit to flash1293/kibana that referenced this pull request Sep 11, 2019
jloleysens added a commit to jloleysens/kibana that referenced this pull request Sep 11, 2019
…-to-np-ready

* 'master' of github.com:elastic/kibana:
  Upgrade EUI to 13.8.1 (elastic#45052)
  [ML] Add multi metric job wizard test (elastic#45279)
  [SIEM] Inject/apply KQL changed in refresh button (elastic#45065)
  [Graph] Type persistence (elastic#44985)
  Functional tests: convert more test/services to TS (elastic#45176)
jloleysens added a commit to jloleysens/kibana that referenced this pull request Sep 11, 2019
…ditor

* 'master' of github.com:elastic/kibana: (76 commits)
  Upgrade EUI to 13.8.1 (elastic#45052)
  [ML] Add multi metric job wizard test (elastic#45279)
  [SIEM] Inject/apply KQL changed in refresh button (elastic#45065)
  [Graph] Type persistence (elastic#44985)
  Functional tests: convert more test/services to TS (elastic#45176)
  [ML] Fixes display of matching modules in index data visualizer (elastic#45261)
  [Console] Update indentation behaviour (elastic#45249)
  Convert value provided to PhraseValueInput to string to catch Exception (elastic#45259)
  [Region Map] Fix loading default vector map and base layer setting (elastic#43858)
  [ML] Fixing empty time range when cloning jobs (elastic#45286)
  [ML] Fixing wizard validation delay (elastic#45265)
  [Logs UI] Interpret finished analysis jobs as healthy (elastic#45268)
  [Console] SQL template with triple quote in completion (elastic#45248)
  [ML] Data Frames: Cards as links (elastic#45254)
  fix(code/frontend): should show updating instead of cloning when updating (elastic#45238)
  fix(code/frontend): fix document search result from (elastic#45236)
  disable another flaky suite (elastic#45323) (elastic#45330)
  disable flaky suite (elastic#45105)
  skip flaky suite (elastic#43069)
  skip flaky suite (elastic#45089)
  ...
flash1293 added a commit that referenced this pull request Sep 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Graph Graph application feature release_note:skip Skip the PR/issue when compiling release notes Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.5.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants