-
Notifications
You must be signed in to change notification settings - Fork 91
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
Adds UI for shrink action #176
Conversation
Signed-off-by: Clay Downs <downsrob@amazon.com>
Signed-off-by: Clay Downs <downsrob@amazon.com>
Codecov Report
@@ Coverage Diff @@
## main #176 +/- ##
==========================================
- Coverage 63.32% 62.28% -1.05%
==========================================
Files 155 156 +1
Lines 4447 4552 +105
Branches 738 718 -20
==========================================
+ Hits 2816 2835 +19
- Misses 1415 1500 +85
- Partials 216 217 +1
Continue to review full report at Codecov.
|
public/pages/VisualCreatePolicy/components/UIActions/ShrinkUIAction.tsx
Outdated
Show resolved
Hide resolved
public/pages/VisualCreatePolicy/components/UIActions/ShrinkUIAction.tsx
Outdated
Show resolved
Hide resolved
onChange={(id) => { | ||
const forceUnsafe = id === "yes"; | ||
const shrinkObject = { ...action.action }; | ||
if (forceUnsafe) { |
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.
Not critical but may be doing a popup or having some warning when this is set to true stating can potentially result in data loss would be preferred I think
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.
Added and demoed in a new screenshot
} | ||
}; | ||
|
||
render = (action: UIAction<ShrinkAction>, onChangeAction: (action: UIAction<ShrinkAction>) => void) => { |
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.
Not sure, how we are doing for other actions but may be differentiating optional and required fields by an *
or calling it out in words might be helpful
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.
Added and demoed in a new screenshot
Signed-off-by: Clay Downs <downsrob@amazon.com>
Signed-off-by: Clay Downs <downsrob@amazon.com>
Signed-off-by: Clay Downs <downsrob@amazon.com>
Signed-off-by: Clay Downs <downsrob@amazon.com>
Signed-off-by: Clay Downs downsrob@amazon.com
Description
Adds UI for the shrink action. This PR does not contain any tests, which should be added later. Additional validation should also be added, such as not allowing percentage to shrink shards to input out of the range of 0 to 1. This is currently validated by the backend but additional validation up front would improve the user experience.
Zoomed out overview of the visual editor:
If more than one number of shards setting is added, this error appears:
When either of the JSON editors are poorly formatted it will show as red.
If any of the above errors are present, it will not be possible to add the action.
Template and alias updated to say -optional
Warning that appears for force unsafe option
Issues Resolved
opensearch-project/index-management#40
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.