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-9118] - Add the Interface Details drawer #11888

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from

Conversation

coliu-akamai
Copy link
Contributor

@coliu-akamai coliu-akamai commented Mar 19, 2025

Description 📝

Adds the Interface Details drawer for Linode Interfaces

Changes 🔄

  • Add drawer
  • Update some routing stuff (tbf what I did feels very jank bc I didn't really want to touch Linode routing too much - def happy to remove this too)

Preview 📷

vpc example public example
image image

How to test 🧪

  • Using devenv or devcloud (or prod? getting info for that), have a Linode with Linode Interfaces

Verification steps

  • Confirm drawer works as expected, confirm information matches interface data
    • Note: the images ^ will not match the mock in the ticket
  • Confirm routing is ok... (may remove this)
Author Checklists

As an Author, to speed up the review process, I considered 🤔

👀 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


  • I have read and considered all applicable items listed above.

As an Author, before moving this PR from Draft to Open, I confirmed ✅

  • All unit tests are passing
  • TypeScript compilation succeeded without errors
  • Code passes all linting rules

@@ -8,17 +8,17 @@ import type { Theme } from '@mui/material';
export const PublicTemplateRules = () => {
return (
<>
<Typography sx={(theme) => ({ marginTop: theme.spacing(3) })}>
<Typography sx={(theme) => ({ marginTop: theme.spacingFunction(24) })}>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This file, VPCTemplateRules, and SuccessDialog content are just spacing updates to follow the new eslint rule (figured new feature may as well be up to date)

Comment on lines +18 to +19
const location = useLocation();
const interfaceIdFromLocation = +location.pathname.split('/').slice(-1);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thoughts on this? I'm not the happiest with it but I also didn't want to touch the Linode feature's routing too much esp given time constraints for this proj - so I'm also fine with not having this for now, and revisiting for a cleaner solution later

My idea is that for Interface firewall devices, we can link to the Interface's details instead of linode/$linodeId/networking

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this works for now, we can create a follow-up ticket to clean this up (maybe add it to the routing refactor work?)

Comment on lines +90 to +93
return (
Boolean(matchPath(p, { path: location.pathname })) ||
location.pathname.includes(p)
);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Without this change, trying to click on the Details drawer (or the upgrade dialog!) switches us back to linode/analytics

@coliu-akamai coliu-akamai marked this pull request as ready for review March 21, 2025 20:53
@coliu-akamai coliu-akamai requested a review from a team as a code owner March 21, 2025 20:53
@coliu-akamai coliu-akamai requested review from hana-akamai, harsh-akamai and bnussman-akamai and removed request for a team March 21, 2025 20:53
Comment on lines 24 to 27
sx={(theme) => ({
...chipStyles(theme),
marginLeft: 0,
})}
Copy link
Member

Choose a reason for hiding this comment

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

In my opinion, we shouldn't be one-off styleing chips because it will just further open us up to UI inconsistencies.

Maybe color="primary" makes the most sense here?

Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed. primary or info makes sense to me

I kind of liked the chip next to the actual address (as seen in the ticket screenshot), any reason why it's at the top now?

Comment on lines +43 to +50
<Typography>
<strong>Type</strong>
</Typography>
<Typography>{type}</Typography>
<Typography sx={(theme) => ({ marginTop: theme.spacingFunction(16) })}>
<strong>ID</strong>
</Typography>
<Typography>{id}</Typography>
Copy link
Member

Choose a reason for hiding this comment

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

Could we apply some spacing to the root Stack so that we can avoid using marginTops to maintain spacing? I think it tends to result in a slightly more maintainable result because the spacing can be defined once rather than at each section

Suggested change
<Typography>
<strong>Type</strong>
</Typography>
<Typography>{type}</Typography>
<Typography sx={(theme) => ({ marginTop: theme.spacingFunction(16) })}>
<strong>ID</strong>
</Typography>
<Typography>{id}</Typography>
<Stack>
<Typography>
<strong>Type</strong>
</Typography>
<Typography>{type}</Typography>
</Stack>
<Stack>
<Typography>
<strong>ID</strong>
</Typography>
<Typography>{id}</Typography>
</Stack>

@coliu-akamai
Copy link
Contributor Author

todo: now that m3-9109 has been merged in, link to details drawer for interfaces

@linode-gh-bot
Copy link
Collaborator

Cloud Manager UI test results

🔺 1 failing test on test run #9 ↗︎

❌ Failing✅ Passing↪️ Skipped🕐 Duration
1 Failing532 Passing4 Skipped114m 28s

Details

Failing Tests
SpecTest
clone-linode.spec.tsclone linode » can clone a Linode from Linode details page

Troubleshooting

Use this command to re-run the failing tests:

pnpm cy:run -s "cypress/e2e/core/linodes/clone-linode.spec.ts"

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.

4 participants