-
Notifications
You must be signed in to change notification settings - Fork 887
feat: add 'impending deletion' badges to workspaces page #7530
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: add 'impending deletion' badges to workspaces page #7530
Conversation
className?: string | ||
} | ||
|
||
const ImpendingDeletionBadge: FC< | ||
PropsWithChildren<Partial<WorkspaceStatusBadgeProps>> |
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 are not using any children
prop here so we can remove PropsWithChildren
|
||
if (!allowAdvancedScheduling || !allowWorkspaceActions) { | ||
return 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.
Since we are already checking if we should or not display the badge on displayImpendingDeletion
I think we should move those checks to be there since they are doing the same thing.
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.
@BrunoQuaresma those checks rely on a hook, which has to be called in a component. Would you rather I call the hook in the WorkspaceStatusBadge
component? I definitely could; I just didn't want to screw up all the storybook stories.
Alternatively, I thought about calling this hook in WorkspacesPage
and then passing down props from there - but there are like 7 layers of prop passing and it just seemed like a lot to me.
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 thing for me is to have the "should display or not" check in one single place. Splitting this check into different places looks confusing to me. But if it is hard, I would add a comment so that in the future, if we want to change the display behavior, we know there are two places to look for.
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.
Agreed - as the ideal behavior is to have the check in one place, I think the best path forward may be to call the hook in the badge component and then ignore Storybook's complaints, rather than let our testing tool dictate how we code.
I'll adjust.
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.
Just minor things but would be nice to explain what an "Impending deletion" is because I have no idea what it is. If makes sense, and the explanation is not simple, I would add a popover on hover explaining the meaning.
Definitely! This is part of a much larger design. I think the explanation will be handled in this ticket: #7365 |
resolves #7349