Add comments and inline docs for visualization saving and editing process.#8208
Conversation
|
@cjcenizal What's the status of this? |
|
@epixa I'll get this merged this week. |
b7285f5 to
fcd9615
Compare
tylersmalley
left a comment
There was a problem hiding this comment.
Just found one nitpick, but other than that it was a very informative PR.
src/ui/public/es.js
Outdated
There was a problem hiding this comment.
To keep this PR consistent, can we place a line break between name and description?
fcd9615 to
b94253a
Compare
|
LGTM |
spalger
left a comment
There was a problem hiding this comment.
Some of the descriptions here feel more like observations, and not descriptions of the functionality they label. I'm all for sharing your observations but I would rather only put full-formed descriptions into the code.
There was a problem hiding this comment.
Is this not explained above?
When a vis is marked as being requested, the bounds of that vis are updated and new data is fetched using the new bounds.
There was a problem hiding this comment.
You actually made this comment on the original PR: #7968 (comment)
There was a problem hiding this comment.
I think that in order for this to be useful the comment should point to the actual file, not just vis.js
There was a problem hiding this comment.
I think this should probably point the reader to where they can find the current state (like the URL) rather than list out it's properties. Otherwise the list will just get out of date and not benefit anyone
There was a problem hiding this comment.
Sounds good but not sure what you mean re point out where the reader can find current state. Can you give me an example of the comment you have in mind?
There was a problem hiding this comment.
I don't think this comment is useful
There was a problem hiding this comment.
It's not the most insightful comment, but it does give some idea of the relationship with the other actors in our codebase, so I'd like to leave it unless we can come up with a more meaningful description. :)
There was a problem hiding this comment.
The relationship between this class and _doc_send_to_es doesn't really describe the class at all
There was a problem hiding this comment.
I think you'll need to illuminate me...
src/ui/public/es.js
Outdated
There was a problem hiding this comment.
esFactory is exposed by the elasticsearch.angular.js client
src/ui/public/vis/vis.js
Outdated
There was a problem hiding this comment.
I don't see how the change or fetch_with_changes listeners are of any importance here. All that maters is that the properties of the appState are synced with the url, right? In order to save changes call appState.save() any changed from the url will be reflected in the properties of the appState
There was a problem hiding this comment.
This is probably unnecessary
There was a problem hiding this comment.
I would agree if the name of the method was something like onClickSave to indicate that this is part of the interface exposed to the template. But since the role of this method is a little unclear from the name, I'd like to leave this comment until we refactor and clarify naming.
There was a problem hiding this comment.
Not seeing the value in this description
f191358 to
bd21af2
Compare
bd21af2 to
00f532e
Compare
|
jenkins, test this |
…cess. The goal is to clarify where URL state is coming from, when working with visualizations. Some of the classes touched upon are: SavedVis, PersistedState, AppState, and base classes. Explored files: - src/core_plugins/kibana/public/visualize/editor/editor.js - src/core_plugins/kibana/public/visualize/saved_visualizations/_saved_vis.js - src/ui/public/courier/data_source/_doc_send_to_es.js - src/ui/public/courier/data_source/doc_source.js - src/ui/public/courier/saved_object/saved_object.js - src/ui/public/es.js - src/ui/public/events.js - src/ui/public/persisted_state/persisted_state.js - src/ui/public/state_management/app_state.js - src/ui/public/state_management/state.js - src/ui/public/vis/agg_config.js - src/ui/public/vis/agg_configs.js - src/ui/public/vis/vis.js
00f532e to
34e3f49
Compare
|
@cjcenizal To help in our ongoing quest to make backports easier, please backport this to 5.x and 5.0 |
--------- **Commit 1:** Add comments and inline docs for visualization saving and editing process. The goal is to clarify where URL state is coming from, when working with visualizations. Some of the classes touched upon are: SavedVis, PersistedState, AppState, and base classes. Explored files: - src/core_plugins/kibana/public/visualize/editor/editor.js - src/core_plugins/kibana/public/visualize/saved_visualizations/_saved_vis.js - src/ui/public/courier/data_source/_doc_send_to_es.js - src/ui/public/courier/data_source/doc_source.js - src/ui/public/courier/saved_object/saved_object.js - src/ui/public/es.js - src/ui/public/events.js - src/ui/public/persisted_state/persisted_state.js - src/ui/public/state_management/app_state.js - src/ui/public/state_management/state.js - src/ui/public/vis/agg_config.js - src/ui/public/vis/agg_configs.js - src/ui/public/vis/vis.js * Original sha: 34e3f49 * Authored by CJ Cenizal <cj@cenizal.com> on 2016-08-10T00:10:48Z
--------- **Commit 1:** Add comments and inline docs for visualization saving and editing process. The goal is to clarify where URL state is coming from, when working with visualizations. Some of the classes touched upon are: SavedVis, PersistedState, AppState, and base classes. Explored files: - src/core_plugins/kibana/public/visualize/editor/editor.js - src/core_plugins/kibana/public/visualize/saved_visualizations/_saved_vis.js - src/ui/public/courier/data_source/_doc_send_to_es.js - src/ui/public/courier/data_source/doc_source.js - src/ui/public/courier/saved_object/saved_object.js - src/ui/public/es.js - src/ui/public/events.js - src/ui/public/persisted_state/persisted_state.js - src/ui/public/state_management/app_state.js - src/ui/public/state_management/state.js - src/ui/public/vis/agg_config.js - src/ui/public/vis/agg_configs.js - src/ui/public/vis/vis.js * Original sha: 34e3f49 * Authored by CJ Cenizal <cj@cenizal.com> on 2016-08-10T00:10:48Z
[backport] PR #8208 to 5.x - Add comments and inline docs for visualization saving and editing process.
|
Backported to 5.0 and 5.x. |
--------- **Commit 1:** Add comments and inline docs for visualization saving and editing process. The goal is to clarify where URL state is coming from, when working with visualizations. Some of the classes touched upon are: SavedVis, PersistedState, AppState, and base classes. Explored files: - src/core_plugins/kibana/public/visualize/editor/editor.js - src/core_plugins/kibana/public/visualize/saved_visualizations/_saved_vis.js - src/ui/public/courier/data_source/_doc_send_to_es.js - src/ui/public/courier/data_source/doc_source.js - src/ui/public/courier/saved_object/saved_object.js - src/ui/public/es.js - src/ui/public/events.js - src/ui/public/persisted_state/persisted_state.js - src/ui/public/state_management/app_state.js - src/ui/public/state_management/state.js - src/ui/public/vis/agg_config.js - src/ui/public/vis/agg_configs.js - src/ui/public/vis/vis.js * Original sha: 3cf76b6004f98d694cb0d31831035e806f71357c [formerly 34e3f49] * Authored by CJ Cenizal <cj@cenizal.com> on 2016-08-10T00:10:48Z Former-commit-id: 433c265
[backport] PR elastic#8208 to 5.x - Add comments and inline docs for visualization saving and editing process. Former-commit-id: 8752eea
`99.0.0-borealis.1` ⏩ `99.1.0-borealis.0` [Questions? Please see our Kibana upgrade FAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams) --- # `@elastic/eui` ## [`v99.1.0`](https://github.com/elastic/eui/releases/v99.1.0) - Updated `EuiColorPalettePicker` - adds `append` to `EuiColorPalettePickerPaletteProps` to support appending custom content to the title ([#8208](elastic/eui#8208)) - Updated font-weight and font-size of `EuiBetaBadge`s to improve legibility ([#8255](elastic/eui#8255)) - Added suppport for `titleColor` variant `warning` on `EuiStat` ([#8278](elastic/eui#8278)) # `@elastic/eui-theme-borealis` ## `v0.0.9` - [Visual Refresh] Support new theme tokens on JSON exports ([#8277](elastic/eui#8277)) - Remap few colors for EuiLoadingSpinner and EuiLoadingChart ([#8276](elastic/eui#8276)) - [Visual Refresh] Update floating border on EuiPanel ([#8270](elastic/eui#8270)) --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: nickofthyme <nicholas.partridge@elastic.co> Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
`98.2.2-borealis.0` ⏩ `99.3.0-classic.0` [Questions? Please see our Kibana upgrade FAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams) --- ## [`v99.3.0`](https://github.com/elastic/eui/releases/v99.3.0) - Updated table components to support adding tooltips to header cells ([#8273](elastic/eui#8273)) - Added `columns.nameTooltip` on `EuiBasicTable` - Added `tooltipProps` prop on `EuiTableHeaderCell` - Added `accent` color option to `EuiCallOut` ([#8303](elastic/eui#8303)) - Updated `EuiInlineEditForm`'s `onCancel` prop type to allow uncontrolled mode usage ([#8307](elastic/eui#8307)) - Added ES|QL syntax highlighting for `EuiCode`, `EuiCodeBlock`, `EuiMarkdownFormat`, and `EuiMarkdownEditor` components. ([#8317](elastic/eui#8317)) - Updated `EuiAccordion` to prevent content from being transitioned on initial render when `initialIsOpen=true` ([#8327](elastic/eui#8327)) **Bug fixes** - Fixed a bug on `EuiSuperDatePicker` where pasting an absolute date would append the date instead of replace it ([#8311](elastic/eui#8311)) ## [`v99.2.0`](https://github.com/elastic/eui/releases/v99.2.0) - Changed `EuiFieldText` styles to prioritize `disabled` styling over `readonly`. ([#8271](elastic/eui#8271)) - Added `plugs` and `web` glyphs to `EuiIcon` ([#8285](elastic/eui#8285)) - Update `title` on `EuiColorPalettePickerPaletteProps` to be optional ([#8289](elastic/eui#8289)) **Bug fixes** - Fixed an issue with EuiDataGrid with auto row height resulting in a table of 0 height ([#8251](elastic/eui#8251)) - Fixed `disabled` behavior of `EuiFieldText` to prevent input changes. ([#8271](elastic/eui#8271)) ## [`v99.1.0`](https://github.com/elastic/eui/releases/v99.1.0) - Updated `EuiColorPalettePicker` - adds `append` to `EuiColorPalettePickerPaletteProps` to support appending custom content to the title ([#8208](elastic/eui#8208)) - Updated font-weight and font-size of `EuiBetaBadge`s to improve legibility ([#8255](elastic/eui#8255)) - Added support for `titleColor` variant `warning` on `EuiStat` ([#8278](elastic/eui#8278)) ## [`v99.0.0`](https://github.com/elastic/eui/releases/v99.0.0) - Added two new icons: `createGenericJob` and `createGeoJob` ([#8248](elastic/eui#8248)) - Added new icon `section` ([#8261](elastic/eui#8261)) **Bug fixes** - Ensures that the `values` of `EuiI18n` used in `EuiPagination` use `key` attributes to prevent potential ["unique key" warnings](https://react.dev/learn/rendering-lists#keeping-list-items-in-order-with-key). ([#8243](elastic/eui#8243)) **Breaking changes** - Removed `EuiPopover`'s deprecated `hasDragDrop` prop. Use `usePortal` on any child `EuiDraggable` instead ([#8256](elastic/eui#8256)) --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Arturo Castillo Delgado <arturo.castillo@elastic.co> Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Lene Gadewoll <lene.gadewoll@elastic.co>
`98.2.2-borealis.0` ⏩ `99.3.0-classic.0` [Questions? Please see our Kibana upgrade FAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams) --- ## [`v99.3.0`](https://github.com/elastic/eui/releases/v99.3.0) - Updated table components to support adding tooltips to header cells ([elastic#8273](elastic/eui#8273)) - Added `columns.nameTooltip` on `EuiBasicTable` - Added `tooltipProps` prop on `EuiTableHeaderCell` - Added `accent` color option to `EuiCallOut` ([elastic#8303](elastic/eui#8303)) - Updated `EuiInlineEditForm`'s `onCancel` prop type to allow uncontrolled mode usage ([elastic#8307](elastic/eui#8307)) - Added ES|QL syntax highlighting for `EuiCode`, `EuiCodeBlock`, `EuiMarkdownFormat`, and `EuiMarkdownEditor` components. ([elastic#8317](elastic/eui#8317)) - Updated `EuiAccordion` to prevent content from being transitioned on initial render when `initialIsOpen=true` ([elastic#8327](elastic/eui#8327)) **Bug fixes** - Fixed a bug on `EuiSuperDatePicker` where pasting an absolute date would append the date instead of replace it ([elastic#8311](elastic/eui#8311)) ## [`v99.2.0`](https://github.com/elastic/eui/releases/v99.2.0) - Changed `EuiFieldText` styles to prioritize `disabled` styling over `readonly`. ([elastic#8271](elastic/eui#8271)) - Added `plugs` and `web` glyphs to `EuiIcon` ([elastic#8285](elastic/eui#8285)) - Update `title` on `EuiColorPalettePickerPaletteProps` to be optional ([elastic#8289](elastic/eui#8289)) **Bug fixes** - Fixed an issue with EuiDataGrid with auto row height resulting in a table of 0 height ([elastic#8251](elastic/eui#8251)) - Fixed `disabled` behavior of `EuiFieldText` to prevent input changes. ([elastic#8271](elastic/eui#8271)) ## [`v99.1.0`](https://github.com/elastic/eui/releases/v99.1.0) - Updated `EuiColorPalettePicker` - adds `append` to `EuiColorPalettePickerPaletteProps` to support appending custom content to the title ([elastic#8208](elastic/eui#8208)) - Updated font-weight and font-size of `EuiBetaBadge`s to improve legibility ([elastic#8255](elastic/eui#8255)) - Added support for `titleColor` variant `warning` on `EuiStat` ([elastic#8278](elastic/eui#8278)) ## [`v99.0.0`](https://github.com/elastic/eui/releases/v99.0.0) - Added two new icons: `createGenericJob` and `createGeoJob` ([elastic#8248](elastic/eui#8248)) - Added new icon `section` ([elastic#8261](elastic/eui#8261)) **Bug fixes** - Ensures that the `values` of `EuiI18n` used in `EuiPagination` use `key` attributes to prevent potential ["unique key" warnings](https://react.dev/learn/rendering-lists#keeping-list-items-in-order-with-key). ([elastic#8243](elastic/eui#8243)) **Breaking changes** - Removed `EuiPopover`'s deprecated `hasDragDrop` prop. Use `usePortal` on any child `EuiDraggable` instead ([elastic#8256](elastic/eui#8256)) --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Arturo Castillo Delgado <arturo.castillo@elastic.co> Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Lene Gadewoll <lene.gadewoll@elastic.co>
Supersedes #7968
The goal is to clarify where URL state is coming from, when working with visualizations. Some of the classes touched upon are: SavedVis, PersistedState, AppState, and base classes.
Explored files: