toga-ai 1.0.471 → 1.0.472
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
| Doc | Summary | Files |
|
|
4
4
|
|-----|---------|-------|
|
|
5
5
|
| [Tools (1.0 Internal-Tools App) Architecture](architecture.md) | **Tools** is a standalone 1.0 (`App_`) application that houses many small internal tools behind simple interfaces, gated by Client_True staff persona. | tools/index.php, tools/_/app/framework.php, tools/_/app/frameworkindex.php, tools/assets/img/favicon/favicon.ico, tools/assets/img/favicon/favicon-32x32.png, tools/assets/img/favicon/favicon-16x16.png, tools/assets/img/favicon/apple-touch-icon.png, tools/_/app/auth.php, tools/_/app/nav.php, tools/common/header.php, tools/common/footer.php, tools/mvc/get.php, tools/mvc/_TEMPLATE/get.php, tools/docs/ADDING_A_TOOL.md |
|
|
6
|
+
| [ClickUp Sprint Dashboard (tools /clickup/react)](features/clickup-sprint-dashboard.md) | A native **ClickUp sprint dashboard** in the 1.0 `tools` app at route `/clickup/react`, built for a wall-mounted **TV display** ("TOGa IQ" internal sprint metri | tools/_/app/clickup/sprint.php, tools/v2/sprints/tile/index.php, tools/v2/sprints/current/index.php, tools/v2/sprints/status-breakdown/index.php, tools/v2/sprints/worktype-breakdown/index.php, tools/v2/sprints/points-by-dev/index.php, tools/v2/sprints/burndown/index.php, tools/assets/clickup/sprint-dashboard.html, tools/mvc/clickup/react/get.php, tools/mvc/login/get.php, tools/_/app/nav.php |
|
|
6
7
|
| [CloudFront Client Setup](features/cloudfront-client-setup.md) | An SSO-gated admin tool at **`/devops/cloudfront-clients`** in the Tools 1.0 app that onboards a client onto **CloudFront + Route 53 across multiple AWS account | tools/_/app/devops/cloudfront.php, tools/mvc/devops/cloudfront-clients/get.php, tools/mvc/devops/cloudfront-clients/post.php, tools/assets/js/cloudfront-clients.js, tools/assets/css/cloudfront-clients.css, tools/_/app/nav.php, tools/_/app/frameworkindex.php, tools/config.production.ini |
|
|
7
8
|
| [Design Demo Admin](features/design-demo-admin.md) | A self-serve admin UI at **`/design`** in the SSO-protected **Tools** app that lets the design team publish self-contained "Claude Design" HTML exports as **ver | tools/_/app/design/github.php, tools/mvc/design/get.php, tools/mvc/design/post.php, tools/assets/css/design.css, tools/assets/js/design.js, tools/_/app/frameworkindex.php, tools/_/app/nav.php, tools/composer.json |
|
|
8
9
|
| [Tools — Developers Folder (UUID & Password Generators)](features/developer-tools.md) | The first two tools shipped in the Tools app, both under the **Developers** folder and gated to personas **Development Team** / **TOGa Technology**. | tools/mvc/developers/uuid/get.php, tools/mvc/developers/password/get.php |
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: ClickUp Sprint Dashboard (tools /clickup/react)
|
|
3
|
+
framework: "1.0"
|
|
4
|
+
repo: tools
|
|
5
|
+
project: Tools
|
|
6
|
+
client: shared
|
|
7
|
+
type: feature
|
|
8
|
+
status: active
|
|
9
|
+
updated: 2026-07-29
|
|
10
|
+
owners: [kyalamarthi]
|
|
11
|
+
files:
|
|
12
|
+
- tools/_/app/clickup/sprint.php
|
|
13
|
+
- tools/v2/sprints/tile/index.php
|
|
14
|
+
- tools/v2/sprints/current/index.php
|
|
15
|
+
- tools/v2/sprints/status-breakdown/index.php
|
|
16
|
+
- tools/v2/sprints/worktype-breakdown/index.php
|
|
17
|
+
- tools/v2/sprints/points-by-dev/index.php
|
|
18
|
+
- tools/v2/sprints/burndown/index.php
|
|
19
|
+
- tools/assets/clickup/sprint-dashboard.html
|
|
20
|
+
- tools/mvc/clickup/react/get.php
|
|
21
|
+
- tools/mvc/login/get.php
|
|
22
|
+
- tools/_/app/nav.php
|
|
23
|
+
related:
|
|
24
|
+
- ./persona-gated-navigation.md
|
|
25
|
+
- ./saml-sso-auth.md
|
|
26
|
+
- ./mvc-data-access-patterns.md
|
|
27
|
+
- ../architecture.md
|
|
28
|
+
- ../../../2.0/apps/worker2/features/team-sprint-management.md
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Summary
|
|
32
|
+
|
|
33
|
+
A native **ClickUp sprint dashboard** in the 1.0 `tools` app at route `/clickup/react`,
|
|
34
|
+
built for a wall-mounted **TV display** ("TOGa IQ" internal sprint metrics). It replaces a
|
|
35
|
+
standalone Node/Express prototype from a prior session, folding the dashboard into `tools`
|
|
36
|
+
so it runs on the existing App\_ framework + SSO with no separate service.
|
|
37
|
+
|
|
38
|
+
It reads the **same Team DB** and reproduces the **same Power BI-parity metric definitions**
|
|
39
|
+
already documented for worker2 — see
|
|
40
|
+
[team-sprint-management](../../../2.0/apps/worker2/features/team-sprint-management.md). This
|
|
41
|
+
doc does **not** duplicate those DAX→SQL definitions; it documents the tools-side delivery
|
|
42
|
+
(data engine, routes, UI, embed, nav, TV decisions).
|
|
43
|
+
|
|
44
|
+
## How it works
|
|
45
|
+
|
|
46
|
+
### Data engine — `App_Clickup_Sprint` (`_/app/clickup/sprint.php`)
|
|
47
|
+
|
|
48
|
+
Static methods, one per metric: `tile`, `status-breakdown`, `worktype-breakdown`,
|
|
49
|
+
`points-by-dev`, `burndown`, `current`. Each queries the **Team DB** via the `db_team`
|
|
50
|
+
connection (registry string `'db_team'`, from the `[database_team]` config section) using
|
|
51
|
+
`App_Database::query($sql, 'db_team')`. Responses are wrapped in the **api2 `/v2` envelope**
|
|
52
|
+
(`{success, data, errors}`) so the tool is a faithful stand-in for api2.
|
|
53
|
+
|
|
54
|
+
**Auth is done by hand as JSON**, not the HTML auth card: `App_Auth::isLoggedIn()` +
|
|
55
|
+
`App_Nav::personasForRoute('/clickup/react')` + `hasAnyPersona`; on failure it returns a
|
|
56
|
+
JSON **401/403** so the fetch-based UI gets a clean error instead of an HTML login page.
|
|
57
|
+
|
|
58
|
+
Two 1.0-framework gotchas this engine had to work around (both reusable beyond this
|
|
59
|
+
feature — see [Gotchas](#gotchas)):
|
|
60
|
+
|
|
61
|
+
1. **Query-logging preflight on a `Defaults`-less DB.** Call
|
|
62
|
+
`App_Registry::set('queryLogging', false)` before the first query on `db_team`, or
|
|
63
|
+
`App_Query`'s one-time preflight (`SELECT ... FROM Defaults WHERE setting='QUERY_LOGGING'`)
|
|
64
|
+
throws `#1146 Table 'Team.Defaults' doesn't exist` and every metric 500s.
|
|
65
|
+
2. **`App_Database::buildArrayOfRows()` takes its result by reference.** Assign the query
|
|
66
|
+
result to a variable first; passing `App_Database::query(...)` inline is fatal under the
|
|
67
|
+
E_ALL handler.
|
|
68
|
+
|
|
69
|
+
### Routes — `v2/sprints/{metric}/index.php`
|
|
70
|
+
|
|
71
|
+
Thin route handlers mapping `/v2/sprints/*` to `App_Clickup_Sprint::serve($metric)`. One
|
|
72
|
+
`index.php` per metric (`tile`, `current`, `status-breakdown`, `worktype-breakdown`,
|
|
73
|
+
`points-by-dev`, `burndown`).
|
|
74
|
+
|
|
75
|
+
### UI — `assets/clickup/sprint-dashboard.html`
|
|
76
|
+
|
|
77
|
+
**React via CDN in a single HTML file** — React 18.3.1 + ReactDOM (production UMD) +
|
|
78
|
+
Babel-standalone from CDN, JSX inside a `<script type="text/babel">`. **No build step, no
|
|
79
|
+
npm, no bundler.** It fetches `/v2/sprints/*` **same-origin**, so the SSO session cookie
|
|
80
|
+
authenticates the calls automatically. Do not mistake this for a bundled React app.
|
|
81
|
+
|
|
82
|
+
### Embed page — `mvc/clickup/react/get.php`
|
|
83
|
+
|
|
84
|
+
A PHP MVC view that `requireAuth`s, then embeds `sprint-dashboard.html` in an
|
|
85
|
+
`<iframe allowfullscreen>` (cache-busted by `filemtime`). Heading "Clickup Dashboard",
|
|
86
|
+
subtitle notes the data is "…refreshed every 5 min."
|
|
87
|
+
|
|
88
|
+
### Nav — `_/app/nav.php`
|
|
89
|
+
|
|
90
|
+
Registered under the **"Dashboard"** nav folder as
|
|
91
|
+
`['label'=>'Clickup','route'=>'/clickup/react']`, persona-gated like every folder (see
|
|
92
|
+
[persona-gated-navigation](./persona-gated-navigation.md)). The old Power BI embed nav entry
|
|
93
|
+
(`/clickup/dashboard`) was **removed** — the page file stays on disk, just unlinked — because
|
|
94
|
+
the React dashboard supersedes it.
|
|
95
|
+
|
|
96
|
+
## TV display decisions
|
|
97
|
+
|
|
98
|
+
- **Soft 5-min auto-refresh.** The `useApi` hook re-fetches in place every 5 min via
|
|
99
|
+
`setInterval`; it does **not** `location.reload()`. On a full-screen TV a soft refresh
|
|
100
|
+
keeps the page full-screen and flash-free, whereas a full reload exits full screen every
|
|
101
|
+
cycle. (JS timers only throttle in hidden/background tabs; a foreground full-screen TV tab
|
|
102
|
+
is not throttled.)
|
|
103
|
+
- **16:9 stage.** The iframe stage uses `aspect-ratio:16/9` with
|
|
104
|
+
`max-height: calc(100vh - 170px)` so it stays TV-shaped without forcing page scroll. Full
|
|
105
|
+
width comes from lifting the shell content cap for this page only —
|
|
106
|
+
`.app-content:has(.cur-dash){max-width:none}` (same pattern the design tool uses in
|
|
107
|
+
`assets/css/design.css`); the dashboard `.page` has no max-width so it fills the stage.
|
|
108
|
+
|
|
109
|
+
## Local development
|
|
110
|
+
|
|
111
|
+
- **Dev auth bypass.** `mvc/login/get.php` has a block that, when
|
|
112
|
+
`!empty($internal['dev_mode']) && !empty($internal['dev_autologin'])`, calls
|
|
113
|
+
`App_Auth::establishSession([...synthetic 'Local Dev' user...], ['Development Team','TOGa Technology'])`
|
|
114
|
+
and `App_MVC::routeTo('/clickup/dashboard')`, skipping the SSO form. The `dev_autologin`
|
|
115
|
+
flag lives **only** in the git-ignored `config.dev-local.ini` (next to `dev_mode`); prod
|
|
116
|
+
has `dev_mode=0` and no such flag, so the bypass is inert in every deployed env. The config
|
|
117
|
+
filename is chosen by `getenv('ENVIRONMENT')` → `config.<env>.ini`
|
|
118
|
+
(`App_Framework::initialize` / `App_Config::getConfigFilename`).
|
|
119
|
+
- **Run on Windows** (the repo's `docs/LOCAL_DEV.md` is macOS-worded):
|
|
120
|
+
`cd tools && ENVIRONMENT=dev-local php -d "include_path=.;C:/www/library" -S localhost:8000 router.php`.
|
|
121
|
+
The `App_` framework + `_.php` bootstrap load from the separate `library` repo via
|
|
122
|
+
`include_path`; `router.php` reproduces the `.htaccess` rewrite for PHP's built-in server.
|
|
123
|
+
|
|
124
|
+
> Credentials note: DB creds and the `dev_mode` / `dev_autologin` flags live in the
|
|
125
|
+
> git-ignored `config.dev-local.ini` — never commit values.
|
|
126
|
+
|
|
127
|
+
## Gotchas
|
|
128
|
+
|
|
129
|
+
- **`queryLogging` preflight fails on any non-core DB without a `Defaults` table.** `App_Query`
|
|
130
|
+
(`library/app/query.php`) runs a one-time-per-request check on the **first** query of the
|
|
131
|
+
request against the active connection: `SELECT value FROM Defaults WHERE setting='QUERY_LOGGING'`.
|
|
132
|
+
If that first query runs on `db_team` (the Team schema has no `Defaults` table) it throws
|
|
133
|
+
`#1146 Table 'Team.Defaults' doesn't exist`. Set `App_Registry::set('queryLogging', false)`
|
|
134
|
+
before any query on a `Defaults`-less connection. General to any 1.0 App\_ code hitting the
|
|
135
|
+
Team DB or any other non-core schema.
|
|
136
|
+
- **`App_Database::buildArrayOfRows()` result is by-reference.**
|
|
137
|
+
`buildArrayOfRows(App_Database::query($sql,$db), false)` raises "Only variables should be
|
|
138
|
+
passed by reference", which the E_ALL error handler promotes to a fatal 500. Assign first:
|
|
139
|
+
`$res = App_Database::query(...); buildArrayOfRows($res, false);`.
|
|
140
|
+
|
|
141
|
+
## Change history
|
|
142
|
+
- 2026-07-29 — Built `/clickup/react` as a native tools feature (data engine, `/v2/sprints/*` routes, CDN-React TV UI, iframe embed, "Dashboard/Clickup" nav); removed the old `/clickup/dashboard` Power BI nav entry; documented two reusable 1.0 gotchas (queryLogging preflight on Defaults-less DBs, buildArrayOfRows by-ref). (kyalamarthi)
|
package/knowledge/INDEX.md
CHANGED
|
@@ -13,7 +13,7 @@ _Auto-generated by `knowledge.js index`. Do not hand-edit._
|
|
|
13
13
|
- **walmarttechservices** (Walmart Tech Services) — 1 doc(s) → [1.0/apps/walmarttechservices/INDEX.md](1.0/apps/walmarttechservices/INDEX.md)
|
|
14
14
|
- **test** (Test) — 13 doc(s) → [1.0/apps/test/INDEX.md](1.0/apps/test/INDEX.md)
|
|
15
15
|
- **toga** (TOGa) — 2 doc(s) → [1.0/apps/toga/INDEX.md](1.0/apps/toga/INDEX.md)
|
|
16
|
-
- **tools** (Tools) —
|
|
16
|
+
- **tools** (Tools) — 11 doc(s) → [1.0/apps/tools/INDEX.md](1.0/apps/tools/INDEX.md)
|
|
17
17
|
|
|
18
18
|
## 2.0 framework
|
|
19
19
|
|
package/package.json
CHANGED