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

refactor: [M3-6257] - React Query for Firewalls #8889

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/api-v4/src/firewalls/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export type FirewallStatus = 'enabled' | 'disabled' | 'deleted';

export type FirewallRuleProtocol = 'ALL' | 'TCP' | 'UDP' | 'ICMP' | 'IPENCAP';

export type FirewallDeviceEntityType = 'linode' | 'nodebalancer';
export type FirewallDeviceEntityType = 'linode';

export type FirewallPolicyType = 'ACCEPT' | 'DROP';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,14 +219,19 @@ describe('Migrate Linode With Firewall', () => {
fbtClick('Create Firewall');
});

cy.get('[data-testid="textfield-input"]')
cy.get('[data-testid="textfield-input"]:first')
.should('be.visible')
.type(firewallLabel);

cy.get('[data-qa-enhanced-select="Select a Linode or type to search..."]')
cy.get('[data-testid="textfield-input"]:last')
.should('be.visible')
.click()
.type(`${linode.label}{enter}`);
.type(linode.label);

cy.get('[data-qa-autocomplete-popper]')
.findByText(linode.label)
.should('be.visible')
.click();

cy.findByText(linode.label).should('be.visible');

Expand Down Expand Up @@ -278,14 +283,19 @@ describe('Migrate Linode With Firewall', () => {
fbtClick('Create Firewall');
});

cy.get('[data-testid="textfield-input"]')
cy.get('[data-testid="textfield-input"]:first')
.should('be.visible')
.type(firewallLabel);

cy.get('[data-qa-enhanced-select="Select a Linode or type to search..."]')
cy.get('[data-testid="textfield-input"]:last')
.should('be.visible')
.click()
.type(`${linodeLabel}{enter}`);
.type(linodeLabel);

cy.get('[data-qa-autocomplete-popper]')
.findByText(linode.label)
.should('be.visible')
.click();

cy.findByText(linodeLabel).should('be.visible');

Expand Down
8 changes: 8 additions & 0 deletions packages/manager/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import withPreferences, {
} from './containers/preferences.container';
import { loadScript } from './hooks/useScript';
import { getNextThemeValue } from './utilities/theme';
import { firewallEventsHandler } from './queries/firewalls';

interface Props {
location: RouteComponentProps['location'];
Expand Down Expand Up @@ -139,6 +140,13 @@ export class App extends React.Component<CombinedProps, State> {
.filter((event) => event.action.startsWith('token') && !event._initial)
.subscribe(tokenEventHandler);

/*
Send any Token events to the Token events handler in the queries file
*/
events$
.filter((event) => event.action.startsWith('firewall') && !event._initial)
.subscribe(firewallEventsHandler);

/*
* We want to listen for migration events side-wide
* It's unpredictable when a migration is going to happen. It could take
Expand Down

This file was deleted.

Loading