@@ -165,7 +165,12 @@ def update_name():
165
165
last_modified = st .date_input ("Last Modified Date" , value = last_modified_date , key = "last_modified" )
166
166
167
167
st .write (f"Debug: Template description: { template .get ('Description' , '' )} " )
168
- description = st .text_area ("Description" , value = template .get ('Description' , '' ), key = "description" , height = 150 )
168
+ description = st .text_area (
169
+ "Description" ,
170
+ value = template .get ('Description' , '' ),
171
+ key = "description" ,
172
+ height = 150
173
+ )
169
174
st .write (f"Debug: Input description value: { description } " )
170
175
171
176
with tab2 :
@@ -292,10 +297,18 @@ def update_name():
292
297
if not st .session_state .name or st .session_state .name .strip () == "" :
293
298
st .error ("A name for the RMM Tool is required. Please enter a name in the 'Basic Info' tab." )
294
299
else :
300
+ # Get the description from the form
301
+ description_value = st .session_state .description # Get description from session state
302
+ st .write (f"Debug: Description from session: { description_value } " )
303
+
304
+ if not description_value or description_value .strip () == "" :
305
+ st .error ("A description is required. Please enter a description in the 'Basic Info' tab." )
306
+ return
307
+
295
308
yaml_data = {
296
309
'Name' : st .session_state .name ,
297
310
'Category' : category ,
298
- 'Description' : description ,
311
+ 'Description' : description_value , # Use the description from session state
299
312
'Author' : author ,
300
313
'Created' : created .strftime ("%Y-%m-%d" ),
301
314
'LastModified' : last_modified .strftime ("%Y-%m-%d" ),
@@ -326,15 +339,12 @@ def update_name():
326
339
'Acknowledgement' : acknowledgements
327
340
}
328
341
329
- st .write (f"Debug: Description value: { description } " )
330
-
331
- yaml_data = {k : v for k , v in yaml_data .items () if v or k == 'Description' }
332
- for key in yaml_data .get ('Details' , {}):
333
- if isinstance (yaml_data ['Details' ][key ], list ):
334
- yaml_data ['Details' ][key ] = [item for item in yaml_data ['Details' ][key ] if item ]
335
- elif isinstance (yaml_data ['Details' ][key ], dict ):
336
- yaml_data ['Details' ][key ] = {k : v for k , v in yaml_data ['Details' ][key ].items () if v }
342
+ # Debug output
343
+ st .write (f"Debug: Final description in yaml_data: { yaml_data .get ('Description' , '' )} " )
337
344
345
+ # Don't filter out Description even if empty
346
+ yaml_data = {k : v for k , v in yaml_data .items ()} # Remove the filtering entirely
347
+
338
348
schema = load_schema ()
339
349
if schema :
340
350
validation_errors = validate_yaml_data (yaml_data , schema )
0 commit comments