@@ -54,10 +54,9 @@ export function TemplateEditContent({
5454 // generated API types yet. Will be cleaned up after type regeneration.
5555 const definitionRaw = control . control as Record < string , unknown > ;
5656 const template = definitionRaw . template as TemplateControlInput [ 'template' ] ;
57- const storedValues = definitionRaw . template_values as Record <
58- string ,
59- TemplateValue
60- > | undefined ;
57+ const storedValues = definitionRaw . template_values as
58+ | Record < string , TemplateValue >
59+ | undefined ;
6160
6261 const [ editorMode , setEditorMode ] = useState < EditorMode > ( 'params' ) ;
6362 const [ controlName , setControlName ] = useState ( control . name ) ;
@@ -76,12 +75,9 @@ export function TemplateEditContent({
7675 const updateControlMetadata = useUpdateControlMetadata ( ) ;
7776 const isPending = updateControl . isPending || updateControlMetadata . isPending ;
7877
79- const handlePreviewErrors = useCallback (
80- ( errors : Record < string , string > ) => {
81- setParamErrors ( errors ) ;
82- } ,
83- [ ]
84- ) ;
78+ const handlePreviewErrors = useCallback ( ( errors : Record < string , string > ) => {
79+ setParamErrors ( errors ) ;
80+ } , [ ] ) ;
8581
8682 const buildTemplateInput = useCallback ( ( ) : TemplateControlInput => {
8783 return {
@@ -107,14 +103,18 @@ export function TemplateEditContent({
107103 try {
108104 const parsed = JSON . parse ( jsonText ) as TemplateControlInput ;
109105 if ( ! parsed . template ?. definition_template ) {
110- setJsonError ( 'JSON must contain a "template" object with "definition_template".' ) ;
106+ setJsonError (
107+ 'JSON must contain a "template" object with "definition_template".'
108+ ) ;
111109 return ;
112110 }
113111 setTemplateValues ( parsed . template_values ?? { } ) ;
114112 setJsonError ( null ) ;
115113 setEditorMode ( 'params' ) ;
116114 } catch {
117- setJsonError ( 'Invalid JSON. Fix syntax errors before switching to Parameters.' ) ;
115+ setJsonError (
116+ 'Invalid JSON. Fix syntax errors before switching to Parameters.'
117+ ) ;
118118 }
119119 } ;
120120
@@ -131,7 +131,9 @@ export function TemplateEditContent({
131131 try {
132132 templateInput = JSON . parse ( jsonText ) as TemplateControlInput ;
133133 if ( ! templateInput . template ?. definition_template ) {
134- setJsonError ( 'JSON must contain a "template" object with "definition_template".' ) ;
134+ setJsonError (
135+ 'JSON must contain a "template" object with "definition_template".'
136+ ) ;
135137 return ;
136138 }
137139 } catch {
@@ -212,10 +214,7 @@ export function TemplateEditContent({
212214 const newParamErrors : Record < string , string > = { } ;
213215 for ( const item of pd . errors ) {
214216 if ( item . field ?. startsWith ( 'template_values.' ) ) {
215- const paramName = item . field . replace (
216- 'template_values.' ,
217- ''
218- ) ;
217+ const paramName = item . field . replace ( 'template_values.' , '' ) ;
219218 newParamErrors [ paramName ] = item . message ;
220219 }
221220 }
@@ -239,7 +238,8 @@ export function TemplateEditContent({
239238 } ;
240239
241240 // Extract read-only summary from the rendered control
242- const action = ( definitionRaw . action as { decision ?: string } ) ?. decision ?? 'unknown' ;
241+ const action =
242+ ( definitionRaw . action as { decision ?: string } ) ?. decision ?? 'unknown' ;
243243 const execution = ( definitionRaw . execution as string ) ?? 'server' ;
244244 const description = definitionRaw . description as string | undefined ;
245245
@@ -281,7 +281,8 @@ export function TemplateEditContent({
281281 { editorMode === 'json' ? (
282282 < Stack gap = "md" >
283283 < Text size = "sm" c = "dimmed" >
284- Edit the full template input JSON below. Control name stays separate.
284+ Edit the full template input JSON below. Control name stays
285+ separate.
285286 </ Text >
286287 < Textarea
287288 value = { jsonText }
@@ -336,8 +337,8 @@ export function TemplateEditContent({
336337 ) : null }
337338 < Alert variant = "light" color = "blue" p = "xs" >
338339 < Text size = "xs" >
339- Scope, condition, and action are managed by the template.
340- Edit the parameters on the right to change control behavior.
340+ Scope, condition, and action are managed by the template. Edit
341+ the parameters on the right to change control behavior.
341342 </ Text >
342343 </ Alert >
343344 </ Stack >
0 commit comments