File tree Expand file tree Collapse file tree 8 files changed +46
-7
lines changed
components/Agentic/IncidentTemplate Expand file tree Collapse file tree 8 files changed +46
-7
lines changed Original file line number Diff line number Diff line change 2929 - run : npm ci
3030
3131 - env :
32- GITHUB_TOKEN : ${{ secrets.CONTENTS_WRITE_PAT }}
32+ GITHUB_TOKEN : ${{ secrets.CONTENTS_WRITE_PAT }} # TODO: fix
3333 run : npm run build:prod:${{ inputs.platform }}
3434
3535 - name : Get artifact name
Original file line number Diff line number Diff line change @@ -166,7 +166,9 @@ export const MCPServerDialog = ({
166166 onClose ( ) ;
167167 } ;
168168
169- const title = serverData ?. uid ? "Set MCP Server" : "Add MCP Server" ;
169+ const title = serverData ?. uid
170+ ? `Edit ${ serverData . name } MCP Server`
171+ : "Add MCP Server" ;
170172
171173 return (
172174 < Dialog title = { title } onClose = { handleDialogClose } >
Original file line number Diff line number Diff line change @@ -170,6 +170,10 @@ export const IncidentTemplate = () => {
170170 }
171171 } , [ mcpServers ] ) ;
172172
173+ const mcpServerToDelete = mcpServers ?. mcps . find (
174+ ( x ) => x . uid === mcpServerIdToDelete
175+ ) ;
176+
173177 return (
174178 < s . Container >
175179 < s . Header >
@@ -211,7 +215,7 @@ export const IncidentTemplate = () => {
211215 { mcpServerIdToDelete && (
212216 < s . StyledOverlay >
213217 < CancelConfirmation
214- header = { " Delete MCP server" }
218+ header = { ` Delete ${ mcpServerToDelete ?. name ?? " " } MCP server` }
215219 description = { "Are you sure you want to delete this MCP server?" }
216220 onClose = { handleDeleteMCPServerDialogClose }
217221 onConfirm = { handleDeleteMCPServerDialogConfirm }
Original file line number Diff line number Diff line change 11import { createApi , fetchBaseQuery } from "@reduxjs/toolkit/query/react" ;
2+ import { serializeParams } from "./serializeParams" ;
23
34export const authApi = createApi ( {
45 reducerPath : "authApi" ,
5- baseQuery : fetchBaseQuery ( { baseUrl : "/auth/" , credentials : "same-origin" } ) ,
6+ baseQuery : fetchBaseQuery ( {
7+ baseUrl : "/auth/" ,
8+ credentials : "same-origin" ,
9+ paramsSerializer : serializeParams
10+ } ) ,
611 endpoints : ( builder ) => ( {
712 logout : builder . mutation < void , void > ( {
813 query : ( ) => ( {
Original file line number Diff line number Diff line change 11import { createApi , fetchBaseQuery } from "@reduxjs/toolkit/query/react" ;
22import { isString } from "../../typeGuards/isString" ;
3+ import { serializeParams } from "./serializeParams" ;
34import type {
45 AddMCPServerPayload ,
56 AgenticInvestigatePayload ,
@@ -137,7 +138,8 @@ export const digmaApi = createApi({
137138 baseUrl : isString ( window . digmaApiProxyPrefix )
138139 ? window . digmaApiProxyPrefix
139140 : "/api/" ,
140- credentials : "same-origin"
141+ credentials : "same-origin" ,
142+ paramsSerializer : serializeParams
141143 } ) ,
142144 endpoints : ( builder ) => ( {
143145 getAbout : builder . query < GetAboutResponse , void > ( {
Original file line number Diff line number Diff line change 11import { createApi , fetchBaseQuery } from "@reduxjs/toolkit/query/react" ;
22import { isString } from "../../typeGuards/isString" ;
3+ import { serializeParams } from "./serializeParams" ;
34
45export const digmaEmptyApi = createApi ( {
56 reducerPath : "digmaApi" ,
67 baseQuery : fetchBaseQuery ( {
78 baseUrl : isString ( window . digmaApiProxyPrefix )
89 ? window . digmaApiProxyPrefix
910 : "/api/" ,
10- credentials : "same-origin"
11+ credentials : "same-origin" ,
12+ paramsSerializer : serializeParams
1113 } ) ,
1214 endpoints : ( ) => ( { } )
1315} ) ;
Original file line number Diff line number Diff line change 11import { createApi , fetchBaseQuery } from "@reduxjs/toolkit/query/react" ;
2+ import { serializeParams } from "./serializeParams" ;
23
34export const pluginApi = createApi ( {
45 reducerPath : "pluginApi" ,
56 baseQuery : fetchBaseQuery ( {
67 baseUrl : "/plugin-api" ,
7- credentials : "same-origin"
8+ credentials : "same-origin" ,
9+ paramsSerializer : serializeParams
810 } ) ,
911 endpoints : ( ) => ( { } )
1012} ) ;
Original file line number Diff line number Diff line change 1+ // Serialize array params as duplicated params
2+ export const serializeParams = (
3+ params : Record < string , string | number | boolean | null | undefined >
4+ ) => {
5+ const searchParams = new URLSearchParams ( ) ;
6+
7+ Object . entries ( params ) . forEach ( ( [ key , value ] ) => {
8+ if ( value === undefined || value === null ) {
9+ return ;
10+ }
11+
12+ if ( Array . isArray ( value ) ) {
13+ value . forEach ( ( item ) => {
14+ searchParams . append ( key , String ( item ) ) ;
15+ } ) ;
16+ } else {
17+ searchParams . append ( key , String ( value ) ) ;
18+ }
19+ } ) ;
20+
21+ return searchParams . toString ( ) ;
22+ } ;
You can’t perform that action at this time.
0 commit comments