mirror of https://github.com/coder/coder.git
Merge c35805f11c
into 93d8812284
This commit is contained in:
commit
8ad473f1a4
|
@ -1,9 +1,14 @@
|
|||
import type { GetJFrogXRayScanParams } from "api/api";
|
||||
import * as API from "api/api";
|
||||
import type { WorkspaceAgentStatus } from "api/typesGenerated";
|
||||
|
||||
export const xrayScan = (params: GetJFrogXRayScanParams) => {
|
||||
export const xrayScan = (
|
||||
params: GetJFrogXRayScanParams,
|
||||
status: WorkspaceAgentStatus,
|
||||
) => {
|
||||
return {
|
||||
queryKey: ["xray", params],
|
||||
// Reload the xray results whenever the status changes
|
||||
queryKey: ["xray", params, status],
|
||||
queryFn: () => API.getJFrogXRayScan(params),
|
||||
};
|
||||
};
|
||||
|
|
|
@ -302,6 +302,7 @@ export const WithXRayScan: Story = {
|
|||
key: [
|
||||
"xray",
|
||||
{ agentId: M.MockWorkspaceAgent.id, workspaceId: M.MockWorkspace.id },
|
||||
M.MockWorkspaceAgent.status,
|
||||
],
|
||||
data: {
|
||||
workspace_id: M.MockWorkspace.id,
|
||||
|
|
|
@ -72,7 +72,7 @@ export const AgentRow: FC<AgentRowProps> = ({
|
|||
}) => {
|
||||
// XRay integration
|
||||
const xrayScanQuery = useQuery(
|
||||
xrayScan({ workspaceId: workspace.id, agentId: agent.id }),
|
||||
xrayScan({ workspaceId: workspace.id, agentId: agent.id }, agent.status),
|
||||
);
|
||||
|
||||
// Apps visibility
|
||||
|
|
|
@ -711,6 +711,7 @@ export const MockWorkspaceAgentDeprecated: TypesGen.WorkspaceAgent = {
|
|||
},
|
||||
},
|
||||
lifecycle_state: "ready",
|
||||
status: "connected",
|
||||
};
|
||||
|
||||
export const MockWorkspaceAgentConnecting: TypesGen.WorkspaceAgent = {
|
||||
|
|
Loading…
Reference in New Issue