Skip to content

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

Merged
merged 8 commits into from
May 15, 2023

Conversation

Kira-Pilot
Copy link
Member

@Kira-Pilot Kira-Pilot commented May 15, 2023

Screenshot 2023-05-12 at 1 07 10 PM

resolves #7349

@Kira-Pilot Kira-Pilot changed the title feat: add 'impending deletion' badges to workspace page feat: add 'impending deletion' badges to workspaces page May 15, 2023
@Kira-Pilot Kira-Pilot requested a review from BrunoQuaresma May 15, 2023 13:24
className?: string
}

const ImpendingDeletionBadge: FC<
PropsWithChildren<Partial<WorkspaceStatusBadgeProps>>
Copy link
Collaborator

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
}
Copy link
Collaborator

@BrunoQuaresma BrunoQuaresma May 15, 2023

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.

Copy link
Member Author

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.

Copy link
Collaborator

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.

Copy link
Member Author

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.

Copy link
Collaborator

@BrunoQuaresma BrunoQuaresma left a 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.

@Kira-Pilot
Copy link
Member Author

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
Also, keep in mind these badges will only show if a user has explicitly turned on this feature. I would love your design expertise after we have more of the FE carved out and hooked up. It is all feature-flagged atm, but I was hoping when the time comes, you could do a sweep with Ben and see what needs to be tweaked.

@Kira-Pilot Kira-Pilot merged commit 224d25d into main May 15, 2023
@Kira-Pilot Kira-Pilot deleted the deletion-indicators-workspaces-page/kira-pilot branch May 15, 2023 14:59
@github-actions github-actions bot locked and limited conversation to collaborators May 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

workspace actions: add new status badge to workspaces table
2 participants