690503:1340 Update workflow #05
CI / CD Pipeline / build (push) Failing after 4m37s
CI / CD Pipeline / deploy (push) Has been skipped

This commit is contained in:
2026-05-03 13:40:00 +07:00
parent 35110cbd3e
commit e4a724bff4
5 changed files with 20 additions and 2 deletions
@@ -15,6 +15,10 @@ vi.mock('@monaco-editor/react', () => ({
onChange={(e) => onChange?.(e.target.value)}
/>
),
// เพิ่ม loader mock เพื่อรองรับ loader.config() call ใน dsl-editor.tsx
loader: {
config: vi.fn(),
},
}));
// Mock next-themes
+8 -1
View File
@@ -1,3 +1,5 @@
// File: components/workflows/dsl-editor.tsx
// Change Log: 2026-05-03 — แก้ CSP violation โดยเปลี่ยนจาก CDN เป็น self-hosted Monaco assets
'use client';
import { useState, useRef, useEffect } from 'react';
@@ -5,11 +7,16 @@ import { Button } from '@/components/ui/button';
import { Card } from '@/components/ui/card';
import { Alert, AlertDescription } from '@/components/ui/alert';
import { CheckCircle, AlertCircle, Play, Loader2 } from 'lucide-react';
import Editor, { OnMount } from '@monaco-editor/react';
import Editor, { OnMount, loader } from '@monaco-editor/react';
import { workflowApi } from '@/lib/api/workflows';
import { ValidationResult } from '@/types/workflow';
import { useTheme } from 'next-themes';
// กำหนดให้ Monaco โหลด assets จาก self-hosted path แทน cdn.jsdelivr.net
// เพื่อผ่าน CSP directive: style-src 'self' 'unsafe-inline'
loader.config({ paths: { vs: '/monaco-vs' } });
interface DSLEditorProps {
initialValue?: string;
onChange?: (value: string) => void;