Skip to content

feat(data): consolidate Huf Data Tables - #460

Merged
esafwan merged 41 commits into
integration/huf-consolidation-2026-07from
consolidation/data-tables
Jul 26, 2026
Merged

feat(data): consolidate Huf Data Tables#460
esafwan merged 41 commits into
integration/huf-consolidation-2026-07from
consolidation/data-tables

Conversation

@esafwan

@esafwan esafwan commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Consolidated scope

Single review surface for the Huf Data Tables feature set.

Original PRs

Integration notes

Overlapping form, API, and service changes were merged by preserving the combined behavior. Agent-access scaffolding and bulk import remain wired into the same Data Table permissions and generated-tool model.

Targets integration/huf-consolidation-2026-07; included in final integration PR #468.

esafwan added 30 commits July 25, 2026 01:57
Add get_table_agent_access / set_table_agent_access to
huf/huf/doctype/huf_data_table/api.py: from a HUF Table, scaffold
deterministic Agent Tool Function docs (view -> Get List + Get Document,
create/edit/delete -> Create/Update/Delete Document), attach/detach them
on an agent's agent_tool child table idempotently, and report which
agents have access. Tool docs are reused by deterministic name and never
deleted on uncheck. params/function_definition are left to the Agent
Tool Function controller's auto-generation.

Adds IntegrationTestCase suite (8 tests) covering scaffolding shape,
idempotency, detach semantics, get/set round-trip, partial-view state,
and the flows.manage capability guard.
Create/Update/Get List tools scaffolded via set_table_agent_access now get
Agent Function Params rows built from the table's DocType meta, so the
generated function_definition exposes the real fields (previously Create had
empty properties with additionalProperties: false). Re-running refreshes
parameters compare-then-save; layout/hidden/read-only fields are excluded;
reqd maps to required only on Create tools.
Add TableAgentAccessModal (agent picker + View/Create/Edit/Delete
checkboxes) wired to the huf_data_table agent-access endpoints, entry
points on the data list page and table view kebab, and a bulk-fetched
"N agents" badge on table cards (2 REST calls, no N+1).
…ndly modal error

BUG-1: the 'N agents' badge could never render — the frontend computed
counts by REST-listing the Agent Tool child table, and Frappe strips all
fields from child-table rows queried without a parent context, so the
grouping always yielded {}. Add get_tables_agent_counts() (flows.use),
reusing _compute_access so distinct agents are counted server-side in one
call, and point the frontend at it. The dead child-table REST code (and
the doctype map entry it needed) is removed.

BUG-2: the access modal's error state showed raw JS error text. It now
shows a friendly message and logs the technical detail to the console.

Also replaces two pre-existing 'as any' filter casts in dataTableApi.ts
with an explicit getDocList filter type so the touched file is
eslint-clean.
…cList call

Instead of calling getTableSchema which requires a registry record name, use direct db.getDocList query on 'Huf Data Table' to resolve the target doctype's schema (specifically title_field_name) using the doctype_name.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant