Skip to content

Commit f7fb4bd

Browse files
committed
Refactor MCP and non-MCP connects in Dash
1 parent 02b1241 commit f7fb4bd

File tree

2 files changed

+4
-30
lines changed

2 files changed

+4
-30
lines changed

dash/pages/external_connections.py

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -64,19 +64,6 @@ def is_connection_login_error(error_message):
6464
return "Credential for user identity" in error_message and "Please login first to the connection" in error_message
6565

6666

67-
# Example HTTP methods
68-
HTTP_METHODS = [
69-
{"label": "GET", "value": "GET"},
70-
{"label": "POST", "value": "POST"}
71-
]
72-
73-
# Authentication type options
74-
AUTH_TYPES = [
75-
{"label": "Bearer token", "value": "bearer_token"},
76-
{"label": "OAuth User to Machine Per User", "value": "oauth_user_machine_per_user"},
77-
{"label": "OAuth Machine to Machine", "value": "oauth_machine_machine"}
78-
]
79-
8067
def layout():
8168
return dbc.Container([
8269
# Header
@@ -112,7 +99,7 @@ def layout():
11299
{"label": "OAuth User to Machine Per User", "value": "oauth_user_machine_per_user"},
113100
{"label": "OAuth Machine to Machine", "value": "oauth_machine_machine"}
114101
],
115-
value="bearer_token",
102+
value="oauth_user_machine_per_user",
116103
className="mb-2"
117104
)
118105
], md=6),

dash/pages/mcp_connect.py

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -96,19 +96,6 @@ def is_connection_login_error(error_message):
9696
return "Credential for user identity" in error_message and "Please login first to the connection" in error_message
9797

9898

99-
# Example HTTP methods
100-
HTTP_METHODS = [
101-
{"label": "GET", "value": "GET"},
102-
{"label": "POST", "value": "POST"}
103-
]
104-
105-
# Authentication type options
106-
AUTH_TYPES = [
107-
{"label": "Bearer token", "value": "bearer_token"},
108-
{"label": "OAuth User to Machine Per User", "value": "oauth_user_machine_per_user"},
109-
{"label": "OAuth Machine to Machine", "value": "oauth_machine_machine"}
110-
]
111-
11299
def layout():
113100
return dbc.Container([
114101
# Header
@@ -151,12 +138,12 @@ def layout():
151138
dbc.Col([
152139
dbc.Label("HTTP Method", className="form-label"),
153140
dcc.Dropdown(
154-
id="method-select",
141+
id="method-mcp-select",
155142
options=[
156143
{"label": "GET", "value": "GET"},
157144
{"label": "POST", "value": "POST"}
158145
],
159-
value="GET",
146+
value="POST",
160147
className="mb-2"
161148
)
162149
], md=6),
@@ -355,7 +342,7 @@ def reset_workspace_client_on_auth_change(auth_type):
355342
Output("mcp-output", "children", allow_duplicate=True),
356343
[Input("send-request-btn", "n_clicks")],
357344
[State("connection-mcp-select", "value"),
358-
State("method-select", "value"),
345+
State("method-mcp-select", "value"),
359346
State("body-mcp-input", "value"),
360347
State("auth-type-mcp-select", "value")],
361348
prevent_initial_call=True

0 commit comments

Comments
 (0)