Add api path prefix into screenshots and title (#1557)
This commit is contained in:
@@ -6,6 +6,7 @@ import { useQuery } from "@tanstack/react-query";
|
|||||||
import { getImageURL } from "./artifactUtils";
|
import { getImageURL } from "./artifactUtils";
|
||||||
import { ReloadIcon } from "@radix-ui/react-icons";
|
import { ReloadIcon } from "@radix-ui/react-icons";
|
||||||
import { statusIsNotFinalized } from "../types";
|
import { statusIsNotFinalized } from "../types";
|
||||||
|
import { apiPathPrefix } from "@/util/env";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
stepId: string;
|
stepId: string;
|
||||||
@@ -25,7 +26,7 @@ function ActionScreenshot({ stepId, index, taskStatus }: Props) {
|
|||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const client = await getClient(credentialGetter);
|
const client = await getClient(credentialGetter);
|
||||||
return client
|
return client
|
||||||
.get(`/step/${stepId}/artifacts`)
|
.get(`${apiPathPrefix}/step/${stepId}/artifacts`)
|
||||||
.then((response) => response.data);
|
.then((response) => response.data);
|
||||||
},
|
},
|
||||||
refetchInterval: (query) => {
|
refetchInterval: (query) => {
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import { Skeleton } from "@/components/ui/skeleton";
|
|||||||
import { useCredentialGetter } from "@/hooks/useCredentialGetter";
|
import { useCredentialGetter } from "@/hooks/useCredentialGetter";
|
||||||
import { useQuery } from "@tanstack/react-query";
|
import { useQuery } from "@tanstack/react-query";
|
||||||
import { WorkflowApiResponse } from "./types/workflowTypes";
|
import { WorkflowApiResponse } from "./types/workflowTypes";
|
||||||
|
import { apiPathPrefix } from "@/util/env";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
workflowPermanentId: string;
|
workflowPermanentId: string;
|
||||||
@@ -20,7 +21,7 @@ function WorkflowTitle({ workflowPermanentId }: Props) {
|
|||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const client = await getClient(credentialGetter);
|
const client = await getClient(credentialGetter);
|
||||||
return client
|
return client
|
||||||
.get(`/workflows/${workflowPermanentId}`)
|
.get(`${apiPathPrefix}/workflows/${workflowPermanentId}`)
|
||||||
.then((response) => response.data);
|
.then((response) => response.data);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import { useQuery } from "@tanstack/react-query";
|
|||||||
import { ReloadIcon } from "@radix-ui/react-icons";
|
import { ReloadIcon } from "@radix-ui/react-icons";
|
||||||
import { statusIsNotFinalized } from "@/routes/tasks/types";
|
import { statusIsNotFinalized } from "@/routes/tasks/types";
|
||||||
import { getImageURL } from "@/routes/tasks/detail/artifactUtils";
|
import { getImageURL } from "@/routes/tasks/detail/artifactUtils";
|
||||||
|
import { apiPathPrefix } from "@/util/env";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
observerThoughtId: string;
|
observerThoughtId: string;
|
||||||
@@ -20,7 +21,7 @@ function ObserverThoughtScreenshot({ observerThoughtId, taskStatus }: Props) {
|
|||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const client = await getClient(credentialGetter);
|
const client = await getClient(credentialGetter);
|
||||||
return client
|
return client
|
||||||
.get(`/observer_thought/${observerThoughtId}/artifacts`)
|
.get(`${apiPathPrefix}/observer_thought/${observerThoughtId}/artifacts`)
|
||||||
.then((response) => response.data);
|
.then((response) => response.data);
|
||||||
},
|
},
|
||||||
refetchInterval: (query) => {
|
refetchInterval: (query) => {
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import { useCredentialGetter } from "@/hooks/useCredentialGetter";
|
|||||||
import { useQuery } from "@tanstack/react-query";
|
import { useQuery } from "@tanstack/react-query";
|
||||||
import { ReloadIcon } from "@radix-ui/react-icons";
|
import { ReloadIcon } from "@radix-ui/react-icons";
|
||||||
import { getImageURL } from "@/routes/tasks/detail/artifactUtils";
|
import { getImageURL } from "@/routes/tasks/detail/artifactUtils";
|
||||||
|
import { apiPathPrefix } from "@/util/env";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
workflowRunBlockId: string;
|
workflowRunBlockId: string;
|
||||||
@@ -18,7 +19,9 @@ function WorkflowRunBlockScreenshot({ workflowRunBlockId }: Props) {
|
|||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const client = await getClient(credentialGetter);
|
const client = await getClient(credentialGetter);
|
||||||
return client
|
return client
|
||||||
.get(`/workflow_run_block/${workflowRunBlockId}/artifacts`)
|
.get(
|
||||||
|
`${apiPathPrefix}/workflow_run_block/${workflowRunBlockId}/artifacts`,
|
||||||
|
)
|
||||||
.then((response) => response.data);
|
.then((response) => response.data);
|
||||||
},
|
},
|
||||||
refetchInterval: (query) => {
|
refetchInterval: (query) => {
|
||||||
|
|||||||
@@ -19,4 +19,12 @@ if (!artifactApiBaseUrl) {
|
|||||||
console.warn("artifactApiBaseUrl environment variable was not set");
|
console.warn("artifactApiBaseUrl environment variable was not set");
|
||||||
}
|
}
|
||||||
|
|
||||||
export { apiBaseUrl, environment, envCredential, artifactApiBaseUrl };
|
const apiPathPrefix = import.meta.env.VITE_API_PATH_PREFIX ?? "";
|
||||||
|
|
||||||
|
export {
|
||||||
|
apiBaseUrl,
|
||||||
|
environment,
|
||||||
|
envCredential,
|
||||||
|
artifactApiBaseUrl,
|
||||||
|
apiPathPrefix,
|
||||||
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user