diff --git a/packages/components/src/jobs/InferenceJob.ts b/packages/components/src/jobs/InferenceJob.ts
index eee50ef525..dc099f2b94 100644
--- a/packages/components/src/jobs/InferenceJob.ts
+++ b/packages/components/src/jobs/InferenceJob.ts
@@ -16,6 +16,10 @@ export enum FrontendInferenceJobType {
VideoStyleTransfer,
}
+export enum AllInferenceJobs { All }
+
+export type JobListOptions = FrontendInferenceJobType | AllInferenceJobs;
+
// NB: Many of these fields are optional despite the response payload containing them
// This is because we create temporary placeholder objects with just the token.
export class InferenceJob {
diff --git a/packages/fakeyou.com/src/components/layout/InferenceJobsList/InferenceJobsList.tsx b/packages/fakeyou.com/src/components/layout/InferenceJobsList/InferenceJobsList.tsx
index 3e8da898f9..c7f31f7255 100644
--- a/packages/fakeyou.com/src/components/layout/InferenceJobsList/InferenceJobsList.tsx
+++ b/packages/fakeyou.com/src/components/layout/InferenceJobsList/InferenceJobsList.tsx
@@ -3,7 +3,6 @@ import { FrontendInferenceJobType, InferenceJob } from "@storyteller/components/
// import { useTransition } from "@react-spring/web";
import JobItem from "./JobItem";
import { useInferenceJobs, useLocalize, useSession } from "hooks";
-import { JobListTypes } from "hooks/useInferenceJobs/useInferenceJobs";
import "./InferenceJobsList.scss";
import { Button, Panel, JobQueueTicker } from "components/common";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
@@ -12,7 +11,6 @@ import { faClipboardList } from "@fortawesome/pro-solid-svg-icons";
interface JobsListProps {
failures: (fail: string) => string;
jobType?: FrontendInferenceJobType;
- value?: JobListTypes;
onSelect?: (e: any) => any;
panel?: boolean;
showJobQueue?: boolean;
@@ -34,21 +32,15 @@ const resultPaths = {
export default function InferenceJobsList({
failures,
jobType,
- value,
onSelect,
panel = true,
showHeader = true,
showJobQueue = false,
showNoJobs = false
}: JobsListProps) {
- const jobValue = value !== undefined ? value : jobType !== undefined ? (jobType || 0) + 1 : 0;
- // undefined specified here to allow 0.
- // jobType + 1 because the difference between FrontendInferenceJobType and JobListTypes is an "all" option
-
const { sessionSubscriptions } = useSession();
const hasPaidFeatures = sessionSubscriptions?.hasPaidFeatures();
- const { inferenceJobs = [], jobStatusDescription } = useInferenceJobs(jobValue);
-
+ const { inferenceJobs = [], jobStatusDescription } = useInferenceJobs(jobType);
const { t } = useLocalize("InferenceJobs");
const jobContent = (
diff --git a/packages/fakeyou.com/src/components/modals/InferenceJobsModal/InferenceJobsModal.tsx b/packages/fakeyou.com/src/components/modals/InferenceJobsModal/InferenceJobsModal.tsx
index cea502693c..8a828975d1 100644
--- a/packages/fakeyou.com/src/components/modals/InferenceJobsModal/InferenceJobsModal.tsx
+++ b/packages/fakeyou.com/src/components/modals/InferenceJobsModal/InferenceJobsModal.tsx
@@ -1,8 +1,8 @@
-import React from "react"; // useState
+import React, { useState } from "react"; // useState
import InferenceJobsList from "components/layout/InferenceJobsList";
import { FrontendInferenceJobType } from "@storyteller/components/src/jobs/InferenceJob";
-// import { TempSelect as Select } from "components/common";
-// import { enumToKeyArr } from "resources";
+import { TempSelect as Select } from "components/common";
+import { enumToKeyArr } from "resources";
import ModalHeader from "../ModalHeader";
import { useLocalize } from "hooks";
@@ -18,18 +18,16 @@ export default function InferenceJobsModal({
showModalHeader = true,
...rest
}: Props) {
- // const presetFilter = enumToKeyArr(FrontendInferenceJobType)[inJobType];
- // const [jobType,jobTypeSet] = useState(inJobType > -1 ? presetFilter : "All");
- // const typeObj = ["All", ...Object.values(FrontendInferenceJobType)];
-
- // const options = typeObj.filter(val => isNaN(Number(val)))
- // .map((value) => {
- // if (typeof value === "string") return { value, label: value }
- // return { label: "", value: "" };
- // });
-
+ const presetFilter = enumToKeyArr(FrontendInferenceJobType)[inJobType];
+ const [jobType,jobTypeSet] = useState(inJobType > -1 ? presetFilter : "All");
+ const typeObj = ["All", ...Object.values(FrontendInferenceJobType)];
+ const options = typeObj.filter(val => isNaN(Number(val)))
+ .map((value) => {
+ if (typeof value === "string") return { value, label: value }
+ return { label: "", value: "" };
+ });
const { t } = useLocalize("InferenceJobs");
-
+ const selectedType = typeObj.indexOf(jobType) - 1;
const failures = (fail = "") => {
switch (fail) {
default:
@@ -41,7 +39,7 @@ export default function InferenceJobsModal({
<>
{ showModalHeader && }
{
- //