Skip to content

feat(huf-tables): add bulk import feature and permission bridge for HUF tables - #429

Closed
esafwan wants to merge 3 commits into
developfrom
feat/huf-table-bulk-import
Closed

feat(huf-tables): add bulk import feature and permission bridge for HUF tables#429
esafwan wants to merge 3 commits into
developfrom
feat/huf-table-bulk-import

Conversation

@esafwan

@esafwan esafwan commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a user-friendly Bulk Import feature for HUF Tables by building a lightweight wrapper around Frappe's native Data Import engine.

Key Changes

  • Backend Permission Bridge (api.py):
    • Automatically sets allow_import=1 on generated HF {table_name} DocTypes at creation/update time.
    • Grants import DocPerms to System Manager and capability holders under flows.manage.
    • Added _ensure_import_enabled(): retrofits legacy HUF tables automatically.
    • Added 3 whitelisted API endpoints: get_bulk_import_template_url, start_table_bulk_import, and get_table_bulk_import_status.
  • Frontend Bulk Import Modal (BulkImportModal.tsx):
    • Step 1: Download CSV template button.
    • Step 2: Drag-and-drop CSV upload via frappeFile.uploadFile.
    • Step 3: Start Import button with 2s live status polling showing success/failure counts and row-level error diagnostic breakdown.
    • Added Import Data button in DataTableViewPage.tsx header bar next to Add Record.

Proof of Test

HUF Table Bulk Import Modal

Verification

  • Built frontend with zero TypeScript errors (tsc -b && vite build).
  • Verified Python compilation (python3 -m py_compile huf/huf/doctype/huf_data_table/api.py).
  • Verified live bench container rendering at http://huf.localhost:8100/huf/data/:tableId.

@esafwan

esafwan commented Jul 26, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by consolidated Data Tables PR #460, now included in integration PR #468.

@esafwan esafwan closed this Jul 26, 2026
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