feat: per-project workflow settings, statistics and "my work" home
Per-project settings (owners/admins, «Configuración» tab):
- Statuses with category (TODO, IN_PROGRESS, QA, DONE, CANCELLED), colour and
"requires reason"; configurable transitions; ticket types (icon, colour) and
areas. Defaults are the previous fixed values; projects created before keep
them without migration.
- Values are archived, never deleted: tickets, history and statistics keep
referring to them. Validated in the domain (ProjectSettingsChangedEvent).
- Releases, board, tracking and "my work" use categories, so custom statuses
keep working. Status changes carry name/category metadata for history.
- GraphQL: status/type/area are strings (breaking for clients sending enum
literals); Project.settings, updateProjectSettings, statusCategory,
myIssues(categories). REST: PUT /projects/{project}/settings, category filters.
- Read model: statusCategory on issues (backfilled at startup).
Statistics («Estadísticas» tab):
- New issue_timeline projection; pure functions compute created vs resolved,
cumulative flow, cycle/lead time (avg + p85), throughput per person, QA
pass/fail and release burnup. GraphQL Project.analytics(days),
Release.burnup; REST /projects/{project}/analytics, /releases/{id}/burnup.
- Web: SVG charts with validated light/dark palette, crosshair tooltip,
keyboard navigation, legend and data table.
Home "Mi trabajo": my open tickets across projects grouped by category (QA
failures first), tickets waiting for QA, upcoming releases and "Ir a…".
Tests: domain/application specs, e2e scenario for settings and analytics,
facade tests. Docs, READMEs, schema.gql/openapi.json and Word/PDF updated.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -31,24 +31,20 @@ import {
|
||||
} from '@task-stream/web/tracker/application';
|
||||
import {
|
||||
Comment,
|
||||
IssueArea,
|
||||
IssueLink,
|
||||
IssueLinkType,
|
||||
IssuePriority,
|
||||
IssueStatus,
|
||||
REASON_REQUIRED,
|
||||
ReleaseStatus,
|
||||
} from '@task-stream/web/tracker/domain';
|
||||
import {
|
||||
AREA,
|
||||
clock,
|
||||
initials,
|
||||
LINK,
|
||||
options,
|
||||
PRIORITY,
|
||||
STATUS,
|
||||
TYPE,
|
||||
statusLook,
|
||||
timeAgo,
|
||||
typeLook,
|
||||
} from '../ui/copy';
|
||||
|
||||
const NONE = '';
|
||||
@@ -303,6 +299,14 @@ const NONE = '';
|
||||
>
|
||||
<pi-label>Release</pi-label>
|
||||
</pi-select-field>
|
||||
<pi-select-field
|
||||
[options]="typeOptions()"
|
||||
[disabled]="!project.canContribute()"
|
||||
[value]="issue.type"
|
||||
(valueChange)="update({ type: $any($event) })"
|
||||
>
|
||||
<pi-label>Tipo</pi-label>
|
||||
</pi-select-field>
|
||||
<pi-select-field
|
||||
[options]="priorityOptions"
|
||||
[disabled]="!project.canContribute()"
|
||||
@@ -312,7 +316,7 @@ const NONE = '';
|
||||
<pi-label>Prioridad</pi-label>
|
||||
</pi-select-field>
|
||||
<pi-select-field
|
||||
[options]="areaOptions"
|
||||
[options]="areaOptions()"
|
||||
[disabled]="!project.canContribute()"
|
||||
[value]="issue.area ?? ''"
|
||||
(valueChange)="update({ area: $any($event || null) })"
|
||||
@@ -439,11 +443,11 @@ export class IssuePage {
|
||||
private readonly commentEditForm =
|
||||
viewChild.required<TemplateRef<unknown>>('commentEditForm');
|
||||
|
||||
protected readonly type = computed(
|
||||
() => TYPE[this.facade.issue()?.type ?? 'TASK'],
|
||||
protected readonly type = computed(() =>
|
||||
typeLook(this.project.workflow(), this.facade.issue()?.type ?? ''),
|
||||
);
|
||||
protected readonly status = computed(
|
||||
() => STATUS[this.facade.issue()?.status ?? IssueStatus.BACKLOG],
|
||||
protected readonly status = computed(() =>
|
||||
statusLook(this.project.workflow(), this.facade.issue()?.status ?? ''),
|
||||
);
|
||||
protected readonly ago = timeAgo;
|
||||
|
||||
@@ -469,10 +473,28 @@ export class IssuePage {
|
||||
],
|
||||
);
|
||||
protected readonly priorityOptions = options(PRIORITY);
|
||||
protected readonly areaOptions: PiSelectFieldOption<string>[] = [
|
||||
{ value: NONE, label: 'Sin área' },
|
||||
...options(AREA),
|
||||
];
|
||||
/** Active values, plus the ticket's own even if archived since. */
|
||||
protected readonly typeOptions = computed<PiSelectFieldOption<string>[]>(
|
||||
() => {
|
||||
const workflow = this.project.workflow();
|
||||
const current = this.facade.issue()?.type;
|
||||
return workflow.settings.issueTypes
|
||||
.filter((t) => !t.archived || t.id === current)
|
||||
.map((t) => ({ value: t.id, label: t.name }));
|
||||
},
|
||||
);
|
||||
protected readonly areaOptions = computed<PiSelectFieldOption<string>[]>(
|
||||
() => {
|
||||
const workflow = this.project.workflow();
|
||||
const current = this.facade.issue()?.area;
|
||||
return [
|
||||
{ value: NONE, label: 'Sin área' },
|
||||
...workflow.settings.areas
|
||||
.filter((a) => !a.archived || a.id === current)
|
||||
.map((a) => ({ value: a.id, label: a.name })),
|
||||
];
|
||||
},
|
||||
);
|
||||
protected readonly linkTypeOptions = (
|
||||
Object.keys(LINK) as IssueLinkType[]
|
||||
).map((value) => ({
|
||||
@@ -485,7 +507,7 @@ export class IssuePage {
|
||||
protected readonly linkTarget = signal('');
|
||||
protected readonly commentBody = signal('');
|
||||
|
||||
private pendingStatus: IssueStatus | null = null;
|
||||
private pendingStatus: string | null = null;
|
||||
private readonly reasonModel = signal({ text: '' });
|
||||
protected readonly reason = form(this.reasonModel, (p) => required(p.text));
|
||||
|
||||
@@ -507,8 +529,10 @@ export class IssuePage {
|
||||
effect(() => this.facade.open(this.issueKey()));
|
||||
}
|
||||
|
||||
protected statusLabel = (status: IssueStatus) => STATUS[status].label;
|
||||
protected statusTone = (status: IssueStatus) => STATUS[status].tone;
|
||||
protected statusLabel = (status: string) =>
|
||||
statusLook(this.project.workflow(), status).label;
|
||||
protected statusTone = (status: string) =>
|
||||
statusLook(this.project.workflow(), status).tone;
|
||||
protected readonly initialsOf = initials;
|
||||
protected readonly clock = clock;
|
||||
protected linkLabel = (link: IssueLink) =>
|
||||
@@ -516,11 +540,11 @@ export class IssuePage {
|
||||
? LINK[link.type].outward
|
||||
: LINK[link.type].inward;
|
||||
|
||||
protected move(to: IssueStatus): void {
|
||||
if (REASON_REQUIRED.includes(to)) {
|
||||
protected move(to: string): void {
|
||||
if (this.project.workflow().requiresReason(to)) {
|
||||
this.pendingStatus = to;
|
||||
this.reasonModel.set({ text: '' });
|
||||
this.drawer.open(`Mover a «${STATUS[to].label}»`, this.reasonForm());
|
||||
this.drawer.open(`Mover a «${this.statusLabel(to)}»`, this.reasonForm());
|
||||
return;
|
||||
}
|
||||
this.facade.changeStatus(to);
|
||||
@@ -542,8 +566,9 @@ export class IssuePage {
|
||||
}
|
||||
|
||||
protected update(changes: {
|
||||
type?: string;
|
||||
priority?: IssuePriority;
|
||||
area?: IssueArea | null;
|
||||
area?: string | null;
|
||||
}): void {
|
||||
this.facade.update(changes);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user