From a3fb2a0a4720327febf1d1577cdbc38c0896dcf2 Mon Sep 17 00:00:00 2001 From: Christopher Oliphant Date: Fri, 12 Apr 2024 22:46:55 -0400 Subject: [PATCH] remove debugging --- .../DialogueInference/DialogueInference.tsx | 88 +++++++++---------- app/pages/PageEnigma/PageEditor.tsx | 15 ++-- app/reducers/appUiReducer/reducer.tsx | 1 - 3 files changed, 48 insertions(+), 56 deletions(-) diff --git a/app/modules/DialogueInference/DialogueInference.tsx b/app/modules/DialogueInference/DialogueInference.tsx index 53ee84b7bf..32676f3d7f 100644 --- a/app/modules/DialogueInference/DialogueInference.tsx +++ b/app/modules/DialogueInference/DialogueInference.tsx @@ -10,15 +10,18 @@ import { } from "@fortawesome/pro-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; -import { deleteInferenceJob, inferenceJobs } from "~/pages/PageEnigma/store/inferenceJobs"; +import { + deleteInferenceJob, + inferenceJobs, +} from "~/pages/PageEnigma/store/inferenceJobs"; import { InferenceJob } from "~/pages/PageEnigma/models"; import { ButtonDialogue } from "../ButtonDialogue"; -import { ButtonIcon, H4,H6,P } from "~/components"; +import { ButtonIcon, H4, H6, P } from "~/components"; import { JobState } from "~/hooks/useInferenceJobManager/useInferenceJobManager"; -const printJobType = (jobType : string)=>{ - switch (jobType){ +const printJobType = (jobType: string) => { + switch (jobType) { case "generic": return "Text to Speech"; default: @@ -26,23 +29,23 @@ const printJobType = (jobType : string)=>{ } }; -const printJobStatus = (jobStatus : string)=>{ - switch (jobStatus){ +const printJobStatus = (jobStatus: string) => { + switch (jobStatus) { case JobState.PENDING: return "Adding to the queue."; case JobState.STARTED: return "Processing, please wait..."; case JobState.COMPLETE_SUCCESS: - return "Completed! See Audio Panel for the result. file." + return "Completed! See Audio Panel for the result. file."; default: return "Unknown Status"; } }; -const JobStatusIcon = ({jobStatus} : {jobStatus:string})=>{ - switch (jobStatus){ - case JobState.PENDING:{ - return( +const JobStatusIcon = ({ jobStatus }: { jobStatus: string }) => { + switch (jobStatus) { + case JobState.PENDING: { + return ( { /> ); } - case JobState.STARTED:{ - return( - ); } - case JobState.COMPLETE_SUCCESS:{ - return( + case JobState.COMPLETE_SUCCESS: { + return ( { /> ); } - default:{ - return( + default: { + return ( { } }; -const InferenceItem = ({job}:{job:InferenceJob}) => { - return( -
  • +const InferenceItem = ({ job }: { job: InferenceJob }) => { + return ( +
  • -

    {printJobType(job.job_type)}

    -
    {printJobStatus(job.job_status)}
    +

    {printJobType(job.job_type)}

    +
    {printJobStatus(job.job_status)}
    - {job.job_status === JobState.COMPLETE_SUCCESS && + {job.job_status === JobState.COMPLETE_SUCCESS && (
    { + onClick={() => { deleteInferenceJob(job); }} />
    - } + )}
  • ); }; -export const DialogueInference = () =>{ +export const DialogueInference = () => { useSignals(); - const buttonIcon = inferenceJobs.value.length > 0 - ? faClipboardList : faClipboard; - return( + const buttonIcon = + inferenceJobs.value.length > 0 ? faClipboardList : faClipboard; + return ( - {inferenceJobs.value.length > 0 && + className: inferenceJobs.value.length === 0 ? "invisible" : "visible", + }}> + {inferenceJobs.value.length > 0 && (
      - {inferenceJobs.value.map(job=> + {inferenceJobs.value.map((job) => ( - )} + ))}
    - } - { - inferenceJobs.value.length === 0 && + )} + {inferenceJobs.value.length === 0 && (

    You currently have no running proccesses.

    - } + )}
    ); -} - +}; diff --git a/app/pages/PageEnigma/PageEditor.tsx b/app/pages/PageEnigma/PageEditor.tsx index df2cf03f73..94614eaa4e 100644 --- a/app/pages/PageEnigma/PageEditor.tsx +++ b/app/pages/PageEnigma/PageEditor.tsx @@ -56,8 +56,7 @@ export const PageEditor = ({ setPage }: Props) => {
    + style={{ height: "calc(100vh - 68px)" }}> {/* Engine section/side panel */}
    { style={{ height, width, - }} - > + }}>
    + }> {/* Top controls */}
    + onClick={handleOverlayClick}>
    @@ -97,8 +93,7 @@ export const PageEditor = ({ setPage }: Props) => { (sidePanelVisible.value ? sidePanelWidth.value : 0) - 84, }} - onClick={handleOverlayClick} - > + onClick={handleOverlayClick}> diff --git a/app/reducers/appUiReducer/reducer.tsx b/app/reducers/appUiReducer/reducer.tsx index 3b05ea592c..fe7c22edb3 100644 --- a/app/reducers/appUiReducer/reducer.tsx +++ b/app/reducers/appUiReducer/reducer.tsx @@ -1,7 +1,6 @@ import { State, Action, ACTION_TYPES } from "./types"; export function reducer(state: State, action: Action): State { - console.log(action.type); switch (action.type) { case ACTION_TYPES.OPEN_DIALOGUE_TTS: { return {