This commit is contained in:
Jon Ayers 2024-05-01 21:47:29 +00:00 committed by GitHub
commit 8ad473f1a4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 10 additions and 3 deletions

View File

@ -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),
};
};

View File

@ -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,

View File

@ -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

View File

@ -711,6 +711,7 @@ export const MockWorkspaceAgentDeprecated: TypesGen.WorkspaceAgent = {
},
},
lifecycle_state: "ready",
status: "connected",
};
export const MockWorkspaceAgentConnecting: TypesGen.WorkspaceAgent = {