OUT-2898 | Show tasks assigned to clients within a company on company details page#1205
OUT-2898 | Show tasks assigned to clients within a company on company details page#1205arpandhakal merged 3 commits intomainfrom
Conversation
…M company preview When an internal user enters CRM preview mode for a company, also include tasks assigned to clients of that company (TEAM TASKS) and IU tasks shared with those clients (SHARED WITH TEAM). Previously only company-level tasks and IU tasks shared with the company itself were visible. The shared task/comment filter is now async and fetches the company's clients via copilot.getCompanyClients only when the new IU-company-preview branch fires; the result is memoized per request to avoid duplicate calls. Other flows (client preview, CU portal, normal IU) skip the new branch entirely, so they incur no extra I/O — only an await on a synchronously resolved promise. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryThis PR extends the IU company-preview CRM view to include tasks assigned to the company's individual clients (TEAM TASKS) and IU tasks shared with those clients (SHARED WITH TEAM), in addition to the previously visible company-level tasks.
Confidence Score: 4/5Safe to merge; the new IU-company-preview branch is isolated and does not affect CU portal or normal IU flows. The new tasksShared.service.ts and comment.service.ts both carry the Important Files Changed
Reviews (1): Last reviewed commit: "feat(OUT-2898): show tasks assigned to c..." | Re-trigger Greptile |
| protected getClientOrCompanyAssigneeFilter(includeAssociatedTask: boolean = true): Prisma.TaskWhereInput { | ||
| protected async getClientOrCompanyAssigneeFilter(includeAssociatedTask: boolean = true): Promise<Prisma.TaskWhereInput> { | ||
| const clientId = z.string().uuid().safeParse(this.user.clientId).data | ||
| const companyId = z.string().uuid().parse(this.user.companyId) |
There was a problem hiding this comment.
Strict
parse(companyId) not patched alongside clientId
The PR explicitly fixed parse(clientId) → safeParse(clientId).data to handle the company-only auth context. The adjacent z.string().uuid().parse(this.user.companyId) is still strict: if the guard user.clientId || user.companyId fires with only clientId set (e.g., a client token that somehow lacks a companyId), this throws a raw ZodError (500) instead of a clean APIError. The same issue exists at the same line in comment.service.ts.
|
Deployment failed with the following error: Learn More: https://vercel.link/multiple-function-regions |
Summary
CommentServiceso comments stay aligned with task visibility (and fixed a latent strictparse(clientId)that would have thrown for any company-only auth context).copilot.getCompanyClientsis only called in the new IU-company-preview branch and the result is memoized per request to avoid duplicate calls.Context
Linear: OUT-2898
Today the company-details CRM view shows:
This PR adds:
3. Tasks assigned to clients within the company
4. IU tasks shared with those clients
Other flows (client preview, CU portal, normal IU listing) skip the new branch entirely, so they incur no extra I/O — only an
awaiton a synchronously resolved promise.Test plan
Testing
🤖 Generated with Claude Code