diff --git a/src/componets/content/ConfigTemplate.tsx b/src/componets/content/ConfigTemplate.tsx index 262b04d..3ced838 100644 --- a/src/componets/content/ConfigTemplate.tsx +++ b/src/componets/content/ConfigTemplate.tsx @@ -14,6 +14,13 @@ export function ConfigTemplateEditor({ config, onSaved }: ConfigTemplateEditorPr const [originalContent, setOriginalContent] = useState(config.template.content); const [jsonError, setJsonError] = useState(null); + // Validate placeholders for warning + const missingPlaceholders = config.validatePlaceholders(); + const hasValidationWarnings = missingPlaceholders.length > 0; + const warningMessage = hasValidationWarnings + ? `Missing params: ${missingPlaceholders.join(', ')}` + : ''; + // Sync draft when config changes (only in view mode) useEffect(() => { if (mode === 'view') { @@ -137,9 +144,15 @@ export function ConfigTemplateEditor({ config, onSaved }: ConfigTemplateEditorPr
{mode === 'view' ? (
-
-
+
+
View Mode + {hasValidationWarnings && ( +
+ Warning: + {warningMessage} +
+ )}
- +
) : ( @@ -165,7 +178,7 @@ export function ConfigTemplateEditor({ config, onSaved }: ConfigTemplateEditorPr > Save Changes - +
{jsonError && ( diff --git a/src/componets/content/Content.tsx b/src/componets/content/Content.tsx index b0d3703..0f13bd4 100644 --- a/src/componets/content/Content.tsx +++ b/src/componets/content/Content.tsx @@ -17,9 +17,6 @@ export function Content({ config, env, onTemplateSaved }: ContentProps) { // Validate placeholders for warning badge const missingPlaceholders = config.validatePlaceholders(); const hasValidationWarnings = missingPlaceholders.length > 0; - const warningMessage = hasValidationWarnings - ? `Missing params: ${missingPlaceholders.join(', ')}` - : ''; const tabs: Array<{ id: string; label: string; badge?: string | number; badgeVariant?: 'warning' | 'danger' }> = [ { id: 'env', label: 'Env' }, @@ -36,15 +33,7 @@ export function Content({ config, env, onTemplateSaved }: ContentProps) { return (
-
- - {activeTab === 'template' && hasValidationWarnings && ( -
- Warning: - {warningMessage} -
- )} -
+