From ebece30f156c98d1f01ad48e24df20f21977a515 Mon Sep 17 00:00:00 2001 From: Harsh Tandiya Date: Sun, 15 Feb 2026 00:23:15 +0530 Subject: [PATCH 1/3] feat: add frappe dependency for benchmarking - Introduced a new section in pyproject.toml for frappe dependencies, specifying version constraints for better compatibility in benchmarking tasks. --- pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 21fb33a..857cc94 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,6 +26,9 @@ build-backend = "flit_core.buildapi" [tool.bench.dev-dependencies] # package_name = "~=1.1.0" +[tool.bench.frappe-dependencies] +frappe = ">=17.0.0-dev,<18.0.0" + [tool.ruff] line-length = 110 target-version = "py310" From e221ba9440aff7108c920e9428fa938ffcfa37ba Mon Sep 17 00:00:00 2001 From: Harsh Tandiya Date: Sun, 15 Feb 2026 20:30:41 +0530 Subject: [PATCH 2/3] fix: route handling for /form --- forms_pro/hooks.py | 2 +- forms_pro/public/js/forms_pro_desk.js | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 forms_pro/public/js/forms_pro_desk.js diff --git a/forms_pro/hooks.py b/forms_pro/hooks.py index 987832d..1b36b08 100644 --- a/forms_pro/hooks.py +++ b/forms_pro/hooks.py @@ -30,7 +30,7 @@ # include js, css files in header of desk.html # app_include_css = "/assets/forms_pro/css/forms_pro.css" -# app_include_js = "/assets/forms_pro/js/forms_pro.js" +app_include_js = "/assets/forms_pro/js/forms_pro_desk.js" # include js, css files in header of web template # web_include_css = "/assets/forms_pro/css/forms_pro.css" diff --git a/forms_pro/public/js/forms_pro_desk.js b/forms_pro/public/js/forms_pro_desk.js new file mode 100644 index 0000000..ece0063 --- /dev/null +++ b/forms_pro/public/js/forms_pro_desk.js @@ -0,0 +1,21 @@ +// Forms Pro: fix opening Form doctype documents from list view. +// The doctype name "Form" conflicts with the router's "form" view, so path-based +// navigation (/desk/form/docname) is misinterpreted. We patch set_route so that +// when called with a path like "/desk/form/" we use ["Form", "Form", name]. +(function () { + if (typeof frappe === "undefined") return; + + const original_set_route = frappe.set_route; + frappe.set_route = function () { + const args = Array.from(arguments); + if (args.length === 1 && typeof args[0] === "string" && args[0].includes("/")) { + // Path string: e.g. "/desk/form/n8tqgeco1u" or "form/n8tqgeco1u" + // Only match form/ (one segment), not form/view/list etc. + const m = args[0].match(/(?:^\/?(?:desk\/|app\/)?)?form\/([^/#?]+)(?=[#?]|$)/); + if (m) { + return original_set_route.apply(frappe.router, ["Form", "Form", m[1]]); + } + } + return original_set_route.apply(frappe.router, args); + }; +})(); From cdbf0200561bd9d83b4babe406d2de3b1e7d9240 Mon Sep 17 00:00:00 2001 From: Harsh Tandiya Date: Wed, 18 Feb 2026 17:09:27 +0530 Subject: [PATCH 3/3] feat: child table support v1 (#42) * chore: bump frappe-ui to `0.1.262` * feat: add 'Table' option to fieldtype selection - Updated form_field.json and form_field.py to include 'Table' in the list of selectable field types for enhanced functionality. - Adjusted the modified timestamp in form_field.json to reflect recent changes. * feat: implement Table field component and enhance field options handling - Added a new Table component for rendering tabular data input. - Updated RenderField and FieldRenderer components to support dynamic options for Select and Link fields. - Introduced useFieldOptions composable for improved option management. - Enhanced form_fields utility to include Table as a selectable field type. - Updated auto-imports and TypeScript definitions to accommodate new functionality. * feat: enhance Table component fieldtype mapping - Integrated utility function to map fieldtype for Table component, ensuring proper handling of field types. - Defaulted unmapped fieldtypes to "Data" for improved consistency in table rendering. * fix: update TableField component to use the correct Table component - Replaced ListView with Table in the TableField definition to ensure proper rendering of tabular data. - Adjusted imports in form_fields utility to reflect the change in component usage. * refactor: remove onMounted hook from useFieldOptions - Eliminated the onMounted lifecycle hook from the useFieldOptions composable to streamline the loading process of options. - Adjusted imports to reflect the removal of the unused onMounted function. --- .../doctype/form_field/form_field.json | 4 +- .../doctype/form_field/form_field.py | 1 + frontend/src/components/RenderField.vue | 14 +++ .../src/components/builder/FieldRenderer.vue | 80 ++++++----------- frontend/src/components/fields/Table.vue | 87 +++++++++++++++++++ frontend/src/types/formfield.ts | 1 + frontend/src/utils/form_fields.ts | 14 +++ frontend/src/utils/selectOptions.ts | 71 +++++++++++++++ 8 files changed, 215 insertions(+), 57 deletions(-) create mode 100644 frontend/src/components/fields/Table.vue create mode 100644 frontend/src/utils/selectOptions.ts diff --git a/forms_pro/forms_pro/doctype/form_field/form_field.json b/forms_pro/forms_pro/doctype/form_field/form_field.json index 19df819..3e1e843 100644 --- a/forms_pro/forms_pro/doctype/form_field/form_field.json +++ b/forms_pro/forms_pro/doctype/form_field/form_field.json @@ -37,7 +37,7 @@ "fieldtype": "Select", "in_list_view": 1, "label": "Fieldtype", - "options": "Attach\nData\nNumber\nEmail\nDate\nDate Time\nDate Range\nTime Picker\nPassword\nSelect\nSwitch\nTextarea\nText Editor\nLink\nCheckbox\nRating\nPhone", + "options": "Attach\nData\nNumber\nEmail\nDate\nDate Time\nDate Range\nTime Picker\nPassword\nSelect\nSwitch\nTextarea\nText Editor\nLink\nCheckbox\nRating\nPhone\nTable", "reqd": 1 }, { @@ -81,7 +81,7 @@ "index_web_pages_for_search": 1, "istable": 1, "links": [], - "modified": "2026-01-15 00:41:11.397823", + "modified": "2026-02-11 14:39:48.593350", "modified_by": "Administrator", "module": "Forms Pro", "name": "Form Field", diff --git a/forms_pro/forms_pro/doctype/form_field/form_field.py b/forms_pro/forms_pro/doctype/form_field/form_field.py index ede01f6..f347b6d 100644 --- a/forms_pro/forms_pro/doctype/form_field/form_field.py +++ b/forms_pro/forms_pro/doctype/form_field/form_field.py @@ -36,6 +36,7 @@ class FormField(Document): "Checkbox", "Rating", "Phone", + "Table", ] hidden: DF.Check label: DF.Data diff --git a/frontend/src/components/RenderField.vue b/frontend/src/components/RenderField.vue index 00fb3c2..b56f979 100644 --- a/frontend/src/components/RenderField.vue +++ b/frontend/src/components/RenderField.vue @@ -1,5 +1,8 @@