diff --git a/packages/manager/.changeset/pr-13221-changed-1766474458876.md b/packages/manager/.changeset/pr-13221-changed-1766474458876.md new file mode 100644 index 00000000000..07d6e24c7af --- /dev/null +++ b/packages/manager/.changeset/pr-13221-changed-1766474458876.md @@ -0,0 +1,5 @@ +--- +"@linode/manager": Changed +--- + +Default selection of network interface type to linode interface in Linode create flow ([#13221](https://github.com/linode/manager/pull/13221)) diff --git a/packages/manager/cypress/e2e/core/linodes/create-linode-with-firewall.spec.ts b/packages/manager/cypress/e2e/core/linodes/create-linode-with-firewall.spec.ts index bfae1112c27..b87f8dea920 100644 --- a/packages/manager/cypress/e2e/core/linodes/create-linode-with-firewall.spec.ts +++ b/packages/manager/cypress/e2e/core/linodes/create-linode-with-firewall.spec.ts @@ -421,6 +421,9 @@ describe('Create Linode with Firewall (Linode Interfaces)', () => { // Confirm the Linode Interfaces section is shown. assertNewLinodeInterfacesIsAvailable(); + // Switch to legacy Config Interfaces + linodeCreatePage.selectLegacyConfigInterfacesType(); + // Confirm that mocked Firewall is shown in the Autocomplete, and then select it. cy.findByLabelText('Firewall').should('be.visible'); cy.get('[data-qa-autocomplete="Firewall"]').within(() => { @@ -491,9 +494,6 @@ describe('Create Linode with Firewall (Linode Interfaces)', () => { // Confirm the Linode Interfaces section is shown. assertNewLinodeInterfacesIsAvailable(); - // Switch to Linode Interfaces - linodeCreatePage.selectLinodeInterfacesType(); - // Confirm that mocked Firewall is shown in the Autocomplete, and then select it. cy.findByLabelText('Public Interface Firewall').should('be.visible'); cy.get('[data-qa-autocomplete="Public Interface Firewall"]').within(() => { @@ -566,6 +566,9 @@ describe('Create Linode with Firewall (Linode Interfaces)', () => { // Confirm the Linode Interfaces section is shown. assertNewLinodeInterfacesIsAvailable(); + // Switch to legacy Config Interfaces + linodeCreatePage.selectLegacyConfigInterfacesType(); + cy.findByText('Create Firewall').should('be.visible').click(); ui.drawer @@ -661,9 +664,6 @@ describe('Create Linode with Firewall (Linode Interfaces)', () => { // Confirm the Linode Interfaces section is shown. assertNewLinodeInterfacesIsAvailable(); - // Switch to Linode Interfaces - linodeCreatePage.selectLinodeInterfacesType(); - cy.findByText('Create Firewall').should('be.visible').click(); ui.drawer @@ -766,6 +766,9 @@ describe('Create Linode with Firewall (Linode Interfaces)', () => { // Confirm the Linode Interfaces section is shown. assertNewLinodeInterfacesIsAvailable(); + // Switch to legacy Config Interfaces + linodeCreatePage.selectLegacyConfigInterfacesType(); + // Creating the linode without a firewall should display a warning. ui.button .findByTitle('Create Linode') @@ -869,9 +872,6 @@ describe('Create Linode with Firewall (Linode Interfaces)', () => { // Confirm the Linode Interfaces section is shown. assertNewLinodeInterfacesIsAvailable(); - // Switch to Linode Interfaces - linodeCreatePage.selectLinodeInterfacesType(); - // Creating the linode without a firewall should display a warning. ui.button .findByTitle('Create Linode') diff --git a/packages/manager/cypress/e2e/core/linodes/create-linode-with-vlan.spec.ts b/packages/manager/cypress/e2e/core/linodes/create-linode-with-vlan.spec.ts index 1b4a1c62f3e..1ed9356b23b 100644 --- a/packages/manager/cypress/e2e/core/linodes/create-linode-with-vlan.spec.ts +++ b/packages/manager/cypress/e2e/core/linodes/create-linode-with-vlan.spec.ts @@ -319,6 +319,9 @@ describe('Create Linode with VLANs (Linode Interfaces)', () => { // Confirm the Linode Interfaces section is shown. assertNewLinodeInterfacesIsAvailable(); + // Switch to legacy Config Interfaces + linodeCreatePage.selectLegacyConfigInterfacesType(); + // select existing VLAN. linodeCreatePage.selectInterface('vlan'); // Confirm that mocked VLAN is shown in the Autocomplete, and then select it. @@ -400,9 +403,6 @@ describe('Create Linode with VLANs (Linode Interfaces)', () => { // Confirm the Linode Interfaces section is shown. assertNewLinodeInterfacesIsAvailable(); - // Switch to Linode Interfaces - linodeCreatePage.selectLinodeInterfacesType(); - // Select VLAN card linodeCreatePage.selectInterface('vlan'); @@ -485,6 +485,9 @@ describe('Create Linode with VLANs (Linode Interfaces)', () => { // Confirm the Linode Interfaces section is shown. assertNewLinodeInterfacesIsAvailable(); + // Switch to legacy Config Interfaces + linodeCreatePage.selectLegacyConfigInterfacesType(); + // Select VLAN card linodeCreatePage.selectInterface('vlan'); @@ -567,9 +570,6 @@ describe('Create Linode with VLANs (Linode Interfaces)', () => { // Confirm the Linode Interfaces section is shown. assertNewLinodeInterfacesIsAvailable(); - // Switch to Linode Interfaces - linodeCreatePage.selectLinodeInterfacesType(); - // Select VLAN card linodeCreatePage.selectInterface('vlan'); diff --git a/packages/manager/cypress/e2e/core/linodes/create-linode-with-vpc.spec.ts b/packages/manager/cypress/e2e/core/linodes/create-linode-with-vpc.spec.ts index ea1688c42d8..0f9fa5ab253 100644 --- a/packages/manager/cypress/e2e/core/linodes/create-linode-with-vpc.spec.ts +++ b/packages/manager/cypress/e2e/core/linodes/create-linode-with-vpc.spec.ts @@ -476,6 +476,9 @@ describe('Create Linode with VPCs (Linode Interfaces)', () => { // Confirm the Linode Interfaces section is shown. assertNewLinodeInterfacesIsAvailable(); + // Switch to legacy Config Interfaces + linodeCreatePage.selectLegacyConfigInterfacesType(); + // Select VPC linodeCreatePage.selectInterface('vpc'); @@ -612,9 +615,6 @@ describe('Create Linode with VPCs (Linode Interfaces)', () => { // Confirm the Linode Interfaces section is shown. assertNewLinodeInterfacesIsAvailable(); - // Switch to Linode Interfaces - linodeCreatePage.selectLinodeInterfacesType(); - // Select VPC option linodeCreatePage.selectInterface('vpc'); @@ -750,6 +750,9 @@ describe('Create Linode with VPCs (Linode Interfaces)', () => { // Confirm the Linode Interfaces section is shown. assertNewLinodeInterfacesIsAvailable(); + // Switch to legacy Config Interfaces + linodeCreatePage.selectLegacyConfigInterfacesType(); + // Select VPC card linodeCreatePage.selectInterface('vpc'); @@ -933,9 +936,6 @@ describe('Create Linode with VPCs (Linode Interfaces)', () => { // Confirm the Linode Interfaces section is shown. assertNewLinodeInterfacesIsAvailable(); - // Switch to Linode Interfaces - linodeCreatePage.selectLinodeInterfacesType(); - // Select VPC card linodeCreatePage.selectInterface('vpc'); diff --git a/packages/manager/src/features/Linodes/LinodeCreate/Networking/InterfaceGeneration.tsx b/packages/manager/src/features/Linodes/LinodeCreate/Networking/InterfaceGeneration.tsx index bd4cf8cf802..9020bfd894b 100644 --- a/packages/manager/src/features/Linodes/LinodeCreate/Networking/InterfaceGeneration.tsx +++ b/packages/manager/src/features/Linodes/LinodeCreate/Networking/InterfaceGeneration.tsx @@ -65,7 +65,7 @@ export const InterfaceGeneration = () => { aria-labelledby="interface-generation" onChange={field.onChange} sx={{ my: '0px !important' }} - value={field.value ?? 'legacy_config'} + value={field.value ?? 'linode'} > } diff --git a/packages/manager/src/features/Linodes/LinodeCreate/utilities.test.tsx b/packages/manager/src/features/Linodes/LinodeCreate/utilities.test.tsx index 9184714117a..10ffa39e821 100644 --- a/packages/manager/src/features/Linodes/LinodeCreate/utilities.test.tsx +++ b/packages/manager/src/features/Linodes/LinodeCreate/utilities.test.tsx @@ -434,14 +434,6 @@ describe('getIsValidLinodeLabelCharacter', () => { }); describe('getDefaultInterfaceGenerationFromAccountSetting', () => { - it('returns "legacy_config" for "legacy_config_default_but_linode_allowed"', () => { - expect( - getDefaultInterfaceGenerationFromAccountSetting( - 'legacy_config_default_but_linode_allowed' - ) - ).toBe('legacy_config'); - }); - it('returns "legacy_config" for "legacy_config_only"', () => { expect( getDefaultInterfaceGenerationFromAccountSetting('legacy_config_only') @@ -454,6 +446,14 @@ describe('getDefaultInterfaceGenerationFromAccountSetting', () => { ); }); + it('returns "linode" for "legacy_config_default_but_linode_allowed"', () => { + expect( + getDefaultInterfaceGenerationFromAccountSetting( + 'legacy_config_default_but_linode_allowed' + ) + ).toBe('linode'); + }); + it('returns "linode" for "linode_default_but_legacy_config_allowed"', () => { expect( getDefaultInterfaceGenerationFromAccountSetting( diff --git a/packages/manager/src/features/Linodes/LinodeCreate/utilities.ts b/packages/manager/src/features/Linodes/LinodeCreate/utilities.ts index 60cd2d430e7..a30cf672123 100644 --- a/packages/manager/src/features/Linodes/LinodeCreate/utilities.ts +++ b/packages/manager/src/features/Linodes/LinodeCreate/utilities.ts @@ -616,14 +616,13 @@ export const getDefaultInterfaceGenerationFromAccountSetting = ( ): InterfaceGenerationType | undefined => { if ( accountSetting === 'linode_only' || - accountSetting === 'linode_default_but_legacy_config_allowed' + accountSetting === 'linode_default_but_legacy_config_allowed' || + accountSetting === 'legacy_config_default_but_linode_allowed' ) { + // Default selection is to the Linode interface to encourage new customer accounts to adopt it safely when using Cloud Manager. return 'linode'; } - if ( - accountSetting === 'legacy_config_only' || - accountSetting === 'legacy_config_default_but_linode_allowed' - ) { + if (accountSetting === 'legacy_config_only') { return 'legacy_config'; } return undefined;