Commit graph

137 commits

Author SHA1 Message Date
Chandler Prall
84d7b9e4ac
Upgrade EUI to v30.6.0 and update jest snapshots (#85504) 2020-12-14 15:18:29 -07:00
Jean-Louis Leysens
b8ab3fdafc
[ILM] Rollover field redesign (#85579)
* implement form-level support for using default rollover action

* slight update to copy

* added use default rollover switch and tooltips for detailed copy

* fix legacy integration tests and do not unmount rollover field!!

* remove unused import

* fix client integration tests

* updated form to use new isUsingRollover check

* fix serialization of rollover

* Update x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/hot_phase/hot_phase.tsx

Co-authored-by: Adam Locke <adam.locke@elastic.co>

* Update x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/hot_phase/hot_phase.tsx

Co-authored-by: Adam Locke <adam.locke@elastic.co>

* Update x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/hot_phase/hot_phase.tsx

Co-authored-by: Adam Locke <adam.locke@elastic.co>

Co-authored-by: Yulia Čech <6585477+yuliacech@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Adam Locke <adam.locke@elastic.co>
2020-12-14 21:10:00 +01:00
Yulia Čech
8858749ce4
[ILM] Added readonly field in hot phase (#85419)
* [ILM] Added readonly field in hot phase

* [ILM] Added readonly field in warm phase

* Update x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/readonly_field.tsx

Co-authored-by: Alison Goryachev <alisonmllr20@gmail.com>

* Update x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/form/schema.ts

Co-authored-by: Alison Goryachev <alisonmllr20@gmail.com>

* Update x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/hot_phase/hot_phase.tsx

Co-authored-by: Alison Goryachev <alisonmllr20@gmail.com>

* Updated labels for the form

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Alison Goryachev <alisonmllr20@gmail.com>
2020-12-14 17:27:56 +01:00
Jean-Louis Leysens
b24ee4b3ff
fix serialization of rollover (#85582) 2020-12-10 17:53:01 +01:00
Jean-Louis Leysens
f6c149f4f2
[ILM] Moved error and loading notices for data allocation (#85154)
* moved error and loading notices for data allocation field to below description

* removed test code

* expect controls to be showing, only render notice after network request has finished

* added loading spinner for field inputs

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-12-10 14:39:57 +01:00
Jean-Louis Leysens
dbd14ad39f
[ILM] Add shrink field to hot phase (#84087)
* moved shrink field to shared_fields and added it to the hot phase

* updated test

* update legacy jest test

* removed configuration context for now

* remove unused i18n and remove duplicated isRolloverEnabled check;

* fixed shrink field to use new described field component

* added test for removing shrink field in serialization and re-ordered fields in hot phase advanced
2020-12-10 10:50:31 +01:00
Jean-Louis Leysens
7fc7fe325c
[ILM] Show forcemerge in hot when rollover is searchable snapshot is enabled (#85292)
* pivot to different rollover validation mechanism

* implement stakeholder feedback to show forcemerge in hot

* replace ternary with if..else statements

* make rollover validation test more comprehensive
2020-12-09 12:29:42 +01:00
Jean-Louis Leysens
8eae30c82f
[ILM] Fix set replicas serialization and validation (#85233)
* added fix for serializing replicas and updated validation to correctly check for non negative nr

* added tests and fixed incorrect use of warm phase setting in cold phase

* remove unused import

* clean up use of Boolean and rename nrOfReplicas -> numberOfReplicas

* fix comment
2020-12-08 16:33:07 +01:00
Jean-Louis Leysens
6ff71992a3
[ILM] Fix hiding/disabling searchable snapshot field when rollover is disabled (#85169)
* fix hiding/disabling searchable snapshot field when rollover is disabled

* added test

* fix i18n

* for now, we hide the forcemerge field in hot

* implement copy updates

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-12-08 16:21:10 +01:00
Jean-Louis Leysens
fac1f1204d
[ILM] Reposition form toggles (#85143)
* merged toggleable field and described form component and moved toggle to left

* moved all toggles to left, renamed DescribedFormField -> DescribedFormRow and added new ToggleFieldWithDescribedFormRow component

* added new prop fieldNotices to render callouts in correct position on the left
2020-12-08 08:47:26 +01:00
Jean-Louis Leysens
34be1e724d
[ILM] Add searchable snapshot field (#83783)
* Added server-side endpoint for getting list of repos

* part one of client side changes: added searchable snapshot field

- added to both hot and cold
- serializing into JSON payload

* make searchable snapshot field toggleable and require value when it is being used

* fix typo in file name and remove whitespace

* added searchable snapshot state context, wip

* finished updating fields to show and hide based on searchable snapshot in the hot phase

* hiding fields when searchable snapshots is enabled in hot

- removed nested EuiFieldRow components in data allocation field
- added SCSS files for data allocation field and searchable
  snapshot field

* added translations and a first hot phase serialization test

* appease type check and i18n

* added cloud-specific behaviour for searchable snapshot default inlc. test

* refactor snapshot state -> configuration issues as this a can be re-used for other issues

* added configuration context file

* hide replicas in cold if snapshotting

* updated new field copy

* update test coverage, test for hiding certain fields too

* added license check to client side!

* moved warning to below field again and moved hot phase searchable snapshot notice to right

* make described form field lazy if needed

* render field even when license requirement is not met

* update serializer for removing searchable_snapshot field

* handle 404 from ES when looking up * snapshot repos - we return an empty array

* address license TODO

* added tests for license check and removed license check HoC

* fix legacy jest tests

* added readme about legacy tests

* updated jest tests and fix type issues

* remove unused import

* refactor component names to have "Field" at the end

* refactor searchable snapshot to single interface def and add comment about force_merge_index option

* address stakeholder feebdack and pr comments

* update tests after latest changes

* link to force merge

* Revert "link to force merge"

This reverts commit 6c714fbbac.

* introduce advanced section to hot, warm and cold

* added test for correctly deserializing delete phase, and added fix

* remove unused variable

* moved fields into advanced settings

* move learn more copy below enable toggle

* fix warm phase on rollover default

* remove label space above rollover toggle

* remove unused import

* update test after fixing warm on rollover default

* removed icons in callouts in searchable snapshot field, added ability to control field toggles

* move callouts to description text

* readd warning callouts to the searchable snapshot field

* slight i18n adjustment

* made callout for actions disabled a bit smaller

* fix i18n

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-12-07 10:52:44 +01:00
Chandler Prall
2f72c8ad10
Upgrade EUI to v30.5.1 (#84677)
* Updated to eui@30.4.1, fixed types and unit tests

* Cleanup some imports

* Fix a text color swap, now back to danger text

* Bump EUI to v30.4.2

* Revert snapshot changes from ownFocus modification

* Clean up alert flyout test actions to better represent user actions

* Upgrade EUI to 30.5.1

* More accurate test interaction

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-12-04 09:39:03 -07:00
Ahmad Bamieh
aa9a353205
[Telemetry] Introduce UI Counters (#84224)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-12-04 17:47:04 +02:00
Jean-Louis Leysens
9d6d78320b
[ILM] Fix delete phase serialization bug (#84870)
* added test for correctly deserializing delete phase, and added fix

* clarify test comment

* fix serialization of hot phase to include delete action

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-12-04 16:02:00 +01:00
Tyler Smalley
b593781009
Jest multi-project configuration (#77894)
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2020-12-02 11:42:23 -08:00
Jean-Louis Leysens
8dfa489da2
[ILM] Relax POST policy route validation (#84203)
* relax policy post route validation

* update comment
2020-11-25 09:28:20 +01:00
Jean-Louis Leysens
6cce21273b
[ILM] Policy form should not throw away data (#83077)
* fix ilm policy deserialization

* reorder expected jest object to match actual

* fix removal of wait for snapshot if it is not on the form

* add client integration test for policy serialization of unknown fields

* save on a few chars

* added unit test for deserializer and serializer

* Implement feedback

- move serializer function around a little bit
- move serialize migrate and allocate function out of serializer
  file

* Updated serialization unit test coverage

- removed the "forcemergeEnabled" meta field that was not being
  used
- added test cases for deleting of values from policies

* fixed minor issue in how serialization tests are being set up

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-11-20 10:18:43 +01:00
Greg Thompson
8a7af5bbda
Upgrade EUI to v30.2.0 (#82730)
* eui to v30.2.0

* src snapshot updates

* x-pack euipanel snapshot updates

* x-pack external link updates

* security_solution_cypress external link text

* clean up
2020-11-17 14:29:57 -07:00
Tyler Smalley
aba2068291
Consolidates Jest configuration files and scripts (#82671)
Jest tests are currently organized into main configuration files (src/dev/jest/config.js and x-pack/dev-tools/jest/create_jest_config.js). Both of these are similar, but very slightly due to  previously being in separate repositories. This change consolidates the scripts referenced in those configs and moves them to the `@kbn/test` project.

OSS contained an alias for `test_utils`. Those aliases have been removed in favor of importing these utilities from `@kbn/test/jest`

Blocker to #72569

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2020-11-12 16:19:56 -08:00
Yulia Čech
1de3a02a46
Fix ilm navigation (#81664)
* Fix edit policy page navigation

* Fix edit policy page navigation

* Add links to PR for explanation

* Added more tests and linked to a github issue about navigation issues

* Fix decoding function for undefined values

* Fix type check issues

* Renamed dollar sign to percent sign, added a method for (double) encoded paths and better description in test names

* Deleted Index Management from required bundles in ILM

* Fixed merge conflicts

* Revert "Deleted Index Management from required bundles in ILM"

This reverts commit 5a735dfe

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-11-10 11:09:37 +01:00
Jean-Louis Leysens
f2f76e104a
[ILM] Migrate Delete phase and name field to Form Lib (#82834)
* remove use of legacy state system and legacy serialization

* remove legacy min_age input component and re-add missing import

* rename shared -> shared_fields for more clarity

* some more cleanup and fixing regressions on policy name for creating new policy from existing policy

* move extract policy static code to lib folder and remove "policies" dir from services

* fix jest tests and minor policy flyout inconsistency

* remove legacy helper

* fix client integration tests

* fix min for set index priority

* moved save policy function into edit policy section

* remove unused translations

* refactor form files to own edit_policy/form folder

* remove "fix errors" badge to fix UX - users can see errors in line before pressing save so the value of this badge has diminished

* fix i18n after removing phase error badge

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-11-09 14:29:53 +01:00
Yulia Čech
71ec5bd36b
Add ILM url generator and use it in Index Management (#82165)
* Add ILM url generator and use in IM for cross linking to policy edit page

* Fix policy name in the link

* Add review suggestions

* Fix import

* Fix eslint error

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-11-06 15:42:51 +01:00
Jean-Louis Leysens
db8f98cc0c
[ILM] Fix breadcrumbs (#82594)
* added breadcrumb service and call on ILM pages

* add notices to legacy pattern services

* fix jest tests and create mock
2020-11-05 11:24:54 +01:00
Greg Thompson
6fdc7eb1fa
Upgrade EUI to v30.1.1 (#81499)
* eui to v30.0.0

* removed unused RecentLinks component

* update compressed -> display prop

* euiformrow compressed -> display

* euipopover remove withtitle

* euibuttongroup prop updates

* remove euibuttontoggle

* src snapshot updates

* tutorial euibuttongroup update

* x-pack snapshot updates

* euibuttongroup test updates

* TODO

* misc. js file updates

* remove euinavdrawer scss references

* translation removals

* more x-pack snapshot updates

* update data-test-subj lookup

* icons logoAMP -> logoObservability

* cypress selector updates

* update euibuttontoggle onchange, test interaction

* Fix auto-update toggle in Visualize

* some more change -> click test updates

* idtoselectedmap change

* Fix feature table button group

* Remove empty SASS file

* Fix feature table button group II

* Using `compressed` to also dictate dual range row

* Fix a few security labels

* An ML fix

* Apply suggestions from code review

Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com>

* remove unused translation

* update view_type_toggle snapshot

* more snapshot updates

* eui to 30.1.0

* undo temp ts-ignore

* more x-pack snapshot updates

* eui to 30.1.1

* update feature privilege text

* Update x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/sub_feature_form.tsx

Co-authored-by: Joe Portner <5295965+jportner@users.noreply.github.com>

* reuse i18n token

* Adapt log entry action button to new `minWidth` prop

* clean up label

* Combine auto apply strings into one

* ternary fix

* cases status useCallback

Co-authored-by: cchaos <caroline.horn@elastic.co>
Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com>
Co-authored-by: Joe Portner <5295965+jportner@users.noreply.github.com>
Co-authored-by: Felix Stürmer <stuermer@weltenwort.de>
2020-10-30 16:18:27 -06:00
Jean-Louis Leysens
ac70e1e944
[ILM] Migrate Cold phase to Form Lib (#81754)
* use form lib fields and start updating deserializer

* delete legacy data tier allocation field

* finished deserialization

* delete legacy serialization, validation and deserialization

* fix type issue and remove propertyOf for now

* fix legacy tests and create another number validator

* added serialization test coverage

* fix https://github.com/elastic/kibana/issues/81697

* clean up remaining legacy tests and slight update to existing test

* remove legacy unused components

* fix copy to be clearer for more scenarios

* remove remaining coldphase interface use and clean up unused i18n

* update default index priority for cold phase

* updated cold phase index priority to 0

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-10-28 17:10:49 +01:00
Yulia Čech
2a94139d30
Add uri decode to es_ui_shared and fix navigation issues with special characters (#80835)
* Add uri decode to es_ui_shared and fix data stream issue with % name

* Add a test for data streams tab opened for name with a dollar sign

* Import uri decode function from es_ui_shared and fix navigation issues for filters

* Add tests for data streams with special characters in name

* Revert react router navigate changes (is done in a separate PR)

* Reverting changes to dataManagement es client and get data stream api route

* Fix data stream name filter when activated from a url parameter

* Clean up for better consistency and fixes after
https://github.com/elastic/kibana/pull/81664

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-10-28 14:04:32 +01:00
Jean-Louis Leysens
1712f0d441
[ILM] Migrate Warm phase to Form Lib (#81323)
* migrate all fields on warm phase except, data alloc, replicas and shrink

* introduce edit policy context to share original policy and migrate shrink and replicas fields

* Refactored biggest field; data allocation

Copied the entire field for now duplicating all of the components

* remove unused import

* complete migration of new serialization

* Remove last vestiges of legacy warm phase

- also removed policy serialization tests for warm phase

* fix existing test coverage and remove use of "none" for node attribute

* added policy serialization tests

* remove unused translations

* Fix use of useFormData after update

- also minor refactor to use useCallback in policy flyout now
  that getFormData changes when the form data changes.

* fix import path

* simplify serialization snapshot tests

* type phases: string -> phases: Phases

* Addressed some PR review items

- refactor toggle click to take a boolean arg
- refactor selection options in data tier component to use a func
  to get select options.

* updated data tier callout logic after new changes

* getPolicy -> updatePolicy

Also rather deconstruct the validate fn from the form object

* fix detection of migrate false and refactor serialization to pure function

* fix type issue

* fix for correctly detecting policy data tier type

- with jest tests see origin here:
https://github.com/elastic/kibana/pull/81642

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-10-27 09:43:39 +01:00
Jean-Louis Leysens
0a0773a2f6
[ILM] Update show/hide data tier logic on cloud (#81455)
* Update show/hide data tier logic

only show data tier options on cloud if the cluster is not using
the deprecated node.data config and there is a data_* role
present. this will likely be a role like data_content which will
ensure that the cluster is configured with the new data tier
roles.

* refactor node role types for clarity

* added comment

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-10-26 11:37:35 +01:00
Jean-Louis Leysens
43a055f9b9
[ILM] Minor copy and link additions to cloud CTA for cold phase (#80512)
* Add CTA for warm phase too

- add/updated component integration tests for checking callouts
- sharing deployment url from cloud plugin

* update comment

* fix i18n

* scope changes to cold phase only

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-10-21 16:24:30 +02:00
Sébastien Loix
702e0c7d73
[Form lib] Export internal state instead of raw state (#80842) 2020-10-20 13:51:11 +02:00
Chandler Prall
42a1744af6
Upgrade EUI to v29.5.0 (#80753)
* Upgraded eui to v29.5.0; snapshot updates

* Cleaned up some types

* addresses feedback on types change

* Update EuiIcon snapshots in jest integration tests

* Updated snapshot from rebasing on master
2020-10-19 14:48:33 -06:00
Jean-Louis Leysens
30fc4bed7d
[ILM] Migrate Hot phase to Form Lib (#80012)
* wip

* added missing shared_imports file to index

* initial migration of hot phase to form lib

- tests are now broken
- need to break up the hot_phase file in to meaningful parts
- duplicated set_priority and forcemerge components

* Big refactor

- moved a lot of files around
- removed the need for the state to track whether rollover is set

* Integrate form lib serialization with existing serialization

- refactor serializePolicy -> legacySerializePolicy
- updated serialization of form lib to factor in pre-existing
  policy values. These should be interacted with in a non-lossy
  way.

* wip on fixing jest tests and some other refactors

* fix jest tests and other refactors

* delete existing hot phase serialization and tests

* beginning of serializer test for hot phase

* added serialization tests for form lib components

* fix some i18n issues

* fixed delete phase integration test

* move hot phase serialization test to pre-existing test location

* fix another jest test issue

* fix ui metric tracking for setting input priority in hot phase

* refactor use rollover switch to form lib component and update validation for number segments in force merge

* readded missing validation 🤦🏼‍♂️

* fix type check issues and setting of rollover enabled 🙄

* migrate all form lib components to spreading all rest props in EuiFormRow

* added comment to test helper function

* refactor test helper setPhaseIndexPriorityFormLib -> setPhaseIndexPriority

* refactor to use form schema

* Removed use of UseMultiFields component

- also fix missing "key" on react component in unrelated file
- fixed ordering of JSON in test file
- also removed default value from form schema so that when a
  value is not set for max size, max docs or max age it will
  remain unset in future policies

* update json flyout behaviour

* fix json policy serialization

* Fix type and i18n issues

* do not use form.subscribe

* add missing key value in cells

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-10-19 17:34:40 +02:00
Yulia Čech
322094a1e8
[ILM] Add esErrorHandler for the new es js client (#80302)
* [ILM] Add esErrorHandler for the new es js client

* [ILM] Fix function call params

* Rename function

* Rename function

* Rename function

* [ILM] Change import of handleEsError to lib dependency

* [ILM] Add comments about legacy and new es js client

* [ILM] Add type casting for ResponseError

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-10-16 15:52:35 +02:00
Jean-Louis Leysens
a0c649ee97
[ILM] Cloud-specific changes for 7.10 (#79650)
* added cloud cold tier specific call out, probably wip

* added jest test

* rephrase copy

* Added logic for showing/hiding data tier allocation option

- Added server-side test for detecting legacy config
- Added client-side test for asserting on cloud data tier option
  is hidden

* added test for not-on-cloud case

* Refactored logic for rendering data allocation notices

Also updated a comment.

* paraphrashing of Adams copy recommendation

* Fix comment

* address pr feedback

* clarify slight hack comment

* complete refactor of new flag for tests

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-10-13 13:41:28 +02:00
Yulia Čech
21c3e04541
[ILM] Replace legacy ES client with the new client (#78416)
* [ILM] Replace legacy ES client with the new client

* [ILM] Fix type check errors

* [ILM] Fix api integration test

* [ILM] Update error handling and integration test for the new client

* [ILM] Fix api integration test

* [ILM] Fix api integration test

* [ILM] Add a todo comment for Index Management plugin extension

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-10-12 17:05:56 +02:00
Yulia Čech
dcb646debc
[ILM] Add index_codec to forcemerge action in hot and warm phases (#78175)
* [ILM] Add index_codec to forcemerge action in hot and warm phases

* [ILM] Fix i18n check errors

* [ILM] Add code review suggestions

* [ILM] Add code review suggestions

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-10-06 14:54:11 +02:00
Jean-Louis Leysens
2904fe01b5
[ILM] Data tier notices should reflect tier preferences (#78398)
* Refactor allocation notices for tier preferences

- also removed the lingering "data_frozen" node role

* added some test coverage

* Implement copy feedback

* Minor refactors based on PR feedback

* expanded README.md with section on testing cluster state notices

* Updated copy to reference policy and updated freeze description

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-09-30 12:42:05 +02:00
Brittany Joiner
63ce752dc2
Adding comment about importing lodash library (#78156)
* added comment about importing lodash library

* fixed space with prefer

* cleaned up extra space and removed comments for lodash/fp

* took out the comment in server files

* Remove newlines

Co-authored-by: Nathan L Smith <smith@nlsmith.com>
2020-09-24 11:38:11 -05:00
Yulia Čech
337fe73d09
[ILM] Add index templates to "add policy" modal in policies table (#77077)
* [ILM] Add index templates to "add policy" modal in policies table

* [ILM] Change select to a combobox in 'add policy' modal in policies table

* [ILM] Add not found message to "add policy to template" modal

* [ILM] Fix api integration test

* [ILM] Fix type check error

* [ILM] Add PR review suggestions

* [ILM] Fix type check error

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-09-21 15:27:52 +02:00
Jean-Louis Leysens
01ef387ade
Round #1 of removing frozen phase UI and server code (#77877)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-09-21 12:25:39 +02:00
Larry Gregory
613509d81a
Improve home screen for limited-access users (#77665) 2020-09-18 08:54:08 -04:00
Jean-Louis Leysens
63bb3bf309
[ILM] Data tiers for 7.10 (#76126)
* wip

* Revert "wip"

This reverts commit 54b6f7ff3ec8b0f57b150ab2276d617686da9fb5.

* Revert "Revert "wip""

This reverts commit 63868b44ec60d7431c3a0189b16aeece1db2d38e.

* Refactor to using EUI button group component

- also moved node attr and node allocation component to inside
  new folder that contains all allocation components.
- only focussed on updating warm phase for now

* WIP: moved form UX more in line with EUI

- The described form group now has a switch for showing
  controls on the left.
- Refactored DataTierAllocation to CustomDataTierAllocation
- Removed 'node-roles' option
- Updated copy
- Moved JSX around a bit in the edit policy section to make logic
  simpler

* Refactor UI to reflect custom-ness of "Custom" and "None" options

- Still only implemented for warm, cold and frozen are still
  under way

* server side changes for getting node data

* double opt-in

* Refactored data tier allocation type

- Made types more explicit 'default', 'custom' and 'none'
- Fixed issue introduced by use useCallback on state setter -
  need to use the function setter pattern to not have stale data
  being set.

* Some refacoring, but main point is to add warning detection for
node roles.

- Refactored way we get node data to a provider component so that
  phases still have flexibility in how they render. Currently
  this also means that we fetch node stats data for each phase
  we render
- Created a callout for when there is no node role to which data
  can be allocated for the default setting
- Also updated the behaviour to render the entire form even when
  we cannot fetch node data for some reason. It is not ideal to
  not have node data, but we should not block the entire form.

* fix i18n

* fix type issue with deafult policies missing allocation type

* remove "undefined" as option for setting phase data

* Create referentially stable data setter for all phases - prevent infini-update

* fix type issue

* refactor data -> nodesData

* refactor cold phase for data tiers

* refactor frozen phase for data tiers

* fixed existing tests for warm section

* restored existing test coverage for cold phase and added test coverage for frozen

* fix api integration test

* remove unused translations

* slight UX update to turning on custom attribute allocation

* added scss file for data tier advanced section and other style
updates

* added tests for new warning

* fix types

* added correct copy for cold and frozen phases

* fix types and i18n

* implement copy feedback

* added spacer after the enable data tier allocation switch

* refactor to super select

* fix replicas copy

* update phase serialization for cold and frozen

* Refactor so that logic determining warnings lives together

- also factor out the warning of the node allocation component
- revisit copy for the allocation warning

* tier -> phase

* Added some much needed policy serialization test coverage

- also factored out policy allocation action serialization

* fix import paths and added required file header

* fix existing test coverage

* refine copy for data tier allocation recommended option

* fix showing warning for no node attrs

* fix inverted warning logic 🤦🏼‍♂️

* fix typing

* implement CJs copy feedback

* fix i18n

* remove unused or invalid translations

* provide ability to not alter original policy

* do not alter the original policy in the serilalization process

* fix jest tests

* Remove duplicate type and refactor NodeRole to NodeDataRole

Also deleted unused component "AdvancedSection" for now

* added comment to "false" typing

* revised and refactored copy based on feedback

* address copy feedback

* update kibana schema to allow migrate: { enabled: false }

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-09-18 12:14:49 +02:00
Yulia Čech
34238e5797
[ILM] Add forcemerge action to hot phase with a rollover enabled (#77193)
* [ILM] Add forcemerge action to hot phase with a rollover enabled

* [ILM] Add PR suggestions

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-09-15 17:12:35 +02:00
Larry Gregory
2e34eb239f
Hide management sections based on cluster/index privileges (#67791)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-09-14 09:30:47 -04:00
CJ Cenizal
e2cbd89e66
Rename useRequest's sendRequest return function to resendRequest and remove return value (#76795) 2020-09-10 08:23:13 -07:00
Yulia Čech
a7d742abc3
[ILM] Clean up remaining js files and any typings (#76803)
* [ILM] Clean up remaining js files and any typings

* [ILM] Fix jest test

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-09-07 16:16:20 +02:00
Yulia Čech
70b4b89270
[ILM] TS conversion of Index Management plugin extension (#76517)
* [ILM] TS conversion of Index Management plugin extension

* [ILM] Implement review suggestions

* [ILM] Fix jest test

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-09-04 13:47:16 +02:00
Yulia Čech
6686cffe01
[ILM] TS conversion of policies table (#76006)
* [ILM] TS conversion of policies table

* [ILM] Fix type check errors

* [ILM] Fix i18n check errors

* [ILM] Add types to linkedIndices

* [ILM] Add PR review fixes

* [ILM] Add PR review fixes (filter fn)

* [ILM] Fix i18n errors

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-09-02 11:17:30 +02:00
Pierre Gayvallet
e70ef657d4
Delete src/legacy/ui/public folder (#76085)
* delete src/legacy/ui/public folder

* remove jest.mock('ui/XXX'); from tests

* adapt stubbedLogstashIndexPatternService

* remove delete keys from translation files

* fix types import with Capabilities

* remove legacy test utils

* remove dead file referencing ui/newPlatform

* move saved-object-finder styles to timelion plugin
2020-09-01 09:23:22 +02:00
Jean-Louis Leysens
aac57fb1a8
[ILM] Add support for frozen phase in UI (#75968)
* ILM public side changes to support frozen phase

This is a very faithful duplication of the cold phase. We are
also excluding the snapshot action as well as the unfollow action
as these are features that require higher than basic license
privilege.

* added "frozen" to the server side schema

* add frozen phases component

* fix i18n and update jest tests

* Slight restructuring to phase types and fix copy paste issues.

- also fixed TS error introduced after TS v4 upgrade (delete)

* fix hot phase type and remove type constraint from error messages

* update validation logic

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-08-31 11:45:57 +02:00