feat(scenarios): link scenarios to a default environment

- add optional ManyToOne relation from scenario to environment entity
- expose environmentId in create/update DTOs, service, and MCP tools
- pre-select linked environment in run modals on detail and list pages
- add environment selector to create/edit scenario forms
- show linked environment as a navigable link on scenario detail page
This commit is contained in:
2026-04-15 00:05:55 +03:00
parent e6aacc899d
commit a779ab4667
12 changed files with 109 additions and 19 deletions
+13 -2
View File
@@ -472,13 +472,18 @@ export class McpService {
.string()
.optional()
.describe("Optional markdown description"),
environmentId: z
.uuid()
.optional()
.describe("Optional linked environment ID"),
},
},
async ({ name, description }) => {
async ({ name, description, environmentId }) => {
try {
const scenario = await this.scenarioService.create({
name,
description,
environmentId,
});
return {
content: [
@@ -505,13 +510,19 @@ export class McpService {
.string()
.optional()
.describe("New markdown description"),
environmentId: z
.uuid()
.nullable()
.optional()
.describe("Linked environment ID (null to unlink)"),
},
},
async ({ id, name, description }) => {
async ({ id, name, description, environmentId }) => {
try {
const scenario = await this.scenarioService.update(id, {
name,
description,
environmentId,
});
return {
content: [