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

feat: [M3-7031] - Add AGLB Create Service Target Drawer #9657

Conversation

bnussman-akamai
Copy link
Member

@bnussman-akamai bnussman-akamai commented Sep 8, 2023

Description 📝

  • Adds the AGLB Create Service Target Drawer 🎉

Preview 📷

Screenshot 2023-09-14 at 10 54 52 PM

How to test 🧪

  • Check out this PR
  • Turn on the MSW
  • Go to http://localhost:3000/loadbalancers/0/service-targets
  • Click Create Service Target
  • Test the drawer 🔍
    • The Linode Select and Certificate Select both are infinite scrollable and API filterable so your mileage will vary on the MSW

@bnussman-akamai bnussman-akamai added the ACLB Relating to the Akamai Cloud Load Balancer label Sep 8, 2023
@bnussman-akamai bnussman-akamai self-assigned this Sep 8, 2023
@bnussman-akamai bnussman-akamai marked this pull request as ready for review September 11, 2023 16:49
Copy link
Contributor

@abailly-akamai abailly-akamai left a comment

Choose a reason for hiding this comment

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

Forms looks and feels great!

Added a few comments for when we are revisiting. Also wasn't able to to filter/search results in the LinodeOrIp component, which i dunno if to be expected or not. Self review would be appreciated for components that may not feature full functionality if so.

@abailly-akamai
Copy link
Contributor

@bnussman can we also add test coverage for new components?

@bnussman-akamai
Copy link
Member Author

@abailly-akamai Searching and filtering the LinodeOrIP select will not work with mocks because it is API filtered. If you want to test it, you can leave the MSW on but comment out the */linode/instances endpoint in serverHandlers.ts

@jdamore-linode jdamore-linode self-requested a review September 14, 2023 20:08
Copy link
Contributor

@abailly-akamai abailly-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 great - added some more comments

@bnussman-akamai bnussman-akamai requested a review from a team as a code owner September 19, 2023 16:53
@bnussman-akamai bnussman-akamai requested review from mjac0bs, carrillo-erik, abailly-akamai and jdamore-linode and removed request for a team September 19, 2023 16:53
Copy link
Contributor

@abailly-akamai abailly-akamai left a comment

Choose a reason for hiding this comment

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

Awesome work on this, well broken down and tested (some components covered by e2e as discussed i the comments)

Approving on second pass have not found any issue but left a couple comments to confirm some behaviours.

`A device has been removed from Firewall ${e.entity?.label ?? ''}.`,
`A ${e.secondary_entity?.type} has been removed from Firewall ${
e.entity?.label ?? ''
}.`,
Copy link
Contributor

Choose a reason for hiding this comment

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

Should you also consider the fallback for an undefined secondary entity here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oops. I did not mean to commit this 😖 Going to revert. This work is covered by #9693

</Button>
</>
);
};
Copy link
Contributor

Choose a reason for hiding this comment

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

This may be related to mock data, but should we be able to add the same endpoint several times and for it not to be filtered out after being added in the table?

Screenshot 2023-09-20 at 10 49 45

Copy link
Member Author

Choose a reason for hiding this comment

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

I took note to follow up and see how the API will validate duplicate endpoints

Copy link
Contributor

@jdamore-linode jdamore-linode left a comment

Choose a reason for hiding this comment

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

Looks great @bnussman-akamai! Confirmed that the create service target drawer works as expected as much as possible with MSW enabled

Copy link
Contributor

@mjac0bs mjac0bs left a comment

Choose a reason for hiding this comment

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

Drawer looked good! Let's just fix the typo in the algorithm options.

Also called out a few places where we have TODOs and based on our past team discussions, it would be great to include the project name (and ticket number if we have it).

@mjac0bs mjac0bs added Approved Multiple approvals and ready to merge! and removed Ready for Review labels Sep 20, 2023
@carrillo-erik
Copy link
Contributor

When entering a very long name for Host it causes the close icon to be pushed out of the view. Would it be possible to make the text in the middle column to wrap at a lower value to decrease to avoid this?

Screenshot 2023-09-20 at 11 34 42 AM

@carrillo-erik
Copy link
Contributor

@bnussman

  • Upon creating a service target and receiving the response for the POST request, Cloud doesn't update the service targets list with the newly created service target from what I could see -- is that outside the scope of this PR?

Any follow up on this? I noticed the comment is about a week old and I was able to make the same observation just now.

@@ -75,17 +77,13 @@ export const CertificateSelect = (props: Props) => {
setInputValue(value);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a specific reason why this logic is separated from the logic in the onChange in line 84?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is because we need to track the inputValue separately in state because we use it to API filter the certificates.

Regarding that other comment, that is just how the MSW and React Query work together. When we have a real API to test against, things should work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ACLB Relating to the Akamai Cloud Load Balancer Approved Multiple approvals and ready to merge!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants