Add Roles/Permissions to Tickets & Default Organization Layer With Chart#190
Merged
Conversation
- Add reportsToUserId field to OrganizationAdminUser interface - Create /v1/org/users/:userId endpoint to update reportsToUserId - Add Reports To dropdown to OrganizationMembersPage with None option - Update backend GET /admin/organization/users to fetch reportsToUserId - Make dropdowns fill entire table cell width with flex-1 class - Support null values for clearing the Reports To field
- Add OrganizationPage: full-viewport org chart display based on reportsTo - Add OrganizationChart: YChartEditor-based org structure visualization - Add Organization link to Manage sidebar section with faSitemap icon - Register /app/organization route in AppLayout - Add seed-hierarchy.ts: deterministic multi-level manager structure for seeded users - Add seed-org-hierarchy.ts: standalone script to reapply hierarchy without full reseed - Wire hierarchy seeding into standard seed flow (npm run seed) - Add npm run seed:hierarchy command for hierarchy-only updates
…esh, cmdk entry - Replace ychart built-in info panel with a centered modal showing Name, @handle, and a View Profile link (patches showNodeDetails on the instance) - Add username field to OrganizationChartMember and pass it through from OrganizationPage so the handle is available in the modal - Move Members/Refresh control from top to bottom-right of the chart canvas - Add Org Chart entry to the command palette (Manage group, faSitemap icon) - Override --yc-color-success and --yc-shadow-node-selected in ychart-dark.css to use the brand primary color instead of the hardcoded Material Blue (#2196F3) that was conflicting with the orange brand on node selection and canvas focus
…t org chart search to names only
- Add public /v1/organization and /v1/organization/users backend endpoints accessible to any authenticated user (not admin-only) - Add orgApi client in src/lib/api.ts for the new public endpoints - Update OrganizationPage to use orgApi instead of admin API - Hide ychart UI chrome (field selector, YAML editor, toggle/filter buttons, POI selector wrapper) via injected CSS in OrganizationChart - Fix unused import lint errors in OrganizationPage and ProfilePage
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a default organization layer, CASL-based ticket authorization, organization/admin UI surfaces, and org chart functionality across the backend and React app.
Changes:
- Adds organization models, migration/config, APIs, roles/permissions, and ticket authorization changes.
- Adds organization chart/member management UI and profile work-summary reuse.
- Updates CI/deploy migration execution and expands ticket permission tests.
Reviewed changes
Copilot reviewed 47 out of 48 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| src/ui/UserDropdown.tsx | Adds team switching and org member navigation. |
| src/ui/Sidebar.tsx | Adds organization navigation. |
| src/ui/SettingsPage.tsx | Adds organization admin settings. |
| src/ui/CommandPalette.tsx | Adds org chart command. |
| src/ui/AppPage.tsx | Adds no-padding layout option. |
| src/ui/AppLayout.tsx | Registers organization routes. |
| src/ui/AppHeader.tsx | Removes header team selector. |
| src/lib/organizationAccess.ts | Adds org admin access helpers. |
| src/lib/api.ts | Adds org/admin API clients and types. |
| src/features/teams/ychart-dark.css | Aligns ychart brand colors. |
| src/features/teams/TeamsPage.tsx | Removes chart/timesheet tab content from teams page. |
| src/features/profile/WorkSummaryTags.tsx | Extracts recent work tags. |
| src/features/profile/useProfileTickets.ts | Extracts profile ticket-fetching hook. |
| src/features/profile/ProfileWorkSnapshot.tsx | Reuses profile ticket hook. |
| src/features/profile/ProfilePage.tsx | Uses extracted work summary component. |
| src/features/profile/CompactTicketList.tsx | Adds compact ticket display. |
| src/features/org/TeamMembersView.tsx | Adds team-member fallback view. |
| src/features/org/OrganizationPage.tsx | Adds organization chart page. |
| src/features/org/OrganizationOverviewPage.tsx | Adds org admin overview. |
| src/features/org/OrganizationMembersPage.tsx | Adds org member/role/reporting management. |
| src/features/org/OrganizationChart.tsx | Adds ychart-based organization chart/lightbox. |
| src/features/clock/TimesheetRow.tsx | Adjusts multi-day row/status/action behavior. |
| src/features/admin/AdminUsersPage.tsx | Adds admin users page implementation. |
| package-lock.json | Adds CASL dependencies. |
| backend/tests/tickets.test.ts | Updates ticket authorization expectations/tests. |
| backend/tests/migrations.test.ts | Removes migration test suite. |
| backend/src/services/timer.service.ts | Adds invalid-date timer start result. |
| backend/src/services/ticket.service.ts | Applies CASL ticket permissions. |
| backend/src/services/team.service.ts | Creates/defaults organization for teams. |
| backend/src/server.ts | Registers org routes. |
| backend/src/routes/users.ts | Adds org/session/admin user endpoints. |
| backend/src/routes/timers.ts | Maps invalid-date timer errors. |
| backend/src/routes/tickets.ts | Uses authorization helpers in ticket routes. |
| backend/src/routes/org.ts | Adds reports-to update endpoint. |
| backend/src/models/team.model.ts | Adds orgId to teams. |
| backend/src/models/organization.model.ts | Adds organization model. |
| backend/src/models/index.ts | Adds organization collection accessor. |
| backend/src/lib/permissions.ts | Adds CASL ability builder. |
| backend/src/lib/org-config.ts | Adds default org config. |
| backend/scripts/seed.ts | Expands seed users/teams and hierarchy setup. |
| backend/scripts/seed-org-hierarchy.ts | Adds hierarchy seed script. |
| backend/scripts/seed-hierarchy.ts | Adds seeded reporting structure. |
| backend/README.md | Documents default org env vars. |
| backend/package.json | Adds CASL deps and hierarchy seed script. |
| backend/migrations/20260514_120000_add-organizations-and-team-org-id.cjs | Adds org/team backfill migration. |
| backend/.github/workflows/deploy-backend.yml | Runs backend migrations during deploy. |
| .github/workflows/ci.yml | Runs backend migrations during deploy jobs. |
| .github/copilot-instructions.md | Adds permission-change guidance. |
Comments suppressed due to low confidence (1)
backend/tests/migrations.test.ts:1
- This removes the migration test suite without adding replacement coverage, while the PR adds a new data migration that backfills organization IDs. Keeping migration tests is important here because a broken migration would block deploys now that deploy workflows run
npm run migrate; add coverage for the new org/team backfill instead of deleting the suite.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
64781c7 to
5ebd617
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduces a default Organization layer for higher level operations in the system. Is easily expandable to a multi-org system. Along with this comes a Roles/Permissions system using CASL. Tickets have been converted to use CASL abilities
Closes #151
Closes #132