Skip to content

Commit

Permalink
fix websocket
Browse files Browse the repository at this point in the history
  • Loading branch information
LiteSun committed Sep 2, 2021
1 parent 528699d commit 8089ceb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ context('Create Edit and Delete Route with redirect plugin', () => {
cy.get(selector.customRedirectLabel).should('be.visible');
cy.get(selector.customRedirectUrI).should('be.visible');
cy.get(selector.customRedirectCode).should('be.visible');
cy.get(selector.webSocketSelector).should('not.exist');
cy.get(selector.enable_websocket_button).should('not.exist');
cy.get(selector.webSocketSelector).should('exist');
cy.get(selector.enable_websocket_button).should('exist');

// step 2 and step 3 should not be visible
cy.contains(data.step2Title).should('not.exist');
Expand Down Expand Up @@ -91,8 +91,8 @@ context('Create Edit and Delete Route with redirect plugin', () => {
// should not shown set upstream notice
cy.contains(data.setUpstreamNotice).should('not.exist');
cy.get(selector.name).clear().type(newName);
cy.get(selector.webSocketSelector).should('not.exist');
cy.get(selector.enable_websocket_button).should('not.exist');
cy.get(selector.webSocketSelector).should('exist');
cy.get(selector.enable_websocket_button).should('exist');

cy.contains('Next').click();
cy.contains('Submit').click();
Expand Down
23 changes: 11 additions & 12 deletions web/src/pages/Route/components/Step1/MetaView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -185,18 +185,17 @@ const MetaView: React.FC<RouteModule.Step1PassProps> = ({
</Form.Item>
);

const WebSocket: React.FC = () =>
form.getFieldValue('redirectOption') === 'disabled' ? (
<Form.Item label="WebSocket">
<Row>
<Col>
<Form.Item noStyle valuePropName="checked" name="enable_websocket">
<Switch disabled={disabled} />
</Form.Item>
</Col>
</Row>
</Form.Item>
) : null;
const WebSocket: React.FC = () => (
<Form.Item label="WebSocket">
<Row>
<Col>
<Form.Item noStyle valuePropName="checked" name="enable_websocket">
<Switch disabled={disabled} />
</Form.Item>
</Col>
</Row>
</Form.Item>
);

const Redirect: React.FC = () => {
const list = [
Expand Down

0 comments on commit 8089ceb

Please sign in to comment.