@bakers-build/addon-bakers-ui 0.6.1-next.4 → 0.6.1-next.6
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/src/Component/section-list/index.d.ts +5 -5
- package/dist/src/Component/section-list/index.js +2 -2
- package/dist/src/Entity/conductor/Data/conductors.d.ts +2 -12
- package/dist/src/Entity/conductor/Data/conductors.js +3 -25
- package/dist/src/Entity/conductor/Data/own-conductor.d.ts +5 -7
- package/dist/src/Entity/conductor/Data/own-conductor.js +9 -16
- package/dist/src/Entity/project/Screen/projects-screen.js +1 -4
- package/dist/src/Entity/run/Component/run-detail/index.d.ts +1 -1
- package/dist/src/Entity/run/Component/run-detail/index.js +1 -1
- package/dist/src/Entity/run/Data/query.d.ts +0 -5
- package/dist/src/Entity/run/Data/query.js +0 -8
- package/dist/src/Entity/run/Data/runs.d.ts +0 -2
- package/dist/src/Entity/run/Data/runs.js +1 -26
- package/dist/src/Entity/run/Screen/run-detail.d.ts +1 -1
- package/dist/src/Entity/run/Screen/run-detail.js +1 -1
- package/dist/src/Entity/ticket/Component/edit-form/index.d.ts +1 -2
- package/dist/src/Entity/ticket/Component/edit-form/index.js +1 -2
- package/dist/src/Entity/ticket/Component/ticket-content/index.d.ts +3 -8
- package/dist/src/Entity/ticket/Component/ticket-content/index.js +4 -71
- package/dist/src/Entity/ticket/Component/ticket-content/model.d.ts +0 -25
- package/dist/src/Entity/ticket/Component/ticket-content/model.js +0 -195
- package/dist/src/Entity/ticket/Data/parents.d.ts +3 -3
- package/dist/src/Entity/ticket/Data/parents.js +8 -9
- package/dist/src/Entity/ticket/Data/query.d.ts +0 -2
- package/dist/src/Entity/ticket/Data/query.js +0 -8
- package/dist/src/Entity/ticket/Data/tickets.d.ts +0 -2
- package/dist/src/Entity/ticket/Data/tickets.js +1 -20
- package/dist/src/Entity/ticket/Data/write.d.ts +0 -32
- package/dist/src/Entity/ticket/Data/write.js +0 -94
- package/dist/src/Entity/ticket/Form/edit-data.js +10 -4
- package/dist/src/Entity/ticket/Form/edit-parent-source.d.ts +1 -1
- package/dist/src/Entity/ticket/Form/edit.d.ts +11 -8
- package/dist/src/Entity/ticket/Form/edit.js +1 -1
- package/dist/src/Entity/ticket/Form/parent-filter.d.ts +2 -2
- package/dist/src/Entity/ticket/Form/parent-filter.js +1 -1
- package/dist/src/Entity/ticket/Form/parent-source.d.ts +11 -2
- package/dist/src/Entity/ticket/Form/parent-source.js +5 -7
- package/dist/src/Entity/ticket/Screen/edit-assignment-form.d.ts +2 -2
- package/dist/src/Entity/ticket/Screen/edit-assignment-form.js +3 -3
- package/dist/src/Entity/ticket/Screen/parent-filter-form.js +3 -4
- package/dist/src/Entity/ticket/Screen/ticket-content-screen.d.ts +1 -1
- package/dist/src/Entity/ticket/Screen/ticket-content-screen.js +1 -1
- package/dist/src/Entity/ticket/Screen/ticket-react-markdown.js +2 -2
- package/dist/src/Entity/ticket/Screen/ticket-runs.d.ts +2 -0
- package/dist/src/Entity/ticket/Screen/ticket-runs.js +26 -16
- package/dist/src/Entity/ticket/Screen/ticket-search.d.ts +1 -1
- package/dist/src/Entity/ticket/Screen/tickets.d.ts +1 -2
- package/dist/src/Entity/ticket/Screen/tickets.js +0 -23
- package/dist/src/Entity/user/Data/member-context.d.ts +1 -1
- package/dist/src/Entity/user/Data/users.d.ts +17 -98
- package/dist/src/Entity/user/Data/users.js +27 -74
- package/dist/src/Entity/user/Screen/member-overview.d.ts +12 -29
- package/dist/src/Entity/user/Screen/member-overview.js +38 -38
- package/dist/src/Entity/workspace/Screen/workspace-picker.js +1 -2
- package/dist/src/Form/field.js +1 -1
- package/dist/src/Kernel/key-input.d.ts +1 -2
- package/dist/src/Kernel/key-input.js +1 -2
- package/dist/src/Kernel/logo.d.ts +3 -0
- package/dist/src/Kernel/logo.js +48 -0
- package/dist/src/Kernel/splash.js +5 -5
- package/dist/src/Kernel/tui-kernel.js +1 -5
- package/dist/src/Routing/context.d.ts +0 -5
- package/dist/src/Routing/context.js +0 -6
- package/dist/src/Routing/registry.js +3 -6
- package/dist/src/Routing/routes.js +1 -24
- package/dist/src/Screen/async-modal-screen.d.ts +1 -1
- package/dist/src/Screen/async-modal-screen.js +1 -1
- package/dist/src/Widget/chrome.d.ts +1 -1
- package/dist/src/Widget/chrome.js +1 -1
- package/dist/src/Widget/option-source.js +3 -3
- package/dist/src/Widget/types.d.ts +2 -3
- package/dist/src/index.d.ts +0 -1
- package/dist/src/index.js +1 -2
- package/dist/src/launcher.d.ts +7 -14
- package/dist/src/launcher.js +2 -10
- package/dist/src/lib/cursor.d.ts +5 -5
- package/dist/src/lib/cursor.js +5 -5
- package/dist/src/lib/refresh-signal.d.ts +1 -1
- package/dist/src/lib/theme.d.ts +7 -23
- package/dist/src/lib/theme.js +7 -23
- package/dist/src/plugin.d.ts +1 -2
- package/dist/src/plugin.js +3 -7
- package/dist/src/react-experiment.js +0 -2
- package/dist/src/route.js +1 -1
- package/dist/src/types.d.ts +5 -56
- package/package.json +4 -4
- package/dist/src/Agent/launch.d.ts +0 -25
- package/dist/src/Agent/launch.js +0 -57
- package/dist/src/Component/badge/index.d.ts +0 -11
- package/dist/src/Component/badge/index.js +0 -10
- package/dist/src/Component/bar-chart/index.d.ts +0 -16
- package/dist/src/Component/bar-chart/index.js +0 -63
- package/dist/src/Component/heat-map/index.d.ts +0 -21
- package/dist/src/Component/heat-map/index.js +0 -86
- package/dist/src/Component/stats-panel/index.d.ts +0 -61
- package/dist/src/Component/stats-panel/index.js +0 -112
- package/dist/src/Component/team-member-workload-list/index.d.ts +0 -9
- package/dist/src/Component/team-member-workload-list/index.js +0 -31
- package/dist/src/Entity/team/Data/members.d.ts +0 -30
- package/dist/src/Entity/team/Data/members.js +0 -83
- package/dist/src/Entity/team/Data/projects.d.ts +0 -3
- package/dist/src/Entity/team/Data/projects.js +0 -23
- package/dist/src/Entity/team/Data/team.d.ts +0 -22
- package/dist/src/Entity/team/Data/team.js +0 -38
- package/dist/src/Entity/team/Data/teams.d.ts +0 -223
- package/dist/src/Entity/team/Data/teams.js +0 -268
- package/dist/src/Entity/team/Data/workload.d.ts +0 -25
- package/dist/src/Entity/team/Data/workload.js +0 -60
- package/dist/src/Entity/team/Screen/team-member-work.d.ts +0 -41
- package/dist/src/Entity/team/Screen/team-member-work.js +0 -56
- package/dist/src/Entity/team/Screen/team-users.d.ts +0 -63
- package/dist/src/Entity/team/Screen/team-users.js +0 -210
- package/dist/src/Entity/team/Screen/team-work.d.ts +0 -39
- package/dist/src/Entity/team/Screen/team-work.js +0 -112
- package/dist/src/Entity/team/Screen/teams-screen.d.ts +0 -110
- package/dist/src/Entity/team/Screen/teams-screen.js +0 -264
- package/dist/src/Entity/ticket/Component/create-form/index.d.ts +0 -28
- package/dist/src/Entity/ticket/Component/create-form/index.js +0 -74
- package/dist/src/Entity/ticket/Component/demo-statistics.d.ts +0 -14
- package/dist/src/Entity/ticket/Component/demo-statistics.js +0 -88
- package/dist/src/Entity/ticket/Component/react-statistics.d.ts +0 -14
- package/dist/src/Entity/ticket/Component/react-statistics.js +0 -23
- package/dist/src/Entity/ticket/Data/workflow.d.ts +0 -9
- package/dist/src/Entity/ticket/Data/workflow.js +0 -18
- package/dist/src/Entity/ticket/Form/create-data.d.ts +0 -75
- package/dist/src/Entity/ticket/Form/create-data.js +0 -217
- package/dist/src/Entity/ticket/Form/create.d.ts +0 -230
- package/dist/src/Entity/ticket/Form/create.js +0 -198
- package/dist/src/Entity/ticket/Screen/create-ticket-form.d.ts +0 -133
- package/dist/src/Entity/ticket/Screen/create-ticket-form.js +0 -621
- package/dist/src/Entity/ticket/Screen/ticket-agents.d.ts +0 -134
- package/dist/src/Entity/ticket/Screen/ticket-agents.js +0 -253
- package/dist/src/Entity/ticket/Screen/ticket-react.d.ts +0 -41
- package/dist/src/Entity/ticket/Screen/ticket-react.js +0 -136
- package/dist/src/Entity/ticket-template/Data/templates.d.ts +0 -26
- package/dist/src/Entity/ticket-template/Data/templates.js +0 -62
- package/dist/src/Kernel/braid.d.ts +0 -4
- package/dist/src/Kernel/braid.js +0 -10
- package/dist/src/Screen/empty-overview.d.ts +0 -9
- package/dist/src/Screen/empty-overview.js +0 -14
- package/dist/src/Statistics/client.d.ts +0 -73
- package/dist/src/Statistics/client.js +0 -220
- package/dist/src/Statistics/comparison-chart.d.ts +0 -7
- package/dist/src/Statistics/comparison-chart.js +0 -525
- package/dist/src/Statistics/dashboard.d.ts +0 -93
- package/dist/src/Statistics/dashboard.js +0 -206
- package/dist/src/Statistics/figures.d.ts +0 -18
- package/dist/src/Statistics/figures.js +0 -162
- package/dist/src/Statistics/member-stats.d.ts +0 -58
- package/dist/src/Statistics/member-stats.js +0 -152
- package/dist/src/Statistics/presentation.d.ts +0 -8
- package/dist/src/Statistics/presentation.js +0 -36
- package/dist/src/Statistics/screen.d.ts +0 -44
- package/dist/src/Statistics/screen.js +0 -204
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
// BB-284 D5 — the PARENT OPTION SOURCE,
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
// source — a copied source would let the two pickers disagree about what a
|
|
6
|
-
// parent row looks like.
|
|
1
|
+
// BB-284 D5 — the PARENT OPTION SOURCE, so every parent picker composes the
|
|
2
|
+
// SAME source: one read (`loadParentCandidates`), one label policy, one error
|
|
3
|
+
// channel. A copied source would let the pickers disagree about what a parent
|
|
4
|
+
// row looks like.
|
|
7
5
|
import { loadParentCandidates } from '../Data/parents.js';
|
|
8
6
|
/**
|
|
9
7
|
* How long the parent picker waits before re-querying (BB-257 D7).
|
|
@@ -37,7 +35,7 @@ const toParentOption = (row) => ({
|
|
|
37
35
|
* `loadParentCandidates` builds its query with `parent: null` criteria, so an
|
|
38
36
|
* active parent filter can never narrow the picker to that parent's children.
|
|
39
37
|
*
|
|
40
|
-
* `match` is forwarded to the read: the
|
|
38
|
+
* `match` is forwarded to the read: the edit form searches identifier AND
|
|
41
39
|
* title (default), the parent FILTER picker matches by identifier only
|
|
42
40
|
* (BB-284, PM steer — the operator knows `BB-273`, not the title).
|
|
43
41
|
*/
|
|
@@ -47,8 +47,8 @@ export declare class EditAssignmentFormScreen extends AsyncModalScreen<EditAssig
|
|
|
47
47
|
private optionLoader;
|
|
48
48
|
/**
|
|
49
49
|
* The operator's uuid, resolved at most once per screen lifetime (BB-460
|
|
50
|
-
* fix round 1). `context.services.currentUser`
|
|
51
|
-
* `Conductor.ownerUserId` compares against — threading it straight through
|
|
50
|
+
* fix round 1). `context.services.currentUser` may be a username, not the
|
|
51
|
+
* uuid `Conductor.ownerUserId` compares against — threading it straight through
|
|
52
52
|
* silently no-oped the owner-first ordering.
|
|
53
53
|
*/
|
|
54
54
|
private readonly ownerIdentity;
|
|
@@ -80,8 +80,8 @@ export class EditAssignmentFormScreen extends AsyncModalScreen {
|
|
|
80
80
|
optionLoader;
|
|
81
81
|
/**
|
|
82
82
|
* The operator's uuid, resolved at most once per screen lifetime (BB-460
|
|
83
|
-
* fix round 1). `context.services.currentUser`
|
|
84
|
-
* `Conductor.ownerUserId` compares against — threading it straight through
|
|
83
|
+
* fix round 1). `context.services.currentUser` may be a username, not the
|
|
84
|
+
* uuid `Conductor.ownerUserId` compares against — threading it straight through
|
|
85
85
|
* silently no-oped the owner-first ordering.
|
|
86
86
|
*/
|
|
87
87
|
ownerIdentity = new OwnerIdentity(resolveWhoCandidate);
|
|
@@ -99,7 +99,7 @@ export class EditAssignmentFormScreen extends AsyncModalScreen {
|
|
|
99
99
|
const document = supplied?.document ??
|
|
100
100
|
(await loadTicketDetail(context.services.client, ticketId));
|
|
101
101
|
const projectId = relationshipId(document, 'project_id');
|
|
102
|
-
// BB-460 fix round 1: `currentUser` is a username; `ownerUserId` must be
|
|
102
|
+
// BB-460 fix round 1: `currentUser` is a uuid or a username; `ownerUserId` must be
|
|
103
103
|
// the operator's uuid (`Conductor.ownerUserId`'s shape), so it is resolved
|
|
104
104
|
// once per screen lifetime through `OwnerIdentity` rather than threaded
|
|
105
105
|
// straight through. Fails open: `unavailable` omits the hint entirely.
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
// BB-284 D4 — the parent-filter picker as a one-field modal screen over the
|
|
2
|
-
// BB-236 kernel
|
|
3
|
-
// second field onward owns. The kernel's `autocomplete` kind and the
|
|
2
|
+
// BB-236 kernel. The kernel's `autocomplete` kind and the
|
|
4
3
|
// `Widget/option-source.ts` driver supply the mechanics: type to filter,
|
|
5
4
|
// debounced server re-query, ←/→ to browse, Enter to pick, Esc to cancel.
|
|
6
5
|
//
|
|
7
6
|
// AC-4: the picker's ONLY ticket read is `loadParentCandidates`, composed as
|
|
8
|
-
// `parentOptionSource` (D5) — the same source the
|
|
7
|
+
// `parentOptionSource` (D5) — the same source the edit form's Parent field
|
|
9
8
|
// loads through, never a second lookup. The source builds its query with
|
|
10
9
|
// `parent: null` criteria (F7), so an active parent filter can never narrow
|
|
11
10
|
// the picker to that parent's own children.
|
|
@@ -43,7 +42,7 @@ export class ParentFilterScreen extends AsyncModalScreen {
|
|
|
43
42
|
const sources = {
|
|
44
43
|
// 'identifier': this picker filters a list the operator scans by
|
|
45
44
|
// identifier — title matching is deliberately off here (PM steer),
|
|
46
|
-
// while the
|
|
45
|
+
// while the edit form keeps the default identifier+title search.
|
|
47
46
|
parent: parentOptionSource(context.services.client, context.project.id, 'identifier'),
|
|
48
47
|
};
|
|
49
48
|
this.sources = sources;
|
|
@@ -55,7 +55,7 @@ export declare abstract class TicketContentScreen extends AsyncScreen<TicketDeta
|
|
|
55
55
|
* The model's selectable keys, plus the inline addons card's row (BB-661
|
|
56
56
|
* D1) when the Overview preview has a message worth reaching: a Tab/arrow
|
|
57
57
|
* visit stops there and Enter opens the full send/poll screen, the same
|
|
58
|
-
* keyboard reach the Details/
|
|
58
|
+
* keyboard reach the Details/Related sidebar card already has via its
|
|
59
59
|
* own (Technical details) row.
|
|
60
60
|
*/
|
|
61
61
|
private selectableKeys;
|
|
@@ -197,7 +197,7 @@ export class TicketContentScreen extends AsyncScreen {
|
|
|
197
197
|
* The model's selectable keys, plus the inline addons card's row (BB-661
|
|
198
198
|
* D1) when the Overview preview has a message worth reaching: a Tab/arrow
|
|
199
199
|
* visit stops there and Enter opens the full send/poll screen, the same
|
|
200
|
-
* keyboard reach the Details/
|
|
200
|
+
* keyboard reach the Details/Related sidebar card already has via its
|
|
201
201
|
* own (Technical details) row.
|
|
202
202
|
*/
|
|
203
203
|
selectableKeys(context) {
|
|
@@ -29,7 +29,7 @@ const EXAMPLE = [
|
|
|
29
29
|
'',
|
|
30
30
|
'```ts',
|
|
31
31
|
'const screen = "NativeScreen";',
|
|
32
|
-
'render({
|
|
32
|
+
'render({ markdown: true });',
|
|
33
33
|
'```',
|
|
34
34
|
'',
|
|
35
35
|
...Array.from({ length: 18 }, (_, index) => [
|
|
@@ -38,7 +38,7 @@ const EXAMPLE = [
|
|
|
38
38
|
'A longer paragraph checks wrapping at narrow terminal widths. Inline **formatting** must remain part of the same text flow, so the words continue naturally after resizing the window.',
|
|
39
39
|
'',
|
|
40
40
|
'- Inspect layout and readable spacing.',
|
|
41
|
-
'- Switch between
|
|
41
|
+
'- Switch between Markdown and the native ticket tabs.',
|
|
42
42
|
'',
|
|
43
43
|
].join('\n')),
|
|
44
44
|
'## End of Markdown example',
|
|
@@ -42,6 +42,8 @@ export declare class TicketRunsScreen extends AsyncScreen<TicketDetailDocument>
|
|
|
42
42
|
select(index: number, context: ScreenContext): boolean;
|
|
43
43
|
activate(index: number, context: ScreenContext): boolean;
|
|
44
44
|
handleInput(input: string, context: ScreenContext): boolean;
|
|
45
|
+
/** The selected run, when it can still be edited (claimed or running). */
|
|
46
|
+
private editableRun;
|
|
45
47
|
commandForInput(input: string): string | undefined;
|
|
46
48
|
actionForInput(input: string, context: ScreenContext): ScreenAction | undefined;
|
|
47
49
|
receiveResult(result: unknown, context: ScreenContext): void;
|
|
@@ -5,7 +5,8 @@ import { columnNode } from '../../../lib/vnode.js';
|
|
|
5
5
|
import { AsyncScreen } from '../../../Screen/async-screen.js';
|
|
6
6
|
import { listRowIds, listTableRows, listTableTree } from '../../collection.js';
|
|
7
7
|
import { TICKET_RUN_TABLE, ticketRunRows } from '../../run/Data/runs.js';
|
|
8
|
-
import {
|
|
8
|
+
import { isRunCancellable } from '../../run/Form/edit.js';
|
|
9
|
+
import { handleTicketCopy, ticketCopyActions, ticketHeaderTree, ticketTitleOf, } from '../Component/ticket-detail/index.js';
|
|
9
10
|
import { ticketDetailInputContext, ticketInputContext } from '../Data/input.js';
|
|
10
11
|
import { loadTicketView, readTicket, refreshTicket, saveTicket, ticketLoaded, watchTicket, } from '../Data/store.js';
|
|
11
12
|
const INCLUDES = ['runs'];
|
|
@@ -131,15 +132,31 @@ export class TicketRunsScreen extends AsyncScreen {
|
|
|
131
132
|
return this.select(view.selectable - 1, context);
|
|
132
133
|
return false;
|
|
133
134
|
}
|
|
135
|
+
/** The selected run, when it can still be edited (claimed or running). */
|
|
136
|
+
editableRun() {
|
|
137
|
+
if (!this.document)
|
|
138
|
+
return undefined;
|
|
139
|
+
const run = ticketRunRows(this.document)[this.cursor.index];
|
|
140
|
+
return run?.id && isRunCancellable(run.state) ? { id: run.id } : undefined;
|
|
141
|
+
}
|
|
134
142
|
commandForInput(input) {
|
|
135
|
-
return this.state === 'ready' && input === 'e'
|
|
136
|
-
? 'edit-
|
|
143
|
+
return this.state === 'ready' && input === 'e' && this.editableRun()
|
|
144
|
+
? 'edit-run'
|
|
137
145
|
: undefined;
|
|
138
146
|
}
|
|
139
147
|
actionForInput(input, context) {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
148
|
+
const run = this.editableRun();
|
|
149
|
+
if (this.commandForInput(input) !== 'edit-run' || !run)
|
|
150
|
+
return undefined;
|
|
151
|
+
return {
|
|
152
|
+
type: 'navigate',
|
|
153
|
+
routeId: 'run.edit',
|
|
154
|
+
params: {
|
|
155
|
+
ticketId: this.document?.data?.id ?? context.params?.ticketId ?? '',
|
|
156
|
+
runId: run.id,
|
|
157
|
+
},
|
|
158
|
+
result: this.document,
|
|
159
|
+
};
|
|
143
160
|
}
|
|
144
161
|
receiveResult(result, context) {
|
|
145
162
|
if (result &&
|
|
@@ -149,15 +166,6 @@ export class TicketRunsScreen extends AsyncScreen {
|
|
|
149
166
|
if (document)
|
|
150
167
|
this.replaceReady(saveTicket(context, document));
|
|
151
168
|
context.requestDraw();
|
|
152
|
-
return;
|
|
153
|
-
}
|
|
154
|
-
if (result &&
|
|
155
|
-
typeof result === 'object' &&
|
|
156
|
-
result.type === 'ticket-assignment-updated') {
|
|
157
|
-
const returned = result;
|
|
158
|
-
if (returned.document)
|
|
159
|
-
this.replaceReady(saveTicket(context, returned.document));
|
|
160
|
-
context.requestDraw();
|
|
161
169
|
}
|
|
162
170
|
}
|
|
163
171
|
renderReady(document, context) {
|
|
@@ -186,7 +194,9 @@ export class TicketRunsScreen extends AsyncScreen {
|
|
|
186
194
|
const view = this.currentView(context);
|
|
187
195
|
return [
|
|
188
196
|
actionItem('detail-tab', 'Tab', 'section'),
|
|
189
|
-
|
|
197
|
+
...(this.editableRun()
|
|
198
|
+
? [actionItem('detail-edit', 'e', 'edit run')]
|
|
199
|
+
: []),
|
|
190
200
|
...ticketCopyActions(),
|
|
191
201
|
actionItem('detail-arrows', '↑↓', view.selectable > 1 ? 'select' : 'scroll'),
|
|
192
202
|
...(view.selectable > 0
|
|
@@ -5,7 +5,7 @@ export interface TicketSearchHost {
|
|
|
5
5
|
/** The typed line; the host's loader sends it as `filter[search]`. */
|
|
6
6
|
searchQuery: string;
|
|
7
7
|
/** The rows on screen, narrowed locally while the server read is in flight.
|
|
8
|
-
* Absent on a screen that shows no ticket rows
|
|
8
|
+
* Absent on a screen that shows no ticket rows. */
|
|
9
9
|
readonly rows?: readonly TicketRow[];
|
|
10
10
|
/** Show these rows until the server answers; `[]` after a refusal. */
|
|
11
11
|
showRows(rows: readonly TicketRow[]): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { FullScreenChrome, ListFilterBadge } from '../../../Screen/full-screen.js';
|
|
2
2
|
import { ListScreen } from '../../../Screen/list-screen.js';
|
|
3
|
-
import type {
|
|
3
|
+
import type { ScreenContext } from '../../../Screen/screen.js';
|
|
4
4
|
import { type TicketCriteria, type WhoCriterion } from '../Data/query.js';
|
|
5
5
|
import { type TicketPage, type TicketRow } from '../Data/tickets.js';
|
|
6
6
|
export declare class TicketsScreen extends ListScreen<TicketRow, void> {
|
|
@@ -80,7 +80,6 @@ export declare class TicketsScreen extends ListScreen<TicketRow, void> {
|
|
|
80
80
|
};
|
|
81
81
|
};
|
|
82
82
|
readonly id: string;
|
|
83
|
-
actionForInput(input: string, context: ScreenContext): ScreenAction | undefined;
|
|
84
83
|
receiveResult(result: unknown, context: ScreenContext): void;
|
|
85
84
|
private openingEdit;
|
|
86
85
|
private status;
|
|
@@ -28,17 +28,6 @@ export class TicketsScreen extends ListScreen {
|
|
|
28
28
|
tab: { id: 'tickets', label: 'Tickets', scope: 'project', weight: 20 },
|
|
29
29
|
};
|
|
30
30
|
id = TicketsScreen.route.id;
|
|
31
|
-
actionForInput(input, context) {
|
|
32
|
-
if (input === 'n')
|
|
33
|
-
return context.services?.agents
|
|
34
|
-
? {
|
|
35
|
-
type: 'navigate',
|
|
36
|
-
routeId: 'ticket.create',
|
|
37
|
-
params: context.params ?? {},
|
|
38
|
-
}
|
|
39
|
-
: { type: 'redraw' };
|
|
40
|
-
return undefined;
|
|
41
|
-
}
|
|
42
31
|
receiveResult(result, context) {
|
|
43
32
|
if (result &&
|
|
44
33
|
typeof result === 'object' &&
|
|
@@ -82,17 +71,6 @@ export class TicketsScreen extends ListScreen {
|
|
|
82
71
|
this.setCriteria({ ...this.criteria, project }, context);
|
|
83
72
|
return;
|
|
84
73
|
}
|
|
85
|
-
if (result &&
|
|
86
|
-
typeof result === 'object' &&
|
|
87
|
-
result.type === 'ticket-created-directly') {
|
|
88
|
-
// BB-309 AC-7 — the same `context.back(result)` channel the pickers and
|
|
89
|
-
// the assignment save already return through. The criteria do not change;
|
|
90
|
-
// the RELOAD is the point, and `setCriteria` resets to page 0, which is
|
|
91
|
-
// where the new ticket sorts: `buildTicketQueryParams` sorts by
|
|
92
|
-
// `changed` DESC, with `drupal_internal__id` DESC as the tiebreaker.
|
|
93
|
-
this.setCriteria({ ...this.criteria }, context);
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
74
|
if (result &&
|
|
97
75
|
typeof result === 'object' &&
|
|
98
76
|
result.type === 'ticket-assignment-updated') {
|
|
@@ -431,7 +409,6 @@ export class TicketsScreen extends ListScreen {
|
|
|
431
409
|
}
|
|
432
410
|
actions() {
|
|
433
411
|
return [
|
|
434
|
-
actionItem('tickets-new', 'n', 'new'),
|
|
435
412
|
actionItem('tickets-edit', 'e', 'edit'),
|
|
436
413
|
...this.pagingActionItems(),
|
|
437
414
|
];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { DropshClient } from '../../../types.js';
|
|
2
|
-
export type MemberParentType = '
|
|
2
|
+
export type MemberParentType = 'bb_workspace';
|
|
3
3
|
/** Reject a contextual member route unless the user is active in its parent. */
|
|
4
4
|
export declare function assertActiveMember(client: DropshClient, parentType: MemberParentType, parentId: string, userId: string): Promise<void>;
|
|
@@ -3,90 +3,10 @@ import { type ListOutcome, type OptionClients } from '../../transport.js';
|
|
|
3
3
|
/**
|
|
4
4
|
* Drupal JSON:API default page size (`OffsetPage::SIZE_MAX`).
|
|
5
5
|
*
|
|
6
|
-
* `
|
|
7
|
-
*
|
|
8
|
-
* not page further.
|
|
6
|
+
* `listAllUsers` walks the collection in pages of this size, the bound the
|
|
7
|
+
* control plane applies anyway.
|
|
9
8
|
*/
|
|
10
9
|
export declare const USER_LIST_PAGE_SIZE = 50;
|
|
11
|
-
/** One team-roster row: account label plus current assigned workload. */
|
|
12
|
-
export interface UserListRow {
|
|
13
|
-
id: string;
|
|
14
|
-
label: string;
|
|
15
|
-
open: number;
|
|
16
|
-
running: number;
|
|
17
|
-
waiting: number;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* The Users list table — labels come from the user collection; the 30d numbers
|
|
21
|
-
* are filled by the screen from unscoped statistics (G2: Data/ stays a leaf).
|
|
22
|
-
*/
|
|
23
|
-
export declare const USER_TABLE: {
|
|
24
|
-
readonly noun: "user";
|
|
25
|
-
readonly emptyMessage: "No users.";
|
|
26
|
-
readonly columns: readonly [{
|
|
27
|
-
readonly key: "label";
|
|
28
|
-
readonly label: "USER";
|
|
29
|
-
readonly width: 0;
|
|
30
|
-
readonly fields: readonly ["display_name", "name"];
|
|
31
|
-
readonly get: (r: UserListRow) => string;
|
|
32
|
-
}, {
|
|
33
|
-
readonly key: "tickets";
|
|
34
|
-
readonly label: "OPEN";
|
|
35
|
-
readonly width: 8;
|
|
36
|
-
readonly fields: readonly [];
|
|
37
|
-
readonly get: (r: UserListRow) => string;
|
|
38
|
-
}, {
|
|
39
|
-
readonly key: "runs";
|
|
40
|
-
readonly label: "RUNNING";
|
|
41
|
-
readonly width: 10;
|
|
42
|
-
readonly fields: readonly [];
|
|
43
|
-
readonly get: (r: UserListRow) => string;
|
|
44
|
-
}, {
|
|
45
|
-
readonly key: "cpr";
|
|
46
|
-
readonly label: "WAITING";
|
|
47
|
-
readonly width: 10;
|
|
48
|
-
readonly fields: readonly [];
|
|
49
|
-
readonly get: (r: UserListRow) => string;
|
|
50
|
-
}];
|
|
51
|
-
};
|
|
52
|
-
/**
|
|
53
|
-
* The SAME columns for one crew's member list (BB-391 AC4, second round).
|
|
54
|
-
*
|
|
55
|
-
* Only the wording differs, and the columns are shared rather than re-declared:
|
|
56
|
-
* a crew's Users tab shows people, so a second column set would be two places
|
|
57
|
-
* for one layout to drift. The noun keys the row node ids and the empty message
|
|
58
|
-
* is the crew's own — `No users.` on a team page would read as an instance with
|
|
59
|
-
* no accounts.
|
|
60
|
-
*/
|
|
61
|
-
export declare const TEAM_MEMBER_TABLE: {
|
|
62
|
-
readonly noun: "member";
|
|
63
|
-
readonly emptyMessage: "No active members in this crew.";
|
|
64
|
-
readonly columns: readonly [{
|
|
65
|
-
readonly key: "label";
|
|
66
|
-
readonly label: "USER";
|
|
67
|
-
readonly width: 0;
|
|
68
|
-
readonly fields: readonly ["display_name", "name"];
|
|
69
|
-
readonly get: (r: UserListRow) => string;
|
|
70
|
-
}, {
|
|
71
|
-
readonly key: "tickets";
|
|
72
|
-
readonly label: "OPEN";
|
|
73
|
-
readonly width: 8;
|
|
74
|
-
readonly fields: readonly [];
|
|
75
|
-
readonly get: (r: UserListRow) => string;
|
|
76
|
-
}, {
|
|
77
|
-
readonly key: "runs";
|
|
78
|
-
readonly label: "RUNNING";
|
|
79
|
-
readonly width: 10;
|
|
80
|
-
readonly fields: readonly [];
|
|
81
|
-
readonly get: (r: UserListRow) => string;
|
|
82
|
-
}, {
|
|
83
|
-
readonly key: "cpr";
|
|
84
|
-
readonly label: "WAITING";
|
|
85
|
-
readonly width: 10;
|
|
86
|
-
readonly fields: readonly [];
|
|
87
|
-
readonly get: (r: UserListRow) => string;
|
|
88
|
-
}];
|
|
89
|
-
};
|
|
90
10
|
/** One user of the control plane, as this renderer needs it. */
|
|
91
11
|
export interface User {
|
|
92
12
|
id: string;
|
|
@@ -97,17 +17,6 @@ export interface User {
|
|
|
97
17
|
/** `drupal_internal__uid`; 0 is Drupal's Anonymous. Absent ⇒ `undefined`, NOT 0. */
|
|
98
18
|
uid: number | undefined;
|
|
99
19
|
}
|
|
100
|
-
/**
|
|
101
|
-
* The user collection through one client, in server order.
|
|
102
|
-
*
|
|
103
|
-
* Yields the OUTCOME rather than a swallowed array (BB-257 D4), for the same
|
|
104
|
-
* reason `listTerms` does: the create popup has to be able to say that the read
|
|
105
|
-
* failed instead of presenting an empty Assignee ring, and only the read knows
|
|
106
|
-
* why it failed. `listUsersPreferringWrite` keeps the swallowing contract — it
|
|
107
|
-
* already HAS an answer to a failure (fall back to the read client), which is
|
|
108
|
-
* the case D4 says the best-effort rule is right for.
|
|
109
|
-
*/
|
|
110
|
-
export declare const listUsers: (client: DropshClient) => Promise<ListOutcome<User>>;
|
|
111
20
|
/** Every readable user, walking JSON:API pages to completion. */
|
|
112
21
|
export declare function listAllUsers(client: DropshClient): Promise<ListOutcome<User>>;
|
|
113
22
|
/**
|
|
@@ -126,10 +35,20 @@ export interface WhoCandidate {
|
|
|
126
35
|
export declare const WHO_PAGE_SIZE = 50;
|
|
127
36
|
export declare function loadWhoCandidates(client: DropshClient, query: string): Promise<ListOutcome<WhoCandidate>>;
|
|
128
37
|
/**
|
|
129
|
-
* Resolve
|
|
130
|
-
* `
|
|
131
|
-
*
|
|
132
|
-
* identity must be proven, not guessed.
|
|
133
|
-
* names are unique); uid 0 is
|
|
38
|
+
* Resolve the current user to the Who criterion's candidate (BB-287 D4) — an
|
|
39
|
+
* EXACT match on `id` when given a uuid, otherwise on `name`. The mine toggle
|
|
40
|
+
* filters tickets on the resolved uuid, so a CONTAINS hit on a longer sibling
|
|
41
|
+
* name would filter on the wrong user: identity must be proven, not guessed.
|
|
42
|
+
* At most one row comes back (uuids and Drupal names are unique); uid 0 is
|
|
43
|
+
* dropped by the shared read.
|
|
134
44
|
*/
|
|
135
45
|
export declare function resolveWhoCandidate(client: DropshClient, name: string): Promise<ListOutcome<WhoCandidate>>;
|
|
46
|
+
/** A member's profile as the member Overview shows it. */
|
|
47
|
+
export interface UserProfile {
|
|
48
|
+
username: string;
|
|
49
|
+
position: string;
|
|
50
|
+
aboutMe: string;
|
|
51
|
+
}
|
|
52
|
+
/** Read one user's username, position (`field_developer_title`) and About me
|
|
53
|
+
* (`field_bb_background`). A refusal propagates to the screen's error. */
|
|
54
|
+
export declare function loadUserProfile(client: DropshClient, userId: string): Promise<UserProfile>;
|
|
@@ -1,70 +1,17 @@
|
|
|
1
1
|
// BB-236 — the USER data service. It returns USERS and knows nothing about forms:
|
|
2
2
|
// no `Option`, no ordering, no filtering, no popup name. Whoever wants users shaped
|
|
3
|
-
// as picker rows says so itself — that is `
|
|
3
|
+
// as picker rows says so itself — that is `Form/edit-data.ts`,
|
|
4
4
|
// and the boundary guard in `tests/boundary.test.ts` keeps this file on the data side
|
|
5
5
|
// of the line. The two read strategies are both just reading, so both live here.
|
|
6
6
|
import { DrupalJsonApiParams } from 'drupal-jsonapi-params';
|
|
7
|
-
import {
|
|
7
|
+
import { listPreferringWrite, messageOf, } from '../../transport.js';
|
|
8
8
|
/**
|
|
9
9
|
* Drupal JSON:API default page size (`OffsetPage::SIZE_MAX`).
|
|
10
10
|
*
|
|
11
|
-
* `
|
|
12
|
-
*
|
|
13
|
-
* not page further.
|
|
11
|
+
* `listAllUsers` walks the collection in pages of this size, the bound the
|
|
12
|
+
* control plane applies anyway.
|
|
14
13
|
*/
|
|
15
14
|
export const USER_LIST_PAGE_SIZE = 50;
|
|
16
|
-
/**
|
|
17
|
-
* The Users list table — labels come from the user collection; the 30d numbers
|
|
18
|
-
* are filled by the screen from unscoped statistics (G2: Data/ stays a leaf).
|
|
19
|
-
*/
|
|
20
|
-
export const USER_TABLE = {
|
|
21
|
-
noun: 'user',
|
|
22
|
-
emptyMessage: 'No users.',
|
|
23
|
-
columns: [
|
|
24
|
-
{
|
|
25
|
-
key: 'label',
|
|
26
|
-
label: 'USER',
|
|
27
|
-
width: 0,
|
|
28
|
-
fields: ['display_name', 'name'],
|
|
29
|
-
get: (r) => r.label,
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
key: 'tickets',
|
|
33
|
-
label: 'OPEN',
|
|
34
|
-
width: 8,
|
|
35
|
-
fields: [],
|
|
36
|
-
get: (r) => String(r.open),
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
key: 'runs',
|
|
40
|
-
label: 'RUNNING',
|
|
41
|
-
width: 10,
|
|
42
|
-
fields: [],
|
|
43
|
-
get: (r) => String(r.running),
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
key: 'cpr',
|
|
47
|
-
label: 'WAITING',
|
|
48
|
-
width: 10,
|
|
49
|
-
fields: [],
|
|
50
|
-
get: (r) => String(r.waiting),
|
|
51
|
-
},
|
|
52
|
-
],
|
|
53
|
-
};
|
|
54
|
-
/**
|
|
55
|
-
* The SAME columns for one crew's member list (BB-391 AC4, second round).
|
|
56
|
-
*
|
|
57
|
-
* Only the wording differs, and the columns are shared rather than re-declared:
|
|
58
|
-
* a crew's Users tab shows people, so a second column set would be two places
|
|
59
|
-
* for one layout to drift. The noun keys the row node ids and the empty message
|
|
60
|
-
* is the crew's own — `No users.` on a team page would read as an instance with
|
|
61
|
-
* no accounts.
|
|
62
|
-
*/
|
|
63
|
-
export const TEAM_MEMBER_TABLE = {
|
|
64
|
-
noun: 'member',
|
|
65
|
-
emptyMessage: 'No active members in this crew.',
|
|
66
|
-
columns: USER_TABLE.columns,
|
|
67
|
-
};
|
|
68
15
|
const str = (v) => typeof v === 'string' && v.length > 0 ? v : undefined;
|
|
69
16
|
// The ONE attribute-level mapping both reads share — the Resource-wrapped
|
|
70
17
|
// collection list and the Who candidate read's raw JSON:API rows — so the
|
|
@@ -80,17 +27,6 @@ const fromAttributes = (id, attr) => {
|
|
|
80
27
|
};
|
|
81
28
|
};
|
|
82
29
|
const toUser = (r) => fromAttributes(r.id, (k) => r.attr(k));
|
|
83
|
-
/**
|
|
84
|
-
* The user collection through one client, in server order.
|
|
85
|
-
*
|
|
86
|
-
* Yields the OUTCOME rather than a swallowed array (BB-257 D4), for the same
|
|
87
|
-
* reason `listTerms` does: the create popup has to be able to say that the read
|
|
88
|
-
* failed instead of presenting an empty Assignee ring, and only the read knows
|
|
89
|
-
* why it failed. `listUsersPreferringWrite` keeps the swallowing contract — it
|
|
90
|
-
* already HAS an answer to a failure (fall back to the read client), which is
|
|
91
|
-
* the case D4 says the best-effort rule is right for.
|
|
92
|
-
*/
|
|
93
|
-
export const listUsers = (client) => listOutcome(client, 'user', toUser);
|
|
94
30
|
/** Every readable user, walking JSON:API pages to completion. */
|
|
95
31
|
export async function listAllUsers(client) {
|
|
96
32
|
const rows = [];
|
|
@@ -158,17 +94,34 @@ export async function loadWhoCandidates(client, query) {
|
|
|
158
94
|
params.addPageLimit(WHO_PAGE_SIZE);
|
|
159
95
|
return fetchWhoCandidates(client, params);
|
|
160
96
|
}
|
|
97
|
+
const UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
161
98
|
/**
|
|
162
|
-
* Resolve
|
|
163
|
-
* `
|
|
164
|
-
*
|
|
165
|
-
* identity must be proven, not guessed.
|
|
166
|
-
* names are unique); uid 0 is
|
|
99
|
+
* Resolve the current user to the Who criterion's candidate (BB-287 D4) — an
|
|
100
|
+
* EXACT match on `id` when given a uuid, otherwise on `name`. The mine toggle
|
|
101
|
+
* filters tickets on the resolved uuid, so a CONTAINS hit on a longer sibling
|
|
102
|
+
* name would filter on the wrong user: identity must be proven, not guessed.
|
|
103
|
+
* At most one row comes back (uuids and Drupal names are unique); uid 0 is
|
|
104
|
+
* dropped by the shared read.
|
|
167
105
|
*/
|
|
168
106
|
export async function resolveWhoCandidate(client, name) {
|
|
169
107
|
const params = new DrupalJsonApiParams();
|
|
170
|
-
|
|
108
|
+
// `me()` reports the account's uuid; older connections still hand over a name.
|
|
109
|
+
params.addFilter(UUID.test(name) ? 'id' : 'name', name);
|
|
171
110
|
params.addPageLimit(WHO_PAGE_SIZE);
|
|
172
111
|
const outcome = await fetchWhoCandidates(client, params);
|
|
173
112
|
return { ...outcome, rows: outcome.rows.slice(0, 1) };
|
|
174
113
|
}
|
|
114
|
+
/** Read one user's username, position (`field_developer_title`) and About me
|
|
115
|
+
* (`field_bb_background`). A refusal propagates to the screen's error. */
|
|
116
|
+
export async function loadUserProfile(client, userId) {
|
|
117
|
+
const doc = (await client.get(`user/user/${userId}`));
|
|
118
|
+
const text = (key) => {
|
|
119
|
+
const value = doc?.data?.attributes?.[key];
|
|
120
|
+
return typeof value === 'string' ? value.trim() : '';
|
|
121
|
+
};
|
|
122
|
+
return {
|
|
123
|
+
username: text('name'),
|
|
124
|
+
position: text('field_developer_title'),
|
|
125
|
+
aboutMe: text('field_bb_background'),
|
|
126
|
+
};
|
|
127
|
+
}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { VNode } from '@opentui/core';
|
|
2
|
+
import { AsyncScreen } from '../../../Screen/async-screen.js';
|
|
2
3
|
import type { FullScreenChrome } from '../../../Screen/full-screen.js';
|
|
3
4
|
import type { ScreenContext } from '../../../Screen/screen.js';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
protected actions(): import("../../../Component/footer-actions/index.js").ActionItem[];
|
|
9
|
-
}
|
|
10
|
-
export declare class WorkspaceMemberOverviewScreen extends MemberOverviewScreen {
|
|
5
|
+
import { type UserProfile } from '../Data/users.js';
|
|
6
|
+
/** The workspace member landing tab: the person's profile, once their active
|
|
7
|
+
* membership in the workspace is confirmed. */
|
|
8
|
+
export declare class WorkspaceMemberOverviewScreen extends AsyncScreen<UserProfile> {
|
|
11
9
|
readonly frameId = "workspace-member-overview";
|
|
12
10
|
static readonly route: {
|
|
13
11
|
id: string;
|
|
@@ -24,25 +22,10 @@ export declare class WorkspaceMemberOverviewScreen extends MemberOverviewScreen
|
|
|
24
22
|
};
|
|
25
23
|
};
|
|
26
24
|
readonly id: string;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
path: string;
|
|
34
|
-
fallback: {
|
|
35
|
-
routeId: string;
|
|
36
|
-
preserveParams: true;
|
|
37
|
-
};
|
|
38
|
-
tab: {
|
|
39
|
-
id: string;
|
|
40
|
-
label: string;
|
|
41
|
-
scope: string;
|
|
42
|
-
weight: number;
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
readonly id: string;
|
|
46
|
-
protected validate(context: ScreenContext): Promise<void>;
|
|
25
|
+
reload(context: ScreenContext): void;
|
|
26
|
+
protected load(context: ScreenContext): Promise<UserProfile>;
|
|
27
|
+
protected renderLoading(): string[];
|
|
28
|
+
protected renderReady(profile: UserProfile): VNode;
|
|
29
|
+
protected chrome(context: ScreenContext): FullScreenChrome;
|
|
30
|
+
protected actions(): import("../../../Component/footer-actions/index.js").ActionItem[];
|
|
47
31
|
}
|
|
48
|
-
export {};
|