Skip to content

feat(samples): add datafabric-app sample#496

Open
amrit-agarwal-1 wants to merge 7 commits into
mainfrom
feat/samples-data-fabric-app
Open

feat(samples): add datafabric-app sample#496
amrit-agarwal-1 wants to merge 7 commits into
mainfrom
feat/samples-data-fabric-app

Conversation

@amrit-agarwal-1

@amrit-agarwal-1 amrit-agarwal-1 commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

What this adds
A new sample under samples/data-fabric-app/ that demonstrates the UiPath TypeScript SDK against Data Fabric Entities and Choice Sets. Follows the same setup pattern as the existing samples (uipath.json + @uipath/coded-apps-dev, OAuth via the SDK, deploys as a Coded App).
SDK surface exercised
Entities service — getAll, getById, getAllRecords, getRecordById, insertRecordById, updateRecordById, deleteRecordById, uploadAttachment, downloadAttachment, deleteAttachment.
ChoiceSets service — getAll, getById.
Key UX

Two-pane layout. Sidebar with collapsible Entities + Choice Sets sections (powered by Entities.getAll and ChoiceSets.getAll), unified search across both, single refresh button.
Entity detail. Schema panel (collapsible), records grid backed by @uipath/ui-widgets-datatable, a modal RecordEditor for create/edit with required-field validation and attachment upload/delete, read-only RowInspector modal showing all fields (including system) via getRecordById, CSV export.
Choice set detail. Dedicated view with metadata header (description, last updated) and a values table.
Smart entity-kind detection. VDOs, Cases, InternalEntity, and SystemEntity are detected up-front and rendered with a friendly notice instead of a failing API call.
Light + dark theme.

Link: https://procodeapps.alpha.uipath.host/data-fabric-app

@amrit-agarwal-1 amrit-agarwal-1 requested a review from a team June 4, 2026 19:00
Comment thread samples/data-fabric-app/src/hooks/useEntity.ts Outdated
Comment thread samples/data-fabric-app/src/hooks/useChoiceSet.ts Outdated
Comment thread samples/data-fabric-app/src/components/RecordEditor.tsx Outdated
- track src/lib/ files (add gitignore exception for root .gitignore rule)
- drop `as unknown as` cast in useEntity; use SDK's EntityGetResponse
- drop `Array.isArray(...) ? ... : (... as any).items` dead branches in
  useEntity, useChoiceSet, useChoiceSets, useEntities — SDK return shapes
  are already typed correctly
- drop redundant cast on insertRecordById in RecordEditor; EntityInsertResponse
  guarantees Id is present
- rewrite widgetCompat shim without `as unknown as`
@claude

claude Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

✅ No issues found. Checked for bugs and CLAUDE.md compliance.

@UiPath UiPath deleted a comment from claude Bot Jun 4, 2026
getAllRecords() and ChoiceSets.getById() each return one server-capped
page per call — passing no options does not return every row. Loop the
cursor and accumulate so CSV export covers all records and the choice-set
value count is accurate.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Comment thread samples/data-fabric-app/src/components/RecordEditor.tsx Outdated
Comment thread samples/data-fabric-app/src/hooks/useWidgetToolbar.ts Outdated
Comment thread samples/data-fabric-app/src/hooks/useWidgetToolbar.ts Outdated
Comment thread samples/data-fabric-app/src/lib/csvExport.ts Outdated
@claude

claude Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Review findings

Bug fix needed:

  • RecordEditor.tsx:454 — .slice(0, 16) applied to both DATE and DATETIME inputs; the date input type needs 10 chars (YYYY-MM-DD), not 16 — produces an invalid value for date-only fields when the API returns a full ISO string.

Convention violations (module-level constants rule from agent_docs/conventions.md):

  • useWidgetToolbar.ts:31 — HIDDEN_BUTTON_LABELS static array defined inside useEffect body; move to module scope.
  • useWidgetToolbar.ts:49 — inline regex inside hideWidgetButtons() (called on every MutationObserver event); move to module scope.
  • csvExport.ts:68 — inline regex inside csvCell() (called per CSV cell); move to module scope.

All three previous inline threads were correctly resolved — the as unknown as cast, dead Array.isArray branch, and unnecessary cast have been cleaned up.

Comment thread samples/data-fabric-app/src/components/RecordEditor.tsx Outdated
Comment thread samples/data-fabric-app/src/components/RecordEditor.tsx Outdated
Comment thread samples/data-fabric-app/src/hooks/useEntity.ts
Comment thread samples/data-fabric-app/src/components/RecordEditor.tsx Outdated
Comment thread samples/data-fabric-app/README.md Outdated
Comment thread samples/data-fabric-app/src/hooks/useWidgetToolbar.ts Outdated
Comment thread samples/data-fabric-app/src/components/EntityDetail.tsx Outdated
Comment thread samples/data-fabric-app/src/components/EntitiesList.tsx Outdated
Comment thread samples/data-fabric-app/src/lib/entityTypes.ts Outdated
Comment thread samples/data-fabric-app/README.md
@claude

claude Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

✅ No issues found. Checked for bugs and CLAUDE.md compliance.

@amrit-agarwal-1 amrit-agarwal-1 force-pushed the feat/samples-data-fabric-app branch from 0311571 to da569db Compare June 10, 2026 11:51
Comment thread samples/data-fabric-app/src/lib/csvExport.ts Outdated
@claude

claude Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Review findings

One new finding this run:

  • csvExport.ts:72/"/g inline regex literal inside csvCell(). The prior thread moved CSV_ESCAPE_REGEX to module scope but this second regex in the same replace call was not part of that fix. Per conventions, move it to module scope as const CSV_QUOTE_REGEX = /"/g.

- Drop local shadcn copies + cn() utility
- Tailwind v3 → v4; postcss reuses @uipath/apollo-wind/postcss
- @import '@uipath/apollo-wind/tailwind.css' (apollo Vertex tokens + dark)
- Components now from @uipath/apollo-wind/components/ui/*
- toast via apollo-wind's sonner re-export
- Remove obsolete patchWidgetStyles vite plugin (widget ships v4-compatible CSS now)
- Rewire AG Grid + .uipath-datatable-container vars to apollo-core --color-* tokens
- Two-tier border hierarchy: --color-border-disabled outer, --color-border-grid rows
- Single column separator via Quartz theme vars; resize-handle visual hidden
@claude

claude Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

✅ No issues found. Checked for bugs and CLAUDE.md compliance.

…et workarounds

@uipath/ui-widgets-datatable 1.0.1 ships self-contained compiled CSS (no
host @layer dependency) and fixes the telemetry contract, so the local
workarounds are no longer needed:

- Bump @uipath/ui-widgets-datatable ^1.0.0 -> ^1.0.1.
- Remove the telemetry shim (src/lib/widgetCompat.ts) and its import in
  main.tsx — the widget no longer calls a missing telemetryClient.track.
- Drop the stale CSS-workaround comment in EntityDetail.tsx referencing the
  already-removed syncWidgetStyles plugin.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@amrit-agarwal-1 amrit-agarwal-1 force-pushed the feat/samples-data-fabric-app branch from c4c7c41 to 4af27e9 Compare June 16, 2026 08:25
@claude

claude Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

✅ No issues found. Checked for bugs and CLAUDE.md compliance.

1 similar comment
@claude

claude Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

✅ No issues found. Checked for bugs and CLAUDE.md compliance.

@sonarqubecloud

Copy link
Copy Markdown

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.

3 participants