Skip to content
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

upcoming: [M3-7618] - Delete Placement Group Modal #10162

Merged
merged 15 commits into from
Feb 16, 2024

Conversation

abailly-akamai
Copy link
Contributor

@abailly-akamai abailly-akamai commented Feb 8, 2024

Description 📝

This PR adds the delete placement group modal to the PG flow. It also touches a few components for some cleanup or enhancing (non breaking changes)

ℹ️ CONTEXT: The reason for adding the removable list in the delete modal is because (not unlike buckets) we can't delete a Placement Group that still has Linodes assigned to it

Changes 🔄

  • Add the PG delete modal and its test
  • Make sure inputProps are passed in TypeToConfirmDialog
  • Allow RemovableSelectionsList to take a readable remove label + test update + story

Preview 📷

Screenshot 2024-02-15 at 16 29 03

How to test 🧪

⚠️ NOTE: this is MSW mock data so we won't get the proper UI data changes 👎

Prerequisites

  • Have the "Placement Group" flag and MSW turned on

Verification steps

  • Navigate to http://localhost:3000/placement-groups
  • Click "Delete" for any placement group
  • Confirm UI and MSW requests
  • change the factory data to an enabled delete modal

As an Author I have considered 🤔

Check all that apply

  • 👀 Doing a self review
  • ❔ Our contribution guidelines
  • 🤏 Splitting feature into small PRs
  • ➕ Adding a changeset
  • 🧪 Providing/Improving test coverage
  • 🔐 Removing all sensitive information from the code and PR description
  • 🚩 Using a feature flag to protect the release
  • 👣 Providing comprehensive reproduction steps
  • 📑 Providing or updating our documentation
  • 🕛 Scheduling a pair reviewing session
  • 📱 Providing mobile support
  • ♿ Providing accessibility support

* Overrides the render of the X Button
* Has no effect if isRemovable is false
*/
removeButtonText?: string;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The mocks call for the X (remove) IconButton to instead feature a readable button (in this case "Unassign")

@@ -120,6 +122,7 @@ export const TypeToConfirmDialog = (props: CombinedProps) => {
data-testid={'dialog-confirm-text-input'}
expand
hideInstructions={entity.subType === 'CloseAccount'}
inputProps={inputProps}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

those were never passed therefore when using our <TypeToConfirmDialog /> component we couldn't access the textfield inputProps

@@ -26,7 +26,7 @@ export const PlacementGroupsDetail = () => {
const flags = useFlags();
const { id, tab } = useParams<{ id: string; tab?: string }>();
const history = useHistory();
const placementGroupId = Number(id);
const placementGroupId = +id;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just find it prettier and more succinct so updating in other places.

@abailly-akamai abailly-akamai marked this pull request as ready for review February 15, 2024 22:26
@abailly-akamai abailly-akamai requested a review from a team as a code owner February 15, 2024 22:26
@abailly-akamai abailly-akamai requested review from dwiley-akamai, bnussman-akamai and carrillo-erik and removed request for a team February 15, 2024 22:26
Copy link

github-actions bot commented Feb 15, 2024

Coverage Report:
Base Coverage: 81.22%
Current Coverage: 81.24%

@abailly-akamai abailly-akamai merged commit 42137a0 into linode:develop Feb 16, 2024
17 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants