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-7610] - Placement Groups Detail #10096

Merged
merged 10 commits into from
Jan 26, 2024

Conversation

abailly-akamai
Copy link
Contributor

@abailly-akamai abailly-akamai commented Jan 22, 2024

Description πŸ“

This PR implements the Placement Groups Detail page and associated routing. It does not implement tabs content (summary & linodes list) which are left for subsequent tickets.

Changes πŸ”„

  • Implement the detail page and its routing
  • Add a couple simple utils and their tests
  • Make the EditableTextField take a new textSuffix prop to manage the breadcrumb suffix
  • Add test and a story for ☝️
  • Fix the HTTP method for placement group query MSW

Preview πŸ“·

Screenshot 2024-01-23 at 12 15 58

Screenshot 2024-01-24 at 09 23 40

How to test πŸ§ͺ

Verification steps

  • Pull and run code locally
  • Turn on the "Placement Group" dev setting and MSW
  • Navigate to http://localhost:3000/placement-groups
  • Click on a placement group in the table
  • Confirm the Placement Group Detail page and its content (breadcrumb w/ editint label, docs link, tabs without content)

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

@abailly-akamai abailly-akamai marked this pull request as ready for review January 23, 2024 17:22
@abailly-akamai abailly-akamai requested a review from a team as a code owner January 23, 2024 17:22
@abailly-akamai abailly-akamai requested review from jdamore-linode and hkhalil-akamai and removed request for a team January 23, 2024 17:22
Copy link

github-actions bot commented Jan 23, 2024

Coverage Report: βœ…
Base Coverage: 80.33%
Current Coverage: 80.36%

Copy link
Contributor

@hkhalil-akamai hkhalil-akamai left a comment

Choose a reason for hiding this comment

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

Looking good, tested all functionality. Left one technical suggestion.

Comment on lines 91 to 93
editableTextTitle: isEditingLabel
? label
: `${label} (${affinityLabel})`,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggestion: instead of storing isEditingLabel in this component, the editableTextTitle prop can accept an optional function (i.e., it would have type editableTextTitle: string | (isEditinglabel: boolean) => string), which avoids duplicating state that is already tracked in the EditableText component as isEditing.

Suggested change
editableTextTitle: isEditingLabel
? label
: `${label} (${affinityLabel})`,
editableTextTitle: (isEditingLabel) => isEditingLabel
? label
: `${label} (${affinityLabel})`,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah that's fair, though the solution above isn't too much of an improvement because of how the initial state of this component is managed in the first place.

I went the route of adding a new prop instead which bypasses relying on state all together. See 31c2f92

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also added a test for the new prop and a story for good measure

className={classes.button}
data-qa-save-edit
onClick={finishEditing}
>
<Check className={classes.icon} />
</Button>
<Button
aria-label="Cancel"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

improving accessibility while I am here. We shouldn't have buttons with only icons as children without an aria label

Copy link
Contributor

Choose a reason for hiding this comment

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

Nice catch, I'll make sure to keep an eye for this type of detail.

Copy link
Contributor

@hkhalil-akamai hkhalil-akamai left a comment

Choose a reason for hiding this comment

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

Thanks for resolving my concerns with the breadcrumb state. Re-tested and looks good; approved pending consideration of some minor changes.

@abailly-akamai abailly-akamai merged commit dfdab4b into linode:develop Jan 26, 2024
17 of 18 checks passed
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.

None yet

4 participants