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

[ui/public/utils] Copy rarely used items to where they are consumed #53819

Merged
merged 18 commits into from
Jan 8, 2020

Conversation

alexwizp
Copy link
Contributor

@alexwizp alexwizp commented Dec 27, 2019

Closes: #52841

Summary

There are a few utils in src/legacy/ui/public/utils that are small and not widely used. Rather than find a "shared" place for them to live, it is probably cleaner to just copy them to the places that rely on them:

  • case_conversion
    • keysToSnakeCaseShallow + tests
      • copy to src/legacy/server/status/lib
      • remove duplicate from src/legacy/utils/case_conversion.ts
    • keysToCamelCaseShallow + tests
      • copy to src/legacy/core_plugins/kibana/public/management
      • remove duplicate from src/legacy/utils/case_conversion.ts
  • collection
    • organizeBy + tests 👉 src/legacy/ui/public/indexed_array
    • pushAll + tests -- delete, unused
  • diff_object + tests 👉ui/state_management
  • function was removed
  • key_map 👉ui/directives
    • also update import from src/test_utils/public
  • math
    • leastCommonMultiple 👉ui/vis (update imports in ui/vis/lib and ui/vis/editor
    • greatestCommonDivisor -- move with leastCommonMultiple, but do not export as it is unused outside of this file
  • numeric 👉src/legacy/core_plugins/kibana/public/management
  • parse_interval 👉src/legacy/core_plugins/data/common
  • sort_prefix_first 👉x-pack/legacy/plugins/kuery_autocomplete
  • string_utils
  • supports 👉src/legacy/core_plugins/tile_map/public

Checklist

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

For maintainers

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

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

# Conflicts:
#	src/legacy/ui/public/vis/editors/config/editor_config_providers.ts
@alexwizp alexwizp self-assigned this Jan 3, 2020
@elasticmachine
Copy link
Contributor

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

@alexwizp alexwizp added v7.6.0 v8.0.0 release_note:skip Skip the PR/issue when compiling release notes Feature:NP Migration review labels Jan 3, 2020
@alexwizp alexwizp closed this Jan 4, 2020
@alexwizp alexwizp deleted the 52841 branch January 4, 2020 08:05
@alexwizp alexwizp restored the 52841 branch January 4, 2020 08:05
@alexwizp alexwizp reopened this Jan 4, 2020
@alexwizp alexwizp marked this pull request as ready for review January 4, 2020 09:56
@alexwizp alexwizp requested review from a team as code owners January 4, 2020 09:56
@@ -33,10 +33,10 @@ import _ from 'lodash';
* @return {array} - the objs argument
*/
export function move(
objs: object[],
objs: any[],
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did you broaden the type here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Please see tests, looks like that function works fine with primitive types too

image

@@ -20,7 +20,7 @@
import $ from 'jquery';
import _ from 'lodash';
import Bluebird from 'bluebird';
import { keyMap } from 'ui/utils/key_map';
import { keyMap } from 'ui/directives/key_map';
Copy link
Contributor

Choose a reason for hiding this comment

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

From what I'm seeing, key_map is not a directive.
So why move it there?

Copy link
Contributor

@lizozom lizozom left a comment

Choose a reason for hiding this comment

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

Overall LGTM
Added a couple of minor comments.

@alexwizp
Copy link
Contributor Author

alexwizp commented Jan 6, 2020

@elasticmachine merge upstream

Copy link
Contributor

@pgayvallet pgayvallet left a comment

Choose a reason for hiding this comment

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

LGTM for platform changes

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.

Code changes LGTM.

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

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

@alexwizp alexwizp merged commit 71ff2de into elastic:master Jan 8, 2020
alexwizp added a commit to alexwizp/kibana that referenced this pull request Jan 8, 2020
…lastic#53819)

* [ui/public/utils] Copy rarely used items to where they are consumed

Closes: elastic#52841

* sort_prefix_first 👉x-pack/legacy/plugins/kuery_autocomplete

* numeric 👉src/legacy/core_plugins/kibana/public/management

* diff_object + tests 👉ui/state_management

* function + tests 👉ui/state_management (function.js was removed!)

* key_map 👉ui/directives

* leastCommonMultiple 👉ui/vis

* string_utils 👉ui/saved_objects

* collection

* parse_interval

* it -> test

* fix CI

* fix PR comments

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
gmmorris added a commit to gmmorris/kibana that referenced this pull request Jan 8, 2020
* master: (55 commits)
  [ui/public/utils] Copy rarely used items to where they are consumed (elastic#53819)
  set AppArch team as an owner of the search endpoints (elastic#54131)
  Don't expose Elasticsearch client as Observable (elastic#53824)
  [SIEM] Cleanup unnecessary use of enzyme-to-json (elastic#53980)
  fix ui exports doc (elastic#54138)
  change markdown element title (elastic#54194)
  [Logs UI] Refactor log position to hooks (elastic#53540)
  [SIEM] Implement NP Plugin Setup (elastic#54030)
  [DOCS] Updates ML links (elastic#53613)
  sort renovate packages in config
  Spaces - fix flakey api tests (elastic#54154)
  Remove dependency that was causing effect to re-execute infinitely. (elastic#54160)
  [dev/run] expose unexpected flags as more than just names (elastic#54080)
  [DOCS] Moves index pattern doc to Discover (elastic#53347)
  [SIEM] Cleanup React imports (elastic#53981)
  Update eslint related packages (elastic#54107)
  [Uptime] Added date range filter into expanded list query (elastic#52609)
  [SIEM] Add react/display-name eslint rule (elastic#53107)
  [SIEM] Enable eslint prefer-template rule (elastic#53983)
  Elasticsearch snapshots automation (elastic#53706)
  ...
alexwizp added a commit that referenced this pull request Jan 8, 2020
…53819) (#54233)

* [ui/public/utils] Copy rarely used items to where they are consumed

Closes: #52841

* sort_prefix_first 👉x-pack/legacy/plugins/kuery_autocomplete

* numeric 👉src/legacy/core_plugins/kibana/public/management

* diff_object + tests 👉ui/state_management

* function + tests 👉ui/state_management (function.js was removed!)

* key_map 👉ui/directives

* leastCommonMultiple 👉ui/vis

* string_utils 👉ui/saved_objects

* collection

* parse_interval

* it -> test

* fix CI

* fix PR comments

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
mbondyra added a commit to mbondyra/kibana that referenced this pull request Jan 8, 2020
….com:mbondyra/kibana into IS-50036_show-sum-for-a-field-with-formatter

* 'IS-50036_show-sum-for-a-field-with-formatter' of github.com:mbondyra/kibana:
  [Telemetry] Fix license page crashing on telemetry.enabled: fa… (elastic#54174)
  [ui/public/utils] Copy rarely used items to where they are consumed (elastic#53819)
  set AppArch team as an owner of the search endpoints (elastic#54131)
  Don't expose Elasticsearch client as Observable (elastic#53824)
  [SIEM] Cleanup unnecessary use of enzyme-to-json (elastic#53980)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ui/public/utils] Copy rarely used items to where they are consumed
6 participants