first commit
This commit is contained in:
57
libs/web/tracker/application/src/lib/events/issue.events.ts
Normal file
57
libs/web/tracker/application/src/lib/events/issue.events.ts
Normal file
@@ -0,0 +1,57 @@
|
||||
import { type } from '@ngrx/signals';
|
||||
import { eventGroup } from '@ngrx/signals/events';
|
||||
import {
|
||||
Activity,
|
||||
ChangeStatusInput,
|
||||
Comment,
|
||||
CommentChanged,
|
||||
Issue,
|
||||
LinkIssuesInput,
|
||||
UpdateIssueInput,
|
||||
} from '@task-stream/web/tracker/domain';
|
||||
|
||||
export const issuePageEvents = eventGroup({
|
||||
source: 'Issue Page',
|
||||
events: {
|
||||
opened: type<{ idOrKey: string }>(),
|
||||
statusChangeRequested: type<ChangeStatusInput>(),
|
||||
assignRequested: type<{ issueId: string; assigneeId: string | null }>(),
|
||||
updateRequested: type<UpdateIssueInput>(),
|
||||
linkRequested: type<LinkIssuesInput>(),
|
||||
/** Relate by the other ticket's key (e.g. BE-3), resolved to its id first. */
|
||||
linkByKeyRequested: type<{
|
||||
issueId: string;
|
||||
type: LinkIssuesInput['type'];
|
||||
targetKey: string;
|
||||
}>(),
|
||||
unlinkRequested: type<LinkIssuesInput>(),
|
||||
releaseChangeRequested: type<{
|
||||
issueId: string;
|
||||
releaseId: string | null;
|
||||
}>(),
|
||||
commentAddRequested: type<{ issueId: string; body: string }>(),
|
||||
commentEditRequested: type<{ commentId: string; body: string }>(),
|
||||
commentDeleteRequested: type<{ commentId: string }>(),
|
||||
},
|
||||
});
|
||||
|
||||
export const issueApiEvents = eventGroup({
|
||||
source: 'Issue API',
|
||||
events: {
|
||||
loaded: type<Issue>(),
|
||||
loadFailed: type<string>(),
|
||||
commentsLoaded: type<Comment[]>(),
|
||||
historyLoaded: type<Activity[]>(),
|
||||
commandSucceeded: type<string>(),
|
||||
commandFailed: type<string>(),
|
||||
},
|
||||
});
|
||||
|
||||
export const issueRealtimeEvents = eventGroup({
|
||||
source: 'Issue Realtime',
|
||||
events: {
|
||||
/** Something about this ticket changed: refetch it. */
|
||||
issueTouched: type<{ issueId: string; version: number }>(),
|
||||
commentChanged: type<CommentChanged>(),
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user