refactor(scenario): remove step type and simplify scheduler to exec-only
- remove StepType, type column, and type field from step entity and DTOs - remove executeLoginStep, executeSignStep, executeExecStep from scheduler - inline exec logic directly in executeStepRun; all steps run execCode - remove AuthService, EnvironmentService, runEnvironments from scheduler - remove type selector from CreateStepPage and EditStepPage - remove type badge column from ScenarioDetailPage - fix useEffect dependency arrays in RunDetailPage (FINAL, id, runId, polling) - fix duplicate /snippets proxy key in vite.config.ts - remove unused escapeHtml export from hljs.ts
This commit is contained in:
1 parent
1c13e068ad
commit
673aa0f458
36 files changed
+339
-421
No files matched your search
@@ -65,7 +65,7 @@ export class CodeExecutorService {
|
||||
const snippetMap: Record<string, string> = snippets ?? {};
|
||||
|
||||
// pageHelpers is referenced by runSnippet, so we declare it as a var first.
|
||||
// eslint-disable-next-line prefer-const
|
||||
|
||||
let pageHelpers: Record<string, unknown>;
|
||||
|
||||
const fakeConsole = {
|
||||
@@ -109,7 +109,10 @@ export class CodeExecutorService {
|
||||
*
|
||||
* Example: await helpers.runSnippet('clickLoginButton', '#submit')
|
||||
*/
|
||||
runSnippet: async (name: string, ...args: unknown[]): Promise<unknown> => {
|
||||
runSnippet: async (
|
||||
name: string,
|
||||
...args: unknown[]
|
||||
): Promise<unknown> => {
|
||||
const snippetCode = snippetMap[name];
|
||||
if (snippetCode == null) {
|
||||
throw new Error(`Snippet "${name}" not found`);
|
||||
@@ -136,7 +139,13 @@ export class CodeExecutorService {
|
||||
`return (async (page, context, helpers) => { ${code} })(page, context, helpers)`,
|
||||
);
|
||||
this.logger.debug("Executing user code");
|
||||
const execResult = await fn(page, context, pageHelpers, fakeConsole, result);
|
||||
const execResult = await fn(
|
||||
page,
|
||||
context,
|
||||
pageHelpers,
|
||||
fakeConsole,
|
||||
result,
|
||||
);
|
||||
return { result: execResult };
|
||||
} catch (err) {
|
||||
throw new InternalServerErrorException(
|
||||
|
||||
Reference in new issue
Block a user