Skip to content

fix: [M3-7262] - Create Firewall Drawer opens in the same tab in the Linode Create Flow#9785

Merged
tyler-akamai merged 13 commits intolinode:developfrom
tyler-akamai:M3-7262-firewall-create-drawer-opens-in-same-tab
Oct 23, 2023
Merged

fix: [M3-7262] - Create Firewall Drawer opens in the same tab in the Linode Create Flow#9785
tyler-akamai merged 13 commits intolinode:developfrom
tyler-akamai:M3-7262-firewall-create-drawer-opens-in-same-tab

Conversation

@tyler-akamai
Copy link
Contributor

@tyler-akamai tyler-akamai commented Oct 11, 2023

Description 📝

Currently there is a 'Create Firewall' button in the Firewall Panel that when clicked, opens the Create Firewall Drawer in another tab. This should open the Create Firewall drawer in the same tab, in the same page.

Changes 🔄

List any change relevant to the reviewer.

  • Firewall Panel's 'Create Firewall' button opens the Firewall Create Drawer in the same tab
  • Once the Firewall is selected, it becomes the value of the dropdown
  • Dropdown header in Create Firewall Drawer 'Linodes' --> 'Additional Linodes (Optional)'
Before After
Screen.Recording.2023-10-12.at.10.02.53.AM.mov
Screen.Recording.2023-10-12.at.9.56.37.AM.mov

How to test 🧪

Prerequisites

  • No required prerequisites

Reproduction steps

Verification steps

Navigate to http://localhost:3000/linodes/create
Ensure that:

  • The default Firewall is still 'None'
  • When you choose a Firewall, the summary section at the bottom gets updated ('Firewall Assigned' gets added)
  • When clicking on 'None', the 'Firewall Assigned' gets removed from the summary section
  • When clicking on the 'Create Firewall' link, the Create Firewall Drawer appears in the same tab
  • The Create Firewall Drawer has the text 'Additional Linodes (Optional)', while the Create Firewall Drawer from the Firewall Landing page has the text 'Linodes'
  • Add an additional Linode and ensure it is added when the Firewall is created
  • After creating a new Firewall, that Firewall is selected in the dropdown (in the firewall panel) and the summary section got updated
  • After creating the Linode, the Linode is properly assigned to the Firewall in the Firewall Landing page. Test this in development, it is blocked in prod by an api feature flag

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

};

const handleFirewallCreated = (id: number, label: string) => {
setDropdownValue({ label, value: id });
Copy link
Contributor Author

@tyler-akamai tyler-akamai Oct 11, 2023

Choose a reason for hiding this comment

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

When the user creates a new Firewall, this code is responsible for setting the value of the dropdown in the Firewall Panel to the recently created Firewall.

@tyler-akamai tyler-akamai self-assigned this Oct 11, 2023
@tyler-akamai tyler-akamai changed the title fix: [M3-7262] - Firewall Create Drawer opens in the same tab in the Linode Create Flow fix: [M3-7262] - Create Firewall Drawer opens in the same tab in the Linode Create Flow Oct 12, 2023
@tyler-akamai tyler-akamai marked this pull request as ready for review October 17, 2023 17:49
@tyler-akamai tyler-akamai requested a review from a team as a code owner October 17, 2023 17:49
@tyler-akamai tyler-akamai requested review from jaalah-akamai and mjac0bs and removed request for a team October 17, 2023 17:49
helperText: JSX.Element;
}

export const createFirewallLabel = 'Additional Linodes (Optional)';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

UX wanted to ensure the user:

  • Wasnt looking for current Linode in the dropdown --> 'Additional'
  • Knew that the input was optional --> '(Optional)'

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.

Thank you for this awesome testing checklist!

I verified:

  • The default Firewall is still 'None'
  • When you choose a Firewall, the summary section at the bottom gets updated ('Firewall Assigned' gets added)
  • When clicking on 'None', the 'Firewall Assigned' gets removed from the summary section
  • When clicking on the 'Create Firewall' link, the Create Firewall Drawer appears in the same tab
  • The Create Firewall Drawer has the text 'Additional Linodes (Optional)', while the Create Firewall Drawer from the Firewall Landing page has the text 'Linodes'
  • Add an additional Linode and ensure it is added when the Firewall is created
  • After creating a new Firewall, that Firewall is selected in the dropdown (in the firewall panel) and the summary section got updated
  • After creating the Linode, the Linode is properly assigned to the Firewall in the Firewall Landing page.

For the last item, I'm not seeing the linode in the create flow be assigned to the firewall -- just the "additional linode" is assigned. Based on your screencap of this branch and my understanding of the acceptance criteria, I would have expected to see both longview-linode-do-not-delete and debian-us-sea listed as assigned to firewall testing123, but debian-us-sea was not. Have you observed any issues with handleFirewallChange?

Screen.Recording.2023-10-18.at.10.07.57.AM.mov

"@linode/manager": Fixed
---

Firewall Create Drawer opens in the same tab in the Linode Create Flow ([#9785](https://github.com/linode/manager/pull/9785))
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Firewall Create Drawer opens in the same tab in the Linode Create Flow ([#9785](https://github.com/linode/manager/pull/9785))
Firewall Create Drawer opening in a new tab in the Linode Create Flow ([#9785](https://github.com/linode/manager/pull/9785))

Similar suggestion here with describing the thing that was fixed.

@tyler-akamai
Copy link
Contributor Author

tyler-akamai commented Oct 18, 2023

Thank you for this awesome testing checklist!

I verified:

  • The default Firewall is still 'None'
  • When you choose a Firewall, the summary section at the bottom gets updated ('Firewall Assigned' gets added)
  • When clicking on 'None', the 'Firewall Assigned' gets removed from the summary section
  • When clicking on the 'Create Firewall' link, the Create Firewall Drawer appears in the same tab
  • The Create Firewall Drawer has the text 'Additional Linodes (Optional)', while the Create Firewall Drawer from the Firewall Landing page has the text 'Linodes'
  • Add an additional Linode and ensure it is added when the Firewall is created
  • After creating a new Firewall, that Firewall is selected in the dropdown (in the firewall panel) and the summary section got updated
  • After creating the Linode, the Linode is properly assigned to the Firewall in the Firewall Landing page.

For the last item, I'm not seeing the linode in the create flow be assigned to the firewall -- just the "additional linode" is assigned. Based on your screencap of this branch and my understanding of the acceptance criteria, I would have expected to see both longview-linode-do-not-delete and debian-us-sea listed as assigned to firewall testing123, but debian-us-sea was not. Have you observed any issues with handleFirewallChange?

Screen.Recording.2023-10-18.at.10.07.57.AM.mov

@mjac0bs Good catch! I had to ask @dwiley-akamai on this one. From my understanding this functionality is blocked by an API feature flag. You can test this on your dev environment locally since the feature flag is turned on, but it is not turned on in prod yet.

@jaalah-akamai
Copy link
Contributor

jaalah-akamai commented Oct 20, 2023

I verified the checklist above and the last item as well. This works in dev, not locally though. ✅

Screenshot 2023-10-20 at 9 11 03 AM

Copy link
Contributor

@jaalah-akamai jaalah-akamai left a comment

Choose a reason for hiding this comment

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

Looks good pending changes requested from @bnussman-akamai

Comment on lines +47 to +50
const [dropdownValue, setDropdownValue] = React.useState<{
label: string;
value: number;
} | null>(null);
Copy link
Member

Choose a reason for hiding this comment

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

I just realized, we shouldn't need state here. We should have a prop on this component called selectedFirewallId: number which we should be using in place of the state

Suggested change
const [dropdownValue, setDropdownValue] = React.useState<{
label: string;
value: number;
} | null>(null);

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.

  • After creating the Linode, the Linode is properly assigned to the Firewall in the Firewall Landing page.

Verified in dev environment, thanks for the clarification!

Functionality looks good. You caught the commented code I was about to note. Other than Banks' feedback and my earlier changelog suggestion, this LGTM.

Copy link
Member

@bnussman-akamai bnussman-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 addressing the feedback! Great change!

@tyler-akamai tyler-akamai merged commit 86ba6e8 into linode:develop Oct 23, 2023
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.

5 participants