Skip to content

Commit

Permalink
fix: fix issues with the ui test job
Browse files Browse the repository at this point in the history
  • Loading branch information
OliverDudgeon committed Jan 5, 2025
1 parent b6a5f49 commit b17cc23
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { type InstanceGetResponse, type InstanceSummary } from "@squonk/data-man
import { useGetJob } from "@squonk/data-manager-client/job";

import { type InputFieldSchema } from "../../../runCards/JobCard/JobInputFields";
import { TEST_JOB_ID } from "../../../runCards/TestJob/jobId";

// Contains only fields we are interested in
type ApplicationSpecification = {
Expand Down Expand Up @@ -31,7 +32,7 @@ export const useGetJobInputs = (instance: InstanceGetResponse | InstanceSummary)
instance.job_id ?? -1,
undefined,
{
query: { enabled: inputsEnabled },
query: { enabled: inputsEnabled, retry: instance.job_id === TEST_JOB_ID ? 1 : 3 },
},
);

Expand Down
6 changes: 4 additions & 2 deletions src/components/runCards/JobCard/JobModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { useEnqueueError } from "../../../hooks/useEnqueueStackError";
import { CenterLoader } from "../../CenterLoader";
import { ModalWrapper } from "../../modals/ModalWrapper";
import { DebugCheckbox, type DebugValue } from "../DebugCheckbox";
import { TEST_JOB_ID } from "../TestJob/jobId";
import { type CommonModalProps } from "../types";
import { type InputSchema, type JobInputFieldsProps, validateInputData } from "./JobInputFields";

Expand Down Expand Up @@ -85,8 +86,9 @@ export const JobModal = ({

const { mutateAsync: createInstance } = useCreateInstance();
// Get extra details about the job
const { data: job } = useGetJob(jobId);

const { data: job } = useGetJob(jobId, undefined, {
query: { retry: jobId === TEST_JOB_ID ? 1 : 3 },
});
const name = nameState || (job?.job ?? "");

const spec = instance?.application_specification;
Expand Down
4 changes: 2 additions & 2 deletions src/pages/run.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ const Run = () => {
</Grid>
)) ?? [];

process.env.NODE_ENV === "development" && jobCards.push(<TestJobCard key={TEST_JOB_ID} />);

const showApplications = executionTypes.includes("application");
const showJobs = executionTypes.includes("job");

Expand All @@ -100,8 +102,6 @@ const Run = () => {
hasPermissionToRun,
]);

process.env.NODE_ENV === "development" && cards.push(<TestJobCard key={TEST_JOB_ID} />);

return (
<>
<Head>
Expand Down

0 comments on commit b17cc23

Please sign in to comment.