Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adjusted guide #2264

Merged
merged 1 commit into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 32 additions & 6 deletions frontend/src/components/GuideWrapper.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,29 @@ export default function GuideWrapper() {
disableBeacon: true,
},
{
target: "#jobsHistory",
target: "#Jobs",
content: (
<div id="guidebox">
<h3>Job History</h3>
<h3>Jobs History</h3>
<p>
Here you could see the list of all previous jobs and expand over the
details through clicking that particular job from the table
Jobs are simple analysis of an observable or a file. Here you could
see the list of all previous jobs and expand over the details
through clicking that particular job from the table
</p>
</div>
),
disableBeacon: true,
},
{
target: "#Investigations",
content: (
<div id="guidebox">
<h3>Investigations History</h3>
<p>
Investigations are a framework to connect jobs with each other. Here
you could see the list of all previous investigations and expand
over the details through clicking that particular investigation from
the table
</p>
</div>
),
Expand Down Expand Up @@ -208,7 +224,7 @@ export default function GuideWrapper() {
if (type === "step:after") {
if (action === "close") {
setGuideState({ run: true, stepIndex: 7 });
navigate("/jobs");
navigate("/history/jobs");
} else {
setGuideState({ run: false, stepIndex: 0 });
navigate("/");
Expand All @@ -219,7 +235,6 @@ export default function GuideWrapper() {
if (type === "step:after") {
if (action === "close") {
setGuideState({ run: true, stepIndex: 8 });
navigate("/dashboard");
} else {
setGuideState({ run: false, stepIndex: 0 });
navigate("/");
Expand All @@ -230,6 +245,7 @@ export default function GuideWrapper() {
if (type === "step:after") {
if (action === "close") {
setGuideState({ run: true, stepIndex: 9 });
navigate("/dashboard");
} else {
setGuideState({ run: false, stepIndex: 0 });
navigate("/");
Expand All @@ -240,6 +256,16 @@ export default function GuideWrapper() {
if (type === "step:after") {
if (action === "close") {
setGuideState({ run: true, stepIndex: 10 });
} else {
setGuideState({ run: false, stepIndex: 0 });
navigate("/");
}
}
break;
case 10:
if (type === "step:after") {
if (action === "close") {
setGuideState({ run: true, stepIndex: 11 });
navigate("/");
} else {
setGuideState({ run: false, stepIndex: 0 });
Expand Down
12 changes: 12 additions & 0 deletions frontend/src/components/History.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Button, Col } from "reactstrap";
import { RouterTabs, FallBackLoading } from "@certego/certego-ui";
import { useNavigate, useLocation } from "react-router-dom";

import { useGuideContext } from "../contexts/GuideContext";
import { createInvestigation } from "./investigations/result/investigationApi";

const JobsTable = React.lazy(() => import("./jobs/table/JobsTable"));
Expand Down Expand Up @@ -54,6 +55,17 @@ export default function History() {
const location = useLocation();
const isJobsTablePage = location?.pathname.includes("jobs");

const { guideState, setGuideState } = useGuideContext();

React.useEffect(() => {
if (guideState.tourActive) {
setTimeout(() => {
setGuideState({ run: true, stepIndex: 7 });
}, 200);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

const onClick = async () => {
if (isJobsTablePage) {
navigate("/scan");
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/dashboard/Dashboard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default function Dashboard() {
useEffect(() => {
if (guideState.tourActive) {
setTimeout(() => {
setGuideState({ run: true, stepIndex: 8 });
setGuideState({ run: true, stepIndex: 9 });
}, 100);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
Expand Down
12 changes: 0 additions & 12 deletions frontend/src/components/jobs/table/JobsTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import useTitle from "react-use/lib/useTitle";
import { jobTableColumns } from "./jobTableColumns";

import { JOB_BASE_URI } from "../../../constants/apiURLs";
import { useGuideContext } from "../../../contexts/GuideContext";
import { usePluginConfigurationStore } from "../../../stores/usePluginConfigurationStore";

// constants
Expand Down Expand Up @@ -65,17 +64,6 @@ export default function JobsTable() {
if (!loadingTable) setInitialLoading(false);
}, [loadingTable]);

const { guideState, setGuideState } = useGuideContext();

React.useEffect(() => {
if (guideState.tourActive) {
setTimeout(() => {
setGuideState({ run: true, stepIndex: 7 });
}, 100);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

React.useEffect(() => {
if (!initialLoading) refetch();
// eslint-disable-next-line react-hooks/exhaustive-deps
Expand Down
Loading