Skip to content

Conversation

david-crespo
Copy link
Collaborator

@david-crespo david-crespo commented Apr 8, 2025

Closes #2771

image

Feels a little

image

maybe needs one fewer "anti-affinity".

Copy link

vercel bot commented Apr 8, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
console ✅ Ready (Inspect) Visit Preview Apr 9, 2025 5:11am

onDismiss()
queryClient.invalidateEndpoint('antiAffinityGroupMemberList')
queryClient.invalidateEndpoint('antiAffinityGroupView')
queryClient.invalidateEndpoint('instanceAntiAffinityGroupList')
Copy link
Collaborator Author

@david-crespo david-crespo Apr 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is kind of annoying — any time group memberships change, we have to clear cache on both endpoints.

const nonMemberGroups = useMemo(
() => R.differenceWith(allGroups.items, memberGroups.items, (a, b) => a.id === b.id),
[memberGroups, allGroups]
)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how cool is differenceWith

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, nice

const actions = makeActions(row.original)
const id = typeof row.original.id === 'string' ? row.original.id : null
return <RowActions id={id} actions={actions} />
return <RowActions id={id} actions={actions} copyIdLabel={copyIdLabel} />
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes in this file let us hook into this copy ID column logic while overriding the name to say Copy group ID because otherwise it's not clear what the ID is of.

image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

@david-crespo david-crespo requested a review from charliepark April 8, 2025 21:38
@david-crespo
Copy link
Collaborator Author

A little better. I thought about changing the button to Add a la #2749 but it felt sparse, almost rude.

image

Copy link
Contributor

@charliepark charliepark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solid. Added some "disable the ADD button" logic in #2792, but this looks good.

@david-crespo david-crespo enabled auto-merge (squash) April 9, 2025 05:21
@david-crespo david-crespo merged commit 04aceb5 into main Apr 9, 2025
7 checks passed
@david-crespo david-crespo deleted the instance-group-mgt branch April 9, 2025 05:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create / Edit punchlist for Anti-affinity groups
2 participants