diff --git a/components/atg/Editor/components/sidebar.tsx b/components/atg/Editor/components/sidebar.tsx
index 06c02da9..7588ed49 100644
--- a/components/atg/Editor/components/sidebar.tsx
+++ b/components/atg/Editor/components/sidebar.tsx
@@ -24,7 +24,7 @@ export const Sidebar = ({
return (
diff --git a/components/atg/Editor/editor/code.tsx b/components/atg/Editor/editor/code.tsx
index 5b53455e..d7143dc2 100644
--- a/components/atg/Editor/editor/code.tsx
+++ b/components/atg/Editor/editor/code.tsx
@@ -2,13 +2,9 @@ import React, { useEffect, useState, useRef } from "react";
import Editor, { useMonaco } from "@monaco-editor/react";
import * as monaco from "monaco-editor";
import { File } from "../utils/file-manager";
-import ChevronLeftIcon from "@mui/icons-material/ChevronLeft";
-import ChevronRightIcon from "@mui/icons-material/ChevronRight";
import { useEditTestSubscription } from "@/app/api/automatic-test-generator/Subscription";
export const Code = ({
selectedFile,
- showSideBannerBool,
- RemoveSideBanner,
settingCodeTheme,
isFullScreen,
selectedFileName,
@@ -220,7 +216,7 @@ export const Code = ({
return (
@@ -235,33 +231,6 @@ export const Code = ({
onChange={handleFileChange}
onMount={(editor) => (editorRef.current = editor)} // Store editor instance
/>
- {!showSideBannerBool && (
-
setShowText(true)}
- onMouseLeave={() => setShowText(false)}
- className={`p-2 absolute z-10 hover:cursor-pointer border border-gray-500 border-b-0 right-0 top-1/2 bg-secondary-300 flex items-center justify-center shadow-lg transition-all duration-500`}
- style={{
- transform: "translateY(-50%)",
- height: "3rem",
- width: showText ? "200px" : "40px",
- }} // Adjust width values as needed
- onClick={() => {
- RemoveSideBanner();
- setShowText(false);
- }}
- >
-
-
-
- )}
);
};
diff --git a/components/atg/components/SideBarContent/SideBarNormal.tsx b/components/atg/components/SideBarContent/SideBarNormal.tsx
index a1b4d67f..729d263e 100644
--- a/components/atg/components/SideBarContent/SideBarNormal.tsx
+++ b/components/atg/components/SideBarContent/SideBarNormal.tsx
@@ -10,6 +10,7 @@ import CircularProgress from "@mui/material/CircularProgress";
import DoneIcon from "@mui/icons-material/Done";
import LockIcon from "@mui/icons-material/Lock";
import CircleIcon from "@mui/icons-material/Circle";
+import ChevronLeftIcon from "@mui/icons-material/ChevronLeft";
import {
StepsForRecording,
StepforTests,
@@ -42,13 +43,16 @@ const stepsRecord = [
];
interface SideBarNormalProps {
+ isColl: boolean;
+ setIsColl: () => void;
onNext: () => void;
+ showTerminal: () => void;
+ functionName: string;
onReset: () => void;
stepsForRecording: StepsForRecording;
stepsForTesting: StepforTests;
stepsForDedup: StepsforDedup;
- RemoveSideContent: () => void;
- SideBartheme: boolean;
+ SideBarTheme: boolean;
activeStep: number;
subStepIndex: number;
dedupStepIndex: number;
@@ -66,13 +70,16 @@ interface SideBarNormalProps {
}
export default function SideBarNormal({
+ isColl,
+ setIsColl,
onNext,
+ showTerminal,
+ functionName,
onReset,
stepsForRecording,
stepsForTesting,
stepsForDedup,
- RemoveSideContent,
- SideBartheme,
+ SideBarTheme,
activeStep,
subStepIndex,
dedupStepIndex,
@@ -81,6 +88,15 @@ export default function SideBarNormal({
setSidebarState,
}: SideBarNormalProps) {
const [subStepCompleted, setSubStepCompleted] = React.useState(false);
+ const [showText, setShowText] = React.useState(false);
+
+ const moveToNextStage = async () => {
+ if (functionName === "Start") {
+ await new Promise((resolve) => setTimeout(resolve, 4000)); // 4-second timeout
+ }
+ showTerminal(); // Assuming this function exists in Editor
+ onNext(); // Assuming this function exists in Editor
+ };
React.useEffect(() => {
if (activeStep === 0) {
@@ -114,7 +130,7 @@ export default function SideBarNormal({
}
}, 1000);
- return () => clearTimeout(timer);
+ return () => {clearTimeout(timer)};
}
} else if (activeStep === 1) {
if (
@@ -150,7 +166,7 @@ export default function SideBarNormal({
}
}, 1000);
- return () => clearTimeout(timer);
+ return () => {clearTimeout(timer)};
}
} else if (activeStep === 2) {
if (
@@ -186,7 +202,7 @@ export default function SideBarNormal({
}
}, 1000);
localStorage.setItem("one_time", "false");
- return () => clearTimeout(timer);
+ return () => {clearTimeout(timer)};
}
}
}, [
@@ -201,7 +217,7 @@ export default function SideBarNormal({
]);
const handleNext = () => {
- onNext();
+ void moveToNextStage()
if (activeStep === 0) {
setSidebarState((prevState) => ({
...prevState,
@@ -231,252 +247,287 @@ export default function SideBarNormal({
}
};
- return (
-
- {
+ return stepsRecord.map((step, index) => (
+
{handleAccordionChange(index)}}
+ sx={{
+ backgroundColor: "#f5f5f5",
+ boxShadow: "none",
+ "&:before": {
+ display: "none",
+ },
+ "&:last-child": {
+ borderBottom: "none",
+ },
+ }}
+ className={
+ SideBarTheme
+ ? "border border-b-1 bg-neutral-200 border-gray-200"
+ : "bg-[#171a1e]"
+ }
+ disableGutters={true}
+ TransitionProps={{ timeout: { appear: 1, enter: 1, exit: 4 } }}
>
-
+ ) : index <= activeStep ? (
+
+ ) : (
+
+ )
+ }
+ aria-controls={`panel${String(index)}-content`}
+ id={`panel${String(index)}-header`}
sx={{
- color: "#1f2937",
+ color: "#ffffff",
fontWeight: "bold",
m: 0,
}}
- className={`${
- SideBartheme ? "text-secondary-300" : "text-white"
- } font-bold`}
- >
- Content
-
-
-
- {stepsRecord.map((step, index) => (
- handleAccordionChange(index)}
+
+ {step.label}
+
+
+
-
- ) : index <= activeStep ? (
-
- ) : (
-
- )
- }
- aria-controls={`panel${index}-content`}
- id={`panel${index}-header`}
- sx={{
- color: "#ffffff",
- fontWeight: "bold",
- m: 0,
- }}
- className={` ${
- SideBartheme
- ? index <= activeStep
- ? "bg-white"
- : "bg-gray-200"
- : index <= activeStep
- ? "bg-[#30363e]"
- : "bg-[#3f4651]"
- } `}
- >
-
- {step.label}
-
-
-
-
-
- {step.steps.map((subStep, subIndex) => (
+
+
+ {step.steps.map((subStep, subIndex) => (
+ subIndex) ||
+ (activeStep === 1 && dedupStepIndex > subIndex) ||
+ (activeStep === 2 && testSubStepIndex > subIndex) ||
+ index < activeStep
+ ? "items-center"
+ : "items-center"
+ }
+ >
subIndex) ||
- (activeStep === 1 && dedupStepIndex > subIndex) ||
- (activeStep === 2 && testSubStepIndex > subIndex) ||
- index < activeStep
- ? "items-center"
- : "items-center"
- }`}
+ sx={{
+ width: 24,
+ display: "flex",
+ justifyContent: "center",
+ alignItems: "center",
+ mr: 1,
+ }}
>
-
- {((activeStep === 0 && subStepIndex === subIndex) ||
- (activeStep === 1 && dedupStepIndex === subIndex) ||
- (activeStep === 2 && testSubStepIndex === subIndex)) &&
- index === activeStep ? (
- subStepCompleted ? (
-
- ) : (
-
- )
- ) : (activeStep === 0 && subStepIndex > subIndex) ||
- (activeStep === 1 && dedupStepIndex > subIndex) ||
- (activeStep === 2 && testSubStepIndex > subIndex) ||
- index < activeStep ? (
+ {((activeStep === 0 && subStepIndex === subIndex) ||
+ (activeStep === 1 && dedupStepIndex === subIndex) ||
+ (activeStep === 2 && testSubStepIndex === subIndex)) &&
+ index === activeStep ? (
+ subStepCompleted ? (
) : (
-
- )}
-
-
- subIndex) ||
- (activeStep === 1 && dedupStepIndex > subIndex) ||
- (activeStep === 2 &&
- testSubStepIndex > subIndex) ||
- index < activeStep
- ? SideBartheme
+
+ )
+ ) : (activeStep === 0 && subStepIndex > subIndex) ||
+ (activeStep === 1 && dedupStepIndex > subIndex) ||
+ (activeStep === 2 && testSubStepIndex > subIndex) ||
+ index < activeStep ? (
+
+ ) : (
+
+ )}
+
+
+ subIndex) ||
+ (activeStep === 1 && dedupStepIndex > subIndex) ||
+ (activeStep === 2 && testSubStepIndex > subIndex) ||
+ index < activeStep
+ ? SideBarTheme
? "text-secondary-300"
: "text-gray-300"
- }`}
- >
- {`${subStep.stepName}`}
-
+ : SideBarTheme
+ ? "text-secondary-300"
+ : "text-gray-300"
+ }
+ >
+ {subStep.stepName}
- ))}
-
+
+ ))}
- {index === activeStep && (
-
-
-
-
-
- )}
-
-
- ))}
- {activeStep === stepsRecord.length && (
-
+ {index === activeStep && (
+
+
+
+
+
+ )}
+
+
+ ));
+ }, [
+ activeStep,
+ subStepIndex,
+ dedupStepIndex,
+ testSubStepIndex,
+ expandedSteps,
+ SideBarTheme,
+ ]);
+
+ return (
+ <>
+
+
-
- Would you like to reset?
-
-
-
- )}
-
+
+ Content
+
+
+
+
+ {renderedSteps}
+ {activeStep === stepsRecord.length && (
+
+
+ Would you like to reset?
+
+
+
+ )}
+
+
+