@skillcdn/console 0.1.1 → 0.1.3
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/README.md +15 -10
- package/dist/api.d.ts +6 -5
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +5 -4
- package/dist/api.js.map +1 -1
- package/dist/cli/cli.d.ts +3 -0
- package/dist/cli/cli.d.ts.map +1 -1
- package/dist/cli/cli.js +251 -44
- package/dist/cli/cli.js.map +1 -1
- package/dist/cli/directory.d.ts +14 -0
- package/dist/cli/directory.d.ts.map +1 -0
- package/dist/cli/directory.js +46 -0
- package/dist/cli/directory.js.map +1 -0
- package/dist/cli/format.d.ts +15 -3
- package/dist/cli/format.d.ts.map +1 -1
- package/dist/cli/format.js +84 -6
- package/dist/cli/format.js.map +1 -1
- package/dist/cli/help.d.ts.map +1 -1
- package/dist/cli/help.js +78 -9
- package/dist/cli/help.js.map +1 -1
- package/dist/cli/main.js +2 -0
- package/dist/cli/main.js.map +1 -1
- package/dist/client.d.ts +69 -10
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +71 -33
- package/dist/client.js.map +1 -1
- package/dist/components/decision-list.d.ts +7 -1
- package/dist/components/decision-list.d.ts.map +1 -1
- package/dist/components/decision-list.js +21 -4
- package/dist/components/decision-list.js.map +1 -1
- package/dist/components/documents.d.ts +85 -0
- package/dist/components/documents.d.ts.map +1 -0
- package/dist/components/documents.js +103 -0
- package/dist/components/documents.js.map +1 -0
- package/dist/components/event-feed.d.ts.map +1 -1
- package/dist/components/event-feed.js +46 -14
- package/dist/components/event-feed.js.map +1 -1
- package/dist/components/markdown.d.ts +5 -2
- package/dist/components/markdown.d.ts.map +1 -1
- package/dist/components/markdown.js +8 -1
- package/dist/components/markdown.js.map +1 -1
- package/dist/components/projects.d.ts +41 -0
- package/dist/components/projects.d.ts.map +1 -0
- package/dist/components/projects.js +81 -0
- package/dist/components/projects.js.map +1 -0
- package/dist/components/runs.d.ts +5 -2
- package/dist/components/runs.d.ts.map +1 -1
- package/dist/components/runs.js +4 -4
- package/dist/components/runs.js.map +1 -1
- package/dist/components/shell.d.ts +5 -0
- package/dist/components/shell.d.ts.map +1 -1
- package/dist/components/shell.js +1 -1
- package/dist/components/shell.js.map +1 -1
- package/dist/components/task-view.d.ts +9 -1
- package/dist/components/task-view.d.ts.map +1 -1
- package/dist/components/task-view.js +3 -2
- package/dist/components/task-view.js.map +1 -1
- package/dist/console.css +253 -1
- package/dist/console.d.ts +3 -0
- package/dist/console.d.ts.map +1 -1
- package/dist/console.js +156 -58
- package/dist/console.js.map +1 -1
- package/dist/data.d.ts +44 -10
- package/dist/data.d.ts.map +1 -1
- package/dist/data.js +215 -81
- package/dist/data.js.map +1 -1
- package/dist/docs-page.d.ts +11 -0
- package/dist/docs-page.d.ts.map +1 -0
- package/dist/docs-page.js +146 -0
- package/dist/docs-page.js.map +1 -0
- package/dist/documents.d.ts +19 -0
- package/dist/documents.d.ts.map +1 -0
- package/dist/documents.js +64 -0
- package/dist/documents.js.map +1 -0
- package/dist/index.d.ts +6 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/limits.d.ts +17 -0
- package/dist/limits.d.ts.map +1 -1
- package/dist/limits.js +17 -0
- package/dist/limits.js.map +1 -1
- package/dist/router.d.ts +28 -7
- package/dist/router.d.ts.map +1 -1
- package/dist/router.js +52 -23
- package/dist/router.js.map +1 -1
- package/dist/routes.d.ts +16 -12
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +31 -11
- package/dist/routes.js.map +1 -1
- package/dist/schemas.d.ts +414 -28
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +204 -27
- package/dist/schemas.js.map +1 -1
- package/dist/use-action.d.ts +8 -0
- package/dist/use-action.d.ts.map +1 -0
- package/dist/use-action.js +30 -0
- package/dist/use-action.js.map +1 -0
- package/dist/vocabulary.d.ts +10 -1
- package/dist/vocabulary.d.ts.map +1 -1
- package/dist/vocabulary.js +16 -0
- package/dist/vocabulary.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { PersonChip, STATE_LABELS, Time } from "./ui.js";
|
|
3
|
-
// The feed: one line per event, newest first, as a sentence a person reads at a glance
|
|
4
|
-
// takes its data as props and nothing from the
|
|
3
|
+
// The feed: one line per event, newest first, as a sentence a person reads at a glance: who,
|
|
4
|
+
// as which agent when through one, and what. It takes its data as props and nothing from the
|
|
5
|
+
// network.
|
|
5
6
|
const FIELD_WORDS = {
|
|
6
7
|
title: "the title",
|
|
7
8
|
body: "the body",
|
|
@@ -9,40 +10,71 @@ const FIELD_WORDS = {
|
|
|
9
10
|
assigneeId: "the assignee",
|
|
10
11
|
parentId: "what it is part of",
|
|
11
12
|
links: "the links",
|
|
13
|
+
name: "the name",
|
|
14
|
+
description: "the description",
|
|
15
|
+
visibility: "who is a member",
|
|
16
|
+
skillsAddress: "the skills address",
|
|
17
|
+
outcome: "what followed",
|
|
12
18
|
};
|
|
13
|
-
|
|
14
|
-
|
|
19
|
+
const roleWords = (role) => role === "admin"
|
|
20
|
+
? "an administrator"
|
|
21
|
+
: role === "owner"
|
|
22
|
+
? "an owner"
|
|
23
|
+
: role === "member"
|
|
24
|
+
? "a member"
|
|
25
|
+
: "something";
|
|
15
26
|
/** What an event says, without its actor: the words after the name. */
|
|
16
27
|
export function describeEvent(event) {
|
|
17
28
|
const { data } = event;
|
|
18
29
|
const task = data.number === undefined
|
|
19
30
|
? "a task"
|
|
20
31
|
: `#${data.number}${data.title === undefined ? "" : ` ${data.title}`}`;
|
|
32
|
+
const project = data.name ?? data.key ?? "a project";
|
|
33
|
+
const fields = (data.fields ?? []).map((field) => FIELD_WORDS[field] ?? field);
|
|
34
|
+
const page = data.title === undefined ? `the page ${data.path ?? ""}`.trimEnd() : `the page ${data.title}`;
|
|
21
35
|
switch (event.kind) {
|
|
22
36
|
case "person.joined":
|
|
23
37
|
return "joined the board";
|
|
24
38
|
case "person.role_changed":
|
|
25
|
-
return `made ${data.login ?? "someone"} ${data.role
|
|
39
|
+
return `made ${data.login ?? "someone"} ${roleWords(data.role)}`;
|
|
40
|
+
case "project.created":
|
|
41
|
+
return `made the project ${project}`;
|
|
42
|
+
case "project.updated":
|
|
43
|
+
return `changed ${fields.length === 0 ? "something" : fields.join(", ")} of the project ${project}`;
|
|
44
|
+
case "project.member_added":
|
|
45
|
+
return `added ${data.login ?? "someone"} to ${project} as ${roleWords(data.role)}`;
|
|
46
|
+
case "project.member_changed":
|
|
47
|
+
return `made ${data.login ?? "someone"} ${roleWords(data.role)} of ${project}`;
|
|
48
|
+
case "project.member_removed":
|
|
49
|
+
return `removed ${data.login ?? "someone"} from ${project}`;
|
|
26
50
|
case "task.created":
|
|
27
51
|
return `wrote ${task}`;
|
|
28
52
|
case "task.moved":
|
|
29
53
|
return `moved ${task} from ${STATE_LABELS[data.from ?? "idea"]} to ${STATE_LABELS[data.to ?? "idea"]}`;
|
|
30
|
-
case "task.updated":
|
|
31
|
-
const fields = (data.fields ?? []).map((field) => FIELD_WORDS[field] ?? field);
|
|
54
|
+
case "task.updated":
|
|
32
55
|
return `changed ${fields.length === 0 ? "something" : fields.join(", ")} of ${task}`;
|
|
33
|
-
}
|
|
34
56
|
case "decision.raised":
|
|
35
|
-
return `asked
|
|
57
|
+
return `asked: ${data.question ?? "a question"}`;
|
|
36
58
|
case "decision.answered":
|
|
37
59
|
return `answered "${data.question ?? "a question"}": ${data.option ?? ""}`;
|
|
60
|
+
case "decision.updated":
|
|
61
|
+
return `wrote ${fields.length === 0 ? "something" : fields.join(", ")} of the decision "${data.question ?? ""}"`;
|
|
38
62
|
case "run.started":
|
|
39
|
-
return `started on ${task}
|
|
63
|
+
return `started on ${task}`;
|
|
40
64
|
case "run.reported":
|
|
41
|
-
return `reported on ${task}${
|
|
65
|
+
return `reported on ${task}${data.excerpt === undefined ? "" : `: ${data.excerpt}`}`;
|
|
42
66
|
case "run.handed_in":
|
|
43
|
-
return `handed in ${data.label ?? "something"} on ${task}
|
|
67
|
+
return `handed in ${data.label ?? "something"} on ${task}`;
|
|
44
68
|
case "run.ended":
|
|
45
|
-
return `${data.status === "finished" ? "finished" : data.status === "failed" ? "failed on" : "gave up on"} ${task}
|
|
69
|
+
return `${data.status === "finished" ? "finished" : data.status === "failed" ? "failed on" : "gave up on"} ${task}`;
|
|
70
|
+
case "document.written":
|
|
71
|
+
return `wrote ${page}${data.version === undefined ? "" : `, version ${data.version}`}`;
|
|
72
|
+
case "document.archived":
|
|
73
|
+
return `archived ${page}`;
|
|
74
|
+
case "document.restored":
|
|
75
|
+
return `restored ${page}`;
|
|
76
|
+
case "document.file_attached":
|
|
77
|
+
return `attached ${data.label ?? "a file"} to ${page}`;
|
|
46
78
|
}
|
|
47
79
|
}
|
|
48
80
|
export function EventFeed(props) {
|
|
@@ -53,7 +85,7 @@ export function EventFeed(props) {
|
|
|
53
85
|
return (_jsx("ol", { className: "sc-feed", "aria-label": "What happened", children: newestFirst.map((event) => {
|
|
54
86
|
const href = props.href?.(event);
|
|
55
87
|
const words = describeEvent(event);
|
|
56
|
-
return (_jsxs("li", { className: "sc-feed-item", children: [
|
|
88
|
+
return (_jsxs("li", { className: "sc-feed-item", children: [_jsxs("span", { className: "sc-feed-actor", children: [event.actor === null ? (_jsx("span", { className: "sc-person-login", children: "The console" })) : (_jsx(PersonChip, { person: event.actor })), event.agent !== null && (_jsxs("span", { className: "sc-feed-agent", title: "The agent the person acted through", children: ["as ", event.agent] }))] }), _jsx("span", { className: "sc-feed-words", children: href === undefined ? words : _jsx("a", { href: href, children: words }) }), _jsx(Time, { iso: event.createdAt })] }, event.id));
|
|
57
89
|
}) }));
|
|
58
90
|
}
|
|
59
91
|
//# sourceMappingURL=event-feed.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-feed.js","sourceRoot":"","sources":["../../src/components/event-feed.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAEzD,
|
|
1
|
+
{"version":3,"file":"event-feed.js","sourceRoot":"","sources":["../../src/components/event-feed.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAEzD,6FAA6F;AAC7F,6FAA6F;AAC7F,WAAW;AAEX,MAAM,WAAW,GAAqC;IACpD,KAAK,EAAE,WAAW;IAClB,IAAI,EAAE,UAAU;IAChB,QAAQ,EAAE,cAAc;IACxB,UAAU,EAAE,cAAc;IAC1B,QAAQ,EAAE,oBAAoB;IAC9B,KAAK,EAAE,WAAW;IAClB,IAAI,EAAE,UAAU;IAChB,WAAW,EAAE,iBAAiB;IAC9B,UAAU,EAAE,iBAAiB;IAC7B,aAAa,EAAE,oBAAoB;IACnC,OAAO,EAAE,eAAe;CACzB,CAAC;AAEF,MAAM,SAAS,GAAG,CAAC,IAAwB,EAAU,EAAE,CACrD,IAAI,KAAK,OAAO;IACd,CAAC,CAAC,kBAAkB;IACpB,CAAC,CAAC,IAAI,KAAK,OAAO;QAChB,CAAC,CAAC,UAAU;QACZ,CAAC,CAAC,IAAI,KAAK,QAAQ;YACjB,CAAC,CAAC,UAAU;YACZ,CAAC,CAAC,WAAW,CAAC;AAEtB,uEAAuE;AACvE,MAAM,UAAU,aAAa,CAAC,KAAgB;IAC5C,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC;IACvB,MAAM,IAAI,GACR,IAAI,CAAC,MAAM,KAAK,SAAS;QACvB,CAAC,CAAC,QAAQ;QACV,CAAC,CAAC,IAAI,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC;IAC3E,MA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CAAC,KAAK,GAAI,CACpC,EACA,KAAK,CAAC,KAAK,KAAK,IAAI,IAAI,CACvB,gBAAM,SAAS,EAAC,eAAe,EAAC,KAAK,EAAC,oCAAoC,oBACpE,KAAK,CAAC,KAAK,IACV,CACR,IACI,EACP,eAAM,SAAS,EAAC,eAAe,YAC5B,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,YAAG,IAAI,EAAE,IAAI,YAAG,KAAK,GAAK,GACnD,EACP,KAAC,IAAI,IAAC,GAAG,EAAE,KAAK,CAAC,SAAS,GAAI,KAhBvB,KAAK,CAAC,EAAE,CAiBZ,CACN,CAAC;QACJ,CAAC,CAAC,GACC,CACN,CAAC;AACJ,CAAC"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
export
|
|
1
|
+
export interface MarkdownProps {
|
|
2
2
|
readonly source: string;
|
|
3
|
-
|
|
3
|
+
/** Where a document of the project is read, by its path; left out, such links stay text. */
|
|
4
|
+
readonly docHref?: ((path: string) => string) | undefined;
|
|
5
|
+
}
|
|
6
|
+
export declare function Markdown(props: MarkdownProps): import("react").JSX.Element;
|
|
4
7
|
//# sourceMappingURL=markdown.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../src/components/markdown.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../src/components/markdown.tsx"],"names":[],"mappings":"AAYA,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,4FAA4F;IAC5F,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC,GAAG,SAAS,CAAC;CAC3D;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,+BAqD5C"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import ReactMarkdown from "react-markdown";
|
|
3
3
|
import remarkGfm from "remark-gfm";
|
|
4
|
+
import { isDocumentPath } from "../documents.js";
|
|
4
5
|
// What people and agents write is untrusted. It is rendered as React elements, never as HTML:
|
|
5
6
|
// raw HTML in the source stays text, links are limited to a few schemes and open elsewhere,
|
|
6
|
-
// and pictures come over https only, lazily and without a referrer.
|
|
7
|
+
// and pictures come over https only, lazily and without a referrer. A link whose destination
|
|
8
|
+
// is a document's path (ADR-0009) leads to the document's page, when the page knows where.
|
|
7
9
|
const SAFE_LINK = /^(https?:|mailto:)/i;
|
|
8
10
|
const SAFE_IMAGE = /^https:\/\//i;
|
|
9
11
|
export function Markdown(props) {
|
|
@@ -17,6 +19,11 @@ export function Markdown(props) {
|
|
|
17
19
|
if (href.startsWith("#")) {
|
|
18
20
|
return _jsx("a", { href: href, children: children });
|
|
19
21
|
}
|
|
22
|
+
const hash = href.indexOf("#");
|
|
23
|
+
const path = hash < 0 ? href : href.slice(0, hash);
|
|
24
|
+
if (props.docHref !== undefined && isDocumentPath(path)) {
|
|
25
|
+
return (_jsx("a", { href: `${props.docHref(path)}${hash < 0 ? "" : href.slice(hash)}`, children: children }));
|
|
26
|
+
}
|
|
20
27
|
if (SAFE_LINK.test(href)) {
|
|
21
28
|
return (_jsx("a", { href: href, target: "_blank", rel: "noopener noreferrer nofollow ugc", children: children }));
|
|
22
29
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdown.js","sourceRoot":"","sources":["../../src/components/markdown.tsx"],"names":[],"mappings":";AAAA,OAAO,aAAa,MAAM,gBAAgB,CAAC;AAC3C,OAAO,SAAS,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"markdown.js","sourceRoot":"","sources":["../../src/components/markdown.tsx"],"names":[],"mappings":";AAAA,OAAO,aAAa,MAAM,gBAAgB,CAAC;AAC3C,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,O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CAAC;oBACD,IAAI,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;wBACzB,OAAO,CACL,YAAG,IAAI,EAAE,IAAI,EAAE,MAAM,EAAC,QAAQ,EAAC,GAAG,EAAC,kCAAkC,YAClE,QAAQ,GACP,CACL,CAAC;oBACJ,CAAC;oBACD,OAAO,yBAAO,QAAQ,GAAQ,CAAC;gBACjC,CAAC;gBACD,GAAG,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE;oBACrB,MAAM,GAAG,GAAG,OAAO,GAAG,KAAK,QAAQ,IAAI,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC;oBAC9E,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;wBACtB,OAAO,eAAM,SAAS,EAAC,qBAAqB,YAAE,GAAG,IAAI,EAAE,GAAQ,CAAC;oBAClE,CAAC;oBACD,OAAO,CACL,cACE,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,GAAG,IAAI,EAAE,EACd,KAAK,EAAE,KAAK,EACZ,OAAO,EAAC,MAAM,EACd,QAAQ,EAAC,OAAO,EAChB,cAAc,EAAC,aAAa,GAC5B,CACH,CAAC;gBACJ,CAAC;aACF,YAEA,KAAK,CAAC,MAAM,GACC,GACZ,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type ProjectRole, type ProjectVisibility, type RestMember, type RestMemberInput, type RestPerson, type RestProject, type RestProjectInput, type RestProjectPatch } from "../api.js";
|
|
3
|
+
export declare const PROJECT_ROLE_LABELS: Readonly<Record<ProjectRole, string>>;
|
|
4
|
+
export declare const VISIBILITY_LABELS: Readonly<Record<ProjectVisibility, string>>;
|
|
5
|
+
export declare function ProjectRoleBadge(props: {
|
|
6
|
+
readonly role: ProjectRole;
|
|
7
|
+
}): import("react").JSX.Element;
|
|
8
|
+
export interface ProjectListProps {
|
|
9
|
+
readonly projects: readonly RestProject[];
|
|
10
|
+
/** The link to a project's board, as the composition routes it. */
|
|
11
|
+
readonly projectHref: (project: RestProject) => string;
|
|
12
|
+
readonly onOpen: (project: RestProject) => void;
|
|
13
|
+
readonly empty?: ReactNode;
|
|
14
|
+
}
|
|
15
|
+
export declare function ProjectList(props: ProjectListProps): import("react").JSX.Element;
|
|
16
|
+
export interface ProjectFormProps {
|
|
17
|
+
/** The project to change; left out, the form makes a new one, with a key. */
|
|
18
|
+
readonly project?: RestProject | undefined;
|
|
19
|
+
readonly busy?: boolean | undefined;
|
|
20
|
+
readonly error?: string | undefined;
|
|
21
|
+
readonly onSubmit: (input: RestProjectInput | RestProjectPatch) => void;
|
|
22
|
+
readonly onCancel?: (() => void) | undefined;
|
|
23
|
+
}
|
|
24
|
+
/** A key as a person types a name: lowercase letters, digits and hyphens, from what they typed. */
|
|
25
|
+
export declare function keyOf(name: string): string;
|
|
26
|
+
export declare function ProjectForm(props: ProjectFormProps): import("react").JSX.Element;
|
|
27
|
+
export interface MemberListProps {
|
|
28
|
+
readonly members: readonly RestMember[];
|
|
29
|
+
/** The people of the workspace who may be listed: those not listed yet are offered. */
|
|
30
|
+
readonly people: readonly RestPerson[];
|
|
31
|
+
/** Whoever is looking, so that their own row says so. */
|
|
32
|
+
readonly me?: RestPerson | undefined;
|
|
33
|
+
/** Called with a person to list, and what they are to be. Left out, the list is read here, not changed. */
|
|
34
|
+
readonly onAdd?: ((input: RestMemberInput) => void) | undefined;
|
|
35
|
+
readonly onChangeRole?: ((member: RestMember, role: ProjectRole) => void) | undefined;
|
|
36
|
+
readonly onRemove?: ((member: RestMember) => void) | undefined;
|
|
37
|
+
readonly busy?: boolean | undefined;
|
|
38
|
+
readonly empty?: ReactNode;
|
|
39
|
+
}
|
|
40
|
+
export declare function MemberList(props: MemberListProps): import("react").JSX.Element;
|
|
41
|
+
//# sourceMappingURL=projects.d.ts.map
|
|
@@ -0,0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JECT_NAME_LENGTH, MAX_SKILLS_ADDRESS_LENGTH, PROJECT_ROLES, PROJECT_VISIBILITIES, } from "../api.js";
|
|
4
|
+
import { Badge, Button, PersonChip, Time } from "./ui.js";
|
|
5
|
+
// The projects of the workspace (ADR-0008): the list a person may see, the way to make one,
|
|
6
|
+
// a project's settings for its owners, and those listed in it. Each takes its data as props
|
|
7
|
+
// and nothing from the network; what people wrote is shown as text, never as HTML.
|
|
8
|
+
export const PROJECT_ROLE_LABELS = {
|
|
9
|
+
owner: "Owner",
|
|
10
|
+
member: "Member",
|
|
11
|
+
};
|
|
12
|
+
export const VISIBILITY_LABELS = {
|
|
13
|
+
workspace: "Everyone of the workspace",
|
|
14
|
+
private: "Only those listed",
|
|
15
|
+
};
|
|
16
|
+
export function ProjectRoleBadge(props) {
|
|
17
|
+
return (_jsx(Badge, { tone: props.role === "owner" ? "point" : "neutral", children: PROJECT_ROLE_LABELS[props.role] }));
|
|
18
|
+
}
|
|
19
|
+
export function ProjectList(props) {
|
|
20
|
+
if (props.projects.length === 0) {
|
|
21
|
+
return _jsx(_Fragment, { children: props.empty ?? null });
|
|
22
|
+
}
|
|
23
|
+
return (_jsx("ul", { className: "sc-projects", "aria-label": "Projects", children: props.projects.map((project) => (_jsxs("li", { className: "sc-project", children: [_jsxs("div", { className: "sc-project-head", children: [_jsx("a", { className: "sc-project-name", href: props.projectHref(project), onClick: (event) => {
|
|
24
|
+
if (event.button === 0 && !event.metaKey && !event.ctrlKey && !event.shiftKey) {
|
|
25
|
+
event.preventDefault();
|
|
26
|
+
props.onOpen(project);
|
|
27
|
+
}
|
|
28
|
+
}, children: project.name }), _jsx("code", { className: "sc-project-key", children: project.key }), _jsx(ProjectRoleBadge, { role: project.role }), project.visibility === "private" && _jsx(Badge, { tone: "neutral", children: "Private" })] }), project.description.length > 0 && (_jsx("p", { className: "sc-project-description", children: project.description })), _jsxs("p", { className: "sc-project-meta", children: [project.openDecisions > 0 && (_jsx(Badge, { tone: "warning", children: project.openDecisions === 1
|
|
29
|
+
? "1 decision waiting"
|
|
30
|
+
: `${project.openDecisions} decisions waiting` })), project.openRuns > 0 && (_jsx(Badge, { tone: "accent", children: project.openRuns === 1 ? "1 agent at work" : `${project.openRuns} agents at work` }))] })] }, project.id))) }));
|
|
31
|
+
}
|
|
32
|
+
/** A key as a person types a name: lowercase letters, digits and hyphens, from what they typed. */
|
|
33
|
+
export function keyOf(name) {
|
|
34
|
+
return name
|
|
35
|
+
.toLowerCase()
|
|
36
|
+
.replaceAll(/[^a-z0-9]+/g, "-")
|
|
37
|
+
.replaceAll(/^-+|-+$/g, "")
|
|
38
|
+
.slice(0, MAX_PROJECT_KEY_LENGTH);
|
|
39
|
+
}
|
|
40
|
+
export function ProjectForm(props) {
|
|
41
|
+
const { project } = props;
|
|
42
|
+
const [name, setName] = useState(project?.name ?? "");
|
|
43
|
+
const [key, setKey] = useState(project?.key ?? "");
|
|
44
|
+
const [keyTouched, setKeyTouched] = useState(project !== undefined);
|
|
45
|
+
const [description, setDescription] = useState(project?.description ?? "");
|
|
46
|
+
const [visibility, setVisibility] = useState(project?.visibility ?? "private");
|
|
47
|
+
const [skillsAddress, setSkillsAddress] = useState(project?.skillsAddress ?? "");
|
|
48
|
+
const submit = (event) => {
|
|
49
|
+
event.preventDefault();
|
|
50
|
+
const settings = {
|
|
51
|
+
name: name.trim(),
|
|
52
|
+
description: description.trim(),
|
|
53
|
+
visibility,
|
|
54
|
+
skillsAddress: skillsAddress.trim() === "" ? null : skillsAddress.trim(),
|
|
55
|
+
};
|
|
56
|
+
props.onSubmit(project === undefined ? { key: key.trim(), ...settings, name: name.trim() } : settings);
|
|
57
|
+
};
|
|
58
|
+
return (_jsxs("form", { className: "sc-form", onSubmit: submit, children: [_jsxs("div", { className: "sc-field-row", children: [_jsxs("label", { className: "sc-field", children: [_jsx("span", { className: "sc-field-label", children: "Name" }), _jsx("input", { className: "sc-input", value: name, maxLength: MAX_PROJECT_NAME_LENGTH, required: true, onChange: (event) => {
|
|
59
|
+
setName(event.target.value);
|
|
60
|
+
if (!keyTouched) {
|
|
61
|
+
setKey(keyOf(event.target.value));
|
|
62
|
+
}
|
|
63
|
+
} })] }), _jsxs("label", { className: "sc-field", children: [_jsx("span", { className: "sc-field-label", children: "Key" }), _jsx("input", { className: "sc-input", value: key, maxLength: MAX_PROJECT_KEY_LENGTH, pattern: "[a-z0-9]([a-z0-9-]*[a-z0-9])?", required: true, disabled: project !== undefined, title: "Lowercase letters, digits and hyphens: what paths and the command say. It does not change.", onChange: (event) => {
|
|
64
|
+
setKeyTouched(true);
|
|
65
|
+
setKey(event.target.value);
|
|
66
|
+
} })] })] }), _jsxs("label", { className: "sc-field", children: [_jsx("span", { className: "sc-field-label", children: "Description" }), _jsx("textarea", { className: "sc-input sc-textarea", value: description, maxLength: MAX_PROJECT_DESCRIPTION_LENGTH, rows: 2, placeholder: "What the project is for, in a sentence or two.", onChange: (event) => setDescription(event.target.value) })] }), _jsxs("div", { className: "sc-field-row", children: [_jsxs("label", { className: "sc-field", children: [_jsx("span", { className: "sc-field-label", children: "Who is a member" }), _jsx("select", { className: "sc-input", value: visibility, onChange: (event) => setVisibility(event.target.value), children: PROJECT_VISIBILITIES.map((candidate) => (_jsx("option", { value: candidate, children: VISIBILITY_LABELS[candidate] }, candidate))) })] }), _jsxs("label", { className: "sc-field", children: [_jsx("span", { className: "sc-field-label", children: "Skills address" }), _jsx("input", { className: "sc-input", value: skillsAddress, maxLength: MAX_SKILLS_ADDRESS_LENGTH, placeholder: "/gh/<owner>/<repo>, or empty for the organization's", onChange: (event) => setSkillsAddress(event.target.value) })] })] }), props.error !== undefined && (_jsx("p", { className: "sc-form-error", role: "alert", children: props.error })), _jsxs("div", { className: "sc-form-actions", children: [_jsx(Button, { type: "submit", variant: "primary", disabled: props.busy === true || name.trim() === "" || key.trim() === "", children: project === undefined ? "Make the project" : "Save" }), props.onCancel !== undefined && (_jsx(Button, { variant: "ghost", onClick: props.onCancel, children: "Cancel" }))] })] }));
|
|
67
|
+
}
|
|
68
|
+
export function MemberList(props) {
|
|
69
|
+
const listed = new Set(props.members.map((member) => member.person.id));
|
|
70
|
+
const candidates = props.people.filter((person) => !listed.has(person.id));
|
|
71
|
+
const [personId, setPersonId] = useState("");
|
|
72
|
+
const [role, setRole] = useState("member");
|
|
73
|
+
return (_jsxs("div", { className: "sc-members", children: [props.members.length === 0 ? ((props.empty ?? null)) : (_jsx("ul", { className: "sc-people", "aria-label": "Members", children: props.members.map((member) => (_jsxs("li", { className: "sc-person-row", children: [_jsx(PersonChip, { person: member.person, size: "md" }), _jsxs("span", { className: "sc-person-name", children: [member.person.name ?? "", props.me?.id === member.person.id && _jsx("span", { className: "sc-muted", children: " (you)" }), _jsxs("span", { className: "sc-muted", children: [" ", "since ", _jsx(Time, { iso: member.addedAt })] })] }), props.onChangeRole === undefined ? (_jsx(ProjectRoleBadge, { role: member.role })) : (_jsxs("label", { className: "sc-field sc-field-inline", children: [_jsxs("span", { className: "sc-visually-hidden", children: ["Role of ", member.person.login] }), _jsx("select", { className: "sc-input", value: member.role, disabled: props.busy === true, onChange: (event) => props.onChangeRole?.(member, event.target.value), children: PROJECT_ROLES.map((candidate) => (_jsx("option", { value: candidate, children: PROJECT_ROLE_LABELS[candidate] }, candidate))) })] })), props.onRemove !== undefined && (_jsx(Button, { variant: "danger", size: "sm", disabled: props.busy === true, onClick: () => props.onRemove?.(member), children: "Remove" }))] }, member.person.id))) })), props.onAdd !== undefined && candidates.length > 0 && (_jsx("form", { className: "sc-form sc-member-form", "aria-label": "Add a member", onSubmit: (event) => {
|
|
74
|
+
event.preventDefault();
|
|
75
|
+
if (personId !== "") {
|
|
76
|
+
props.onAdd?.({ personId, role });
|
|
77
|
+
setPersonId("");
|
|
78
|
+
}
|
|
79
|
+
}, children: _jsxs("div", { className: "sc-field-row", children: [_jsxs("label", { className: "sc-field", children: [_jsx("span", { className: "sc-field-label", children: "Person" }), _jsxs("select", { className: "sc-input", value: personId, onChange: (event) => setPersonId(event.target.value), children: [_jsx("option", { value: "", children: "Choose someone" }), candidates.map((person) => (_jsx("option", { value: person.id, children: person.login }, person.id)))] })] }), _jsxs("label", { className: "sc-field", children: [_jsx("span", { className: "sc-field-label", children: "As" }), _jsx("select", { className: "sc-input", value: role, onChange: (event) => setRole(event.target.value), children: PROJECT_ROLES.map((candidate) => (_jsx("option", { value: candidate, children: PROJECT_ROLE_LABELS[candidate] }, candidate))) })] }), _jsx("div", { className: "sc-form-actions", children: _jsx(Button, { type: "submit", variant: "primary", disabled: props.busy === true || personId === "", children: "Add" }) })] }) }))] }));
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=projects.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projects.js","sourceRoot":"","sources":["../../src/components/projects.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAkC,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjE,OAAO,EACL,8BAA8B,EAC9B,sBAAsB,EACtB,uBAAuB,EACvB,yBAAyB,EACzB,aAAa,EACb,oBAAoB,GASrB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE1D,4FAA4F;AAC5F,4FAA4F;AAC5F,mFAAmF;AAEnF,MAAM,CAAC,MAAM,mBAAmB,GAA0C;IACxE,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ;CACjB,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAgD;IAC5E,SAAS,EAAE,2BAA2B;IACtC,OAAO,EAAE,mBAAmB;CAC7B,CAAC;AAEF,MAAM,UAAU,gBAAgB,CAAC,KAAqC;IACpE,OAAO,CACL,KAAC,KAAK,IAAC,IAAI,EAAE,KAAK,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,YACtD,mBAAmB,CAAC,KAAK,CAAC,IAAI,CAAC,GAC1B,CAC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,CAAC,KAAK,CAAC,aAEpD,iBAAQ,KAAK,EAAC,EAAE,+BAAwB,EACvC,UAAU,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAC1B,iBAAwB,KAAK,EAAE,MAAM,CAAC,EAAE,YACrC,MAAM,CAAC,KAAK,IADF,MAAM,CAAC,EAAE,CAEb,CACV,CAAC,IACK,IACH,EACR,iBAAO,SAAS,EAAC,UAAU,aACzB,eAAM,SAAS,EAAC,gBAAgB,mBAAU,EAC1C,iBACE,SAAS,EAAC,UAAU,EACpB,KAAK,EAAE,IAAI,EACX,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,KAAoB,CAAC,YAE9D,aAAa,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAChC,iBAAwB,KAAK,EAAE,SAAS,YACrC,mBAAmB,CAAC,SAAS,CAAC,IADpB,SAAS,CAEb,CACV,CAAC,GACK,IACH,EACR,cAAK,SAAS,EAAC,iBAAiB,YAC9B,KAAC,MAAM,IACL,IAAI,EAAC,QAAQ,EACb,OAAO,EAAC,SAAS,EACjB,QAAQ,EAAE,KAAK,CAAC,IAAI,KAAK,IAAI,IAAI,QAAQ,KAAK,EAAE,oBAGzC,GACL,IACF,GACD,CACR,IACG,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import type { RestArtifact, RestRun, RunStatus } from "../api.js";
|
|
3
3
|
export declare const RUN_STATUS_LABELS: Readonly<Record<RunStatus, string>>;
|
|
4
4
|
export declare function RunStatusBadge(props: {
|
|
5
5
|
readonly status: RunStatus;
|
|
@@ -8,8 +8,10 @@ export interface RunCardProps {
|
|
|
8
8
|
readonly run: RestRun;
|
|
9
9
|
/** Where the decision the run waits for is answered, when the page knows. */
|
|
10
10
|
readonly decisionHref?: ((decisionId: string) => string) | undefined;
|
|
11
|
-
/** Where a file handed in is read
|
|
11
|
+
/** Where a file handed in is read: the project's path for it. Left out, a file is named and not linked. */
|
|
12
12
|
readonly fileHref?: ((artifact: RestArtifact) => string) | undefined;
|
|
13
|
+
/** Where a document of the project is read, by its path, for the links in what the agent wrote. */
|
|
14
|
+
readonly docHref?: ((path: string) => string) | undefined;
|
|
13
15
|
/** Called to mark a run that will not come back as abandoned. Left out, it cannot be here. */
|
|
14
16
|
readonly onAbandon?: ((run: RestRun) => void) | undefined;
|
|
15
17
|
readonly busy?: boolean | undefined;
|
|
@@ -19,6 +21,7 @@ export interface RunListProps {
|
|
|
19
21
|
readonly runs: readonly RestRun[];
|
|
20
22
|
readonly decisionHref?: ((decisionId: string) => string) | undefined;
|
|
21
23
|
readonly fileHref?: ((artifact: RestArtifact) => string) | undefined;
|
|
24
|
+
readonly docHref?: ((path: string) => string) | undefined;
|
|
22
25
|
readonly onAbandon?: ((run: RestRun) => void) | undefined;
|
|
23
26
|
readonly busy?: boolean | undefined;
|
|
24
27
|
readonly empty?: ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runs.d.ts","sourceRoot":"","sources":["../../src/components/runs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"runs.d.ts","sourceRoot":"","sources":["../../src/components/runs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAOlE,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAMjE,CAAC;AAEF,wBAAgB,cAAc,CAAC,KAAK,EAAE;IAAE,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAA;C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AAS,CAAC;IACpC,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC;CAC5B;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,+BAmB1C"}
|
package/dist/components/runs.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { restPath } from "../api.js";
|
|
3
2
|
import { Markdown } from "./markdown.js";
|
|
4
3
|
import { Badge, Button, formatBytes, PersonChip, Time } from "./ui.js";
|
|
5
4
|
// A run: one agent at work on one task for one person, with what it reported, what it handed
|
|
@@ -26,7 +25,7 @@ export function RunStatusBadge(props) {
|
|
|
26
25
|
export function RunCard(props) {
|
|
27
26
|
const { run } = props;
|
|
28
27
|
const open = run.status === "running" || run.status === "waiting";
|
|
29
|
-
return (_jsxs("article", { className: "sc-run", "aria-label": `${run.agent} for ${run.person.login}`, children: [_jsxs("header", { className: "sc-run-header", children: [_jsx("span", { className: "sc-run-agent", children: run.agent }), _jsx(RunStatusBadge, { status: run.status }), _jsxs("span", { className: "sc-run-meta", children: ["for ", _jsx(PersonChip, { person: run.person }), " since ", _jsx(Time, { iso: run.startedAt }), run.endedAt !== null && (_jsxs(_Fragment, { children: [" ", "until ", _jsx(Time, { iso: run.endedAt })] }))] }), open && props.onAbandon !== undefined && (_jsx(Button, { variant: "ghost", size: "sm", disabled: props.busy === true, onClick: () => props.onAbandon?.(run), children: "Mark abandoned" }))] }), run.waitingFor !== null && (_jsxs("p", { className: "sc-run-waiting", children: ["Waiting for a decision", props.decisionHref !== undefined && (_jsxs(_Fragment, { children: [": ", _jsx("a", { href: props.decisionHref(run.waitingFor), children: "answer it" })] })), "."] })), run.reports.length > 0 && (_jsx("ol", { className: "sc-run-reports", "aria-label": "Reports", children: run.reports.map((report) => (_jsxs("li", { className: "sc-report", children: [_jsx(Time, { iso: report.createdAt }), _jsx(Markdown, { source: report.body })] }, report.id))) })), run.artifacts.length > 0 && (_jsx("ul", { className: "sc-link-list", "aria-label": "Handed in", children: run.artifacts.map((artifact) => (_jsx("li", { children: _jsx(ArtifactLink, { artifact: artifact, fileHref: props.fileHref }) }, artifact.id))) })), run.summary !== null && (_jsx("div", { className: "sc-run-summary", children: _jsx(Markdown, { source: run.summary }) }))] }));
|
|
28
|
+
return (_jsxs("article", { className: "sc-run", "aria-label": `${run.agent} for ${run.person.login}`, children: [_jsxs("header", { className: "sc-run-header", children: [_jsx("span", { className: "sc-run-agent", children: run.agent }), _jsx(RunStatusBadge, { status: run.status }), _jsxs("span", { className: "sc-run-meta", children: ["for ", _jsx(PersonChip, { person: run.person }), " since ", _jsx(Time, { iso: run.startedAt }), run.endedAt !== null && (_jsxs(_Fragment, { children: [" ", "until ", _jsx(Time, { iso: run.endedAt })] }))] }), open && props.onAbandon !== undefined && (_jsx(Button, { variant: "ghost", size: "sm", disabled: props.busy === true, onClick: () => props.onAbandon?.(run), children: "Mark abandoned" }))] }), run.waitingFor !== null && (_jsxs("p", { className: "sc-run-waiting", children: ["Waiting for a decision", props.decisionHref !== undefined && (_jsxs(_Fragment, { children: [": ", _jsx("a", { href: props.decisionHref(run.waitingFor), children: "answer it" })] })), "."] })), run.reports.length > 0 && (_jsx("ol", { className: "sc-run-reports", "aria-label": "Reports", children: run.reports.map((report) => (_jsxs("li", { className: "sc-report", children: [_jsx(Time, { iso: report.createdAt }), _jsx(Markdown, { source: report.body, docHref: props.docHref })] }, report.id))) })), run.artifacts.length > 0 && (_jsx("ul", { className: "sc-link-list", "aria-label": "Handed in", children: run.artifacts.map((artifact) => (_jsx("li", { children: _jsx(ArtifactLink, { artifact: artifact, fileHref: props.fileHref }) }, artifact.id))) })), run.summary !== null && (_jsx("div", { className: "sc-run-summary", children: _jsx(Markdown, { source: run.summary, docHref: props.docHref }) }))] }));
|
|
30
29
|
}
|
|
31
30
|
/** A link as it was handed in; a file by its name, with its size, read from the console. */
|
|
32
31
|
function ArtifactLink(props) {
|
|
@@ -34,12 +33,13 @@ function ArtifactLink(props) {
|
|
|
34
33
|
if (artifact.file === null) {
|
|
35
34
|
return (_jsx("a", { href: artifact.url ?? "", target: "_blank", rel: "noopener noreferrer nofollow ugc", children: artifact.label ?? artifact.url }));
|
|
36
35
|
}
|
|
37
|
-
|
|
36
|
+
const href = props.fileHref?.(artifact);
|
|
37
|
+
return (_jsxs(_Fragment, { children: [href === undefined ? (_jsx("span", { children: artifact.label ?? artifact.file.name })) : (_jsx("a", { href: href, rel: "nofollow ugc", children: artifact.label ?? artifact.file.name })), " ", _jsxs("span", { className: "sc-muted", children: [artifact.label === null ? "" : `${artifact.file.name}, `, formatBytes(artifact.file.size)] })] }));
|
|
38
38
|
}
|
|
39
39
|
export function RunList(props) {
|
|
40
40
|
if (props.runs.length === 0) {
|
|
41
41
|
return _jsx(_Fragment, { children: props.empty ?? null });
|
|
42
42
|
}
|
|
43
|
-
return (_jsx("div", { className: "sc-runs", children: props.runs.map((run) => (_jsx(RunCard, { run: run, decisionHref: props.decisionHref, fileHref: props.fileHref, onAbandon: props.onAbandon, busy: props.busy }, run.id))) }));
|
|
43
|
+
return (_jsx("div", { className: "sc-runs", children: props.runs.map((run) => (_jsx(RunCard, { run: run, decisionHref: props.decisionHref, fileHref: props.fileHref, docHref: props.docHref, onAbandon: props.onAbandon, busy: props.busy }, run.id))) }));
|
|
44
44
|
}
|
|
45
45
|
//# sourceMappingURL=runs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runs.js","sourceRoot":"","sources":["../../src/components/runs.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"runs.js","sourceRoot":"","sources":["../../src/components/runs.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAEvE,6FAA6F;AAC7F,mFA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C,IAAI,CAAC,IAAI,IAAI,EACxD,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,IAC3B,IACN,CACJ,CAAC;AACJ,CAAC;AAYD,MAAM,UAAU,OAAO,CAAC,KAAmB;IACzC,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC5B,OAAO,4BAAG,KAAK,CAAC,KAAK,IAAI,IAAI,GAAI,CAAC;IACpC,CAAC;IACD,OAAO,CACL,cAAK,SAAS,EAAC,SAAS,YACrB,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CACvB,KAAC,OAAO,IAEN,GAAG,EAAE,GAAG,EACR,YAAY,EAAE,KAAK,CAAC,YAAY,EAChC,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,IAAI,EAAE,KAAK,CAAC,IAAI,IANX,GAAG,CAAC,EAAE,CAOX,CACH,CAAC,GACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -9,6 +9,11 @@ export interface NavItem {
|
|
|
9
9
|
}
|
|
10
10
|
export interface ShellProps {
|
|
11
11
|
readonly title: string;
|
|
12
|
+
/** The project the page is on, named after the workspace, or nothing on the workspace's own pages. */
|
|
13
|
+
readonly project?: {
|
|
14
|
+
readonly name: string;
|
|
15
|
+
readonly href: string;
|
|
16
|
+
} | undefined;
|
|
12
17
|
readonly nav: readonly NavItem[];
|
|
13
18
|
readonly person: RestPerson | undefined;
|
|
14
19
|
/** Follows a link inside the app without loading a document. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shell.d.ts","sourceRoot":"","sources":["../../src/components/shell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"shell.d.ts","sourceRoot":"","sources":["../../src/components/shell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAO5C,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,oEAAoE;IACpE,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACrC;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,sGAAsG;IACtG,QAAQ,CAAC,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CAAC;IAChF,QAAQ,CAAC,GAAG,EAAE,SAAS,OAAO,EAAE,CAAC;IACjC,QAAQ,CAAC,MAAM,EAAE,UAAU,GAAG,SAAS,CAAC;IACxC,gEAAgE;IAChE,QAAQ,CAAC,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC;IAC9C,kEAAkE;IAClE,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACpC,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;CAC9B;AAED,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,+BAmFtC"}
|
package/dist/components/shell.js
CHANGED
|
@@ -11,6 +11,6 @@ export function Shell(props) {
|
|
|
11
11
|
props.onNavigate(href);
|
|
12
12
|
}
|
|
13
13
|
};
|
|
14
|
-
return (_jsxs("div", { className: "sc-shell", children: [_jsx("a", { className: "sc-skip", href: "#sc-content", children: "Skip to content" }), _jsx("header", { className: "sc-header", children: _jsxs("div", { className: "sc-header-inner", children: [_jsx("a", { className: "sc-brand", href: "/", onClick: follow("/"), children: props.title }), _jsx("nav", { className: "sc-nav", "aria-label": "Pages", children: props.nav.map((item) => (_jsxs("a", { href: item.href, className: cx("sc-nav-link", item.current && "sc-nav-current"), "aria-current": item.current ? "page" : undefined, onClick: follow(item.href), children: [item.label, item.count !== undefined && item.count > 0 && (_jsx("span", { className: "sc-nav-count", children: item.count }))] }, item.href))) }), _jsxs("div", { className: "sc-header-end", children: [props.live !== undefined && (_jsx("span", { className: cx("sc-live", props.live && "sc-live-on"), title: props.live ? "Live" : "Reconnecting", children: _jsx("span", { className: "sc-visually-hidden", children: props.live ? "Live" : "Reconnecting" }) })), props.person !== undefined && (_jsxs(_Fragment, { children: [_jsxs("span", { className: "sc-person", title: props.person.name ?? props.person.login, children: [_jsx(Avatar, { person: props.person, size: "sm" }), _jsx("span", { className: "sc-person-login", children: props.person.login })] }), props.onSignOut !== undefined && (_jsx(Button, { size: "sm", variant: "ghost", onClick: props.onSignOut, children: "Sign out" }))] }))] })] }) }), _jsx("main", { id: "sc-content", className: "sc-main", children: props.children })] }));
|
|
14
|
+
return (_jsxs("div", { className: "sc-shell", children: [_jsx("a", { className: "sc-skip", href: "#sc-content", children: "Skip to content" }), _jsx("header", { className: "sc-header", children: _jsxs("div", { className: "sc-header-inner", children: [_jsx("a", { className: "sc-brand", href: "/", onClick: follow("/"), children: props.title }), props.project !== undefined && (_jsxs("span", { className: "sc-crumb", children: [_jsx("span", { className: "sc-crumb-separator", "aria-hidden": "true", children: "/" }), _jsx("a", { className: "sc-crumb-link", href: props.project.href, onClick: follow(props.project.href), children: props.project.name })] })), _jsx("nav", { className: "sc-nav", "aria-label": "Pages", children: props.nav.map((item) => (_jsxs("a", { href: item.href, className: cx("sc-nav-link", item.current && "sc-nav-current"), "aria-current": item.current ? "page" : undefined, onClick: follow(item.href), children: [item.label, item.count !== undefined && item.count > 0 && (_jsx("span", { className: "sc-nav-count", children: item.count }))] }, item.href))) }), _jsxs("div", { className: "sc-header-end", children: [props.live !== undefined && (_jsx("span", { className: cx("sc-live", props.live && "sc-live-on"), title: props.live ? "Live" : "Reconnecting", children: _jsx("span", { className: "sc-visually-hidden", children: props.live ? "Live" : "Reconnecting" }) })), props.person !== undefined && (_jsxs(_Fragment, { children: [_jsxs("span", { className: "sc-person", title: props.person.name ?? props.person.login, children: [_jsx(Avatar, { person: props.person, size: "sm" }), _jsx("span", { className: "sc-person-login", children: props.person.login })] }), props.onSignOut !== undefined && (_jsx(Button, { size: "sm", variant: "ghost", onClick: props.onSignOut, children: "Sign out" }))] }))] })] }) }), _jsx("main", { id: "sc-content", className: "sc-main", children: props.children })] }));
|
|
15
15
|
}
|
|
16
16
|
//# sourceMappingURL=shell.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shell.js","sourceRoot":"","sources":["../../src/components/shell.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"shell.js","sourceRoot":"","sources":["../../src/components/shell.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AA4B7C,MAAM,UAAU,KAAK,CAAC,KAAiB;IACrC,MAAM,MAAM,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,CAAC,KAAuB,EAAE,EAAE;QAC3D,IACE,KAAK,CAAC,MAAM,KAAK,CAAC;YAClB,CAAC,KAAK,CAAC,OAAO;YACd,CAAC,KAAK,CAAC,OAAO;YACd,CAAC,KAAK,CAAC,QAAQ;YACf,CAAC,KAAK,CAAC,MAAM,EACb,CAAC;YACD,KAAK,CAAC,cAAc,EA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CACnD,KATI,IAAI,CAAC,IAAI,CAUZ,CACL,CAAC,GACE,EACN,eAAK,SAAS,EAAC,eAAe,aAC3B,KAAK,CAAC,IAAI,KAAK,SAAS,IAAI,CAC3B,eACE,SAAS,EAAE,EAAE,CAAC,SAAS,EAAE,KAAK,CAAC,IAAI,IAAI,YAAY,CAAC,EACpD,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,cAAc,YAE3C,eAAM,SAAS,EAAC,oBAAoB,YAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,cAAc,GAAQ,GAC7E,CACR,EACA,KAAK,CAAC,MAAM,KAAK,SAAS,IAAI,CAC7B,8BACE,gBAAM,SAAS,EAAC,WAAW,EAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,aACxE,KAAC,MAAM,IAAC,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,IAAI,EAAC,IAAI,GAAG,EAC1C,eAAM,SAAS,EAAC,iBAAiB,YAAE,KAAK,CAAC,MAAM,CAAC,KAAK,GAAQ,IACxD,EACN,KAAK,CAAC,SAAS,KAAK,SAAS,IAAI,CAChC,KAAC,MAAM,IAAC,IAAI,EAAC,IAAI,EAAC,OAAO,EAAC,OAAO,EAAC,OAAO,EAAE,KAAK,CAAC,SAAS,yBAEjD,CACV,IACA,CACJ,IACG,IACF,GACC,EACT,eAAM,EAAE,EAAC,YAAY,EAAC,SAAS,EAAC,SAAS,YACtC,KAAK,CAAC,QAAQ,GACV,IACH,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RestAnswerInput, RestDecision, RestDecisionInput, RestPerson, RestRun, RestTask, RestTaskInput, TaskState } from "../api.js";
|
|
1
|
+
import type { RestAnswerInput, RestArtifact, RestDecision, RestDecisionInput, RestDecisionPatch, RestEvent, RestPerson, RestRun, RestTask, RestTaskInput, TaskState } from "../api.js";
|
|
2
2
|
export interface TaskViewProps {
|
|
3
3
|
readonly task: RestTask;
|
|
4
4
|
readonly people: readonly RestPerson[];
|
|
@@ -7,15 +7,23 @@ export interface TaskViewProps {
|
|
|
7
7
|
readonly decisions: readonly RestDecision[];
|
|
8
8
|
/** The runs of the board, or of this task; the ones on this task are shown. */
|
|
9
9
|
readonly runs?: readonly RestRun[] | undefined;
|
|
10
|
+
/** Everything that happened to the task, oldest first, when the page has read it. */
|
|
11
|
+
readonly history?: readonly RestEvent[] | undefined;
|
|
10
12
|
readonly taskHref: (task: RestTask) => string;
|
|
11
13
|
/** Where a decision is answered, for a run that waits for one. */
|
|
12
14
|
readonly decisionHref?: ((decisionId: string) => string) | undefined;
|
|
15
|
+
/** Where a file a run handed in is read. */
|
|
16
|
+
readonly fileHref?: ((artifact: RestArtifact) => string) | undefined;
|
|
17
|
+
/** Where a document of the project is read, by its path, for the links in what was written. */
|
|
18
|
+
readonly docHref?: ((path: string) => string) | undefined;
|
|
13
19
|
readonly busy?: boolean | undefined;
|
|
14
20
|
readonly error?: string | undefined;
|
|
15
21
|
readonly onChange: (task: RestTask, patch: RestTaskInput) => void;
|
|
16
22
|
readonly onMove: (task: RestTask, state: TaskState) => void;
|
|
17
23
|
readonly onRaiseDecision: (input: RestDecisionInput) => void;
|
|
18
24
|
readonly onAnswer: (decision: RestDecision, input: RestAnswerInput) => void;
|
|
25
|
+
/** Called to grow a decision's record with what followed. */
|
|
26
|
+
readonly onUpdateDecision?: ((decision: RestDecision, patch: RestDecisionPatch) => void) | undefined;
|
|
19
27
|
readonly onAbandonRun?: ((run: RestRun) => void) | undefined;
|
|
20
28
|
}
|
|
21
29
|
export declare function TaskView(props: TaskViewProps): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task-view.d.ts","sourceRoot":"","sources":["../../src/components/task-view.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,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AC;IAC1D,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACpC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,QAAQ,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAClE,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;IAC5D,QAAQ,CAAC,eAAe,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC7D,QAAQ,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,YAAY,EAAE,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;IAC5E,6DAA6D;IAC7D,QAAQ,CAAC,gBAAgB,CAAC,EACtB,CAAC,CAAC,QAAQ,EAAE,YAAY,EAAE,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAC,GAC5D,SAAS,CAAC;IACd,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;CAC9D;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,+BAoM5C"}
|
|
@@ -3,6 +3,7 @@ import { useState } from "react";
|
|
|
3
3
|
import { TASK_STATES } from "../vocabulary.js";
|
|
4
4
|
import { DecisionForm } from "./decision-form.js";
|
|
5
5
|
import { DecisionCard } from "./decision-list.js";
|
|
6
|
+
import { EventFeed } from "./event-feed.js";
|
|
6
7
|
import { Markdown } from "./markdown.js";
|
|
7
8
|
import { RunList } from "./runs.js";
|
|
8
9
|
import { TaskForm } from "./task-form.js";
|
|
@@ -24,9 +25,9 @@ export function TaskView(props) {
|
|
|
24
25
|
setEditing(false);
|
|
25
26
|
}, onCancel: () => setEditing(false) })] }));
|
|
26
27
|
}
|
|
27
|
-
return (_jsxs("div", { className: "sc-task", children: [_jsxs("header", { className: "sc-task-header", children: [parent !== undefined && (_jsxs("p", { className: "sc-task-parent", children: ["Part of", " ", _jsxs("a", { href: props.taskHref(parent), children: ["#", parent.number, " ", parent.title] })] })), _jsxs("h1", { className: "sc-task-title", children: [_jsxs("span", { className: "sc-card-number", children: ["#", task.number] }), " ", task.title] }), _jsxs("div", { className: "sc-task-badges", children: [_jsx(StateBadge, { state: task.state }), _jsx(PriorityBadge, { priority: task.priority })] })] }), _jsxs("dl", { className: "sc-facts", children: [_jsxs("div", { children: [_jsx("dt", { children: "Owner" }), _jsx("dd", { children: _jsx(PersonChip, { person: task.owner }) })] }), _jsxs("div", { children: [_jsx("dt", { children: "Assignee" }), _jsx("dd", { children: task.assignee === null ? (_jsx("span", { className: "sc-muted", children: "Nobody" })) : (_jsx(PersonChip, { person: task.assignee })) })] }), _jsxs("div", { children: [_jsx("dt", { children: "Written" }), _jsx("dd", { children: _jsx(Time, { iso: task.createdAt }) })] }), _jsxs("div", { children: [_jsx("dt", { children: "Changed" }), _jsx("dd", { children: _jsx(Time, { iso: task.updatedAt }) })] })] }), _jsxs("div", { className: "sc-task-actions", children: [_jsxs("label", { className: "sc-field sc-field-inline", children: [_jsx("span", { className: "sc-field-label", children: "State" }), _jsx("select", { className: "sc-input", value: task.state, disabled: props.busy === true, onChange: (event) => props.onMove(task, event.target.value), children: TASK_STATES.map((state) => (_jsx("option", { value: state, children: STATE_LABELS[state] }, state))) })] }), _jsx(Button, { onClick: () => setEditing(true), children: "Edit" }), _jsx(Button, { onClick: () => setAsking(true), disabled: asking, children: "Raise a decision" })] }), props.error !== undefined && (_jsx("p", { className: "sc-form-error", role: "alert", children: props.error })), task.body.length > 0 ? (_jsx(Markdown, { source: task.body })) : (_jsx("p", { className: "sc-muted", children: "Nothing more was written about it." })), task.links.length > 0 && (_jsxs("section", { className: "sc-task-section", "aria-label": "Links", children: [_jsx("h2", { className: "sc-section-title", children: "Links" }), _jsx("ul", { className: "sc-link-list", children: task.links.map((link) => (_jsx("li", { children: _jsx("a", { href: link.url, target: "_blank", rel: "noopener noreferrer nofollow", children: link.label ?? link.url }) }, link.url))) })] })), asking && (_jsxs("section", { className: "sc-task-section", "aria-label": "Raise a decision", children: [_jsx("h2", { className: "sc-section-title", children: "Raise a decision" }), _jsx(DecisionForm, { tasks: props.tasks, taskId: task.id, busy: props.busy, onSubmit: (input) => {
|
|
28
|
+
return (_jsxs("div", { className: "sc-task", children: [_jsxs("header", { className: "sc-task-header", children: [parent !== undefined && (_jsxs("p", { className: "sc-task-parent", children: ["Part of", " ", _jsxs("a", { href: props.taskHref(parent), children: ["#", parent.number, " ", parent.title] })] })), _jsxs("h1", { className: "sc-task-title", children: [_jsxs("span", { className: "sc-card-number", children: ["#", task.number] }), " ", task.title] }), _jsxs("div", { className: "sc-task-badges", children: [_jsx(StateBadge, { state: task.state }), _jsx(PriorityBadge, { priority: task.priority })] })] }), _jsxs("dl", { className: "sc-facts", children: [_jsxs("div", { children: [_jsx("dt", { children: "Owner" }), _jsx("dd", { children: _jsx(PersonChip, { person: task.owner }) })] }), _jsxs("div", { children: [_jsx("dt", { children: "Assignee" }), _jsx("dd", { children: task.assignee === null ? (_jsx("span", { className: "sc-muted", children: "Nobody" })) : (_jsx(PersonChip, { person: task.assignee })) })] }), _jsxs("div", { children: [_jsx("dt", { children: "Written" }), _jsx("dd", { children: _jsx(Time, { iso: task.createdAt }) })] }), _jsxs("div", { children: [_jsx("dt", { children: "Changed" }), _jsx("dd", { children: _jsx(Time, { iso: task.updatedAt }) })] })] }), _jsxs("div", { className: "sc-task-actions", children: [_jsxs("label", { className: "sc-field sc-field-inline", children: [_jsx("span", { className: "sc-field-label", children: "State" }), _jsx("select", { className: "sc-input", value: task.state, disabled: props.busy === true, onChange: (event) => props.onMove(task, event.target.value), children: TASK_STATES.map((state) => (_jsx("option", { value: state, children: STATE_LABELS[state] }, state))) })] }), _jsx(Button, { onClick: () => setEditing(true), children: "Edit" }), _jsx(Button, { onClick: () => setAsking(true), disabled: asking, children: "Raise a decision" })] }), props.error !== undefined && (_jsx("p", { className: "sc-form-error", role: "alert", children: props.error })), task.body.length > 0 ? (_jsx(Markdown, { source: task.body, docHref: props.docHref })) : (_jsx("p", { className: "sc-muted", children: "Nothing more was written about it." })), task.links.length > 0 && (_jsxs("section", { className: "sc-task-section", "aria-label": "Links", children: [_jsx("h2", { className: "sc-section-title", children: "Links" }), _jsx("ul", { className: "sc-link-list", children: task.links.map((link) => (_jsx("li", { children: _jsx("a", { href: link.url, target: "_blank", rel: "noopener noreferrer nofollow", children: link.label ?? link.url }) }, link.url))) })] })), asking && (_jsxs("section", { className: "sc-task-section", "aria-label": "Raise a decision", children: [_jsx("h2", { className: "sc-section-title", children: "Raise a decision" }), _jsx(DecisionForm, { tasks: props.tasks, taskId: task.id, busy: props.busy, onSubmit: (input) => {
|
|
28
29
|
props.onRaiseDecision(input);
|
|
29
30
|
setAsking(false);
|
|
30
|
-
}, onCancel: () => setAsking(false) })] })), runs.length > 0 && (_jsxs("section", { className: "sc-task-section", "aria-label": "Runs", children: [_jsx("h2", { className: "sc-section-title", children: "Agents at work" }), _jsx(RunList, { runs: runs, decisionHref: props.decisionHref, onAbandon: props.onAbandonRun, busy: props.busy })] })), about.length > 0 && (_jsxs("section", { className: "sc-task-section", "aria-label": "Decisions", children: [_jsx("h2", { className: "sc-section-title", children: "Decisions" }), about.map((decision) => (_jsx(DecisionCard, { decision: decision, task: decision.taskId === null ? undefined : tasksById.get(decision.taskId), onAnswer: props.onAnswer, busy: props.busy }, decision.id)))] })), subtasks.length > 0 && (_jsxs("section", { className: "sc-task-section", "aria-label": "Subtasks", children: [_jsx("h2", { className: "sc-section-title", children: "Part of it" }), _jsx("ul", { className: "sc-subtasks", children: subtasks.map((subtask) => (_jsxs("li", { children: [_jsxs("a", { href: props.taskHref(subtask), children: [_jsxs("span", { className: "sc-card-number", children: ["#", subtask.number] }), " ", subtask.title] }), " ", _jsx(StateBadge, { state: subtask.state })] }, subtask.id))) })] }))] }));
|
|
31
|
+
}, onCancel: () => setAsking(false) })] })), runs.length > 0 && (_jsxs("section", { className: "sc-task-section", "aria-label": "Runs", children: [_jsx("h2", { className: "sc-section-title", children: "Agents at work" }), _jsx(RunList, { runs: runs, decisionHref: props.decisionHref, fileHref: props.fileHref, docHref: props.docHref, onAbandon: props.onAbandonRun, busy: props.busy })] })), about.length > 0 && (_jsxs("section", { className: "sc-task-section", "aria-label": "Decisions", children: [_jsx("h2", { className: "sc-section-title", children: "Decisions" }), about.map((decision) => (_jsx(DecisionCard, { decision: decision, task: decision.taskId === null ? undefined : tasksById.get(decision.taskId), docHref: props.docHref, onAnswer: props.onAnswer, onUpdate: props.onUpdateDecision, busy: props.busy }, decision.id)))] })), props.history !== undefined && props.history.length > 0 && (_jsxs("section", { className: "sc-task-section", "aria-label": "History", children: [_jsx("h2", { className: "sc-section-title", children: "What happened" }), _jsx(EventFeed, { events: props.history })] })), subtasks.length > 0 && (_jsxs("section", { className: "sc-task-section", "aria-label": "Subtasks", children: [_jsx("h2", { className: "sc-section-title", children: "Part of it" }), _jsx("ul", { className: "sc-subtasks", children: subtasks.map((subtask) => (_jsxs("li", { children: [_jsxs("a", { href: props.taskHref(subtask), children: [_jsxs("span", { className: "sc-card-number", children: ["#", subtask.number] }), " ", subtask.title] }), " ", _jsx(StateBadge, { state: subtask.state })] }, subtask.id))) })] }))] }));
|
|
31
32
|
}
|
|
32
33
|
//# sourceMappingURL=task-view.js.map
|