-
Notifications
You must be signed in to change notification settings - Fork 0
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
Refactor pagination and selection to emphasize primitive values, both as state and props. #3
Conversation
}; | ||
|
||
this.pager = new Pager(2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made this 2 items per page for demo purposes.
endNumber={0} | ||
totalItems={10} | ||
hasPreviousPage={this.hasPreviousPage} | ||
hasNextPage={this.hasNextPage} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The duplication of the props here and for LandingPageToolBar
make me question this interface. Maybe we shouldn't encapsulate the composition of this UI. What if we create a function here called getPagerButtons()
which will render the pagination buttons? We could call it once and then provide the buttons to both LandingPageToolBar
and LandingPageToolBarFooter
as children, or possibly as a prop.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, maybe the LandingPageToolBar
encapsulation is unnecessary. Just composing KuiSectionedToolBar
, KuiToolBarSearchBox
and KuiToolBarPager
might be enough. Roughly:
render() {
const { filter, pager, selectedIds } = this.state;
const pager = (
<KuiToolBarPager
startNumber={0}
endNumber={0}
totalItems={10}
hasPreviousPage={this.hasPreviousPage}
hasNextPage={this.hasNextPage}
/>
);
return (
<div>
<KuiSectionedToolBar>
<KuiToolBarSearchBox filter={filter} onFilter={onFilter}/>
{ actionButtons }
{ pager }
</KuiSectionedToolBar>
{ this.getTableContents() }
<div className="kuiToolBarFooter">
<KuiSelectedItemsFooterSection selectedItemsCount={selectedIds.length} />
{ pager }
</div>
</div>
);
}
hasPreviousPage={hasPreviousPage} | ||
hasNextPage={hasNextPage} | ||
onNextPage={onNextPage} | ||
onPreviousPage={onPreviousPage} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're passing so many props down to the component tree, I wonder if there's some refactoring that needs to be done here. This would be something I'd probably want to tackle in a subsequent iteration.
@@ -21,6 +22,34 @@ import { | |||
LandingPageToolBarFooter | |||
} from 'ui_framework/components'; | |||
|
|||
class Pager { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be extracted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like what the state looks like, but the actions are still awkwardly scattered. See my comment at elastic#10434 (comment).
endNumber={0} | ||
totalItems={10} | ||
hasPreviousPage={this.hasPreviousPage} | ||
hasNextPage={this.hasNextPage} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, maybe the LandingPageToolBar
encapsulation is unnecessary. Just composing KuiSectionedToolBar
, KuiToolBarSearchBox
and KuiToolBarPager
might be enough. Roughly:
render() {
const { filter, pager, selectedIds } = this.state;
const pager = (
<KuiToolBarPager
startNumber={0}
endNumber={0}
totalItems={10}
hasPreviousPage={this.hasPreviousPage}
hasNextPage={this.hasNextPage}
/>
);
return (
<div>
<KuiSectionedToolBar>
<KuiToolBarSearchBox filter={filter} onFilter={onFilter}/>
{ actionButtons }
{ pager }
</KuiSectionedToolBar>
{ this.getTableContents() }
<div className="kuiToolBarFooter">
<KuiSelectedItemsFooterSection selectedItemsCount={selectedIds.length} />
{ pager }
</div>
</div>
);
}
startNumber={0} | ||
endNumber={0} | ||
totalItems={10} | ||
hasPreviousPage={this.hasPreviousPage} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why pass a function instead of the value here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point! I don't think it needs to be.
import { PagerActions } from 'ui/pager/pager_actions'; | ||
import { ItemSelectionActions } from 'ui/saved_object_table/item_selection_actions'; | ||
import { | ||
areAllItemsSelected, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I smell a selector! 🎉 and it smells good 😉
013f328
to
8952b5a
Compare
this.setState({ | ||
items, | ||
isFetchingItems: false, | ||
pager: new Pager(items.length, PAGE_SIZE, 1), | ||
selectedIds: new SelectedIds() | ||
currentPage: Math.min(this.state.currentPage, pagesCount - 1), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should be more explicit about whether currentPage is an index or not. I'm working on merging your PR into mine and ran into a bug here because pagesCount can be 0. I'm going to add a new getLastPageIndex function and put the - 1
logic in there. Sound okay?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or alternatively, have currentPage be 1 based, not 0 based. Any opinion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a really good point. We should disambiguate whether this number is 0-indexed or 1-indexed in the various places it's referenced. The problem isn't formed clearly enough in my head for me to form an opinion. We can zoom about it if you want, or you can just take a stab at it and I can take a look in code review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another question is how the pager should look if there are no items.
Will it show 0 - 0 of 0
?
And if there is 1 item, is it 1 - 1 of 1
?
And for 2, 1 - 2 of 2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use @uboness 's idea in elastic#10555
These ideas have been incorporated in a separate PR into the original branch. |
* Initial check-in to replace gridster with react-grid-layout and reactify panels * # This is a combination of 3 commits. # This is the 1st commit message: Add margin of error to test determining panel widths # This is the commit message #2: use real kibana version when creating panel data. Will make future conversions easier. # This is the commit message #3: Fix lint errors * Add margin of error to test determining panel widths use real kibana version when creating panel data. Will make future conversions easier. Move default height and width to dashboard_constants so those that need it don't end up including extra stuff like ui/chrome * Remove unnecessary _.once when creating react directives in dashboard.js * Remove unnecessary constructors * Use componentDidMount instead of componentWillMount bc of async calls, and handle case where destroyEmbeddable is not defined. * Remove unnecessary null in classNames * Use loads defaultsDeep instead of Object.assign * use render* instead of get* for functions returning an element * use relative css paths * Use local import path * Switch to local imports and remove need for plugins path in jest tests * Improve accessibility of max/min panel toggle icon * remove unused css Had to implement this via code * disable eslint rule for setState in componentDidMount Am not aware of a better way to handle this, aside from switching to redux, since it’s recommended not to put async calls in componentWillMount. Since I plan to investigate redux next, disabling for now. Open to other’s opinions on the matter. * Use native map instead of lodash * Have the grid handle setting the z-indexes of the right reactgriditem * Make the draggable handle the title, not the whole heading Otherwise the drag event often takes over click events when trying to open the panel options menu and it gets really annoying. * Change from click to mouse down detector in KuiOutsideClickDector so drags also close pop ups. * Fix mistaken commit Code from the redux PR snuck into this one. * Run getEditPath and getTitle async calls in parallel - no need to wait on the return value of one before starting the others. * Fix tests: update snapshots, add promise returns. * version being added to panelData in the wrong spot caused isDirty flag to be true when it shouldn't be * Fix unmounting/mounting problem with panels due to view/edit mode switch * Fix bug where panels get squashed to one side when view mode is changed while a panel is expanded. * Update snapshots to match wrong view mode comparison * Improve naming of a variable * Fix issue with pop over hiding behind tile maps * Previous panel.js included ui/doc_table and ui/visualize - needed to include them in the chain for Dash only mode but not in that file. * Fix bad merge: remove baseline screenshots
* Initial check-in to replace gridster with react-grid-layout and reactify panels * # This is a combination of 3 commits. # This is the 1st commit message: Add margin of error to test determining panel widths # This is the commit message #2: use real kibana version when creating panel data. Will make future conversions easier. # This is the commit message #3: Fix lint errors * Add margin of error to test determining panel widths use real kibana version when creating panel data. Will make future conversions easier. Move default height and width to dashboard_constants so those that need it don't end up including extra stuff like ui/chrome * Remove unnecessary _.once when creating react directives in dashboard.js * Remove unnecessary constructors * Use componentDidMount instead of componentWillMount bc of async calls, and handle case where destroyEmbeddable is not defined. * Remove unnecessary null in classNames * Use loads defaultsDeep instead of Object.assign * use render* instead of get* for functions returning an element * use relative css paths * Use local import path * Switch to local imports and remove need for plugins path in jest tests * Improve accessibility of max/min panel toggle icon * remove unused css Had to implement this via code * disable eslint rule for setState in componentDidMount Am not aware of a better way to handle this, aside from switching to redux, since it’s recommended not to put async calls in componentWillMount. Since I plan to investigate redux next, disabling for now. Open to other’s opinions on the matter. * Use native map instead of lodash * Have the grid handle setting the z-indexes of the right reactgriditem * Make the draggable handle the title, not the whole heading Otherwise the drag event often takes over click events when trying to open the panel options menu and it gets really annoying. * Change from click to mouse down detector in KuiOutsideClickDector so drags also close pop ups. * Fix mistaken commit Code from the redux PR snuck into this one. * Run getEditPath and getTitle async calls in parallel - no need to wait on the return value of one before starting the others. * Fix tests: update snapshots, add promise returns. * version being added to panelData in the wrong spot caused isDirty flag to be true when it shouldn't be * Fix unmounting/mounting problem with panels due to view/edit mode switch * Fix bug where panels get squashed to one side when view mode is changed while a panel is expanded. * Update snapshots to match wrong view mode comparison * Improve naming of a variable * Fix issue with pop over hiding behind tile maps * Previous panel.js included ui/doc_table and ui/visualize - needed to include them in the chain for Dash only mode but not in that file. * Fix bad merge: remove baseline screenshots
* Initial check-in to replace gridster with react-grid-layout and reactify panels * # This is a combination of 3 commits. # This is the 1st commit message: Add margin of error to test determining panel widths # This is the commit message #2: use real kibana version when creating panel data. Will make future conversions easier. # This is the commit message #3: Fix lint errors * Add margin of error to test determining panel widths use real kibana version when creating panel data. Will make future conversions easier. Move default height and width to dashboard_constants so those that need it don't end up including extra stuff like ui/chrome * Remove unnecessary _.once when creating react directives in dashboard.js * Remove unnecessary constructors * Use componentDidMount instead of componentWillMount bc of async calls, and handle case where destroyEmbeddable is not defined. * Remove unnecessary null in classNames * Use loads defaultsDeep instead of Object.assign * use render* instead of get* for functions returning an element * use relative css paths * Use local import path * Switch to local imports and remove need for plugins path in jest tests * Improve accessibility of max/min panel toggle icon * remove unused css Had to implement this via code * disable eslint rule for setState in componentDidMount Am not aware of a better way to handle this, aside from switching to redux, since it’s recommended not to put async calls in componentWillMount. Since I plan to investigate redux next, disabling for now. Open to other’s opinions on the matter. * Use native map instead of lodash * Have the grid handle setting the z-indexes of the right reactgriditem * Make the draggable handle the title, not the whole heading Otherwise the drag event often takes over click events when trying to open the panel options menu and it gets really annoying. * Change from click to mouse down detector in KuiOutsideClickDector so drags also close pop ups. * Fix mistaken commit Code from the redux PR snuck into this one. * Run getEditPath and getTitle async calls in parallel - no need to wait on the return value of one before starting the others. * Fix tests: update snapshots, add promise returns. * version being added to panelData in the wrong spot caused isDirty flag to be true when it shouldn't be * Fix unmounting/mounting problem with panels due to view/edit mode switch * Fix bug where panels get squashed to one side when view mode is changed while a panel is expanded. * Update snapshots to match wrong view mode comparison * Improve naming of a variable * Fix issue with pop over hiding behind tile maps * Previous panel.js included ui/doc_table and ui/visualize - needed to include them in the chain for Dash only mode but not in that file. * Fix bad merge: remove baseline screenshots
* Prepare control flow to use embeddable factories in add panel * Rewrite saved object finder and add tests * Fix usages of new saved object finder * fix test failures * fix some functional tests and re-introduce makeUrl * fix tests * remove direct hrefs in saved_object_lists * PR review fixes * update snapshot * overwrite width of viz dialog * Update src/legacy/core_plugins/kibana/public/dashboard/top_nav/add_panel.js Co-Authored-By: flash1293 <email@johannes-reuter.de> * Update src/legacy/core_plugins/kibana/public/discover/embeddable/search_embeddable_factory.ts Co-Authored-By: flash1293 <email@johannes-reuter.de> * Update src/legacy/core_plugins/kibana/public/discover/top_nav/open_search_panel.js Co-Authored-By: flash1293 <email@johannes-reuter.de> * Update src/legacy/core_plugins/kibana/public/visualize/wizard/search_selection/search_selection.tsx Co-Authored-By: flash1293 <email@johannes-reuter.de> * Update src/legacy/core_plugins/kibana/public/visualize/wizard/search_selection/search_selection.tsx Co-Authored-By: flash1293 <email@johannes-reuter.de> * Update src/legacy/core_plugins/kibana/public/visualize/wizard/search_selection/search_selection.tsx Co-Authored-By: flash1293 <email@johannes-reuter.de> * fix tests * review fixes #1 * review fixes #2 * dont use classname in functional test * remove call to action button prop * align buttons correctly * fix tests * remove debugging statement * Update src/legacy/core_plugins/kibana/public/dashboard/top_nav/add_panel.js Co-Authored-By: flash1293 <email@johannes-reuter.de> * Update src/legacy/core_plugins/kibana/public/discover/top_nav/open_search_panel.js Co-Authored-By: flash1293 <email@johannes-reuter.de> * review fixes #3 * improve filter behavior and enable it for search wizard * adjust functional tests for new filter behavior * Change translation id due to string change * Update Jest snapshot
* Prepare control flow to use embeddable factories in add panel * Rewrite saved object finder and add tests * Fix usages of new saved object finder * fix test failures * fix some functional tests and re-introduce makeUrl * fix tests * remove direct hrefs in saved_object_lists * PR review fixes * update snapshot * overwrite width of viz dialog * Update src/legacy/core_plugins/kibana/public/dashboard/top_nav/add_panel.js Co-Authored-By: flash1293 <email@johannes-reuter.de> * Update src/legacy/core_plugins/kibana/public/discover/embeddable/search_embeddable_factory.ts Co-Authored-By: flash1293 <email@johannes-reuter.de> * Update src/legacy/core_plugins/kibana/public/discover/top_nav/open_search_panel.js Co-Authored-By: flash1293 <email@johannes-reuter.de> * Update src/legacy/core_plugins/kibana/public/visualize/wizard/search_selection/search_selection.tsx Co-Authored-By: flash1293 <email@johannes-reuter.de> * Update src/legacy/core_plugins/kibana/public/visualize/wizard/search_selection/search_selection.tsx Co-Authored-By: flash1293 <email@johannes-reuter.de> * Update src/legacy/core_plugins/kibana/public/visualize/wizard/search_selection/search_selection.tsx Co-Authored-By: flash1293 <email@johannes-reuter.de> * fix tests * review fixes #1 * review fixes #2 * dont use classname in functional test * remove call to action button prop * align buttons correctly * fix tests * remove debugging statement * Update src/legacy/core_plugins/kibana/public/dashboard/top_nav/add_panel.js Co-Authored-By: flash1293 <email@johannes-reuter.de> * Update src/legacy/core_plugins/kibana/public/discover/top_nav/open_search_panel.js Co-Authored-By: flash1293 <email@johannes-reuter.de> * review fixes #3 * improve filter behavior and enable it for search wizard * adjust functional tests for new filter behavior * Change translation id due to string change * Update Jest snapshot
…tic#39570) * [APM] Context-aware query examples for the query bar We now adjust the query example based on whether the user is viewing transactions, errors or metrics. * Change query example for transactions * Address review feedback * Fix ts issues in unit tests * Use enum for route names, clarify queryExample w/ comment
…-security-solution-es-utils package (elastic#99828) ## Summary Fixes the hopefully last circular dependency issues between security solutions and lists. * Adds a package of `@kbn/securitysolution-es-utils` and moves files from security solutions into that package. * Re-ingests that package back into lists Before this PR if you ran: ```ts node scripts/find_plugins_with_circular_deps.js --debug ``` Then you would get: ``` debg !!!!!!!!!!!!!! CIRCULAR DEPENDENCIES FOUND !!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! Circular dependencies were found, you can find below ! ! all the paths involved. ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! debg 01) x-pack/plugins/lists/server/index.ts -> x-pack/plugins/lists/server/plugin.ts -> x-pack/plugins/lists/server/routes/init_routes.ts -> x-pack/plugins/lists/server/types.ts -> x-pack/plugins/lists/server/services/lists/list_client.ts -> x-pack/plugins/lists/server/siem_server_deps.ts -> x-pack/plugins/security_solution/server/index.ts -> x-pack/plugins/security_solution/server/plugin.ts 02) x-pack/plugins/lists/server/index.ts -> x-pack/plugins/lists/server/plugin.ts -> x-pack/plugins/lists/server/routes/init_routes.ts -> x-pack/plugins/lists/server/types.ts -> x-pack/plugins/lists/server/services/lists/list_client.ts -> x-pack/plugins/lists/server/siem_server_deps.ts -> x-pack/plugins/security_solution/server/index.ts -> x-pack/plugins/security_solution/server/plugin.ts -> x-pack/plugins/security_solution/server/lib/compose/kibana.ts -> x-pack/plugins/security_solution/server/lib/framework/kibana_framework_adapter.ts -> x-pack/plugins/security_solution/server/types.ts 03) x-pack/plugins/lists/server/index.ts -> x-pack/plugins/lists/server/plugin.ts -> x-pack/plugins/lists/server/routes/init_routes.ts -> x-pack/plugins/lists/server/types.ts -> x-pack/plugins/lists/server/services/lists/list_client.ts -> x-pack/plugins/lists/server/siem_server_deps.ts -> x-pack/plugins/security_solution/server/index.ts -> x-pack/plugins/security_solution/server/plugin.ts -> x-pack/plugins/security_solution/server/lib/compose/kibana.ts -> x-pack/plugins/security_solution/server/endpoint/types.ts -> x-pack/plugins/security_solution/server/endpoint/endpoint_app_context_services.ts 04) x-pack/plugins/lists/server/index.ts -> x-pack/plugins/lists/server/plugin.ts -> x-pack/plugins/lists/server/routes/init_routes.ts -> x-pack/plugins/lists/server/types.ts -> x-pack/plugins/lists/server/services/lists/list_client.ts -> x-pack/plugins/lists/server/siem_server_deps.ts -> x-pack/plugins/security_solution/server/index.ts -> x-pack/plugins/security_solution/server/plugin.ts -> x-pack/plugins/security_solution/server/lib/compose/kibana.ts -> x-pack/plugins/security_solution/server/endpoint/types.ts -> x-pack/plugins/security_solution/server/endpoint/endpoint_app_context_services.ts -> x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.ts 05) x-pack/plugins/lists/server/index.ts -> x-pack/plugins/lists/server/plugin.ts -> x-pack/plugins/lists/server/routes/init_routes.ts -> x-pack/plugins/lists/server/types.ts -> x-pack/plugins/lists/server/services/lists/list_client.ts -> x-pack/plugins/lists/server/siem_server_deps.ts -> x-pack/plugins/security_solution/server/index.ts -> x-pack/plugins/security_solution/server/plugin.ts -> x-pack/plugins/security_solution/server/lib/compose/kibana.ts -> x-pack/plugins/security_solution/server/endpoint/types.ts -> x-pack/plugins/security_solution/server/endpoint/endpoint_app_context_services.ts -> x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.ts -> x-pack/plugins/security_solution/server/endpoint/services/index.ts -> x-pack/plugins/security_solution/server/endpoint/services/artifacts/index.ts -> x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/index.ts -> x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/manifest_manager.ts 06) x-pack/plugins/lists/server/index.ts -> x-pack/plugins/lists/server/plugin.ts -> x-pack/plugins/lists/server/routes/init_routes.ts -> x-pack/plugins/lists/server/types.ts -> x-pack/plugins/lists/server/services/lists/list_client.ts -> x-pack/plugins/lists/server/siem_server_deps.ts -> x-pack/plugins/security_solution/server/index.ts -> x-pack/plugins/security_solution/server/plugin.ts -> x-pack/plugins/security_solution/server/lib/compose/kibana.ts -> x-pack/plugins/security_solution/server/endpoint/types.ts -> x-pack/plugins/security_solution/server/endpoint/endpoint_app_context_services.ts -> x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.ts -> x-pack/plugins/security_solution/server/endpoint/services/index.ts -> x-pack/plugins/security_solution/server/endpoint/services/artifacts/index.ts -> x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/index.ts -> x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/manifest_manager.ts -> x-pack/plugins/security_solution/server/endpoint/lib/artifacts/index.ts -> x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.ts 07) x-pack/plugins/lists/server/index.ts -> x-pack/plugins/lists/server/plugin.ts -> x-pack/plugins/lists/server/routes/init_routes.ts -> x-pack/plugins/lists/server/types.ts -> x-pack/plugins/lists/server/services/lists/list_client.ts -> x-pack/plugins/lists/server/siem_server_deps.ts -> x-pack/plugins/security_solution/server/index.ts -> x-pack/plugins/security_solution/server/plugin.ts -> x-pack/plugins/security_solution/server/lib/compose/kibana.ts -> x-pack/plugins/security_solution/server/endpoint/types.ts -> x-pack/plugins/security_solution/server/endpoint/endpoint_app_context_services.ts -> x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.ts -> x-pack/plugins/security_solution/server/fleet_integration/handlers/install_prepackaged_rules.ts 08) x-pack/plugins/lists/server/index.ts -> x-pack/plugins/lists/server/plugin.ts -> x-pack/plugins/lists/server/routes/init_routes.ts -> x-pack/plugins/lists/server/types.ts -> x-pack/plugins/lists/server/services/lists/list_client.ts -> x-pack/plugins/lists/server/siem_server_deps.ts -> x-pack/plugins/security_solution/server/index.ts -> x-pack/plugins/security_solution/server/plugin.ts -> x-pack/plugins/security_solution/server/lib/compose/kibana.ts -> x-pack/plugins/security_solution/server/endpoint/types.ts -> x-pack/plugins/security_solution/server/endpoint/endpoint_app_context_services.ts -> x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.ts -> x-pack/plugins/security_solution/server/fleet_integration/handlers/install_prepackaged_rules.ts -> x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/add_prepackaged_rules_route.ts 09) x-pack/plugins/lists/server/index.ts -> x-pack/plugins/lists/server/plugin.ts -> x-pack/plugins/lists/server/routes/init_routes.ts -> x-pack/plugins/lists/server/types.ts -> x-pack/plugins/lists/server/services/lists/list_client.ts -> x-pack/plugins/lists/server/siem_server_deps.ts -> x-pack/plugins/security_solution/server/index.ts -> x-pack/plugins/security_solution/server/plugin.ts -> x-pack/plugins/security_solution/server/lib/detection_engine/signals/types.ts 10) x-pack/plugins/lists/server/index.ts -> x-pack/plugins/lists/server/plugin.ts -> x-pack/plugins/lists/server/routes/init_routes.ts -> x-pack/plugins/lists/server/types.ts -> x-pack/plugins/lists/server/services/lists/list_client.ts -> x-pack/plugins/lists/server/siem_server_deps.ts -> x-pack/plugins/security_solution/server/index.ts -> x-pack/plugins/security_solution/server/plugin.ts -> x-pack/plugins/security_solution/server/lib/detection_engine/signals/signal_rule_alert_type.ts -> x-pack/plugins/security_solution/server/lib/detection_engine/signals/utils.ts 11) x-pack/plugins/lists/server/index.ts -> x-pack/plugins/lists/server/plugin.ts -> x-pack/plugins/lists/server/routes/init_routes.ts -> x-pack/plugins/lists/server/types.ts -> x-pack/plugins/lists/server/services/lists/list_client.ts -> x-pack/plugins/lists/server/siem_server_deps.ts -> x-pack/plugins/security_solution/server/index.ts -> x-pack/plugins/security_solution/server/plugin.ts -> x-pack/plugins/security_solution/server/lib/detection_engine/signals/signal_rule_alert_type.ts -> x-pack/plugins/security_solution/server/lib/detection_engine/signals/executors/query.ts 12) x-pack/plugins/lists/server/index.ts -> x-pack/plugins/lists/server/plugin.ts -> x-pack/plugins/lists/server/routes/init_routes.ts -> x-pack/plugins/lists/server/types.ts -> x-pack/plugins/lists/server/services/lists/list_client.ts -> x-pack/plugins/lists/server/siem_server_deps.ts -> x-pack/plugins/security_solution/server/index.ts -> x-pack/plugins/security_solution/server/plugin.ts -> x-pack/plugins/security_solution/server/lib/detection_engine/signals/signal_rule_alert_type.ts -> x-pack/plugins/security_solution/server/lib/detection_engine/signals/executors/query.ts -> x-pack/plugins/security_solution/server/lib/detection_engine/signals/search_after_bulk_create.ts -> x-pack/plugins/security_solution/server/lib/detection_engine/signals/filters/filter_events_against_list.ts -> x-pack/plugins/security_solution/server/lib/detection_engine/signals/filters/types.ts 13) x-pack/plugins/lists/server/index.ts -> x-pack/plugins/lists/server/plugin.ts -> x-pack/plugins/lists/server/routes/init_routes.ts -> x-pack/plugins/lists/server/types.ts -> x-pack/plugins/lists/server/services/lists/list_client.ts -> x-pack/plugins/lists/server/siem_server_deps.ts -> x-pack/plugins/security_solution/server/index.ts -> x-pack/plugins/security_solution/server/plugin.ts -> x-pack/plugins/security_solution/server/lib/detection_engine/signals/signal_rule_alert_type.ts -> x-pack/plugins/security_solution/server/lib/detection_engine/signals/executors/threat_match.ts 14) x-pack/plugins/lists/server/index.ts -> x-pack/plugins/lists/server/plugin.ts -> x-pack/plugins/lists/server/routes/init_routes.ts -> x-pack/plugins/lists/server/types.ts -> x-pack/plugins/lists/server/services/lists/list_client.ts -> x-pack/plugins/lists/server/siem_server_deps.ts -> x-pack/plugins/security_solution/server/index.ts -> x-pack/plugins/security_solution/server/plugin.ts -> x-pack/plugins/security_solution/server/lib/detection_engine/signals/signal_rule_alert_type.ts -> x-pack/plugins/security_solution/server/lib/detection_engine/signals/executors/threat_match.ts -> x-pack/plugins/security_solution/server/lib/detection_engine/signals/threat_mapping/create_threat_signals.ts -> x-pack/plugins/security_solution/server/lib/detection_engine/signals/threat_mapping/get_threat_list.ts -> x-pack/plugins/security_solution/server/lib/detection_engine/signals/threat_mapping/types.ts 15) x-pack/plugins/lists/server/index.ts -> x-pack/plugins/lists/server/plugin.ts -> x-pack/plugins/lists/server/routes/init_routes.ts -> x-pack/plugins/lists/server/types.ts -> x-pack/plugins/lists/server/services/lists/list_client.ts -> x-pack/plugins/lists/server/siem_server_deps.ts -> x-pack/plugins/security_solution/server/index.ts -> x-pack/plugins/security_solution/server/plugin.ts -> x-pack/plugins/security_solution/server/lib/detection_engine/signals/signal_rule_alert_type.ts -> x-pack/plugins/security_solution/server/lib/detection_engine/signals/executors/ml.ts 16) x-pack/plugins/lists/server/index.ts -> x-pack/plugins/lists/server/plugin.ts -> x-pack/plugins/lists/server/routes/init_routes.ts -> x-pack/plugins/lists/server/types.ts -> x-pack/plugins/lists/server/services/lists/list_client.ts -> x-pack/plugins/lists/server/siem_server_deps.ts -> x-pack/plugins/security_solution/server/index.ts -> x-pack/plugins/security_solution/server/plugin.ts -> x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/index.ts -> x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/handlers.ts 17) x-pack/plugins/lists/server/index.ts -> x-pack/plugins/lists/server/plugin.ts -> x-pack/plugins/lists/server/routes/init_routes.ts -> x-pack/plugins/lists/server/types.ts -> x-pack/plugins/lists/server/services/lists/list_client.ts -> x-pack/plugins/lists/server/siem_server_deps.ts -> x-pack/plugins/security_solution/server/index.ts -> x-pack/plugins/security_solution/server/plugin.ts -> x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/index.ts -> x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/handlers.ts -> x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/service.ts 18) x-pack/plugins/lists/server/index.ts -> x-pack/plugins/lists/server/plugin.ts -> x-pack/plugins/lists/server/routes/init_routes.ts -> x-pack/plugins/lists/server/types.ts -> x-pack/plugins/lists/server/services/lists/list_client.ts -> x-pack/plugins/lists/server/siem_server_deps.ts -> x-pack/plugins/security_solution/server/index.ts -> x-pack/plugins/security_solution/server/plugin.ts -> x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/index.ts -> x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/handlers.ts -> x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/service.ts -> x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/mapping.ts debg !!!!!!!!!!!!!!!!! UP TO DATE ALLOWED LIST !!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! The declared circular dependencies allowed list is up ! ! to date and includes every plugin listed in above paths. ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! The allowed circular dependencies list is (#3): 'x-pack/plugins/lists -> x-pack/plugins/security_solution', succ None non allowed circular dependencies were found ``` Now you get: ``` debg !!!!!!!!!!!!!!!!! UP TO DATE ALLOWED LIST !!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! The declared circular dependencies allowed list is up ! ! to date and includes every plugin listed in above paths. ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! The allowed circular dependencies list is (#1): 'x-pack/plugins/lists -> x-pack/plugins/security_solution', succ None non allowed circular dependencies were found ``` ### Checklist Delete any items that are not applicable to this PR. - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
…-security-solution-es-utils package (elastic#99828) (elastic#100001) ## Summary Fixes the hopefully last circular dependency issues between security solutions and lists. * Adds a package of `@kbn/securitysolution-es-utils` and moves files from security solutions into that package. * Re-ingests that package back into lists Before this PR if you ran: ```ts node scripts/find_plugins_with_circular_deps.js --debug ``` Then you would get: ``` debg !!!!!!!!!!!!!! CIRCULAR DEPENDENCIES FOUND !!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! Circular dependencies were found, you can find below ! ! all the paths involved. ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! debg 01) x-pack/plugins/lists/server/index.ts -> x-pack/plugins/lists/server/plugin.ts -> x-pack/plugins/lists/server/routes/init_routes.ts -> x-pack/plugins/lists/server/types.ts -> x-pack/plugins/lists/server/services/lists/list_client.ts -> x-pack/plugins/lists/server/siem_server_deps.ts -> x-pack/plugins/security_solution/server/index.ts -> x-pack/plugins/security_solution/server/plugin.ts 02) x-pack/plugins/lists/server/index.ts -> x-pack/plugins/lists/server/plugin.ts -> x-pack/plugins/lists/server/routes/init_routes.ts -> x-pack/plugins/lists/server/types.ts -> x-pack/plugins/lists/server/services/lists/list_client.ts -> x-pack/plugins/lists/server/siem_server_deps.ts -> x-pack/plugins/security_solution/server/index.ts -> x-pack/plugins/security_solution/server/plugin.ts -> x-pack/plugins/security_solution/server/lib/compose/kibana.ts -> x-pack/plugins/security_solution/server/lib/framework/kibana_framework_adapter.ts -> x-pack/plugins/security_solution/server/types.ts 03) x-pack/plugins/lists/server/index.ts -> x-pack/plugins/lists/server/plugin.ts -> x-pack/plugins/lists/server/routes/init_routes.ts -> x-pack/plugins/lists/server/types.ts -> x-pack/plugins/lists/server/services/lists/list_client.ts -> x-pack/plugins/lists/server/siem_server_deps.ts -> x-pack/plugins/security_solution/server/index.ts -> x-pack/plugins/security_solution/server/plugin.ts -> x-pack/plugins/security_solution/server/lib/compose/kibana.ts -> x-pack/plugins/security_solution/server/endpoint/types.ts -> x-pack/plugins/security_solution/server/endpoint/endpoint_app_context_services.ts 04) x-pack/plugins/lists/server/index.ts -> x-pack/plugins/lists/server/plugin.ts -> x-pack/plugins/lists/server/routes/init_routes.ts -> x-pack/plugins/lists/server/types.ts -> x-pack/plugins/lists/server/services/lists/list_client.ts -> x-pack/plugins/lists/server/siem_server_deps.ts -> x-pack/plugins/security_solution/server/index.ts -> x-pack/plugins/security_solution/server/plugin.ts -> x-pack/plugins/security_solution/server/lib/compose/kibana.ts -> x-pack/plugins/security_solution/server/endpoint/types.ts -> x-pack/plugins/security_solution/server/endpoint/endpoint_app_context_services.ts -> x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.ts 05) x-pack/plugins/lists/server/index.ts -> x-pack/plugins/lists/server/plugin.ts -> x-pack/plugins/lists/server/routes/init_routes.ts -> x-pack/plugins/lists/server/types.ts -> x-pack/plugins/lists/server/services/lists/list_client.ts -> x-pack/plugins/lists/server/siem_server_deps.ts -> x-pack/plugins/security_solution/server/index.ts -> x-pack/plugins/security_solution/server/plugin.ts -> x-pack/plugins/security_solution/server/lib/compose/kibana.ts -> x-pack/plugins/security_solution/server/endpoint/types.ts -> x-pack/plugins/security_solution/server/endpoint/endpoint_app_context_services.ts -> x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.ts -> x-pack/plugins/security_solution/server/endpoint/services/index.ts -> x-pack/plugins/security_solution/server/endpoint/services/artifacts/index.ts -> x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/index.ts -> x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/manifest_manager.ts 06) x-pack/plugins/lists/server/index.ts -> x-pack/plugins/lists/server/plugin.ts -> x-pack/plugins/lists/server/routes/init_routes.ts -> x-pack/plugins/lists/server/types.ts -> x-pack/plugins/lists/server/services/lists/list_client.ts -> x-pack/plugins/lists/server/siem_server_deps.ts -> x-pack/plugins/security_solution/server/index.ts -> x-pack/plugins/security_solution/server/plugin.ts -> x-pack/plugins/security_solution/server/lib/compose/kibana.ts -> x-pack/plugins/security_solution/server/endpoint/types.ts -> x-pack/plugins/security_solution/server/endpoint/endpoint_app_context_services.ts -> x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.ts -> x-pack/plugins/security_solution/server/endpoint/services/index.ts -> x-pack/plugins/security_solution/server/endpoint/services/artifacts/index.ts -> x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/index.ts -> x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/manifest_manager.ts -> x-pack/plugins/security_solution/server/endpoint/lib/artifacts/index.ts -> x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.ts 07) x-pack/plugins/lists/server/index.ts -> x-pack/plugins/lists/server/plugin.ts -> x-pack/plugins/lists/server/routes/init_routes.ts -> x-pack/plugins/lists/server/types.ts -> x-pack/plugins/lists/server/services/lists/list_client.ts -> x-pack/plugins/lists/server/siem_server_deps.ts -> x-pack/plugins/security_solution/server/index.ts -> x-pack/plugins/security_solution/server/plugin.ts -> x-pack/plugins/security_solution/server/lib/compose/kibana.ts -> x-pack/plugins/security_solution/server/endpoint/types.ts -> x-pack/plugins/security_solution/server/endpoint/endpoint_app_context_services.ts -> x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.ts -> x-pack/plugins/security_solution/server/fleet_integration/handlers/install_prepackaged_rules.ts 08) x-pack/plugins/lists/server/index.ts -> x-pack/plugins/lists/server/plugin.ts -> x-pack/plugins/lists/server/routes/init_routes.ts -> x-pack/plugins/lists/server/types.ts -> x-pack/plugins/lists/server/services/lists/list_client.ts -> x-pack/plugins/lists/server/siem_server_deps.ts -> x-pack/plugins/security_solution/server/index.ts -> x-pack/plugins/security_solution/server/plugin.ts -> x-pack/plugins/security_solution/server/lib/compose/kibana.ts -> x-pack/plugins/security_solution/server/endpoint/types.ts -> x-pack/plugins/security_solution/server/endpoint/endpoint_app_context_services.ts -> x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.ts -> x-pack/plugins/security_solution/server/fleet_integration/handlers/install_prepackaged_rules.ts -> x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/add_prepackaged_rules_route.ts 09) x-pack/plugins/lists/server/index.ts -> x-pack/plugins/lists/server/plugin.ts -> x-pack/plugins/lists/server/routes/init_routes.ts -> x-pack/plugins/lists/server/types.ts -> x-pack/plugins/lists/server/services/lists/list_client.ts -> x-pack/plugins/lists/server/siem_server_deps.ts -> x-pack/plugins/security_solution/server/index.ts -> x-pack/plugins/security_solution/server/plugin.ts -> x-pack/plugins/security_solution/server/lib/detection_engine/signals/types.ts 10) x-pack/plugins/lists/server/index.ts -> x-pack/plugins/lists/server/plugin.ts -> x-pack/plugins/lists/server/routes/init_routes.ts -> x-pack/plugins/lists/server/types.ts -> x-pack/plugins/lists/server/services/lists/list_client.ts -> x-pack/plugins/lists/server/siem_server_deps.ts -> x-pack/plugins/security_solution/server/index.ts -> x-pack/plugins/security_solution/server/plugin.ts -> x-pack/plugins/security_solution/server/lib/detection_engine/signals/signal_rule_alert_type.ts -> x-pack/plugins/security_solution/server/lib/detection_engine/signals/utils.ts 11) x-pack/plugins/lists/server/index.ts -> x-pack/plugins/lists/server/plugin.ts -> x-pack/plugins/lists/server/routes/init_routes.ts -> x-pack/plugins/lists/server/types.ts -> x-pack/plugins/lists/server/services/lists/list_client.ts -> x-pack/plugins/lists/server/siem_server_deps.ts -> x-pack/plugins/security_solution/server/index.ts -> x-pack/plugins/security_solution/server/plugin.ts -> x-pack/plugins/security_solution/server/lib/detection_engine/signals/signal_rule_alert_type.ts -> x-pack/plugins/security_solution/server/lib/detection_engine/signals/executors/query.ts 12) x-pack/plugins/lists/server/index.ts -> x-pack/plugins/lists/server/plugin.ts -> x-pack/plugins/lists/server/routes/init_routes.ts -> x-pack/plugins/lists/server/types.ts -> x-pack/plugins/lists/server/services/lists/list_client.ts -> x-pack/plugins/lists/server/siem_server_deps.ts -> x-pack/plugins/security_solution/server/index.ts -> x-pack/plugins/security_solution/server/plugin.ts -> x-pack/plugins/security_solution/server/lib/detection_engine/signals/signal_rule_alert_type.ts -> x-pack/plugins/security_solution/server/lib/detection_engine/signals/executors/query.ts -> x-pack/plugins/security_solution/server/lib/detection_engine/signals/search_after_bulk_create.ts -> x-pack/plugins/security_solution/server/lib/detection_engine/signals/filters/filter_events_against_list.ts -> x-pack/plugins/security_solution/server/lib/detection_engine/signals/filters/types.ts 13) x-pack/plugins/lists/server/index.ts -> x-pack/plugins/lists/server/plugin.ts -> x-pack/plugins/lists/server/routes/init_routes.ts -> x-pack/plugins/lists/server/types.ts -> x-pack/plugins/lists/server/services/lists/list_client.ts -> x-pack/plugins/lists/server/siem_server_deps.ts -> x-pack/plugins/security_solution/server/index.ts -> x-pack/plugins/security_solution/server/plugin.ts -> x-pack/plugins/security_solution/server/lib/detection_engine/signals/signal_rule_alert_type.ts -> x-pack/plugins/security_solution/server/lib/detection_engine/signals/executors/threat_match.ts 14) x-pack/plugins/lists/server/index.ts -> x-pack/plugins/lists/server/plugin.ts -> x-pack/plugins/lists/server/routes/init_routes.ts -> x-pack/plugins/lists/server/types.ts -> x-pack/plugins/lists/server/services/lists/list_client.ts -> x-pack/plugins/lists/server/siem_server_deps.ts -> x-pack/plugins/security_solution/server/index.ts -> x-pack/plugins/security_solution/server/plugin.ts -> x-pack/plugins/security_solution/server/lib/detection_engine/signals/signal_rule_alert_type.ts -> x-pack/plugins/security_solution/server/lib/detection_engine/signals/executors/threat_match.ts -> x-pack/plugins/security_solution/server/lib/detection_engine/signals/threat_mapping/create_threat_signals.ts -> x-pack/plugins/security_solution/server/lib/detection_engine/signals/threat_mapping/get_threat_list.ts -> x-pack/plugins/security_solution/server/lib/detection_engine/signals/threat_mapping/types.ts 15) x-pack/plugins/lists/server/index.ts -> x-pack/plugins/lists/server/plugin.ts -> x-pack/plugins/lists/server/routes/init_routes.ts -> x-pack/plugins/lists/server/types.ts -> x-pack/plugins/lists/server/services/lists/list_client.ts -> x-pack/plugins/lists/server/siem_server_deps.ts -> x-pack/plugins/security_solution/server/index.ts -> x-pack/plugins/security_solution/server/plugin.ts -> x-pack/plugins/security_solution/server/lib/detection_engine/signals/signal_rule_alert_type.ts -> x-pack/plugins/security_solution/server/lib/detection_engine/signals/executors/ml.ts 16) x-pack/plugins/lists/server/index.ts -> x-pack/plugins/lists/server/plugin.ts -> x-pack/plugins/lists/server/routes/init_routes.ts -> x-pack/plugins/lists/server/types.ts -> x-pack/plugins/lists/server/services/lists/list_client.ts -> x-pack/plugins/lists/server/siem_server_deps.ts -> x-pack/plugins/security_solution/server/index.ts -> x-pack/plugins/security_solution/server/plugin.ts -> x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/index.ts -> x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/handlers.ts 17) x-pack/plugins/lists/server/index.ts -> x-pack/plugins/lists/server/plugin.ts -> x-pack/plugins/lists/server/routes/init_routes.ts -> x-pack/plugins/lists/server/types.ts -> x-pack/plugins/lists/server/services/lists/list_client.ts -> x-pack/plugins/lists/server/siem_server_deps.ts -> x-pack/plugins/security_solution/server/index.ts -> x-pack/plugins/security_solution/server/plugin.ts -> x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/index.ts -> x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/handlers.ts -> x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/service.ts 18) x-pack/plugins/lists/server/index.ts -> x-pack/plugins/lists/server/plugin.ts -> x-pack/plugins/lists/server/routes/init_routes.ts -> x-pack/plugins/lists/server/types.ts -> x-pack/plugins/lists/server/services/lists/list_client.ts -> x-pack/plugins/lists/server/siem_server_deps.ts -> x-pack/plugins/security_solution/server/index.ts -> x-pack/plugins/security_solution/server/plugin.ts -> x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/index.ts -> x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/handlers.ts -> x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/service.ts -> x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/mapping.ts debg !!!!!!!!!!!!!!!!! UP TO DATE ALLOWED LIST !!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! The declared circular dependencies allowed list is up ! ! to date and includes every plugin listed in above paths. ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! The allowed circular dependencies list is (#3): 'x-pack/plugins/lists -> x-pack/plugins/security_solution', succ None non allowed circular dependencies were found ``` Now you get: ``` debg !!!!!!!!!!!!!!!!! UP TO DATE ALLOWED LIST !!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! The declared circular dependencies allowed list is up ! ! to date and includes every plugin listed in above paths. ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! The allowed circular dependencies list is (#1): 'x-pack/plugins/lists -> x-pack/plugins/security_solution', succ None non allowed circular dependencies were found ``` ### Checklist Delete any items that are not applicable to this PR. - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios Co-authored-by: Frank Hassanabad <frank.hassanabad@elastic.co>
… Synchronization section (elastic#113982) * Rename method We have to set the source from the sync logic file and this naming makes more sense * Wire up Enable Synchronization toggle * Remove sync controls from source settings * Refactor to pass in contentSource as prop Because we have a child logic file, SynchronizationLogic, we have to pass the content source into it for reading its values from SourceLogic. There are 3 ways to do this: 1. Access the source directly at SourceLogic.values.contentSource - This how we normally do it. The problem here is that SourceLogic is not mounted when the default values are set in the reducers. This caused the UI to break and I could not find a way to safely mount SourceLogic before this logic file needed it. 2. Use the connect property and connect to Sourcelogic to access contentSource - This actually worked great but our test helper does not work well with it and after an hour or so trying to make it work, I punted and decided to go with #3 below. 3. Pass the contentSource as a prop - This works great and is easy to test. The only drawback is that all other components that use the SynchronizationLogic file have to also pass in the content source. This commit does just that. * Add logic for Objects and assets view * Add content to Objects and assets view * Add fallback for `nextStart` that is in the past This is slightly beyond the scope of this PR but trying to make the final PR more manageable. There is an edge case where a running job lists the nextStart in the past if it is is running. After a lengthy Slack convo, it was decided to catch these in the UI and show a fallback string instead of something like “Next run 3 hours ago” * reduce -> map From previous PR feedback * Fix casing on i18n ID
… Synchronization section (elastic#113982) (elastic#114015) * Rename method We have to set the source from the sync logic file and this naming makes more sense * Wire up Enable Synchronization toggle * Remove sync controls from source settings * Refactor to pass in contentSource as prop Because we have a child logic file, SynchronizationLogic, we have to pass the content source into it for reading its values from SourceLogic. There are 3 ways to do this: 1. Access the source directly at SourceLogic.values.contentSource - This how we normally do it. The problem here is that SourceLogic is not mounted when the default values are set in the reducers. This caused the UI to break and I could not find a way to safely mount SourceLogic before this logic file needed it. 2. Use the connect property and connect to Sourcelogic to access contentSource - This actually worked great but our test helper does not work well with it and after an hour or so trying to make it work, I punted and decided to go with #3 below. 3. Pass the contentSource as a prop - This works great and is easy to test. The only drawback is that all other components that use the SynchronizationLogic file have to also pass in the content source. This commit does just that. * Add logic for Objects and assets view * Add content to Objects and assets view * Add fallback for `nextStart` that is in the past This is slightly beyond the scope of this PR but trying to make the final PR more manageable. There is an edge case where a running job lists the nextStart in the past if it is is running. After a lengthy Slack convo, it was decided to catch these in the UI and show a fallback string instead of something like “Next run 3 hours ago” * reduce -> map From previous PR feedback * Fix casing on i18n ID Co-authored-by: Scotty Bollinger <scotty.bollinger@elastic.co>
* First very draft version * Added validation, clean up code * Some fixes * Adapt components to the new UI design * Some fixes * Fix validation * Fix lint errors * Fix metric vis for new color stop UI * Fix problems with keeping state of auto detecting max/min value * Add tests * Fix CI * Fix tests * Fix some lint problems * Fix CI * Fix min/max behavior for heatmap * Fix checks. * Fix auto value when we add new color range * Fix check task * Fix some issues * Some fixes * Fix functional tests * small fix for heatmap * Fix test * Update comment-description * fix PR comments * do some refactoring (work in progress) * do some refactoring (work in progress) * some cleanup * some cleanup * wp: fix validation * wip: fix validation * push some refactoring * do some refactoring * add useDebounce * add useReducer * remove autoValue * fix validation * update validation logic * revert getStopsForFixedMode * some updates * update EuiColorPaletteDisplay palette arg * push some logic * push some logic * update validation messages * push some updates * fix some logic * fix some cases * fix JES * fix CI * reset continuity * fix functional tests * fix issue with -infinite/+infinite * fix CI * push some updates * Update x-pack/plugins/lens/public/shared_components/coloring/color_ranges/color_ranges_reducer.tsx Co-authored-by: Marco Liberati <dej611@users.noreply.github.com> * Update x-pack/plugins/lens/public/shared_components/coloring/color_ranges/color_ranges_validation.tsx Co-authored-by: Marco Liberati <dej611@users.noreply.github.com> * fix some comments * make color ranges crud methods "immutable" * fix Max. value input size * fix PR comment * fix tests * Fix edit/min/max buttons behavior * Fix entering decimal values and max/min value behavior * Fix lint * Fix getNormalizedValueByRange for case when min == max * Fix table cell coloring * add warning messages * Move color ranges reducer upper to palette_configuration (#3) * Move color ranges reducer upper to palette_configuration * Remove from local state unnecessary params * Fix some cases * Fix lint * use one dataBounds type across palette configuration * cleanup * Fix some behavior * Fix checks * Some clean up * Some fixes * Some fixes * Fix validation * Fix CI * Add unit tests for color_ranges_crud util * Fix unit test * Add unit tests for color ranges utils.ts * Add allowEditMinMaxValues props and fix validation * Fix CI * Rename allowEditMinMaxValues to disableSwitchingContinuity * Add unit tests for color_ranges_validation * Add unit tests for updateRangeType and changeColorPalette functions * Add unit tests for color_ranges_extra_actions * Fix checks * Clean up code * Some fixes * Fix unit-tests * Fix comments * Some changes * Fix tests * Fix all comments * Fix Checks * Fix CI Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Alexey Antonov <alexwizp@gmail.com> Co-authored-by: Marco Liberati <dej611@users.noreply.github.com>
* Client side execution app level context propagation * context$ + apm rum integration * invert the context parent \ child relationship (cc @mikhail) move more things to top level context * Pass down context to apm on server * types * eslint * parent <> child * docs + eslint + jest * execution context mock * eslint * jest * jest * server jest * check * jest * storybook * jest * report the current space * fix server side context container * Remove spaces for now * docssss * jest * lint * test * docs * revert file * doc * all context params are optional * clear on page change * lint * ts * skipped test again * testing fixes * oops * code review #1 * code review #2 * getAsLabels * maps inherit dashboard context * docs * ts * Give common context to all vis editors * fix test * ts \ es \ tests * labels * missing types * docsy docs * cr #3 * improve jest * Use editor name * Update src/plugins/visualizations/public/visualize_app/components/visualize_editor.tsx Co-authored-by: Marco Liberati <dej611@users.noreply.github.com> * fix maps context * jest tests for maps * cr * docs * Update execution_context.test.ts * docs * lint Co-authored-by: Marco Liberati <dej611@users.noreply.github.com>
@stacey-gammon Based on elastic#10434, I wanted to try out a couple ideas and see what you and @weltenwort thought.
Instead of assigning instances of
Pager
andSelectedIds
to the state object, I tried to reserve that object for primitive values only. In this case,currentPage
(number) andselectedIds
(array).Then I tried to create pure functional helpers for reasoning and manipulating this state. I created a new
Pager
class (which needs to be extracted) and refactoredItemSelectionActions
to export pure functions to support selection behavior. I was also able to remove the dependency onPagerActions
.The ideas I want to focus on are:
Edit: I just did a second stage of exploration which builds on this one (cjcenizal#16)