Skip to content

Commit a5e07a2

Browse files
authored
fix websocket (#2115)
1 parent 528699d commit a5e07a2

File tree

2 files changed

+15
-16
lines changed

2 files changed

+15
-16
lines changed

web/cypress/integration/route/create-edit-route-with-redirect-plugin.spec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ context('Create Edit and Delete Route with redirect plugin', () => {
6161
cy.get(selector.customRedirectLabel).should('be.visible');
6262
cy.get(selector.customRedirectUrI).should('be.visible');
6363
cy.get(selector.customRedirectCode).should('be.visible');
64-
cy.get(selector.webSocketSelector).should('not.exist');
65-
cy.get(selector.enable_websocket_button).should('not.exist');
64+
cy.get(selector.webSocketSelector).should('exist');
65+
cy.get(selector.enable_websocket_button).should('exist');
6666

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

9797
cy.contains('Next').click();
9898
cy.contains('Submit').click();

web/src/pages/Route/components/Step1/MetaView.tsx

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -185,18 +185,17 @@ const MetaView: React.FC<RouteModule.Step1PassProps> = ({
185185
</Form.Item>
186186
);
187187

188-
const WebSocket: React.FC = () =>
189-
form.getFieldValue('redirectOption') === 'disabled' ? (
190-
<Form.Item label="WebSocket">
191-
<Row>
192-
<Col>
193-
<Form.Item noStyle valuePropName="checked" name="enable_websocket">
194-
<Switch disabled={disabled} />
195-
</Form.Item>
196-
</Col>
197-
</Row>
198-
</Form.Item>
199-
) : null;
188+
const WebSocket: React.FC = () => (
189+
<Form.Item label="WebSocket">
190+
<Row>
191+
<Col>
192+
<Form.Item noStyle valuePropName="checked" name="enable_websocket">
193+
<Switch disabled={disabled} />
194+
</Form.Item>
195+
</Col>
196+
</Row>
197+
</Form.Item>
198+
);
200199

201200
const Redirect: React.FC = () => {
202201
const list = [

0 commit comments

Comments
 (0)