Files
task-stream/libs/web/tracker/application/src/lib/events/project.events.ts
Josep Piguillem f2001aca88 feat: formatted text, a list view, ticket details, public proposals and votes
Formatted text
- Descriptions, comments, replies and release notes render Markdown,
  sanitised with DOMPurify (tested against scripts, handlers and
  javascript: links). A pasted image is uploaded and written as
  ![name](attachment:<id>); the web fetches it with the reader's session,
  so it works on private projects. Every text box has a preview. The
  attachment upload now answers its attachmentId.

List view
- /p/:key/list: every ticket as rows, sortable by any column, filtered by
  text, open/closed, type, priority and assignee; status, priority and
  assignee change in place; bulk edit (the backlog's bar, now shared).

Ticket details
- Reactions on comments (GitHub's eight), for members and viewers.
- Duplicate a ticket: what it says, not where it stands.
- blockedBy: open tickets it waits for (BLOCKS / DEPENDS_ON), worked out
  when reading with one query per board or page; shown on cards, list
  rows and the ticket.

Public proposals
- A public project can take bug reports and ideas from anyone
  (acceptsProposals): POST /api/explore/projects/{project}/proposals and
  the form at /p/:key/proponer. They become tickets labelled «propuesta»,
  opened by TaskStream; a honeypot field and 5 per address every 15
  minutes keep spam out. No e-mail is asked: it would be public.

Votes
- Anyone signed in votes on a public project's tickets, members on a
  private one (voteIssue, PUT/DELETE /api/issues/{issue}/vote): votes and
  voted on each ticket, buttons on the ticket and the roadmap, a column
  in the list. The showcase carries votes and the open proposals.

MCP: vote_issue, duplicate_issue, react_to_comment; listings show
blockers and votes. Docs, Word and PDF updated; chat notifications
(Discord, Slack, Telegram) noted for later.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 21:36:11 +02:00

92 lines
2.9 KiB
TypeScript

import { type } from '@ngrx/signals';
import { eventGroup } from '@ngrx/signals/events';
import {
Activity,
CreateReleaseInput,
MemberInput,
Project,
ProjectAnalytics,
ProjectSettings,
ProjectStats,
Release,
ReleaseBurnup,
CreateSprintInput,
Sprint,
SprintBurndown,
UpdateSprintInput,
UserDirectoryEntry,
} from '@task-stream/web/tracker/domain';
export const projectPageEvents = eventGroup({
source: 'Project Page',
events: {
opened: type<{ idOrKey: string }>(),
memberAddRequested: type<MemberInput>(),
memberRoleChangeRequested: type<MemberInput>(),
memberRemoveRequested: type<{ projectId: string; userId: string }>(),
releaseCreateRequested: type<CreateReleaseInput>(),
releasePublishRequested: type<{ releaseId: string; force: boolean }>(),
releaseArchiveRequested: type<{ releaseId: string }>(),
releaseNotesWriteRequested: type<{
releaseId: string;
notes: string | null;
}>(),
sprintCreateRequested: type<CreateSprintInput>(),
sprintUpdateRequested: type<UpdateSprintInput>(),
sprintStartRequested: type<{ sprintId: string }>(),
sprintCloseRequested: type<{
sprintId: string;
carryOverTo: string | null;
}>(),
sprintDeleteRequested: type<{ sprintId: string }>(),
burndownRequested: type<{ sprintId: string }>(),
userSearchRequested: type<string>(),
settingsSaveRequested: type<{
projectId: string;
settings: ProjectSettings;
}>(),
analyticsRequested: type<{ projectId: string; days: number }>(),
burnupRequested: type<{ releaseId: string }>(),
visibilityChangeRequested: type<{ projectId: string; isPublic: boolean }>(),
proposalsChangeRequested: type<{
projectId: string;
acceptsProposals: boolean;
}>(),
deleteRequested: type<{ projectId: string; confirmKey: string }>(),
},
});
export const projectApiEvents = eventGroup({
source: 'Project API',
events: {
loaded: type<Project>(),
loadFailed: type<string>(),
statsLoaded: type<ProjectStats>(),
releasesLoaded: type<Release[]>(),
sprintsLoaded: type<Sprint[]>(),
burndownLoaded: type<SprintBurndown>(),
activityLoaded: type<Activity[]>(),
commandSucceeded: type<string>(),
commandFailed: type<string>(),
usersFound: type<UserDirectoryEntry[]>(),
analyticsLoaded: type<ProjectAnalytics>(),
analyticsFailed: type<string>(),
burnupLoaded: type<ReleaseBurnup>(),
settingsSaved: type<string>(),
/** I deleted the open project. */
deleted: type<string>(),
},
});
export const projectRealtimeEvents = eventGroup({
source: 'Project Realtime',
events: {
projectChanged: type<Project>(),
/** Someone else deleted the open project. */
projectDeleted: type<Project>(),
activityAdded: type<Activity>(),
releaseChanged: type<Release>(),
sprintChanged: type<{ sprintId: string }>(),
},
});