-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
feat(ui): ability to create a bucket from time machine #17860
Conversation
Doesn't need org, overlay state, or any overlay components
this is 💯 amazing and blows my mind and delivers all of my hopes and dreams, but write a cypress test for it. "i went to data explorer, clicked on a button, filled out a name and clicked on some more buttons, and then it was there forever" |
const [bucketRetentionRules, setBucketRetentionRules] = useState<any>( | ||
isRetentionLimitEnforced ? DEFAULT_RULES : [] | ||
) | ||
const [bucketRuleType, setBucketRuleType] = useState<'expire' | null>( |
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.
There's enough state in here to justify moving this into a useReducer
hook. It could all even stay in this file but would pull a bunch of this state management into a reducer.
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.
A similar thought I had was to make a component that is just the contents of the popover, then most of the state can live in there. We'd still have a lot of state though. The component I based this off of just had a whole Bucket
object as a single piece of state so I flattened it out
@drdelambre I added the e2e test |
@121watts alright I rebuilt the component with |
…me state management
This change makes creating a bucket much more natural by enabling it without leaving the time machine
CreateBucketOverlay
to get everything it needs from redux and dispatchcreate-bucket
to overlay controllerBucketSelector
that shows the create bucket form within a popovergetActiveTimeMachine