feat(ui): Goals → Initiatives pages — list, detail, create/edit with teams and signals (G-P2-4)
What
G-P2-4 (UI): Goals → Initiatives. Part of the Gauzy ↔ Ever Works integration plan (06-gauzy-implementation-plan.md G-P2-4, decision D3b, in ever-co/homelab). Strategic Initiatives had a REST/GraphQL API but no Angular UI. Ever Works Missions will sync into them, so they need pages.
Builds on #10778 (initiative ↔ team links and teamIds). Until that merges, this diff also shows its commits.
| Where | What |
|---|---|
/pages/goals/initiatives (new lazy InitiativesModule) | Lists the selected organization's initiatives the user may see. The server applies the leadership / organization / team visibility. Columns: title, state, visibility, directly linked teams, number of aligned projects, confidence, momentum. Add / Edit / Delete follow ORG_STRATEGIC_INITIATIVE_CREATE / _UPDATE / _DELETE. The route needs ORG_STRATEGIC_INITIATIVE_READ. |
/pages/goals/initiatives/:id | Detail page: intent, steward, state, visibility, signals (confidence, momentum, known risks, notes, last assessment), linked teams, aligned goals (with progress) and projects. Edit is shown by permission. |
| Create / edit dialog | Title, intent, state, visibility, steward (an organization employee), teams (multi-select → teamIds), and signals. Edits save the fields with PUT :id, then the signals with PUT :id/signals, which merges them and stamps the assessment. |
| Menu | Goals → Initiatives (ORG_STRATEGIC_INITIATIVE_READ, under the Goals feature flag). |
| Favorites | A favorited initiative now opens its detail page instead of /pages/goals. favorite-links.routes.spec.ts resolves the new target. |
| ui-core | StrategicInitiativesService (list, get, create, update, signals, delete). |
| i18n | STRATEGIC_INITIATIVES.* (31 keys plus state, visibility, confidence and momentum labels) and MENU.INITIATIVES in all 14 language files, translated. |
Nothing else changes for people who do not open the new pages.
Tests
-
initiatives.components.spec.ts(new). The three components compile against their templates (TestBed, jest-preset-angular):- the list loads the organization's initiatives and shows their teams;
- create sends the trimmed title,
teamIdsand signals (risks one per line); - edit sends the fields, then the signals as one assessment;
- the detail page shows intent, steward, teams, goals, projects and risks;
- a malformed signals document reads as none.
5 tests, all green.
-
favorite-links.routes.spec.ts(OrganizationStrategicInitiative →/pages/goals/initiatives/:idresolves) and the ui-core favorites specs (35) pass. -
tsc -p apps/gauzy/tsconfig.app.jsonreports 0 errors. -
The 30 node-only static gates and the egress static-hostname audit pass.
🤖 Generated with Claude Code
Summary by cubic
Adds Angular UI for strategic initiatives (G-P2-4 of the Gauzy ↔ Ever Works integration plan): list, detail, and create/edit pages under Goals → Initiatives, plus backend support to link initiatives directly to teams.
New Features
- New lazy
InitiativesModuleat/pages/goals/initiativeslists the organization's initiatives with state, visibility, linked teams, projects, confidence, and momentum; add/edit/delete follow theORG_STRATEGIC_INITIATIVE_*permissions. - A detail page (
/pages/goals/initiatives/:id) shows intent, steward, state, visibility, signals, linked teams, aligned goals, and projects, with edit by permission; it edits with the initiative's own organization's employees and teams, whichever organization is selected. - The create/edit dialog takes title, intent, state, visibility, steward, teams (
teamIds), and signals; edits save the fields, then the signals separately, and send cleared steward, confidence, and momentum as null so stored values are overwritten. - The list discards stale loads from earlier organization selections, and a favorited initiative now opens its detail page.
Backend and Migration
- New many-to-many
teamsonOrganizationStrategicInitiativevia migration1791000000731on Postgres, SQLite, and MySQL; on MySQL the pivot's foreign keys are created in one statement under a named lock whose name fitsGET_LOCK's 64-character limit. - Links are set only through
teamIds, each validated against the organization the initiative is saved in; updates replace the linkage when stated, moving to another organization withoutteamIdsunlinks the old one's teams, and reads answer them onIOrganizationStrategicInitiativeRead. visibilityScope: 'team'now includes members of directly linked teams.- New
StrategicInitiativesServiceadded to ui-core, withSTRATEGIC_INITIATIVES.*translations across all 14 language files. New specs cover the components, the team-linking service, and the migration.