feat(scenarios,environments): add markdown description field

- add optional description to scenario and environment entities
- expose description in create/update DTOs, MCP tools, and export DTOs
- render description as markdown on detail pages
- add description editor (CodeEditor) to create/edit forms for both resources
This commit is contained in:
2026-04-14 23:53:45 +03:00
parent 4dab218b75
commit e6aacc899d
20 changed files with 206 additions and 32 deletions
+11 -2
View File
@@ -410,6 +410,7 @@ export class ScenarioService {
kind: "scenario",
id: scenario.id,
name: scenario.name,
description: scenario.description ?? undefined,
steps: scenario.steps.map((s) => ({
title: s.title,
execCode: s.execCode,
@@ -424,17 +425,25 @@ export class ScenarioService {
const existing = await this.scenarioRepo.findOneBy({ id: dto.id });
if (existing) {
existing.name = dto.name;
existing.description = dto.description ?? null;
scenario = await this.scenarioRepo.save(existing);
// Delete old steps and recreate
await this.stepRepo.delete({ scenarioId: scenario.id });
} else {
scenario = await this.scenarioRepo.save(
this.scenarioRepo.create({ id: dto.id, name: dto.name }),
this.scenarioRepo.create({
id: dto.id,
name: dto.name,
description: dto.description ?? null,
}),
);
}
} else {
scenario = await this.scenarioRepo.save(
this.scenarioRepo.create({ name: dto.name }),
this.scenarioRepo.create({
name: dto.name,
description: dto.description ?? null,
}),
);
}
if (dto.steps.length > 0) {