From 3a4abfb9e5bd8c1cddd8573219dc00d7458b9fec Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Wed, 1 Jan 2025 22:01:33 +0530 Subject: [PATCH] fix: add name fields while generating default layout for settings page --- frontend/src/components/Settings/SettingsPage.vue | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/Settings/SettingsPage.vue b/frontend/src/components/Settings/SettingsPage.vue index dbde52bc..87af6480 100644 --- a/frontend/src/components/Settings/SettingsPage.vue +++ b/frontend/src/components/Settings/SettingsPage.vue @@ -106,9 +106,12 @@ const tabs = computed(() => { if (fieldsData[0].type != 'Tab Break') { let _sections = [] if (fieldsData[0].type != 'Section Break') { - _sections.push({ columns: [{ fields: [] }] }) + _sections.push({ + name: 'first_section', + columns: [{ name: 'first_column', fields: [] }], + }) } - _tabs.push({ sections: _sections }) + _tabs.push({ name: 'first_tab', sections: _sections }) } fieldsData.forEach((field) => { @@ -127,7 +130,10 @@ const tabs = computed(() => { columns: [{ fields: [] }], }) } else if (field.type === 'Column Break') { - _sections[_sections.length - 1].columns.push({ fields: [] }) + _sections[_sections.length - 1].columns.push({ + name: field.value, + fields: [], + }) } else { let last_section = _sections[_sections.length - 1] let last_column = last_section.columns[last_section.columns.length - 1]