11<!--
22 * EDIT MODE CONFIGURATION SCHEMA STEP
3- *
3+ *
44 * This component follows the EDIT wizard storage-first architecture:
5- * - Uses event bus and localStorage exclusively
5+ * - Uses event bus and localStorage exclusively
66 * - No v-model or props for data management
77 * - Storage-first patterns throughout
88 * - Reads/writes data directly to/from storage
@@ -264,47 +264,47 @@ const assembleSchemaAndSave = () => {
264264 localData .value .forEach (item => {
265265 if (item .type === ' arg' ) {
266266 if (item .category === ' template' ) {
267- schema .template_args ! .push ({
268- value: item .value || ' ' ,
269- locked: item .locked ,
270- description: item .description
267+ schema .template_args ! .push ({
268+ value: item .value || ' ' ,
269+ locked: item .locked ,
270+ description: item .description
271271 })
272272 } else if (item .category === ' team' ) {
273- schema .team_args_schema ! .push ({
274- name: item .name ,
275- type: item .dataType ,
276- description: item .description ,
277- required: item .required ,
278- locked: item .locked ,
279- default_team_locked: item .default_team_locked
273+ schema .team_args_schema ! .push ({
274+ name: item .name ,
275+ type: item .dataType ,
276+ description: item .description ,
277+ required: item .required ,
278+ locked: item .locked ,
279+ default_team_locked: item .default_team_locked
280280 })
281281 } else if (item .category === ' user' ) {
282- schema .user_args_schema ! .push ({
283- name: item .name ,
284- type: item .dataType ,
285- description: item .description ,
286- required: item .required ,
287- locked: item .locked
282+ schema .user_args_schema ! .push ({
283+ name: item .name ,
284+ type: item .dataType ,
285+ description: item .description ,
286+ required: item .required ,
287+ locked: item .locked
288288 })
289289 }
290290 } else if (item .type === ' env' ) {
291291 if (item .category === ' team' ) {
292- schema .team_env_schema ! .push ({
293- name: item .name ,
294- type: item .dataType ,
295- description: item .description ,
296- required: item .required ,
297- locked: item .locked ,
298- default_team_locked: item .default_team_locked ,
299- visible_to_users: item .visible_to_users
292+ schema .team_env_schema ! .push ({
293+ name: item .name ,
294+ type: item .dataType ,
295+ description: item .description ,
296+ required: item .required ,
297+ locked: item .locked ,
298+ default_team_locked: item .default_team_locked ,
299+ visible_to_users: item .visible_to_users
300300 })
301301 } else if (item .category === ' user' ) {
302- schema .user_env_schema ! .push ({
303- name: item .name ,
304- type: item .dataType ,
305- description: item .description ,
306- required: item .required ,
307- locked: item .locked
302+ schema .user_env_schema ! .push ({
303+ name: item .name ,
304+ type: item .dataType ,
305+ description: item .description ,
306+ required: item .required ,
307+ locked: item .locked
308308 })
309309 }
310310 }
@@ -315,13 +315,6 @@ const assembleSchemaAndSave = () => {
315315 }
316316}
317317
318- // Save data to storage
319- const saveToStorage = () => {
320- if (! isUpdatingFromStorage .value ) {
321- assembleSchemaAndSave ()
322- }
323- }
324-
325318// Computed properties
326319const argumentItems = computed (() => {
327320 return localData .value .filter (item => item .type === ' arg' )
@@ -387,7 +380,7 @@ const validateForm = () => {
387380 } else {
388381 // Check for duplicates
389382 const isDuplicate = localData .value .some ((item , index ) =>
390- item .name === formDataLocal .value .name &&
383+ item .name === formDataLocal .value .name &&
391384 item .type === formDataLocal .value .type &&
392385 index !== editingIndex .value
393386 )
@@ -409,7 +402,7 @@ const handleSubmit = () => {
409402 if (! validateForm ()) return
410403
411404 const updatedData = [... localData .value ]
412- const newItem = {
405+ const newItem = {
413406 ... formDataLocal .value ,
414407 id: formDataLocal .value .id || ` ${formDataLocal .value .type }_${Date .now ()} `
415408 }
@@ -441,7 +434,7 @@ const updateData = (newData: ConfigItem[]) => {
441434
442435// Get category info for display with safe fallback
443436const getCategoryInfo = (category : string ) => {
444- const allOptions = [... argCategoryOptions ,
437+ const allOptions = [... argCategoryOptions ,
445438 { value: ' team' , label: computed (() => t (' mcpCatalog.form.configurationSchema.categories.team' )), icon: Users , color: ' green' },
446439 { value: ' user' , label: computed (() => t (' mcpCatalog.form.configurationSchema.categories.user' )), icon: User , color: ' purple' },
447440 ]
@@ -499,10 +492,10 @@ const availableCategoryOptions = computed(() => {
499492// Fresh data loading on step entry
500493const refreshDataOnStepEntry = () => {
501494 loadFromStorageSchema ()
502-
495+
503496 // Load persisted environment variables from TechnicalStep
504497 const extractedEnvVars = eventBus .getState <string []>(' technical_extracted_env_vars_edit' )
505-
498+
506499 if (extractedEnvVars && extractedEnvVars .length > 0 ) {
507500 handleTechnicalEnvVarsUpdate ({ envVars: extractedEnvVars })
508501 }
@@ -522,10 +515,10 @@ const handleStepChange = (data: { to: number; stepKey: string }) => {
522515const handleTechnicalEnvVarsUpdate = (data : { envVars: string [] }) => {
523516 // Get current environment variables to avoid duplicates
524517 const currentEnvNames = environmentItems .value .map (item => item .name )
525-
518+
526519 // Add new environment variables that don't already exist
527520 const newItems: ConfigItem [] = []
528-
521+
529522 data .envVars .forEach (envVarName => {
530523 if (! currentEnvNames .includes (envVarName )) {
531524 newItems .push ({
@@ -542,7 +535,7 @@ const handleTechnicalEnvVarsUpdate = (data: { envVars: string[] }) => {
542535 })
543536 }
544537 })
545-
538+
546539 // Add new items to existing data
547540 if (newItems .length > 0 ) {
548541 const updatedData = [... localData .value , ... newItems ]
@@ -553,13 +546,13 @@ const handleTechnicalEnvVarsUpdate = (data: { envVars: string[] }) => {
553546onMounted (() => {
554547 // Initialize with current storage data
555548 loadFromStorageSchema ()
556-
549+
557550 // Listen for step changes
558551 eventBus .on (' mcp-form-step-changed' , handleStepChange )
559-
552+
560553 // Listen for environment variables updates from TechnicalStep
561554 eventBus .on (' technical-env-vars-updated' , handleTechnicalEnvVarsUpdate )
562-
555+
563556 // Load persisted env vars immediately on mount
564557 const extractedEnvVars = eventBus .getState <string []>(' technical_extracted_env_vars_edit' )
565558 if (extractedEnvVars && extractedEnvVars .length > 0 ) {
@@ -610,7 +603,7 @@ onUnmounted(() => {
610603 </tr >
611604 </thead >
612605 <tbody >
613- <tr v-for =" (item, index ) in argumentItems" :key =" item.id" >
606+ <tr v-for =" (item) in argumentItems" :key =" item.id" >
614607 <td class =" relative py-5 pr-6" >
615608 <div class =" flex gap-x-6" >
616609 <div class =" flex-auto" >
@@ -692,7 +685,7 @@ onUnmounted(() => {
692685 </div >
693686
694687 <!-- Environment Variables Section - Now using shared component -->
695- <ConfigurationSchemaEnvironmentSection
688+ <ConfigurationSchemaEnvironmentSection
696689 :items =" environmentItems"
697690 :get-category-info =" getCategoryInfo"
698691 @add =" handleEnvAdd"
0 commit comments