-
Notifications
You must be signed in to change notification settings - Fork 361
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
feat: [M3-6729] - Add VPC column to Linodes landing table #9485
Conversation
packages/manager/src/features/Linodes/LinodesLanding/SortableTableHead.tsx
Outdated
Show resolved
Hide resolved
packages/manager/src/features/Linodes/LinodesLanding/LinodeRow/LinodeRow.tsx
Outdated
Show resolved
Hide resolved
packages/manager/src/features/Linodes/LinodesLanding/LinodeRow/LinodeRow.tsx
Outdated
Show resolved
Hide resolved
// a linode should have only one vpc associated with it (?) so we can | ||
// short circuit once we find the associated vpc | ||
return vpc; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was seeing in the mock examples that linodes would often have multiple vpcs associated with them, but just wanted to confirm that in the actual live data, a linode will have at most one vpc associated with it (although this function may eventually be unnecessary if the api endpoints get updated)
const { data: accountMaintenanceData } = useAllAccountMaintenanceQuery( | ||
{}, | ||
{ status: { '+or': ['pending, started'] } } | ||
); | ||
|
||
const maintenance = accountMaintenanceData?.find( | ||
(m) => m.entity.id === id && m.entity.type === 'linode' | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed this bc we seem to already have this information associated with the linodes due to this functionality being done in src/features/Linodes/index.tsx
and the information needed for the maintenance being passed along from the parent components, but lmk if I missed anything!
packages/manager/src/features/Linodes/LinodesLanding/SortableTableHead.tsx
Outdated
Show resolved
Hide resolved
@jaalah-akamai Should we build this right now given that the API might add |
I should probably clarify - API will not be adding a new endpoint at this time, but they will correct the existing endpoint |
I will also add this fix is pending API approval, so I'm for moving forward with the approach we know will work (even though it's a roundabout way of getting the VPC label). Update: This will be out in Alpha by Tuesday, so let's wait to finish this work |
So for every Linode row we'll have to do a |
I think the API team's plan is to add the VPC id to the interface config return object, so just using tbh, I might still need to put this functionality into the Linodes/index.tsx file in order to be able to have the table sort by the vpc label -- earlier, when I'd had a solution of getting the vpc id and label inside the Linodes/LinodesLanding/LinodeRow/LinodeRow.tsx file only, the sorting didn't work. I can look into this more once the new api spec comes out on Tuesday though! 👀 |
Okay, understood @coliu-akamai. I do want to bring some attention to making vpc label sortable on the client-side. I don't think we should let people order by vpc label. Practices like this have been blocking us from API paginating and sorting Linodes. I think the only way we should allow this is if the /linode/instances endpoint returns a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a couple of comments -- I would agree with not allowing for sorting by the VPC label in the Linodes landing table unless the API supports it.
packages/manager/src/features/Linodes/LinodesLanding/SortableTableHead.tsx
Show resolved
Hide resolved
packages/manager/src/features/Linodes/LinodesLanding/SortableTableHead.tsx
Outdated
Show resolved
Hide resolved
updated to reflect the new api changes -- have also made the vpc column not sortable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, just have a few small items before I approve ✅
packages/manager/src/features/Linodes/LinodesLanding/LinodeRow/LinodeRow.tsx
Outdated
Show resolved
Hide resolved
<TableCell noWrap> | ||
{vpcLabel && (vpcId === 0 || vpcId) && ( | ||
<Link tabIndex={0} to={`/vpc/${vpcId}`}> | ||
{vpcLabel} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…/LinodeRow.tsx Co-authored-by: Banks Nussman <115251059+bnussman-akamai@users.noreply.github.com>
{vpcLoading || configsLoading ? ( | ||
<Skeleton /> | ||
) : vpcLabel ? ( | ||
<Link tabIndex={0} to={`/vpc/${vpcId}`}> | ||
{vpcLabel} | ||
</Link> | ||
) : ( | ||
'None' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bnussman-akamai added the skeleton / 'None'! I think the skeleton is definitely a nice addition for loading. The 'none' looked good too imo -- would we need to get UX approval for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it looks great! We probably should get UX approval. Can you reach out to Andrew?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Andrew approved! 🎉
Hey @coliu-akamai, just a heads up that there's an E2E test failure! It's nothing big, just a test expecting to see "IP Address" rather than "Public IP Address" in the Linodes landing page. The failure is in You can fix that test and verify your changes with this command while Cloud's running locally: yarn cy:run -s "cypress/e2e/core/linodes/smoke-linode-landing-table.spec.ts" Happy to help out if you have any trouble! |
@jdamore-linode thanks for pointing that out! Those tests are now passing on local so hopefully they pass here too 🎉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job! 🚀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work, @coliu-akamai !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work on this! There's one cleanup item but I'm approving pending that being addressed.
* add vpc column to linode landing pg table * roundabout way to get vpcs associated with a linode * add comments and todos * sortable table row for vpcs now * remove unneeded comment * ...fix comment * changeset and update test * linode row trying to test for vpc column wip * test vpc column shows up with feature flag * updated linode row vpc column * Added changeset: Update linode config interface return object as per new API spec * Update packages/api-v4/.changeset/pr-9485-upcoming-features-1691764196950.md Co-authored-by: Dajahi Wiley <114682940+dwiley-akamai@users.noreply.github.com> * Update packages/manager/src/features/Linodes/LinodesLanding/LinodeRow/LinodeRow.tsx Co-authored-by: Banks Nussman <115251059+bnussman-akamai@users.noreply.github.com> * address feedback * Added changeset: Update validation for `linodeInterfaceSchema`: include validation for `vpc_id` and update `subnet` to `subnet_id` * Update packages/manager/src/features/Linodes/LinodesLanding/LinodeRow/LinodeRow.tsx Co-authored-by: Banks Nussman <115251059+bnussman-akamai@users.noreply.github.com> * address feedback @bnussman-akamai * update cypress test * remove vpc_id from linode interface schema --------- Co-authored-by: Dajahi Wiley <114682940+dwiley-akamai@users.noreply.github.com> Co-authored-by: Banks Nussman <115251059+bnussman-akamai@users.noreply.github.com>
Description 📝
Added vpc column to linode landing table so that users can see what vpc a linode is associated with
Major Changes 🔄
Preview 📷
How to test 🧪