@design.estate/dees-catalog 21.46.0 → 21.47.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist_bundle/bundle.js +825 -259
- package/dist_bundle/bundle.js.map +1 -1
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-FCUX4QGD.js → chunk-Q5VY4AV7.js} +3 -3
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-LWT7IIPZ.js → chunk-QG5BHDQO.js} +2 -2
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-VJVZHESI.js → chunk-UPDBEHU2.js} +16 -3
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-VJVZHESI.js.map → chunk-UPDBEHU2.js.map} +1 -1
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{de-7PGZC4IF.js → de-E2CUVVOP.js} +16 -3
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/de-E2CUVVOP.js.map +1 -0
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{dees-modal-VOIWY235.js → dees-modal-YOGT7PSU.js} +3 -3
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{dees-workspace-terminal-EJRHSZ5F.js → dees-workspace-terminal-ORLONA36.js} +4 -4
- package/dist_ts_web/00_commitinfo_data.js +1 -1
- package/dist_ts_web/elements/00group-dataview/dees-table/dees-table.d.ts +24 -7
- package/dist_ts_web/elements/00group-dataview/dees-table/dees-table.js +53 -18
- package/dist_ts_web/elements/00group-dataview/dees-thread/dees-thread.d.ts +9 -1
- package/dist_ts_web/elements/00group-dataview/dees-thread/dees-thread.js +42 -5
- package/dist_ts_web/elements/00group-dataview/dees-thread/interfaces.d.ts +11 -0
- package/dist_ts_web/elements/00group-harness/dees-harness-question-card/dees-harness-question-card.d.ts +30 -8
- package/dist_ts_web/elements/00group-harness/dees-harness-question-card/dees-harness-question-card.js +95 -24
- package/dist_ts_web/elements/00group-harness/interfaces.d.ts +14 -3
- package/dist_ts_web/elements/00group-kanban/dees-kanban/dees-kanban.d.ts +17 -5
- package/dist_ts_web/elements/00group-kanban/dees-kanban/dees-kanban.demo.js +6 -2
- package/dist_ts_web/elements/00group-kanban/dees-kanban/dees-kanban.js +76 -20
- package/dist_ts_web/elements/00group-kanban/dees-kanban-activity/dees-kanban-activity.js +3 -1
- package/dist_ts_web/elements/00group-kanban/dees-kanban-card/dees-kanban-card.d.ts +3 -1
- package/dist_ts_web/elements/00group-kanban/dees-kanban-card/dees-kanban-card.js +17 -3
- package/dist_ts_web/elements/00group-kanban/dees-kanban-column/dees-kanban-column.d.ts +3 -1
- package/dist_ts_web/elements/00group-kanban/dees-kanban-column/dees-kanban-column.js +12 -2
- package/dist_ts_web/elements/00group-kanban/dees-kanban-discussion/dees-kanban-discussion.d.ts +41 -5
- package/dist_ts_web/elements/00group-kanban/dees-kanban-discussion/dees-kanban-discussion.js +196 -20
- package/dist_ts_web/elements/00group-kanban/dees-kanban-ticket-detail/dees-kanban-ticket-detail.d.ts +25 -2
- package/dist_ts_web/elements/00group-kanban/dees-kanban-ticket-detail/dees-kanban-ticket-detail.js +137 -8
- package/dist_ts_web/elements/00group-kanban/index.d.ts +1 -0
- package/dist_ts_web/elements/00group-kanban/index.js +2 -1
- package/dist_ts_web/elements/00group-kanban/interfaces.d.ts +96 -3
- package/dist_ts_web/elements/00group-kanban/kanban.demodata.js +119 -3
- package/dist_ts_web/elements/00group-kanban/kanban.helpers.d.ts +19 -1
- package/dist_ts_web/elements/00group-kanban/kanban.helpers.js +50 -1
- package/dist_ts_web/elements/00group-kanban/kanban.styles.js +32 -1
- package/dist_ts_web/i18n/de.d.ts +53 -1
- package/dist_ts_web/i18n/de.js +15 -2
- package/dist_ts_web/i18n/messages.d.ts +53 -1
- package/dist_ts_web/i18n/messages.js +15 -2
- package/package.json +1 -1
- package/readme.md +58 -19
- package/ts_web/00_commitinfo_data.ts +1 -1
- package/ts_web/elements/00group-dataview/dees-table/dees-table.ts +54 -17
- package/ts_web/elements/00group-dataview/dees-thread/dees-thread.ts +39 -4
- package/ts_web/elements/00group-dataview/dees-thread/interfaces.ts +11 -0
- package/ts_web/elements/00group-harness/dees-harness-question-card/dees-harness-question-card.ts +83 -21
- package/ts_web/elements/00group-harness/interfaces.ts +14 -3
- package/ts_web/elements/00group-kanban/dees-kanban/dees-kanban.demo.ts +5 -1
- package/ts_web/elements/00group-kanban/dees-kanban/dees-kanban.ts +82 -23
- package/ts_web/elements/00group-kanban/dees-kanban-activity/dees-kanban-activity.ts +2 -0
- package/ts_web/elements/00group-kanban/dees-kanban-card/dees-kanban-card.ts +11 -2
- package/ts_web/elements/00group-kanban/dees-kanban-column/dees-kanban-column.ts +6 -1
- package/ts_web/elements/00group-kanban/dees-kanban-discussion/dees-kanban-discussion.ts +199 -21
- package/ts_web/elements/00group-kanban/dees-kanban-ticket-detail/dees-kanban-ticket-detail.ts +144 -6
- package/ts_web/elements/00group-kanban/index.ts +1 -0
- package/ts_web/elements/00group-kanban/interfaces.ts +101 -4
- package/ts_web/elements/00group-kanban/kanban.demodata.ts +126 -2
- package/ts_web/elements/00group-kanban/kanban.helpers.ts +70 -0
- package/ts_web/elements/00group-kanban/kanban.styles.ts +31 -0
- package/ts_web/i18n/de.ts +14 -1
- package/ts_web/i18n/messages.ts +14 -1
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/de-7PGZC4IF.js.map +0 -1
- /package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-FCUX4QGD.js.map → chunk-Q5VY4AV7.js.map} +0 -0
- /package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-LWT7IIPZ.js.map → chunk-QG5BHDQO.js.map} +0 -0
- /package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{dees-modal-VOIWY235.js.map → dees-modal-YOGT7PSU.js.map} +0 -0
- /package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{dees-workspace-terminal-EJRHSZ5F.js.map → dees-workspace-terminal-ORLONA36.js.map} +0 -0
|
@@ -58,6 +58,11 @@ export interface IKanbanTicket {
|
|
|
58
58
|
priority?: TKanbanPriority;
|
|
59
59
|
assignee?: IKanbanPerson;
|
|
60
60
|
labels?: string[];
|
|
61
|
+
/**
|
|
62
|
+
* Labels the host derives from the ticket's state and sets itself, such as `openQuestion` while a
|
|
63
|
+
* question on it waits for an answer: shown beside the labels, never edited, filtered apart.
|
|
64
|
+
*/
|
|
65
|
+
autoLabels?: string[];
|
|
61
66
|
/** The `id` of the project the ticket belongs to (`IKanbanProject`). */
|
|
62
67
|
project?: string;
|
|
63
68
|
links?: TKanbanLink[];
|
|
@@ -69,10 +74,22 @@ export interface IKanbanTicket {
|
|
|
69
74
|
updatedBy?: IKanbanPerson;
|
|
70
75
|
/** The ticket's server revision, advanced by every change to it. */
|
|
71
76
|
revision?: number;
|
|
72
|
-
/**
|
|
73
|
-
|
|
77
|
+
/**
|
|
78
|
+
* UI capabilities; the provider must enforce authorization independently. `ask` offers asking a
|
|
79
|
+
* question from the composer, `answer` lets the reader answer the ticket's questions.
|
|
80
|
+
*/
|
|
81
|
+
permissions?: {
|
|
82
|
+
edit?: boolean;
|
|
83
|
+
move?: boolean;
|
|
84
|
+
comment?: boolean;
|
|
85
|
+
createChild?: boolean;
|
|
86
|
+
ask?: boolean;
|
|
87
|
+
answer?: boolean;
|
|
88
|
+
};
|
|
74
89
|
}
|
|
75
90
|
export interface IKanbanComment {
|
|
91
|
+
/** Tells a comment from a question in a ticket's discussion; unset means a comment. */
|
|
92
|
+
kind?: 'comment';
|
|
76
93
|
id: string;
|
|
77
94
|
ticketId: string;
|
|
78
95
|
author: IKanbanPerson;
|
|
@@ -80,13 +97,79 @@ export interface IKanbanComment {
|
|
|
80
97
|
createdAt: string;
|
|
81
98
|
body: TReferenceContent;
|
|
82
99
|
}
|
|
100
|
+
/** A choice a ticket's question offers. */
|
|
101
|
+
export interface IKanbanQuestionOption {
|
|
102
|
+
/** Names the option in an answer's `choices`. */
|
|
103
|
+
id: string;
|
|
104
|
+
label: string;
|
|
105
|
+
description?: string;
|
|
106
|
+
}
|
|
107
|
+
/** The answer a ticket's question was given. */
|
|
108
|
+
export interface IKanbanQuestionAnswer {
|
|
109
|
+
/** The chosen options' ids, in the order the question lists them; empty for an answer in words only. */
|
|
110
|
+
choices: string[];
|
|
111
|
+
/** The answer in the person's own words. */
|
|
112
|
+
text?: string;
|
|
113
|
+
answeredBy: IKanbanPerson;
|
|
114
|
+
/** ISO 8601 timestamp. */
|
|
115
|
+
answeredAt: string;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* A question asked on a ticket, in its discussion, such as an agent working it asking the owner:
|
|
119
|
+
* shown as a question card the reader answers by its options, in their own words, or both. Without
|
|
120
|
+
* `answer` it waits for one.
|
|
121
|
+
*/
|
|
122
|
+
export interface IKanbanQuestion {
|
|
123
|
+
kind: 'question';
|
|
124
|
+
id: string;
|
|
125
|
+
ticketId: string;
|
|
126
|
+
/** Who asked. */
|
|
127
|
+
author: IKanbanPerson;
|
|
128
|
+
/** ISO 8601 timestamp. */
|
|
129
|
+
createdAt: string;
|
|
130
|
+
/** Markdown, as the composer writes it; the card shows it as text, a linked ticket by its label. */
|
|
131
|
+
question: string;
|
|
132
|
+
/** The choices; none, the question takes an answer in words only. */
|
|
133
|
+
options?: IKanbanQuestionOption[];
|
|
134
|
+
/** More than one option may be chosen. */
|
|
135
|
+
multiSelect?: boolean;
|
|
136
|
+
/** The reader may answer in their own words; `true` when unset. */
|
|
137
|
+
allowCustom?: boolean;
|
|
138
|
+
answer?: IKanbanQuestionAnswer;
|
|
139
|
+
}
|
|
140
|
+
/** An item of a ticket's discussion: a comment or a question, told apart by `kind`. */
|
|
141
|
+
export type TKanbanDiscussionItem = IKanbanComment | IKanbanQuestion;
|
|
142
|
+
/** What the person answered a question with, as the provider's `answerQuestion` receives it. */
|
|
143
|
+
export interface IKanbanQuestionAnswerInput {
|
|
144
|
+
ticketId: string;
|
|
145
|
+
questionId: string;
|
|
146
|
+
/** The chosen options' ids, in the order the question lists them. */
|
|
147
|
+
choices: string[];
|
|
148
|
+
/** The answer in the person's own words, when they wrote any. */
|
|
149
|
+
text?: string;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* A label the host sets on tickets itself (`IKanbanTicket.autoLabels`): its `label` as tickets
|
|
153
|
+
* carry it, and what the board shows for it ("Open question") and says of it in its tooltip.
|
|
154
|
+
*/
|
|
155
|
+
export interface IKanbanAutoLabel {
|
|
156
|
+
label: string;
|
|
157
|
+
name?: string;
|
|
158
|
+
description?: string;
|
|
159
|
+
/** A Lucide icon before its name; a sparkle when unset. */
|
|
160
|
+
iconName?: string;
|
|
161
|
+
/** `warning` outlines it in the warning colour, for a label that asks for someone; `neutral` when unset. */
|
|
162
|
+
tone?: 'neutral' | 'warning';
|
|
163
|
+
}
|
|
83
164
|
export type TKanbanActivityAction =
|
|
84
165
|
| 'created'
|
|
85
166
|
| 'updated'
|
|
86
167
|
| 'moved'
|
|
87
168
|
| 'reordered'
|
|
88
169
|
| 'commented'
|
|
89
|
-
| 'linked'
|
|
170
|
+
| 'linked'
|
|
171
|
+
| 'asked'
|
|
172
|
+
| 'answered';
|
|
90
173
|
/** One entry of a ticket's history. */
|
|
91
174
|
export interface IKanbanActivity {
|
|
92
175
|
id: string;
|
|
@@ -180,6 +263,8 @@ export interface IKanbanFilterValues {
|
|
|
180
263
|
/** A person's `id`; `'none'` for unassigned tasks. */
|
|
181
264
|
assignee?: string;
|
|
182
265
|
label?: string;
|
|
266
|
+
/** A label the host sets itself (`IKanbanTicket.autoLabels`), such as `openQuestion`. */
|
|
267
|
+
autoLabel?: string;
|
|
183
268
|
/** An epic's ticket `id`. */
|
|
184
269
|
epic?: string;
|
|
185
270
|
/** Only tasks assigned to `currentPersonId`. */
|
|
@@ -196,12 +281,24 @@ export interface IKanbanBoardSnapshot {
|
|
|
196
281
|
export interface IKanbanProvider {
|
|
197
282
|
getTicket?: (id: string, signal: AbortSignal) => Promise<IKanbanTicket>;
|
|
198
283
|
searchTickets?: (query: string, signal: AbortSignal) => Promise<IKanbanTicket[]>;
|
|
199
|
-
|
|
284
|
+
/** A ticket's discussion: its comments and, for a host with questions, its questions. */
|
|
285
|
+
loadComments?: (ticketId: string, signal: AbortSignal) => Promise<TKanbanDiscussionItem[]>;
|
|
200
286
|
/** A ticket's history, oldest first. Without it the detail shows no history. */
|
|
201
287
|
loadActivity?: (ticketId: string, signal: AbortSignal) => Promise<IKanbanActivity[]>;
|
|
202
288
|
/** The whole board again, for `refresh()`. */
|
|
203
289
|
loadBoard?: (signal: AbortSignal) => Promise<IKanbanBoardSnapshot>;
|
|
204
290
|
addComment?: (input: { ticketId: string; body: TReferenceContent }) => Promise<IKanbanComment>;
|
|
291
|
+
/**
|
|
292
|
+
* Asks the composer's text, in Markdown, as a question on the ticket, answered in words; resolves
|
|
293
|
+
* to the question the server saved. A rejection's message shows under the composer, which keeps
|
|
294
|
+
* the text.
|
|
295
|
+
*/
|
|
296
|
+
askQuestion?: (input: { ticketId: string; question: string }) => Promise<IKanbanQuestion>;
|
|
297
|
+
/**
|
|
298
|
+
* Saves the person's answer to a question; resolves to the question with its `answer`. A
|
|
299
|
+
* rejection's message shows on the question, which waits for an answer again.
|
|
300
|
+
*/
|
|
301
|
+
answerQuestion?: (input: IKanbanQuestionAnswerInput) => Promise<IKanbanQuestion>;
|
|
205
302
|
/**
|
|
206
303
|
* `expectedRevision` is the ticket's `revision` the edit started from; a provider that checks it
|
|
207
304
|
* refuses a stale edit with an `IKanbanRevisionConflict`.
|
|
@@ -5,9 +5,11 @@ import type {
|
|
|
5
5
|
IKanbanPerson,
|
|
6
6
|
IKanbanProject,
|
|
7
7
|
IKanbanProvider,
|
|
8
|
+
IKanbanQuestion,
|
|
8
9
|
IKanbanTicket,
|
|
9
10
|
TKanbanActivityAction,
|
|
10
11
|
} from './interfaces.js';
|
|
12
|
+
import { kanbanOpenQuestionLabel } from './kanban.helpers.js';
|
|
11
13
|
|
|
12
14
|
export const kanbanDemoPeople: IKanbanPerson[] = [
|
|
13
15
|
{ id: 'mara', name: 'Mara Chen' },
|
|
@@ -64,6 +66,9 @@ export interface IKanbanDemo {
|
|
|
64
66
|
actAs: (person: IKanbanPerson) => void;
|
|
65
67
|
}
|
|
66
68
|
|
|
69
|
+
/** Refuses an answer the way a server does, with its `code`. */
|
|
70
|
+
const refusal = (code: string, message: string): Error => Object.assign(new Error(message), { code });
|
|
71
|
+
|
|
67
72
|
/** Shipped tasks, one release each, the newest last. */
|
|
68
73
|
const releasedTickets = (): IKanbanTicket[] =>
|
|
69
74
|
[
|
|
@@ -378,7 +383,50 @@ export const createKanbanDemo = (options: IKanbanDemoOptions = {}): IKanbanDemo
|
|
|
378
383
|
...options.released ? releasedTickets() : [],
|
|
379
384
|
...options.workflow ? workflowTickets() : [],
|
|
380
385
|
];
|
|
381
|
-
|
|
386
|
+
// Alex, who works CAT-103, asks Mara: one question she answered, one that waits for her.
|
|
387
|
+
let questions: IKanbanQuestion[] = [
|
|
388
|
+
{
|
|
389
|
+
kind: 'question',
|
|
390
|
+
id: 'Q1',
|
|
391
|
+
ticketId: 'task-3',
|
|
392
|
+
author: alex,
|
|
393
|
+
createdAt: '2026-09-16T10:20:00Z',
|
|
394
|
+
question: 'Should the arrow keys move a focused card between columns as well?',
|
|
395
|
+
options: [
|
|
396
|
+
{ id: '1', label: 'Within its column only' },
|
|
397
|
+
{ id: '2', label: 'Between columns too', description: 'Left and right change the column.' },
|
|
398
|
+
],
|
|
399
|
+
multiSelect: false,
|
|
400
|
+
allowCustom: true,
|
|
401
|
+
answer: {
|
|
402
|
+
choices: ['2'],
|
|
403
|
+
text: 'Up and down stay in the column.',
|
|
404
|
+
answeredBy: mara,
|
|
405
|
+
answeredAt: '2026-09-16T10:48:00Z',
|
|
406
|
+
},
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
kind: 'question',
|
|
410
|
+
id: 'Q2',
|
|
411
|
+
ticketId: 'task-3',
|
|
412
|
+
author: alex,
|
|
413
|
+
createdAt: '2026-09-16T11:05:00Z',
|
|
414
|
+
question: 'Which keys should open the focused card?',
|
|
415
|
+
options: [
|
|
416
|
+
{ id: '1', label: 'Enter' },
|
|
417
|
+
{ id: '2', label: 'Space' },
|
|
418
|
+
{ id: '3', label: 'O', description: 'As in the list views.' },
|
|
419
|
+
],
|
|
420
|
+
multiSelect: true,
|
|
421
|
+
allowCustom: true,
|
|
422
|
+
},
|
|
423
|
+
];
|
|
424
|
+
/** The ticket with the AutoLabels the server derives: `openQuestion` while a question on it waits. */
|
|
425
|
+
const labelled = ({ autoLabels: _, ...ticket }: IKanbanTicket): IKanbanTicket =>
|
|
426
|
+
questions.some(question => question.ticketId === ticket.id && !question.answer)
|
|
427
|
+
? { ...ticket, autoLabels: [kanbanOpenQuestionLabel] }
|
|
428
|
+
: ticket;
|
|
429
|
+
let tickets = seeded.map(ticket => revised(labelled(ticket)));
|
|
382
430
|
let comments: IKanbanComment[] = [
|
|
383
431
|
{
|
|
384
432
|
id: 'comment-1',
|
|
@@ -465,6 +513,27 @@ export const createKanbanDemo = (options: IKanbanDemoOptions = {}): IKanbanDemo
|
|
|
465
513
|
createdAt: '2026-09-18T09:42:00Z',
|
|
466
514
|
action: 'commented',
|
|
467
515
|
},
|
|
516
|
+
{
|
|
517
|
+
id: 'activity-7',
|
|
518
|
+
ticketId: 'task-3',
|
|
519
|
+
actor: alex,
|
|
520
|
+
createdAt: '2026-09-16T10:20:00Z',
|
|
521
|
+
action: 'asked',
|
|
522
|
+
},
|
|
523
|
+
{
|
|
524
|
+
id: 'activity-8',
|
|
525
|
+
ticketId: 'task-3',
|
|
526
|
+
actor: mara,
|
|
527
|
+
createdAt: '2026-09-16T10:48:00Z',
|
|
528
|
+
action: 'answered',
|
|
529
|
+
},
|
|
530
|
+
{
|
|
531
|
+
id: 'activity-9',
|
|
532
|
+
ticketId: 'task-3',
|
|
533
|
+
actor: alex,
|
|
534
|
+
createdAt: '2026-09-16T11:05:00Z',
|
|
535
|
+
action: 'asked',
|
|
536
|
+
},
|
|
468
537
|
];
|
|
469
538
|
let nextKey = 300;
|
|
470
539
|
let revision = 1;
|
|
@@ -483,6 +552,12 @@ export const createKanbanDemo = (options: IKanbanDemoOptions = {}): IKanbanDemo
|
|
|
483
552
|
revision++;
|
|
484
553
|
return createdAt;
|
|
485
554
|
};
|
|
555
|
+
/** Saves a question as asked or answered: the ticket's next revision carries its AutoLabels. */
|
|
556
|
+
const saveQuestion = (question: IKanbanQuestion): IKanbanQuestion => {
|
|
557
|
+
questions = [...questions.filter(other => other.id !== question.id), question];
|
|
558
|
+
tickets = tickets.map(ticket => ticket.id === question.ticketId ? revised(labelled(ticket)) : ticket);
|
|
559
|
+
return question;
|
|
560
|
+
};
|
|
486
561
|
// Demo-only in-memory provider. Applications persist through their own authorized APIs.
|
|
487
562
|
const provider: IKanbanProvider = {
|
|
488
563
|
getTicket: async id => {
|
|
@@ -494,7 +569,10 @@ export const createKanbanDemo = (options: IKanbanDemoOptions = {}): IKanbanDemo
|
|
|
494
569
|
tickets.filter(ticket =>
|
|
495
570
|
`${ticket.key} ${ticket.title}`.toLowerCase().includes(query.toLowerCase()),
|
|
496
571
|
),
|
|
497
|
-
loadComments: async id =>
|
|
572
|
+
loadComments: async id =>
|
|
573
|
+
[...comments, ...questions]
|
|
574
|
+
.filter(item => item.ticketId === id)
|
|
575
|
+
.sort((a, b) => a.createdAt.localeCompare(b.createdAt)),
|
|
498
576
|
loadActivity: async id => activity.filter(entry => entry.ticketId === id),
|
|
499
577
|
loadBoard: async () => ({ tickets, revision }),
|
|
500
578
|
addComment: async input => {
|
|
@@ -508,6 +586,52 @@ export const createKanbanDemo = (options: IKanbanDemoOptions = {}): IKanbanDemo
|
|
|
508
586
|
record(input.ticketId, 'commented');
|
|
509
587
|
return comment;
|
|
510
588
|
},
|
|
589
|
+
askQuestion: async ({ ticketId, question }) => {
|
|
590
|
+
return saveQuestion({
|
|
591
|
+
kind: 'question',
|
|
592
|
+
id: `Q${questions.length + 1}`,
|
|
593
|
+
ticketId,
|
|
594
|
+
author: actor,
|
|
595
|
+
createdAt: record(ticketId, 'asked'),
|
|
596
|
+
question,
|
|
597
|
+
options: [],
|
|
598
|
+
multiSelect: false,
|
|
599
|
+
allowCustom: true,
|
|
600
|
+
});
|
|
601
|
+
},
|
|
602
|
+
// Like a server: one answer per question, an identical second one changes nothing.
|
|
603
|
+
answerQuestion: async ({ ticketId, questionId, choices, text }) => {
|
|
604
|
+
const question = questions.find(item => item.id === questionId && item.ticketId === ticketId);
|
|
605
|
+
if (!question) throw refusal('ticket_question_not_found', 'This question is no longer on the ticket.');
|
|
606
|
+
const options = question.options ?? [];
|
|
607
|
+
const ordered = options.filter(option => choices.includes(option.id)).map(option => option.id);
|
|
608
|
+
const words = text?.trim() || undefined;
|
|
609
|
+
if (question.answer) {
|
|
610
|
+
if (JSON.stringify([question.answer.choices, question.answer.text]) === JSON.stringify([ordered, words]))
|
|
611
|
+
return question;
|
|
612
|
+
throw refusal(
|
|
613
|
+
'ticket_question_answered',
|
|
614
|
+
`${question.answer.answeredBy.name} answered this question already. Ask a new one to change course.`,
|
|
615
|
+
);
|
|
616
|
+
}
|
|
617
|
+
// An unknown or repeated option, two for a single choice, words where none are taken, or nothing.
|
|
618
|
+
if (
|
|
619
|
+
ordered.length !== choices.length ||
|
|
620
|
+
(!question.multiSelect && ordered.length > 1) ||
|
|
621
|
+
(words && question.allowCustom === false) ||
|
|
622
|
+
(!ordered.length && !words)
|
|
623
|
+
)
|
|
624
|
+
throw refusal('ticket_answer_invalid', 'This answer does not fit the question.');
|
|
625
|
+
return saveQuestion({
|
|
626
|
+
...question,
|
|
627
|
+
answer: {
|
|
628
|
+
choices: ordered,
|
|
629
|
+
...words ? { text: words } : {},
|
|
630
|
+
answeredBy: actor,
|
|
631
|
+
answeredAt: record(ticketId, 'answered'),
|
|
632
|
+
},
|
|
633
|
+
});
|
|
634
|
+
},
|
|
511
635
|
updateTicket: async ({ ticketId, changes, expectedRevision }) => {
|
|
512
636
|
const previous = tickets.find(ticket => ticket.id === ticketId)!;
|
|
513
637
|
// A server refuses an edit that started from an older revision, so it cannot undo a teammate's.
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import type {
|
|
2
|
+
IKanbanAutoLabel,
|
|
2
3
|
IKanbanEditConflict,
|
|
3
4
|
IKanbanProject,
|
|
5
|
+
IKanbanQuestion,
|
|
4
6
|
IKanbanRevisionConflict,
|
|
5
7
|
IKanbanTicket,
|
|
6
8
|
IKanbanTicketDraft,
|
|
9
|
+
TKanbanDiscussionItem,
|
|
7
10
|
TKanbanDraftField,
|
|
8
11
|
TKanbanLink,
|
|
9
12
|
TKanbanPriority,
|
|
10
13
|
} from './interfaces.js';
|
|
11
14
|
import type { TDcLocalizer } from '../../i18n/messages.js';
|
|
15
|
+
import { html, type TemplateResult } from '@design.estate/dees-element';
|
|
12
16
|
|
|
13
17
|
export const kanbanInitials = (name: string): string =>
|
|
14
18
|
name.trim().split(/\s+/).map(part => part[0]).join('').slice(0, 2);
|
|
@@ -162,3 +166,69 @@ export const kanbanEvent = <T>(owner: HTMLElement, name: string, detail: T): voi
|
|
|
162
166
|
|
|
163
167
|
export const kanbanError = (error: unknown): string =>
|
|
164
168
|
error instanceof Error ? error.message : String(error);
|
|
169
|
+
|
|
170
|
+
export const isKanbanQuestion = (item: TKanbanDiscussionItem): item is IKanbanQuestion =>
|
|
171
|
+
item.kind === 'question';
|
|
172
|
+
|
|
173
|
+
/** A discussion item's key, its kind with its id: a comment and a question may share an id. */
|
|
174
|
+
export const kanbanItemKey = (item: TKanbanDiscussionItem): string =>
|
|
175
|
+
`${item.kind ?? 'comment'}:${item.id}`;
|
|
176
|
+
|
|
177
|
+
/** The board's own AutoLabel: a question on the ticket waits for an answer. */
|
|
178
|
+
export const kanbanOpenQuestionLabel = 'openQuestion';
|
|
179
|
+
|
|
180
|
+
/** An AutoLabel as the board shows it, its name and icon always set. */
|
|
181
|
+
export type TKanbanAutoLabelView = Required<Pick<IKanbanAutoLabel, 'label' | 'name' | 'iconName' | 'tone'>> &
|
|
182
|
+
Pick<IKanbanAutoLabel, 'description'>;
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* An AutoLabel as the board shows it: the host's definition, else the board's own for
|
|
186
|
+
* `openQuestion`, else the label itself with a sparkle.
|
|
187
|
+
*/
|
|
188
|
+
export const kanbanAutoLabel = (
|
|
189
|
+
t: TDcLocalizer,
|
|
190
|
+
definitions: readonly IKanbanAutoLabel[],
|
|
191
|
+
label: string,
|
|
192
|
+
): TKanbanAutoLabelView => {
|
|
193
|
+
const own: IKanbanAutoLabel | undefined = label === kanbanOpenQuestionLabel
|
|
194
|
+
? {
|
|
195
|
+
label,
|
|
196
|
+
name: t('kanban.autoLabelOpenQuestion'),
|
|
197
|
+
description: t('kanban.autoLabelOpenQuestionDescription'),
|
|
198
|
+
iconName: 'lucide:MessageCircleQuestionMark',
|
|
199
|
+
tone: 'warning',
|
|
200
|
+
}
|
|
201
|
+
: undefined;
|
|
202
|
+
const host = definitions.find(item => item.label === label);
|
|
203
|
+
// A key the host's definition leaves out, or sets to undefined, keeps the board's own.
|
|
204
|
+
const value = <K extends keyof IKanbanAutoLabel>(key: K) => host?.[key] ?? own?.[key];
|
|
205
|
+
return {
|
|
206
|
+
label,
|
|
207
|
+
name: value('name') || label,
|
|
208
|
+
description: value('description'),
|
|
209
|
+
iconName: value('iconName') || 'lucide:Sparkles',
|
|
210
|
+
tone: value('tone') ?? 'neutral',
|
|
211
|
+
};
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* A ticket's AutoLabels as chips, outlined where its labels are filled and listed apart from them,
|
|
216
|
+
* for assistive technology as well; nothing without any. Each chip says what it means in its tooltip.
|
|
217
|
+
*/
|
|
218
|
+
export const renderKanbanAutoLabels = (
|
|
219
|
+
t: TDcLocalizer,
|
|
220
|
+
definitions: readonly IKanbanAutoLabel[],
|
|
221
|
+
labels: readonly string[] | undefined,
|
|
222
|
+
): TemplateResult | '' => {
|
|
223
|
+
if (!labels?.length) return '';
|
|
224
|
+
return html`<span class="auto-labels" role="list" aria-label=${t('kanban.autoLabels')}>${labels.map(label => {
|
|
225
|
+
const view = kanbanAutoLabel(t, definitions, label);
|
|
226
|
+
return html`<span
|
|
227
|
+
class="badge auto ${view.tone}"
|
|
228
|
+
role="listitem"
|
|
229
|
+
data-auto-label=${label}
|
|
230
|
+
title=${view.description ?? view.name}
|
|
231
|
+
><dees-icon .icon=${view.iconName} iconSize="12" aria-hidden="true"></dees-icon><span class="badge-text"
|
|
232
|
+
>${view.name}</span></span>`;
|
|
233
|
+
})}</span>`;
|
|
234
|
+
};
|
|
@@ -90,6 +90,37 @@ export const kanbanStyles = [
|
|
|
90
90
|
color: var(--dees-color-text-secondary);
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
+
/* AutoLabels: set by the host and never edited, so outlined where a label is filled. */
|
|
94
|
+
.auto-labels {
|
|
95
|
+
display: inline-flex;
|
|
96
|
+
flex-wrap: wrap;
|
|
97
|
+
gap: 6px;
|
|
98
|
+
min-width: 0;
|
|
99
|
+
max-width: 100%;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.badge.auto {
|
|
103
|
+
background: transparent;
|
|
104
|
+
box-shadow: inset 0 0 0 var(--dees-line-width-hairline) var(--dees-color-border-strong);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.badge.auto.warning {
|
|
108
|
+
color: var(--dees-color-text-warning);
|
|
109
|
+
box-shadow: inset 0 0 0 var(--dees-line-width-hairline) var(--dees-color-accent-warning);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.badge.auto dees-icon {
|
|
113
|
+
flex: 0 0 auto;
|
|
114
|
+
font-size: var(--dees-icon-size-xs);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.badge-text {
|
|
118
|
+
min-width: 0;
|
|
119
|
+
overflow: hidden;
|
|
120
|
+
white-space: nowrap;
|
|
121
|
+
text-overflow: ellipsis;
|
|
122
|
+
}
|
|
123
|
+
|
|
93
124
|
.avatar {
|
|
94
125
|
flex: 0 0 auto;
|
|
95
126
|
width: 24px;
|
package/ts_web/i18n/de.ts
CHANGED
|
@@ -905,12 +905,24 @@ export default dcMessages.translation('de', {
|
|
|
905
905
|
'kanban.readOnly': 'Kommentare sind schreibgeschützt.',
|
|
906
906
|
'kanban.commentMismatch': 'Der gespeicherte Kommentar gehört zu einem anderen Ticket.',
|
|
907
907
|
'kanban.activityMismatch': 'Der Verlauf gehört zu einem anderen Ticket.',
|
|
908
|
+
'kanban.askQuestion': 'Als Frage stellen',
|
|
909
|
+
'kanban.questionMismatch': 'Die gespeicherte Frage gehört zu einem anderen Ticket.',
|
|
910
|
+
'kanban.answeredBy': 'Beantwortet von {name} · {when}',
|
|
911
|
+
'kanban.answerSaving': 'Antwort wird gespeichert …',
|
|
912
|
+
'kanban.openQuestions': '{count, plural, one {Eine Frage wartet auf eine Antwort.} other {# Fragen warten auf eine Antwort.}}',
|
|
913
|
+
'kanban.answerQuestion': 'Antworten',
|
|
914
|
+
'kanban.showQuestion': 'Frage anzeigen',
|
|
908
915
|
'kanban.project': 'Projekt',
|
|
909
916
|
'kanban.allProjects': 'Alle Projekte',
|
|
910
917
|
'kanban.noProject': 'Kein Projekt',
|
|
911
918
|
'kanban.projectRequired': 'Jedes Ticket gehört zu einem Projekt.',
|
|
912
919
|
'kanban.label': 'Label',
|
|
913
920
|
'kanban.allLabels': 'Alle Labels',
|
|
921
|
+
'kanban.autoLabel': 'Auto-Label',
|
|
922
|
+
'kanban.allAutoLabels': 'Alle Auto-Labels',
|
|
923
|
+
'kanban.autoLabels': 'Auto-Labels',
|
|
924
|
+
'kanban.autoLabelOpenQuestion': 'Offene Frage',
|
|
925
|
+
'kanban.autoLabelOpenQuestionDescription': 'Eine Frage zu diesem Ticket wartet auf eine Antwort.',
|
|
914
926
|
'kanban.anyone': 'Alle Personen',
|
|
915
927
|
'kanban.mine': 'Mir zugewiesen',
|
|
916
928
|
'kanban.filters': 'Filter',
|
|
@@ -936,7 +948,7 @@ export default dcMessages.translation('de', {
|
|
|
936
948
|
'kanban.feed': 'Kommentare oder Verlauf',
|
|
937
949
|
'kanban.loadingHistory': 'Verlauf wird geladen …',
|
|
938
950
|
'kanban.noHistory': 'Noch kein Verlauf.',
|
|
939
|
-
'kanban.activity': '{action, select, created {hat das Ticket erstellt} updated {hat das Ticket geändert} moved {hat das Ticket verschoben} reordered {hat die Position des Tickets geändert} commented {hat kommentiert} linked {hat einen Link hinzugefügt} other {hat das Ticket geändert}}',
|
|
951
|
+
'kanban.activity': '{action, select, created {hat das Ticket erstellt} updated {hat das Ticket geändert} moved {hat das Ticket verschoben} reordered {hat die Position des Tickets geändert} commented {hat kommentiert} asked {hat eine Frage gestellt} answered {hat eine Frage beantwortet} linked {hat einen Link hinzugefügt} other {hat das Ticket geändert}}',
|
|
940
952
|
'kanban.activityMoved': 'hat das Ticket von {from} nach {to} verschoben',
|
|
941
953
|
'kanban.activityLinked': '{count, plural, one {hat einen Link hinzugefügt} other {hat # Links hinzugefügt}}',
|
|
942
954
|
'kanban.parent': 'Übergeordnet',
|
|
@@ -1333,6 +1345,7 @@ export default dcMessages.translation('de', {
|
|
|
1333
1345
|
'question.personFieldsMissing': 'Füllen Sie die Pflichtfelder aus, um zu bestätigen.',
|
|
1334
1346
|
'question.personTooLong': 'Höchstens {max, plural, one {# Zeichen} other {# Zeichen}}; eingegeben sind {count, number}.',
|
|
1335
1347
|
'question.rejected': 'Nicht ausgeführt. Prüfen Sie die markierten Felder und bestätigen Sie erneut.',
|
|
1348
|
+
'question.answerRefused': 'Ihre Antwort wurde nicht gespeichert. Antworten Sie erneut.',
|
|
1336
1349
|
'message.usage': '{input, number} ein · {output, number} aus · {total, number} Tokens insgesamt',
|
|
1337
1350
|
'todos.empty': 'Noch keine Aufgaben.',
|
|
1338
1351
|
'reasoning.thinking': 'Denkt nach',
|
package/ts_web/i18n/messages.ts
CHANGED
|
@@ -939,12 +939,24 @@ export const dcMessages = plugins.smarti18n.defineCatalog({
|
|
|
939
939
|
'kanban.readOnly': { message: 'Comments are read-only.', description: 'Said in place of the comment field when the reader cannot comment.' },
|
|
940
940
|
'kanban.commentMismatch': { message: 'The saved comment belongs to a different ticket.', description: 'Said when the host saved a comment to another ticket.' },
|
|
941
941
|
'kanban.activityMismatch': { message: 'The history belongs to a different ticket.', description: 'Said when the host answered a ticket\'s history with another ticket\'s entries.' },
|
|
942
|
+
'kanban.askQuestion': { message: 'Ask as question', description: 'The composer\'s action that posts its text as a question waiting for an answer, beside the comment button.' },
|
|
943
|
+
'kanban.questionMismatch': { message: 'The saved question belongs to a different ticket.', description: 'Said when the host saved a question to another ticket, or answered another ticket\'s question.' },
|
|
944
|
+
'kanban.answeredBy': { message: 'Answered by {name} · {when}', description: 'Below an answered question in a ticket\'s discussion; {name} is who answered it, {when} the date and time.' },
|
|
945
|
+
'kanban.answerSaving': { message: 'Saving the answer…', description: 'Below a question in a ticket\'s discussion while its answer is saved.' },
|
|
946
|
+
'kanban.openQuestions': { message: '{count, plural, one {A question waits for an answer.} other {# questions wait for an answer.}}', description: 'The hint at the top of a ticket with unanswered questions; {count} is how many.' },
|
|
947
|
+
'kanban.answerQuestion': { message: 'Answer', description: 'The open-question hint\'s button that shows the first unanswered question, ready for an answer.' },
|
|
948
|
+
'kanban.showQuestion': { message: 'Show question', description: 'The open-question hint\'s button, for a reader who cannot answer: it shows the first unanswered question.' },
|
|
942
949
|
'kanban.project': { message: 'Project', description: 'The project a ticket belongs to: the board\'s project filter and a ticket\'s field.' },
|
|
943
950
|
'kanban.allProjects': { message: 'All projects', description: 'The project filter\'s option that shows the tasks of every project.' },
|
|
944
951
|
'kanban.noProject': { message: 'No project', description: 'A ticket\'s project field while the ticket belongs to no project.' },
|
|
945
952
|
'kanban.projectRequired': { message: 'Every ticket belongs to a project.', description: 'Below the create dialog\'s project field where the board requires one: why the dialog offers no "No project".' },
|
|
946
953
|
'kanban.label': { message: 'Label', description: 'The board\'s label filter.' },
|
|
947
954
|
'kanban.allLabels': { message: 'All labels', description: 'The label filter\'s option that shows tasks with any label.' },
|
|
955
|
+
'kanban.autoLabel': { message: 'Auto label', description: 'The board\'s filter by auto labels: labels the board sets from a ticket\'s state, such as an open question.' },
|
|
956
|
+
'kanban.allAutoLabels': { message: 'All auto labels', description: 'The auto-label filter\'s option that shows tasks with any auto label or none.' },
|
|
957
|
+
'kanban.autoLabels': { message: 'Auto labels', description: 'A ticket\'s auto labels, which the board sets from its state and no one edits (the list\'s name).' },
|
|
958
|
+
'kanban.autoLabelOpenQuestion': { message: 'Open question', description: 'The auto label of a ticket with an unanswered question, and the badge over such a question.' },
|
|
959
|
+
'kanban.autoLabelOpenQuestionDescription': { message: 'A question on this ticket waits for an answer.', description: 'The tooltip of the "Open question" auto label.' },
|
|
948
960
|
'kanban.anyone': { message: 'Anyone', description: 'The assignee filter\'s option that shows the tasks of every person.' },
|
|
949
961
|
'kanban.mine': { message: 'Assigned to me', description: 'The board\'s switch filter that shows only the reader\'s tasks, and its chip.' },
|
|
950
962
|
'kanban.filters': { message: 'Filters', description: 'The filter button at the end of the board\'s search field (its name and tooltip while no filter is active), and the speech bubble it opens.' },
|
|
@@ -970,7 +982,7 @@ export const dcMessages = plugins.smarti18n.defineCatalog({
|
|
|
970
982
|
'kanban.feed': { message: 'Comments or history', description: 'The switch between a ticket\'s comments and its history (its name).' },
|
|
971
983
|
'kanban.loadingHistory': { message: 'Loading history…', description: 'Said while a ticket\'s history loads.' },
|
|
972
984
|
'kanban.noHistory': { message: 'No history yet.', description: 'Said by a ticket without history.' },
|
|
973
|
-
'kanban.activity': { message: '{action, select, created {created the ticket} updated {changed the ticket} moved {moved the ticket} reordered {changed the ticket’s position} commented {commented} linked {added a link} other {changed the ticket}}', description: 'What a person did to a ticket, after their name in its history; {action} is the kind of change.' },
|
|
985
|
+
'kanban.activity': { message: '{action, select, created {created the ticket} updated {changed the ticket} moved {moved the ticket} reordered {changed the ticket’s position} commented {commented} asked {asked a question} answered {answered a question} linked {added a link} other {changed the ticket}}', description: 'What a person did to a ticket, after their name in its history; {action} is the kind of change.' },
|
|
974
986
|
'kanban.activityMoved': { message: 'moved the ticket from {from} to {to}', description: 'A move in a ticket\'s history, after the person\'s name; {from} and {to} are columns.' },
|
|
975
987
|
'kanban.activityLinked': { message: '{count, plural, one {added a link} other {added # links}}', description: 'Links added to a ticket, in its history, after the person\'s name.' },
|
|
976
988
|
'kanban.parent': { message: 'Parent', description: 'The ticket a ticket belongs to, as a field in the ticket\'s history.' },
|
|
@@ -1403,6 +1415,7 @@ export const dcMessages = plugins.smarti18n.defineCatalog({
|
|
|
1403
1415
|
'question.personFieldsMissing': { message: 'Fill in the required fields to confirm.', description: 'Said while a required field of a proposal is empty; its Confirm button waits for it.' },
|
|
1404
1416
|
'question.personTooLong': { message: 'Use {max, plural, one {# character} other {# characters}} or fewer; this has {count, number}.', description: 'Said on a field whose value is too long to confirm; {max} is the most it takes, {count} how many it has.' },
|
|
1405
1417
|
'question.rejected': { message: 'Not carried out. Check the marked fields and confirm again.', description: 'Said when the app refused a confirmation because of values entered, and named no reason of its own.' },
|
|
1418
|
+
'question.answerRefused': { message: 'Your answer was not saved. Answer again.', description: 'Said over a question when the app refused the answer it was sent, and named no reason of its own; the question waits for an answer again.' },
|
|
1406
1419
|
'message.usage': { message: '{input, number} in · {output, number} out · {total, number} total tokens', description: 'A reply\'s token usage: tokens read, written and in total.' },
|
|
1407
1420
|
|
|
1408
1421
|
// dees-harness-todos, dees-harness-reasoning, dees-harness-status, dees-harness-thread-cut, dees-harness-usage
|