Skip to content

Commit b7a2c26

Browse files
feat(tasks): action-center sample app
1 parent 40ba19a commit b7a2c26

22 files changed

Lines changed: 5530 additions & 735 deletions

package-lock.json

Lines changed: 1042 additions & 734 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Logs
2+
*.log
3+
npm-debug.log*
4+
5+
# Build outputs
6+
node_modules
7+
dist
8+
dist-ssr
9+
10+
# Local UiPath OAuth config (tenant-specific) — copy uipath.json.example to
11+
# uipath.json and fill in your values. Only the .example template is committed.
12+
uipath.json
13+
14+
# Coded App publish artifacts
15+
.uipath
16+
17+
# OS / editor
18+
.DS_Store
19+
.vscode/*
20+
!.vscode/extensions.json
21+
.idea
22+
*.sw?
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
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.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title>Action Center Manager</title>
7+
</head>
8+
<body>
9+
<div id="root"></div>
10+
<script type="module" src="/src/main.tsx"></script>
11+
</body>
12+
</html>

0 commit comments

Comments
 (0)