|
| 1 | +# Action Center Manager — UiPath Coded Web App sample |
| 2 | + |
| 3 | +A minimal React + TypeScript [UiPath Coded Web App](https://docs.uipath.com/) |
| 4 | +demonstrating the `@uipath/uipath-typescript` SDK's **Tasks (Action Center)** |
| 5 | +service. It's an operational dashboard for triaging human tasks in a folder: |
| 6 | +list and filter them, view detail, assign / reassign / unassign, complete |
| 7 | +(approve / reject), and create external tasks. |
| 8 | + |
| 9 | +Built with plain Tailwind (no component library) to keep the file count small. |
| 10 | + |
| 11 | +## What it demonstrates |
| 12 | + |
| 13 | +Every method on [`TaskServiceModel`](https://uipath.github.io/uipath-typescript/api/interfaces/TaskServiceModel/): |
| 14 | + |
| 15 | +| SDK call | Where | |
| 16 | +|----------|-------| |
| 17 | +| `Tasks.getAll({ folderId, pageSize, jumpToPage, filter, orderby })` | `hooks/useTasks.ts` (`useTasks`) — paginated, filterable list | |
| 18 | +| `Tasks.getById(id, {}, folderId)` | `hooks/useTasks.ts` (`useTask`) — full detail | |
| 19 | +| `Tasks.getUsers(folderId)` | `hooks/useTasks.ts` (`useTaskUsers`) — assignee picker (cursor-looped) | |
| 20 | +| `Tasks.create({ title, priority }, folderId)` | `components/TaskList.tsx` (create form) | |
| 21 | +| `task.assign` / `task.reassign` / `task.unassign` | `components/TaskDetail.tsx` | |
| 22 | +| `task.complete(options)` | `components/TaskDetail.tsx` (+ `taskUtils.ts` builds the discriminated-union options) | |
| 23 | + |
| 24 | +By default the app lists tasks across **all folders** you can view/edit. The |
| 25 | +header's **Folder ID** field is an optional filter — leave it blank for all |
| 26 | +folders, or set it to scope the list (persisted to `localStorage`). Per-task |
| 27 | +actions (detail, assign, complete) use each task's own folder; creating a task |
| 28 | +asks for a target folder. |
| 29 | + |
| 30 | +## Files |
| 31 | + |
| 32 | +``` |
| 33 | +src/ |
| 34 | + main.tsx App.tsx index.css |
| 35 | + taskUtils.ts — badges, filter builder, complete-options builder, formatting |
| 36 | + hooks/useAuth.tsx — OAuth/PKCE via the SDK (Coded Apps template) |
| 37 | + hooks/useTasks.ts — useTasks + useTask + useTaskUsers |
| 38 | + components/Modal.tsx, TaskList.tsx, TaskDetail.tsx |
| 39 | +``` |
| 40 | + |
| 41 | +## Prerequisites |
| 42 | + |
| 43 | +- Node.js 20+ |
| 44 | +- A UiPath OAuth External Application (client ID) with the **`OR.Tasks`** scope |
| 45 | +- An Orchestrator folder ID that contains Action Center tasks |
| 46 | + |
| 47 | +## Setup |
| 48 | + |
| 49 | +```bash |
| 50 | +npm install |
| 51 | +cp uipath.json.example uipath.json # then fill in your values |
| 52 | +npm run dev # http://localhost:5173 |
| 53 | +``` |
| 54 | + |
| 55 | +`uipath.json` (git-ignored) configures local dev — the `@uipath/coded-apps-dev` |
| 56 | +Vite plugin reads it and injects the `<meta name="uipath:*">` tags the SDK |
| 57 | +needs. A deployed Coded App gets these from the platform, so the same code works |
| 58 | +in both places. |
| 59 | + |
| 60 | +## Build & deploy |
| 61 | + |
| 62 | +```bash |
| 63 | +npm run build # tsc && vite build → dist/ |
| 64 | + |
| 65 | +uip codedapp pack dist -n action-center-app --version 1.0.0 |
| 66 | +uip codedapp publish |
| 67 | +uip codedapp deploy -n action-center-app --folder-key <FOLDER_KEY> |
| 68 | +``` |
| 69 | + |
| 70 | +## Notes |
| 71 | + |
| 72 | +- **My Tasks / Manage Tasks tabs:** these map to `getAll`'s `asTaskAdmin` flag, |
| 73 | + mirroring Action Center. "Manage Tasks" (`asTaskAdmin: true`) lists tasks |
| 74 | + across folders where you can assign them — the context where assigning to a |
| 75 | + **group** applies. (The SDK doesn't expose a strict "assigned only to me" |
| 76 | + view or a task `delete`, so those parts of the product aren't replicated.) |
| 77 | +- **Pagination:** the list uses server-side page navigation (`jumpToPage` + |
| 78 | + `totalCount`); the user picker loops the cursor. No list call assumes one |
| 79 | + response holds every row. |
| 80 | +- **Creation** through the API only supports **external** tasks — form and app |
| 81 | + tasks are created by the system through workflows. |
0 commit comments