MGMT-20895: Use humanized label for displaying the selected subnet#3015
Conversation
|
@celdrake: This pull request references MGMT-20895 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.20.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
WalkthroughThe changes enhance networking configuration test coverage by adding assertions for IPv4 and IPv6 subnet CIDRs, introduce two new Cypress getter methods for subnet fields, and refactor the Changes
Sequence Diagram(s)sequenceDiagram
participant Test as Cypress Test
participant UI as Networking UI
participant SubnetsDropdown as SubnetsDropdown Component
Test->>UI: Visit networking page
Test->>UI: Assert IPv4/IPv6 subnet CIDR fields (via new getters)
UI->>SubnetsDropdown: Render dropdown
SubnetsDropdown->>SubnetsDropdown: Compute items and display label with useMemo
Test->>UI: Switch to dual-stack mode
UI->>SubnetsDropdown: Rerender with updated subnets
SubnetsDropdown->>SubnetsDropdown: Recompute items and label
Test->>UI: Assert updated IPv4/IPv6 subnet CIDR fields
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
libs/ui-lib/lib/ocm/components/clusterConfiguration/networkConfiguration/SubnetsDropdown.tsxOops! Something went wrong! :( ESLint: 8.57.1 ESLint couldn't find the config "@openshift-assisted/eslint-config" to extend from. Please check that the name of the config is correct. The config "@openshift-assisted/eslint-config" was referenced from the config file in "/libs/ui-lib/.eslintrc.cjs". If you still have problems, please stop by https://eslint.org/chat/help to chat with the team. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
⏰ Context from checks skipped due to timeout of 90000ms (6)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
@celdrake: This pull request references MGMT-20895 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.20.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
19aa466 to
d774dd6
Compare
|
@celdrake: This pull request references MGMT-20895 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.20.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ammont82, celdrake The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
4d6a8f9
into
openshift-assisted:master
The
currentDisplayValueinSubnetsDropdownwas kept in an unnecessaryuseState, since it's value can be derived from other fields. On top of that, when the component first mounted,currentDisplayValuehad the humanized label (eg.192.168.122.0/24 (192.168.122.0 - 192.168.122.255)), but when the user modified the selection, the display value had only the field value (eg.192.168.122.0/24).Now
currentDisplayValueis always displaying the humanized label, and it's calculated from the fields it derives from.Summary by CodeRabbit