mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
feat(builder): not tested step logging
This commit is contained in:
11
rnd/autogpt_builder/src/components/build/actions.ts
Normal file
11
rnd/autogpt_builder/src/components/build/actions.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
"use server";
|
||||
|
||||
import { TutorialStepData } from "@/lib/autogpt-server-api/types";
|
||||
import AutoGPTServerAPI from "@/lib/autogpt-server-api/client";
|
||||
|
||||
export const sendTutorialStep = async (data: TutorialStepData) => {
|
||||
console.log("sendTutorialStep", data);
|
||||
const api = new AutoGPTServerAPI();
|
||||
|
||||
await api.logTutorialStep(data);
|
||||
};
|
||||
@@ -1,5 +1,6 @@
|
||||
import Shepherd from "shepherd.js";
|
||||
import "shepherd.js/dist/css/shepherd.css";
|
||||
import { sendTutorialStep } from "./build/actions";
|
||||
|
||||
export const startTutorial = (
|
||||
setPinBlocksPopover: (value: boolean) => void,
|
||||
@@ -493,6 +494,18 @@ export const startTutorial = (
|
||||
localStorage.setItem("shepherd-tour", "completed"); // Optionally mark the tutorial as completed
|
||||
});
|
||||
|
||||
for (let index = 0; index < tour.steps.length; index++) {
|
||||
const step = tour.steps[index];
|
||||
step.on("complete", () => {
|
||||
console.log("sendTutorialStep");
|
||||
|
||||
sendTutorialStep({
|
||||
step: index,
|
||||
data: {},
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
tour.on("cancel", () => {
|
||||
setPinBlocksPopover(false);
|
||||
localStorage.setItem("shepherd-tour", "canceled"); // Optionally mark the tutorial as canceled
|
||||
|
||||
Reference in New Issue
Block a user