@bakers-build/addon-bakers-ui 0.6.1-next.5 → 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
|
@@ -3,9 +3,9 @@ import { type Cell, type StyledLine, type StyledRun } from '../../lib/vnode.js';
|
|
|
3
3
|
/**
|
|
4
4
|
* A section body row that is COLUMNS rather than prose — BB-340 Task 13.
|
|
5
5
|
*
|
|
6
|
-
* The
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* The original producer is the ticket detail's Runs table, which used to
|
|
7
|
+
* compose its columns into one padded string with `lib/format.ts`'s `pad`.
|
|
8
|
+
* Producers describe their cells instead: the tree lays them
|
|
9
9
|
* out with Yoga budgets, and a surface with no layout — the pipe — prints
|
|
10
10
|
* {@link lineText}'s join. That is the operator-approved cost of retiring the
|
|
11
11
|
* padding, and it is what lets `pad` (and with it two of `lib/width.ts`'s
|
|
@@ -173,7 +173,7 @@ export declare const panelSectionKey: (heading: string) => string;
|
|
|
173
173
|
* The one description of what a section renders as. {@link flattenSections}
|
|
174
174
|
* derives the row surface from it and a converted screen derives its nodes from
|
|
175
175
|
* it, so the two cannot answer differently for the same document — which is the
|
|
176
|
-
* property that lets
|
|
176
|
+
* property that lets a screen hand over renderables while its pipe keeps
|
|
177
177
|
* emitting the bytes it always did (spec F5).
|
|
178
178
|
*/
|
|
179
179
|
export declare function sectionRows(sections: Section[], keyOf?: (heading: string) => string): SectionRow[];
|
|
@@ -181,7 +181,7 @@ export declare function sectionRows(sections: Section[], keyOf?: (heading: strin
|
|
|
181
181
|
* One flattened row as the node a converted screen hands over — BB-340 D1.
|
|
182
182
|
*
|
|
183
183
|
* The ONE place a `SectionRow` becomes a renderable, so the two screens that
|
|
184
|
-
* render section rows (the
|
|
184
|
+
* render section rows (the ticket detail's tabs, the project overview) cannot
|
|
185
185
|
* disagree about what a columned row looks like. `prefix` is the screen's own
|
|
186
186
|
* body id, which is what keeps two screens' rows apart in one tree.
|
|
187
187
|
*/
|
|
@@ -131,7 +131,7 @@ export const panelSectionKey = (heading) => Array.from(new TextEncoder().encode(
|
|
|
131
131
|
* The one description of what a section renders as. {@link flattenSections}
|
|
132
132
|
* derives the row surface from it and a converted screen derives its nodes from
|
|
133
133
|
* it, so the two cannot answer differently for the same document — which is the
|
|
134
|
-
* property that lets
|
|
134
|
+
* property that lets a screen hand over renderables while its pipe keeps
|
|
135
135
|
* emitting the bytes it always did (spec F5).
|
|
136
136
|
*/
|
|
137
137
|
export function sectionRows(sections,
|
|
@@ -155,7 +155,7 @@ keyOf = sectionKey) {
|
|
|
155
155
|
* One flattened row as the node a converted screen hands over — BB-340 D1.
|
|
156
156
|
*
|
|
157
157
|
* The ONE place a `SectionRow` becomes a renderable, so the two screens that
|
|
158
|
-
* render section rows (the
|
|
158
|
+
* render section rows (the ticket detail's tabs, the project overview) cannot
|
|
159
159
|
* disagree about what a columned row looks like. `prefix` is the screen's own
|
|
160
160
|
* body id, which is what keeps two screens' rows apart in one tree.
|
|
161
161
|
*/
|
|
@@ -21,21 +21,11 @@ export interface Conductor {
|
|
|
21
21
|
/**
|
|
22
22
|
* The conductor collection through one client, in server order.
|
|
23
23
|
*
|
|
24
|
-
* Yields the OUTCOME rather than a swallowed array (BB-257 D4)
|
|
25
|
-
*
|
|
24
|
+
* Yields the OUTCOME rather than a swallowed array (BB-257 D4), so a caller
|
|
25
|
+
* can say why a read failed. `listConductorsPreferringWrite` keeps the swallowing
|
|
26
26
|
* contract, because it already answers a failure by falling back.
|
|
27
27
|
*/
|
|
28
28
|
export declare const listConductors: (client: DropshClient) => Promise<ListOutcome<Conductor>>;
|
|
29
|
-
/**
|
|
30
|
-
* The conductor collection scoped to one project (BB-664 review F4).
|
|
31
|
-
*
|
|
32
|
-
* The create popup's narrow option loader, not `ConductorQuery`'s row-page
|
|
33
|
-
* read above (BB-664 plan correction): this keeps `listOutcome`'s own
|
|
34
|
-
* outcome/error contract rather than inventing a second one for the same
|
|
35
|
-
* entity. An unscoped caller keeps calling {@link listConductors}; this is
|
|
36
|
-
* additive.
|
|
37
|
-
*/
|
|
38
|
-
export declare const listConductorsForProject: (client: DropshClient, projectId: string) => Promise<ListOutcome<Conductor>>;
|
|
39
29
|
/**
|
|
40
30
|
* The same collection read through the WRITE client where there is one — still just
|
|
41
31
|
* reading, but the write scope is the one that decides what a write may reference,
|
|
@@ -8,7 +8,7 @@ import { DrupalJsonApiParams } from 'drupal-jsonapi-params';
|
|
|
8
8
|
import { humanizeAge } from '../../../lib/format.js';
|
|
9
9
|
import { loadPage, } from '../../collection.js';
|
|
10
10
|
import { LIST_PAGE_SIZE } from '../../cycle.js';
|
|
11
|
-
import { listOutcome, listPreferringWrite,
|
|
11
|
+
import { listOutcome, listPreferringWrite, } from '../../transport.js';
|
|
12
12
|
import { deriveConductorStatus } from './liveness.js';
|
|
13
13
|
const str = (v) => typeof v === 'string' && v.length > 0 ? v : undefined;
|
|
14
14
|
const toConductor = (r) => ({
|
|
@@ -23,33 +23,11 @@ const toConductor = (r) => ({
|
|
|
23
23
|
/**
|
|
24
24
|
* The conductor collection through one client, in server order.
|
|
25
25
|
*
|
|
26
|
-
* Yields the OUTCOME rather than a swallowed array (BB-257 D4)
|
|
27
|
-
*
|
|
26
|
+
* Yields the OUTCOME rather than a swallowed array (BB-257 D4), so a caller
|
|
27
|
+
* can say why a read failed. `listConductorsPreferringWrite` keeps the swallowing
|
|
28
28
|
* contract, because it already answers a failure by falling back.
|
|
29
29
|
*/
|
|
30
30
|
export const listConductors = (client) => listOutcome(client, 'bb_conductor', toConductor);
|
|
31
|
-
/**
|
|
32
|
-
* The conductor collection scoped to one project (BB-664 review F4).
|
|
33
|
-
*
|
|
34
|
-
* The create popup's narrow option loader, not `ConductorQuery`'s row-page
|
|
35
|
-
* read above (BB-664 plan correction): this keeps `listOutcome`'s own
|
|
36
|
-
* outcome/error contract rather than inventing a second one for the same
|
|
37
|
-
* entity. An unscoped caller keeps calling {@link listConductors}; this is
|
|
38
|
-
* additive.
|
|
39
|
-
*/
|
|
40
|
-
export const listConductorsForProject = async (client, projectId) => {
|
|
41
|
-
try {
|
|
42
|
-
return {
|
|
43
|
-
rows: (await client
|
|
44
|
-
.collection('bb_conductor')
|
|
45
|
-
.where('project_id.id', '=', projectId)
|
|
46
|
-
.list()).map(toConductor),
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
catch (caught) {
|
|
50
|
-
return { rows: [], error: messageOf(caught) };
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
31
|
/**
|
|
54
32
|
* The same collection read through the WRITE client where there is one — still just
|
|
55
33
|
* reading, but the write scope is the one that decides what a write may reference,
|
|
@@ -2,9 +2,7 @@ import type { DropshClient } from '../../../types.js';
|
|
|
2
2
|
import type { JsonApiCollectionDoc } from '../../collection.js';
|
|
3
3
|
/** What this checkout's conductor record supplies to the cockpit's defaults. */
|
|
4
4
|
export interface OwnConductor {
|
|
5
|
-
/**
|
|
6
|
-
machineId: string | undefined;
|
|
7
|
-
/** The project name it serves — the new-ticket form's default project. */
|
|
5
|
+
/** The project name it serves — the cockpit's default project. */
|
|
8
6
|
project: string | undefined;
|
|
9
7
|
}
|
|
10
8
|
/**
|
|
@@ -13,8 +11,8 @@ export interface OwnConductor {
|
|
|
13
11
|
* A repo may host several conductor configs, and they share one
|
|
14
12
|
* `workspace_root` — the dir alone cannot say which of them the cockpit belongs
|
|
15
13
|
* to. The first in server order is taken, and that is a documented guess rather
|
|
16
|
-
* than a resolution:
|
|
17
|
-
*
|
|
14
|
+
* than a resolution: it only picks the default project, which `--project`
|
|
15
|
+
* overrides.
|
|
18
16
|
*/
|
|
19
17
|
export declare function selectOwnConductor(doc: JsonApiCollectionDoc, bakersDir: string): OwnConductor;
|
|
20
18
|
/**
|
|
@@ -28,7 +26,7 @@ export declare function selectOwnConductor(doc: JsonApiCollectionDoc, bakersDir:
|
|
|
28
26
|
* this lookup needs no filter because its predicate is already stricter.
|
|
29
27
|
*
|
|
30
28
|
* A failure yields nothing rather than rejecting: this runs on the boot path,
|
|
31
|
-
* and an unreachable control plane must leave the cockpit openable — the
|
|
32
|
-
*
|
|
29
|
+
* and an unreachable control plane must leave the cockpit openable — the
|
|
30
|
+
* project it produces is a default, not a precondition.
|
|
33
31
|
*/
|
|
34
32
|
export declare function readOwnConductor(client: DropshClient, bakersDir: string): Promise<OwnConductor>;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
// BB-232 (spec Decision D9) — "which conductor is THIS checkout's?", answered
|
|
2
2
|
// from the control plane instead of the deleted `~/.bakers/conductors.json`.
|
|
3
3
|
//
|
|
4
|
-
// The `bakers ui` entry used to read
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
// resolve them itself — it holds no JSON:API client (BB-223 spec Finding 1) —
|
|
4
|
+
// The `bakers ui` entry used to read the project this checkout belongs to
|
|
5
|
+
// straight out of the registry file; it is the cockpit's default project. The
|
|
6
|
+
// entry cannot resolve it itself — it holds no JSON:API client (BB-223 spec Finding 1) —
|
|
8
7
|
// so it hands over the `.bakers` dir it is standing in and the renderer matches it
|
|
9
8
|
// against each conductor's `workspace_root`, which is the same directory the
|
|
10
9
|
// registry's `path` held.
|
|
@@ -23,7 +22,7 @@
|
|
|
23
22
|
// itself — so a cockpit opened against an un-healed record still resolves.
|
|
24
23
|
import { dirname, resolve } from 'node:path';
|
|
25
24
|
import { DrupalJsonApiParams } from 'drupal-jsonapi-params';
|
|
26
|
-
const NOTHING = {
|
|
25
|
+
const NOTHING = { project: undefined };
|
|
27
26
|
/** Id of a single-valued relationship linkage (`data` object), or null. */
|
|
28
27
|
function singleRelId(rel) {
|
|
29
28
|
const data = rel?.data;
|
|
@@ -38,8 +37,8 @@ const str = (v) => typeof v === 'string' && v.length > 0 ? v : undefined;
|
|
|
38
37
|
* A repo may host several conductor configs, and they share one
|
|
39
38
|
* `workspace_root` — the dir alone cannot say which of them the cockpit belongs
|
|
40
39
|
* to. The first in server order is taken, and that is a documented guess rather
|
|
41
|
-
* than a resolution:
|
|
42
|
-
*
|
|
40
|
+
* than a resolution: it only picks the default project, which `--project`
|
|
41
|
+
* overrides.
|
|
43
42
|
*/
|
|
44
43
|
export function selectOwnConductor(doc, bakersDir) {
|
|
45
44
|
// The current form (BB-450 D3): workspace_root is the checkout root.
|
|
@@ -63,13 +62,7 @@ export function selectOwnConductor(doc, bakersDir) {
|
|
|
63
62
|
? str((doc.included ?? []).find((inc) => inc.id === projectId)?.attributes
|
|
64
63
|
?.name)
|
|
65
64
|
: undefined;
|
|
66
|
-
|
|
67
|
-
// the legacy attribute during cutover so a pre-upgrade control plane still
|
|
68
|
-
// preselects this checkout's conductor.
|
|
69
|
-
return {
|
|
70
|
-
machineId: str(own.attributes?.conductor_id) ?? str(own.attributes?.machine_id),
|
|
71
|
-
project,
|
|
72
|
-
};
|
|
65
|
+
return { project };
|
|
73
66
|
}
|
|
74
67
|
/**
|
|
75
68
|
* Read the conductor collection and resolve this checkout's own record.
|
|
@@ -82,8 +75,8 @@ export function selectOwnConductor(doc, bakersDir) {
|
|
|
82
75
|
* this lookup needs no filter because its predicate is already stricter.
|
|
83
76
|
*
|
|
84
77
|
* A failure yields nothing rather than rejecting: this runs on the boot path,
|
|
85
|
-
* and an unreachable control plane must leave the cockpit openable — the
|
|
86
|
-
*
|
|
78
|
+
* and an unreachable control plane must leave the cockpit openable — the
|
|
79
|
+
* project it produces is a default, not a precondition.
|
|
87
80
|
*/
|
|
88
81
|
export async function readOwnConductor(client, bakersDir) {
|
|
89
82
|
const params = new DrupalJsonApiParams().addInclude(['project_id']);
|
|
@@ -79,10 +79,7 @@ export class ProjectsScreen extends AsyncScreen {
|
|
|
79
79
|
};
|
|
80
80
|
}
|
|
81
81
|
actions() {
|
|
82
|
-
return [
|
|
83
|
-
actionItem('projects-new', 'n', 'new'),
|
|
84
|
-
actionItem('projects-tab', 'Tab', 'tabs'),
|
|
85
|
-
];
|
|
82
|
+
return [actionItem('projects-tab', 'Tab', 'tabs')];
|
|
86
83
|
}
|
|
87
84
|
activate(index, context) {
|
|
88
85
|
const row = this.readyValue?.[index];
|
|
@@ -19,7 +19,7 @@ export declare function runDetailTree(document: TicketDetailDocument, runId: str
|
|
|
19
19
|
* The run block as PLAIN TEXT — the pipe's own output (spec F5).
|
|
20
20
|
*
|
|
21
21
|
* The operator's ruling after plan Task 10: a run is handled exactly like every
|
|
22
|
-
* other entity. `ticket.detail
|
|
22
|
+
* other entity. `ticket.detail` and the project picker each print
|
|
23
23
|
* a deliberately different text into a pipe rather than a rendering of their
|
|
24
24
|
* surface; the run detail was the only entity detail that did not, which is the
|
|
25
25
|
* only reason its rows went through the tree→text path at all. That path renders
|
|
@@ -248,7 +248,7 @@ export function runDetailTree(document, runId, baseUrl) {
|
|
|
248
248
|
* The run block as PLAIN TEXT — the pipe's own output (spec F5).
|
|
249
249
|
*
|
|
250
250
|
* The operator's ruling after plan Task 10: a run is handled exactly like every
|
|
251
|
-
* other entity. `ticket.detail
|
|
251
|
+
* other entity. `ticket.detail` and the project picker each print
|
|
252
252
|
* a deliberately different text into a pipe rather than a rendering of their
|
|
253
253
|
* surface; the run detail was the only entity detail that did not, which is the
|
|
254
254
|
* only reason its rows went through the tree→text path at all. That path renders
|
|
@@ -34,11 +34,6 @@ export declare function buildUserRunQueryParams(userId: string, criteria: RunCri
|
|
|
34
34
|
size: number;
|
|
35
35
|
index: number;
|
|
36
36
|
}): DrupalJsonApiParams;
|
|
37
|
-
/** Runs attributed to one member inside the selected team's project set. */
|
|
38
|
-
export declare function buildTeamMemberRunQueryParams(userId: string, projectIds: string[], criteria: RunCriteria, page?: {
|
|
39
|
-
size: number;
|
|
40
|
-
index: number;
|
|
41
|
-
}): DrupalJsonApiParams;
|
|
42
37
|
/**
|
|
43
38
|
* Build the JSON:API query for one conductor's held work: runs whose
|
|
44
39
|
* `conductor_id` matches and whose state is still non-terminal
|
|
@@ -44,14 +44,6 @@ export function buildUserRunQueryParams(userId, criteria, page = { size: LIST_PA
|
|
|
44
44
|
applyRunCriteria(params, criteria, page);
|
|
45
45
|
return params;
|
|
46
46
|
}
|
|
47
|
-
/** Runs attributed to one member inside the selected team's project set. */
|
|
48
|
-
export function buildTeamMemberRunQueryParams(userId, projectIds, criteria, page = { size: LIST_PAGE_SIZE, index: 0 }) {
|
|
49
|
-
const params = new DrupalJsonApiParams();
|
|
50
|
-
params.addFilter('ticket_id.assignee_user_id.id', userId);
|
|
51
|
-
params.addFilter('ticket_id.project_id.id', projectIds, 'IN');
|
|
52
|
-
applyRunCriteria(params, criteria, page);
|
|
53
|
-
return params;
|
|
54
|
-
}
|
|
55
47
|
/**
|
|
56
48
|
* Build the JSON:API query for one conductor's held work: runs whose
|
|
57
49
|
* `conductor_id` matches and whose state is still non-terminal
|
|
@@ -320,8 +320,6 @@ export type RunPage = Page<RunRow>;
|
|
|
320
320
|
export declare function loadProjectRuns(client: DropshClient, projectId: string, criteria: RunCriteria, page?: number): Promise<RunPage>;
|
|
321
321
|
/** One page of runs attributed to a user via ticket assignee (BB-377 D2). */
|
|
322
322
|
export declare function loadUserRuns(client: DropshClient, userId: string, criteria: RunCriteria, page?: number): Promise<RunPage>;
|
|
323
|
-
/** One page attributed to a member within a team's linked project set. */
|
|
324
|
-
export declare function loadTeamMemberRuns(client: DropshClient, userId: string, projectIds: string[], criteria: RunCriteria, page?: number): Promise<RunPage>;
|
|
325
323
|
/**
|
|
326
324
|
* Newest-STARTED first, and TOTAL (BB-255 D5).
|
|
327
325
|
*
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
// no-request read of the ticket document (spec D7).
|
|
8
8
|
import { loadPage, } from '../../collection.js';
|
|
9
9
|
import { LIST_PAGE_SIZE } from '../../cycle.js';
|
|
10
|
-
import { buildRunQueryParams,
|
|
10
|
+
import { buildRunQueryParams, buildUserRunQueryParams, } from './query.js';
|
|
11
11
|
import { deriveRunStatus, runStartedAge } from './status.js';
|
|
12
12
|
/** Read a value as a string, or `undefined` when it is not one. */
|
|
13
13
|
function str(value) {
|
|
@@ -272,31 +272,6 @@ export async function loadUserRuns(client, userId, criteria, page = 0) {
|
|
|
272
272
|
return data.map((item) => mapRunData(item, ticketsById));
|
|
273
273
|
}, page, window);
|
|
274
274
|
}
|
|
275
|
-
/** One page attributed to a member within a team's linked project set. */
|
|
276
|
-
export async function loadTeamMemberRuns(client, userId, projectIds, criteria, page = 0) {
|
|
277
|
-
if (projectIds.length === 0) {
|
|
278
|
-
return { rows: [], hasNext: false, page, total: 0, window: null };
|
|
279
|
-
}
|
|
280
|
-
const window = {
|
|
281
|
-
offset: page * LIST_PAGE_SIZE,
|
|
282
|
-
limit: LIST_PAGE_SIZE,
|
|
283
|
-
};
|
|
284
|
-
const params = buildTeamMemberRunQueryParams(userId, projectIds, criteria, {
|
|
285
|
-
size: window.limit,
|
|
286
|
-
index: page,
|
|
287
|
-
});
|
|
288
|
-
const result = await loadPage(client, 'bb_run/bb_run', params, (data, included) => {
|
|
289
|
-
const ticketsById = new Map();
|
|
290
|
-
for (const inc of included)
|
|
291
|
-
if (inc.id)
|
|
292
|
-
ticketsById.set(inc.id, inc);
|
|
293
|
-
return data.map((item) => mapRunData(item, ticketsById));
|
|
294
|
-
}, page, window);
|
|
295
|
-
if (result.withheld) {
|
|
296
|
-
throw new Error('the control plane withheld team member run rows');
|
|
297
|
-
}
|
|
298
|
-
return result;
|
|
299
|
-
}
|
|
300
275
|
/**
|
|
301
276
|
* Newest-STARTED first, and TOTAL (BB-255 D5).
|
|
302
277
|
*
|
|
@@ -55,7 +55,7 @@ export declare class RunDetailScreen extends AsyncScreen<TicketDetailDocument> {
|
|
|
55
55
|
* F5 — the pipe's own output, and it is `string[]`.
|
|
56
56
|
*
|
|
57
57
|
* The run is handled exactly like every other entity (the operator's ruling
|
|
58
|
-
* after plan Task 10): `ticket.detail
|
|
58
|
+
* after plan Task 10): `ticket.detail` and the project picker
|
|
59
59
|
* have always printed their own plain text into a pipe, and this screen was
|
|
60
60
|
* the only entity detail falling through to the tree→text path instead. That
|
|
61
61
|
* path lays the body out on a cell grid of a fixed width, and a pipe has no
|
|
@@ -99,7 +99,7 @@ export class RunDetailScreen extends AsyncScreen {
|
|
|
99
99
|
* F5 — the pipe's own output, and it is `string[]`.
|
|
100
100
|
*
|
|
101
101
|
* The run is handled exactly like every other entity (the operator's ruling
|
|
102
|
-
* after plan Task 10): `ticket.detail
|
|
102
|
+
* after plan Task 10): `ticket.detail` and the project picker
|
|
103
103
|
* have always printed their own plain text into a pipe, and this screen was
|
|
104
104
|
* the only entity detail falling through to the tree→text path instead. That
|
|
105
105
|
* path lays the body out on a cell grid of a fixed width, and a pipe has no
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { VNode } from '@opentui/core';
|
|
2
2
|
import type { ActiveRunInfo } from '../../../run/Data/active-run.js';
|
|
3
|
-
import type { FieldDef } from '../../Form/
|
|
4
|
-
import type { EditFieldId, EditFormOptions, EditFormState } from '../../Form/edit.js';
|
|
3
|
+
import type { EditFieldId, EditFormOptions, EditFormState, FieldDef } from '../../Form/edit.js';
|
|
5
4
|
/**
|
|
6
5
|
* The chrome around the fields: what went wrong, and who is live.
|
|
7
6
|
*
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// The "Edit ticket" popup's body (BB-233, widened by BB-308 / BB-360), as
|
|
2
|
-
// CHROME around its declaration
|
|
3
|
-
// now, not a second implementation of it.
|
|
2
|
+
// CHROME around its declaration.
|
|
4
3
|
//
|
|
5
4
|
// BB-257 (re-entry) AC-13/AC-14. What this file used to carry, and why each
|
|
6
5
|
// piece had to go:
|
|
@@ -1,19 +1,14 @@
|
|
|
1
1
|
import { type VNode } from '@opentui/core';
|
|
2
2
|
import type { TicketAddons } from '../../Data/addons.js';
|
|
3
|
-
import { type TicketContentEntry, type TicketContentModel, type TicketContentTab, type TicketProperty
|
|
3
|
+
import { type TicketContentEntry, type TicketContentModel, type TicketContentTab, type TicketProperty } from './model.js';
|
|
4
4
|
export declare const SIDEBAR_TABS: readonly [{
|
|
5
5
|
readonly id: "details";
|
|
6
6
|
readonly label: "Details";
|
|
7
|
-
}, {
|
|
8
|
-
readonly id: "stats";
|
|
9
|
-
readonly label: "Stats";
|
|
10
7
|
}, {
|
|
11
8
|
readonly id: "related";
|
|
12
9
|
readonly label: "Related";
|
|
13
10
|
}];
|
|
14
11
|
export type SidebarTabId = (typeof SIDEBAR_TABS)[number]['id'];
|
|
15
|
-
/** The pane a sidebar opens on: Stats once the ticket is done, else Details. */
|
|
16
|
-
export declare const defaultSidebarTab: (sidebar: TicketSidebar) => SidebarTabId;
|
|
17
12
|
export interface TicketContentProps {
|
|
18
13
|
/** The owner every node id derives from. */
|
|
19
14
|
readonly id: string;
|
|
@@ -26,7 +21,7 @@ export interface TicketContentProps {
|
|
|
26
21
|
readonly activateProperty?: (item: TicketProperty) => void;
|
|
27
22
|
/** Terminal width — the Overview's side-by-side breakpoint reads it. */
|
|
28
23
|
readonly terminalColumns: number;
|
|
29
|
-
/** The visit's sidebar pane; absent means
|
|
24
|
+
/** The visit's sidebar pane; absent means Details. */
|
|
30
25
|
readonly sidebarTab?: SidebarTabId;
|
|
31
26
|
readonly onSidebarTab: (tab: SidebarTabId) => void;
|
|
32
27
|
/** The Planning document tab last chosen in this visit. */
|
|
@@ -45,7 +40,7 @@ export declare const activeDocumentKey: (documents: readonly TicketContentEntry[
|
|
|
45
40
|
/**
|
|
46
41
|
* The row id a Tab/arrow-key visit lands on for the inline messages card —
|
|
47
42
|
* exported so the screen can add it to `selectableKeys` and open the full
|
|
48
|
-
* send/poll screen on Enter, the same way Details/
|
|
43
|
+
* send/poll screen on Enter, the same way Details/Related are reached
|
|
49
44
|
* by keyboard even though their own pane switching stays mouse-only.
|
|
50
45
|
*/
|
|
51
46
|
export declare const ADDONS_KEY = "addons-card";
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { BoxRenderable, h } from '@opentui/core';
|
|
2
2
|
import { Card } from '../../../../Component/card/index.js';
|
|
3
3
|
import { Divider } from '../../../../Component/divider/index.js';
|
|
4
|
-
import { HeatMap } from '../../../../Component/heat-map/index.js';
|
|
5
4
|
import { KeyValue, } from '../../../../Component/key-value/index.js';
|
|
6
5
|
import { HeadlineMarkdown, MarkdownLines, } from '../../../../Component/markdown/index.js';
|
|
7
6
|
import { lineText, } from '../../../../Component/section-list/index.js';
|
|
@@ -12,11 +11,8 @@ import { documentTabLabel, ticketContentRowId, } from './model.js';
|
|
|
12
11
|
// they render full-width in the left column (see linksSection) instead.
|
|
13
12
|
export const SIDEBAR_TABS = [
|
|
14
13
|
{ id: 'details', label: 'Details' },
|
|
15
|
-
{ id: 'stats', label: 'Stats' },
|
|
16
14
|
{ id: 'related', label: 'Related' },
|
|
17
15
|
];
|
|
18
|
-
/** The pane a sidebar opens on: Stats once the ticket is done, else Details. */
|
|
19
|
-
export const defaultSidebarTab = (sidebar) => sidebar.showMetrics ? 'stats' : 'details';
|
|
20
16
|
const isCells = (line) => typeof line !== 'string' && 'cells' in line;
|
|
21
17
|
const isStyled = (line) => typeof line !== 'string' && 'runs' in line;
|
|
22
18
|
const TECHNICAL_KEY = 'section:Technical details';
|
|
@@ -262,69 +258,8 @@ const properties = (id, items, activateProperty) => KeyValue({
|
|
|
262
258
|
keyColor: FOREGROUND,
|
|
263
259
|
valueColor: FOREGROUND_HIGHLIGHT,
|
|
264
260
|
});
|
|
265
|
-
const heatGrid = (id, grid) => {
|
|
266
|
-
if (grid.columns.length === 0 || grid.rows.length === 0)
|
|
267
|
-
return null;
|
|
268
|
-
return HeatMap({
|
|
269
|
-
id,
|
|
270
|
-
data: grid.rows.map((row) => row.cells.map((cell) => cell.value ?? 0)),
|
|
271
|
-
rowLabels: grid.rows.map((row) => row.label),
|
|
272
|
-
colLabels: grid.columns.map((column) => column.label),
|
|
273
|
-
showValues: true,
|
|
274
|
-
});
|
|
275
|
-
};
|
|
276
|
-
const ticketStats = (id, grid) => {
|
|
277
|
-
const row = grid.rows[0];
|
|
278
|
-
if (grid.columns.length === 0 || row === undefined)
|
|
279
|
-
return null;
|
|
280
|
-
return KeyValue({
|
|
281
|
-
id,
|
|
282
|
-
items: grid.columns.map((column, index) => ({
|
|
283
|
-
key: column.label,
|
|
284
|
-
value: row.cells[index]?.display ?? 'none',
|
|
285
|
-
})),
|
|
286
|
-
keyColor: FOREGROUND,
|
|
287
|
-
valueColor: FOREGROUND_HIGHLIGHT,
|
|
288
|
-
});
|
|
289
|
-
};
|
|
290
|
-
const metricsMatrix = (id, matrix) => {
|
|
291
|
-
const ticket = ticketStats(`${id}-ticket-values`, matrix.ticket);
|
|
292
|
-
const runs = heatGrid(`${id}-runs-values`, matrix.runs);
|
|
293
|
-
if (ticket === null && runs === null)
|
|
294
|
-
return paragraphNode({
|
|
295
|
-
id: `${id}-none`,
|
|
296
|
-
runs: [plainRun('none')],
|
|
297
|
-
fg: FOREGROUND_HIGHLIGHT,
|
|
298
|
-
flexShrink: 0,
|
|
299
|
-
});
|
|
300
|
-
return column(id, { width: '100%', flexShrink: 0 }, ...(ticket === null
|
|
301
|
-
? []
|
|
302
|
-
: [
|
|
303
|
-
HeadlineMarkdown({
|
|
304
|
-
id: `${id}-ticket`,
|
|
305
|
-
headline: 'ticket',
|
|
306
|
-
children: [ticket],
|
|
307
|
-
}),
|
|
308
|
-
]), ...(runs === null
|
|
309
|
-
? []
|
|
310
|
-
: [
|
|
311
|
-
HeadlineMarkdown({
|
|
312
|
-
id: `${id}-runs`,
|
|
313
|
-
headline: 'runs',
|
|
314
|
-
children: [runs],
|
|
315
|
-
}),
|
|
316
|
-
]));
|
|
317
|
-
};
|
|
318
261
|
const sidebarCard = (id, sidebar, props) => {
|
|
319
|
-
|
|
320
|
-
// then the sidebar opens on Details and never offers a Stats tab.
|
|
321
|
-
const tabs = sidebar.showMetrics
|
|
322
|
-
? SIDEBAR_TABS
|
|
323
|
-
: SIDEBAR_TABS.filter((item) => item.id !== 'stats');
|
|
324
|
-
const requested = props.sidebarTab ?? defaultSidebarTab(sidebar);
|
|
325
|
-
const tab = tabs.some((item) => item.id === requested)
|
|
326
|
-
? requested
|
|
327
|
-
: defaultSidebarTab(sidebar);
|
|
262
|
+
const tab = props.sidebarTab ?? 'details';
|
|
328
263
|
const pane = tab === 'related' ? sidebar.related : sidebar.details;
|
|
329
264
|
return Card({
|
|
330
265
|
id,
|
|
@@ -347,20 +282,18 @@ const sidebarCard = (id, sidebar, props) => {
|
|
|
347
282
|
flexShrink: 0,
|
|
348
283
|
gap: 1,
|
|
349
284
|
onMouseDown: pressHandler(() => props.select(TECHNICAL_KEY)),
|
|
350
|
-
}, ...
|
|
285
|
+
}, ...SIDEBAR_TABS.map((item) => tabLabel(`${id}-tab-${item.id}`, item.label, tab === item.id, tab === item.id ? FOREGROUND_HIGHLIGHT : FOREGROUND, () => {
|
|
351
286
|
props.onSidebarTab(item.id);
|
|
352
287
|
props.select(TECHNICAL_KEY);
|
|
353
288
|
})))),
|
|
354
|
-
column(`${id}-pane`, { width: '100%', flexShrink: 0, marginTop: 1, gap: 1 }, tab
|
|
355
|
-
? metricsMatrix(`${id}-metrics`, sidebar.matrix)
|
|
356
|
-
: properties(`${id}-properties-${tab}`, pane, props.activateProperty)),
|
|
289
|
+
column(`${id}-pane`, { width: '100%', flexShrink: 0, marginTop: 1, gap: 1 }, properties(`${id}-properties-${tab}`, pane, props.activateProperty)),
|
|
357
290
|
],
|
|
358
291
|
});
|
|
359
292
|
};
|
|
360
293
|
/**
|
|
361
294
|
* The row id a Tab/arrow-key visit lands on for the inline messages card —
|
|
362
295
|
* exported so the screen can add it to `selectableKeys` and open the full
|
|
363
|
-
* send/poll screen on Enter, the same way Details/
|
|
296
|
+
* send/poll screen on Enter, the same way Details/Related are reached
|
|
364
297
|
* by keyboard even though their own pane switching stays mouse-only.
|
|
365
298
|
*/
|
|
366
299
|
export const ADDONS_KEY = 'addons-card';
|
|
@@ -15,34 +15,10 @@ export interface TicketProperty {
|
|
|
15
15
|
readonly ticketId?: string;
|
|
16
16
|
readonly href?: string;
|
|
17
17
|
}
|
|
18
|
-
export interface TicketMatrixColumn {
|
|
19
|
-
readonly key: string;
|
|
20
|
-
readonly label: string;
|
|
21
|
-
}
|
|
22
|
-
export interface TicketMatrixCell {
|
|
23
|
-
readonly intensity: number | null;
|
|
24
|
-
readonly display: string;
|
|
25
|
-
readonly value?: number;
|
|
26
|
-
}
|
|
27
|
-
export interface TicketMatrixRow {
|
|
28
|
-
readonly id: string;
|
|
29
|
-
readonly label: string;
|
|
30
|
-
readonly cells: readonly TicketMatrixCell[];
|
|
31
|
-
}
|
|
32
|
-
export interface TicketHeatGrid {
|
|
33
|
-
readonly columns: readonly TicketMatrixColumn[];
|
|
34
|
-
readonly rows: readonly TicketMatrixRow[];
|
|
35
|
-
}
|
|
36
|
-
export interface TicketMetricMatrix {
|
|
37
|
-
readonly ticket: TicketHeatGrid;
|
|
38
|
-
readonly runs: TicketHeatGrid;
|
|
39
|
-
}
|
|
40
18
|
export interface TicketSidebar {
|
|
41
19
|
readonly details: readonly TicketProperty[];
|
|
42
20
|
readonly links: readonly TicketProperty[];
|
|
43
21
|
readonly related: readonly TicketProperty[];
|
|
44
|
-
readonly matrix: TicketMetricMatrix;
|
|
45
|
-
readonly showMetrics: boolean;
|
|
46
22
|
}
|
|
47
23
|
export interface TicketContentModel {
|
|
48
24
|
readonly entries: readonly TicketContentEntry[];
|
|
@@ -51,7 +27,6 @@ export interface TicketContentModel {
|
|
|
51
27
|
}
|
|
52
28
|
export type TicketContentTab = 'overview' | 'planning' | 'comments';
|
|
53
29
|
export declare const documentTabLabel: (title: string) => string;
|
|
54
|
-
export declare const FOOTPRINT_COLUMNS: readonly TicketMatrixColumn[];
|
|
55
30
|
export declare function ticketContentModel(document: TicketDetailDocument, tab: TicketContentTab, labels: AssignmentLabels | undefined, nowSeconds: number, baseUrl?: string): TicketContentModel;
|
|
56
31
|
export declare function ticketContentRowId(key: string): string;
|
|
57
32
|
export declare function resolveSelectedKey(selectableKeys: readonly string[], previous: string | undefined): string | undefined;
|