@manta-eu/react 0.1.4 → 0.1.5
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 +4 -8
- package/dist/components/audience-phase-badge/index.d.ts +1 -1
- package/dist/components/audience-phase-badge/index.d.ts.map +1 -1
- package/dist/components/audience-phase-badge/index.js +3 -0
- package/dist/components/authenticated-chat/index.d.ts.map +1 -1
- package/dist/components/authenticated-chat/index.js +0 -5
- package/dist/components/chat-view/Chat.d.ts +6 -0
- package/dist/components/chat-view/Chat.d.ts.map +1 -1
- package/dist/components/chat-view/Chat.js +6 -6
- package/dist/components/chat-view/ChatHeaders.d.ts.map +1 -1
- package/dist/components/chat-view/ChatHeaders.js +3 -2
- package/dist/components/embedded-chat/EmbeddedDatastorePicker.d.ts +1 -0
- package/dist/components/embedded-chat/EmbeddedDatastorePicker.d.ts.map +1 -1
- package/dist/components/embedded-chat/EmbeddedDatastorePicker.js +9 -3
- package/dist/components/embedded-chat/index.d.ts.map +1 -1
- package/dist/components/embedded-chat/index.js +1 -8
- package/dist/components/layouts/Sidebar.d.ts.map +1 -1
- package/dist/components/layouts/Sidebar.js +11 -4
- package/dist/components/planning/ActioningView.d.ts.map +1 -1
- package/dist/components/planning/ActioningView.js +11 -6
- package/dist/components/planning/ExecutionSectionItem.d.ts +2 -3
- package/dist/components/planning/ExecutionSectionItem.d.ts.map +1 -1
- package/dist/components/planning/ExecutionSectionItem.js +3 -6
- package/dist/components/planning/ExecutionSections.d.ts +2 -3
- package/dist/components/planning/ExecutionSections.d.ts.map +1 -1
- package/dist/components/planning/ExecutionSections.js +2 -2
- package/dist/components/planning/ManualActionCard.d.ts +3 -4
- package/dist/components/planning/ManualActionCard.d.ts.map +1 -1
- package/dist/components/planning/ManualActionCard.js +24 -6
- package/dist/components/rdf-insights/CampaignChannelMix.js +1 -1
- package/dist/components/rdf-insights/CampaignGrid.d.ts.map +1 -1
- package/dist/components/rdf-insights/CampaignGrid.js +2 -2
- package/dist/components/rdf-insights/DailyPerformance.js +2 -2
- package/dist/components/rdf-insights/KpiDashboard.d.ts +2 -2
- package/dist/components/rdf-insights/KpiDashboard.d.ts.map +1 -1
- package/dist/components/rdf-insights/KpiDashboard.js +33 -53
- package/dist/components/rdf-insights/MetaDailyInsights.js +2 -2
- package/dist/components/rdf-insights/ProductCard.d.ts.map +1 -1
- package/dist/components/rdf-insights/ProductCard.js +1 -1
- package/dist/components/rdf-insights/ProductVariantsTable.js +1 -1
- package/dist/components/rdf-insights/useExtractedInsights.d.ts +1 -1
- package/dist/components/rdf-insights/useExtractedInsights.js +3 -3
- package/dist/datastore-picker/datastore-picker-rows.d.ts +1 -0
- package/dist/datastore-picker/datastore-picker-rows.d.ts.map +1 -1
- package/dist/datastore-picker/datastore-picker-rows.js +6 -2
- package/dist/graph/nodes/GoogleCampaignView.js +2 -2
- package/dist/hooks/use-action-plans-list.js +1 -1
- package/dist/hooks/use-manual-actions.d.ts +11 -1
- package/dist/hooks/use-manual-actions.d.ts.map +1 -1
- package/dist/hooks/use-manual-actions.js +47 -100
- package/dist/hooks/useAuth.d.ts +5 -1
- package/dist/hooks/useAuth.d.ts.map +1 -1
- package/dist/hooks/useAuth.js +4 -0
- package/dist/hooks/useValidateActionPlan.d.ts.map +1 -1
- package/dist/ldo-ui.d.ts +1 -1
- package/dist/ldo-ui.d.ts.map +1 -1
- package/dist/lib/manual-actions.js +1 -1
- package/dist/lib/rdf/index.d.ts +4 -2
- package/dist/lib/rdf/index.d.ts.map +1 -1
- package/dist/lib/rdf/index.js +48 -18
- package/dist/lib/rdf/insights.d.ts +6 -1
- package/dist/lib/rdf/insights.d.ts.map +1 -1
- package/dist/lib/rdf/insights.js +15 -3
- package/dist/lib/rdf/types.d.ts +21 -8
- package/dist/lib/rdf/types.d.ts.map +1 -1
- package/dist/providers/AuthContext.d.ts +1 -1
- package/dist/providers/AuthContext.d.ts.map +1 -1
- package/dist/providers/index.d.ts +4 -1
- package/dist/providers/index.d.ts.map +1 -1
- package/dist/providers/index.js +2 -1
- package/dist/routes/datastores/components/DatastoreFormDialog.d.ts +4 -2
- package/dist/routes/datastores/components/DatastoreFormDialog.d.ts.map +1 -1
- package/dist/routes/datastores/components/DatastoreFormDialog.js +7 -4
- package/dist/routes/datastores/components/DatastoresToolbar.d.ts +3 -1
- package/dist/routes/datastores/components/DatastoresToolbar.d.ts.map +1 -1
- package/dist/routes/datastores/components/DatastoresToolbar.js +18 -5
- package/dist/routes/datastores/components/LinkUnlinkedDatastoreDialog.d.ts.map +1 -1
- package/dist/routes/datastores/components/LinkUnlinkedDatastoreDialog.js +6 -2
- package/dist/routes/datastores/components/ProvisionDatastoreDialog.d.ts +7 -0
- package/dist/routes/datastores/components/ProvisionDatastoreDialog.d.ts.map +1 -0
- package/dist/routes/datastores/components/ProvisionDatastoreDialog.js +10 -0
- package/dist/routes/datastores/flatten.d.ts +4 -0
- package/dist/routes/datastores/flatten.d.ts.map +1 -1
- package/dist/routes/datastores/flatten.js +11 -0
- package/dist/routes/datastores/hooks/useDatastoreColumns.d.ts +4 -1
- package/dist/routes/datastores/hooks/useDatastoreColumns.d.ts.map +1 -1
- package/dist/routes/datastores/hooks/useDatastoreColumns.js +6 -2
- package/dist/routes/datastores/hooks/useTenantOrganizationCheck.d.ts +3 -0
- package/dist/routes/datastores/hooks/useTenantOrganizationCheck.d.ts.map +1 -0
- package/dist/routes/datastores/hooks/useTenantOrganizationCheck.js +21 -0
- package/dist/routes/datastores/index.d.ts.map +1 -1
- package/dist/routes/datastores/index.js +44 -6
- package/dist/routes/datastores/link-provider.d.ts +11 -0
- package/dist/routes/datastores/link-provider.d.ts.map +1 -0
- package/dist/routes/datastores/link-provider.js +34 -0
- package/dist/routes/integrations/components/connect-forms/types.d.ts +1 -0
- package/dist/routes/integrations/components/connect-forms/types.d.ts.map +1 -1
- package/dist/routes/integrations/connection-view.d.ts.map +1 -1
- package/dist/routes/integrations/connection-view.js +19 -6
- package/dist/routes/integrations/types.d.ts +2 -0
- package/dist/routes/integrations/types.d.ts.map +1 -1
- package/dist/routes/memories/components/ChangeScopeDialog.d.ts +1 -1
- package/dist/routes/memories/components/ChangeScopeDialog.d.ts.map +1 -1
- package/dist/routes/memories/components/ChangeScopeDialog.js +3 -3
- package/dist/routes/memories/components/EmptyStates.d.ts +1 -2
- package/dist/routes/memories/components/EmptyStates.d.ts.map +1 -1
- package/dist/routes/memories/components/EmptyStates.js +2 -2
- package/dist/routes/memories/components/MemoriesPanel.d.ts +1 -1
- package/dist/routes/memories/components/MemoriesPanel.d.ts.map +1 -1
- package/dist/routes/memories/components/MemoriesPanel.js +9 -9
- package/dist/routes/memories/components/MemoryActions.d.ts +1 -1
- package/dist/routes/memories/components/MemoryActions.d.ts.map +1 -1
- package/dist/routes/memories/components/MemoryActions.js +4 -4
- package/dist/routes/memories/components/MemoryFields.d.ts +1 -1
- package/dist/routes/memories/components/MemoryFields.d.ts.map +1 -1
- package/dist/routes/memories/components/MemoryFields.js +2 -2
- package/dist/routes/memories/components/MemoryFormDialog.d.ts +1 -1
- package/dist/routes/memories/components/MemoryFormDialog.d.ts.map +1 -1
- package/dist/routes/memories/components/MemoryFormDialog.js +2 -2
- package/dist/routes/memories/components/TeamPicker.d.ts +1 -1
- package/dist/routes/memories/components/TeamPicker.d.ts.map +1 -1
- package/dist/routes/memories/components/TeamPicker.js +2 -2
- package/dist/routes/memories/hooks/useMemoryColumns.d.ts +1 -1
- package/dist/routes/memories/hooks/useMemoryColumns.d.ts.map +1 -1
- package/dist/routes/memories/hooks/useMemoryColumns.js +3 -3
- package/dist/routes/memories/index.d.ts.map +1 -1
- package/dist/routes/memories/index.js +21 -21
- package/package.json +7 -6
package/README.md
CHANGED
|
@@ -57,12 +57,7 @@ The copilot reads a datastore whose shapes are specific to your deployment, so t
|
|
|
57
57
|
that datastore rather than from this package. `@manta-eu/codegen` fetches them over HTTP:
|
|
58
58
|
|
|
59
59
|
```bash
|
|
60
|
-
pnpm manta-codegen generate
|
|
61
|
-
--api-url https://app.hiremanta.com \
|
|
62
|
-
--datastore your-datastore \
|
|
63
|
-
--keycloak-url https://auth.hiremanta.com \
|
|
64
|
-
--keycloak-realm your-realm \
|
|
65
|
-
--out ./.ldkit
|
|
60
|
+
pnpm manta-codegen generate --datastore your-datastore --out ./.ldkit
|
|
66
61
|
```
|
|
67
62
|
|
|
68
63
|
The run writes one file per namespace plus an `index.ts` that re-exports them. Re-run it whenever
|
|
@@ -72,7 +67,8 @@ the device-login and service-account paths.
|
|
|
72
67
|
### 5. Mount the chat
|
|
73
68
|
|
|
74
69
|
`EmbeddedChatProviders` supplies the API client, query cache and graph state; `EmbeddedChat` is the
|
|
75
|
-
copilot itself. Requests carry the session from `mantaBaseUrl`, so the user signs in there.
|
|
70
|
+
copilot itself. Requests carry the session from `mantaBaseUrl`, so the user signs in there. It
|
|
71
|
+
defaults to `https://app.hiremanta.com`.
|
|
76
72
|
|
|
77
73
|
```tsx
|
|
78
74
|
import { EmbeddedChat } from "@manta-eu/react/components/embedded-chat";
|
|
@@ -81,7 +77,7 @@ import "./globals.css";
|
|
|
81
77
|
|
|
82
78
|
export function Copilot() {
|
|
83
79
|
return (
|
|
84
|
-
<EmbeddedChatProviders
|
|
80
|
+
<EmbeddedChatProviders datastoreId="your-datastore">
|
|
85
81
|
<EmbeddedChat
|
|
86
82
|
user={{ id: "…", email: "you@example.com", name: "You" }}
|
|
87
83
|
isOperator={false}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type AudiencePhase = "ACTIVE" | "PAUSED" | "DRAFT" | "ARCHIVED" | "ACTIVATING" | "PAUSING" | "PUBLISHING" | "REPUBLISHING" | "PAUSED_REPUBLISHING";
|
|
1
|
+
export type AudiencePhase = "ACTIVE" | "PAUSED" | "DRAFT" | "ARCHIVED" | "ENDED" | "ACTIVATING" | "PAUSING" | "PUBLISHING" | "REPUBLISHING" | "PAUSED_REPUBLISHING";
|
|
2
2
|
export type AudiencePhaseBadgeProps = {
|
|
3
3
|
phase: AudiencePhase;
|
|
4
4
|
headerDetails?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/audience-phase-badge/index.tsx"],"names":[],"mappings":"AAIA,MAAM,MAAM,aAAa,GACrB,QAAQ,GACR,QAAQ,GACR,OAAO,GACP,UAAU,GACV,YAAY,GACZ,SAAS,GACT,YAAY,GACZ,cAAc,GACd,qBAAqB,CAAC;AAE1B,MAAM,MAAM,uBAAuB,GAAG;IACpC,KAAK,EAAE,aAAa,CAAC;IACrB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/audience-phase-badge/index.tsx"],"names":[],"mappings":"AAIA,MAAM,MAAM,aAAa,GACrB,QAAQ,GACR,QAAQ,GACR,OAAO,GACP,UAAU,GACV,OAAO,GACP,YAAY,GACZ,SAAS,GACT,YAAY,GACZ,cAAc,GACd,qBAAqB,CAAC;AAE1B,MAAM,MAAM,uBAAuB,GAAG;IACpC,KAAK,EAAE,aAAa,CAAC;IACrB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAoDF,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,2CAMhE"}
|
|
@@ -9,6 +9,7 @@ function getPhaseColorClass(phase, headerDetails) {
|
|
|
9
9
|
.with("PAUSED", () => "bg-transparent text-info-foreground border border-info-foreground")
|
|
10
10
|
.with("DRAFT", () => "bg-transparent text-default-foreground border border-default-foreground")
|
|
11
11
|
.with("ARCHIVED", () => "bg-transparent text-error-foreground border border-error-foreground")
|
|
12
|
+
.with("ENDED", () => "bg-transparent text-muted-foreground border border-muted-foreground")
|
|
12
13
|
.with("PUBLISHING", "REPUBLISHING", "PAUSED_REPUBLISHING", "ACTIVATING", "PAUSING", () => "bg-transparent text-warning-foreground border border-warning-foreground")
|
|
13
14
|
.otherwise(() => "");
|
|
14
15
|
}
|
|
@@ -17,6 +18,7 @@ function getPhaseColorClass(phase, headerDetails) {
|
|
|
17
18
|
.with("PAUSED", () => "bg-muted text-default-foreground border border-muted")
|
|
18
19
|
.with("PUBLISHING", "REPUBLISHING", "PAUSED_REPUBLISHING", "ACTIVATING", "PAUSING", () => "bg-warning text-warning-foreground border border-warning")
|
|
19
20
|
.with("ARCHIVED", () => "bg-error text-error-foreground border border-error")
|
|
21
|
+
.with("ENDED", () => "bg-muted text-muted-foreground border border-muted-border")
|
|
20
22
|
.with("DRAFT", () => "bg-info border border-info text-info-foreground")
|
|
21
23
|
.otherwise(() => "bg-default-foreground text-secondary-foreground border-default-foreground");
|
|
22
24
|
}
|
|
@@ -26,6 +28,7 @@ function getPhaseDisplayName(phase) {
|
|
|
26
28
|
.with("PAUSED", () => "Paused")
|
|
27
29
|
.with("DRAFT", () => "Draft")
|
|
28
30
|
.with("ARCHIVED", () => "Archived")
|
|
31
|
+
.with("ENDED", () => "Ended")
|
|
29
32
|
.with("PUBLISHING", () => "Publishing")
|
|
30
33
|
.with("REPUBLISHING", "PAUSED_REPUBLISHING", () => "Updating")
|
|
31
34
|
.with("ACTIVATING", () => "Activating")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/authenticated-chat/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/authenticated-chat/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAIhF,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,2CA6B9D"}
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { isEmpty } from "ramda";
|
|
3
2
|
import { resolveChatProps } from "#lib/chat-types";
|
|
4
3
|
import { cn } from "#lib/utils";
|
|
5
4
|
import { ChatRoute } from "#routes/chat/index";
|
|
6
5
|
export function AuthenticatedChat(props) {
|
|
7
6
|
const { datastore, user, onLogout, isOperator, canSwitchDatastore, datastores, ...otherProps } = resolveChatProps(props);
|
|
8
|
-
if (isOperator && canSwitchDatastore && isEmpty(datastores)) {
|
|
9
|
-
console.error("AuthenticatedChat: datastores array cannot be empty for operators");
|
|
10
|
-
return (_jsx("div", { className: "flex items-center justify-center min-h-screen", children: _jsxs("div", { className: "text-center space-y-4 max-w-md", children: [_jsx("h2", { className: "typography-large-body-semibold text-error-foreground", children: "Configuration Error" }), _jsx("p", { className: "typography-small text-muted-foreground", children: "No datastores available for operator access. Please contact your administrator." }), onLogout && (_jsx("button", { onClick: onLogout, className: cn("px-4 py-2 rounded-lg transition-colors", "bg-background hover:bg-accent"), children: "Sign Out" }))] }) }));
|
|
11
|
-
}
|
|
12
7
|
if (!user) {
|
|
13
8
|
console.error("AuthenticatedChat: user object is required");
|
|
14
9
|
return (_jsx("div", { className: "flex items-center justify-center min-h-screen", children: _jsxs("div", { className: "text-center space-y-2", children: [_jsx("h2", { className: "typography-large-body-semibold text-error-foreground", children: "Authentication Error" }), _jsx("p", { className: "typography-small text-muted-foreground", children: "Invalid user session. Please sign in again." }), onLogout && (_jsx("button", { onClick: onLogout, className: cn("px-4 py-2 rounded-lg transition-colors", "bg-background hover:bg-accent"), children: "Sign Out" }))] }) }));
|
|
@@ -20,6 +20,10 @@ export type ChatProps = {
|
|
|
20
20
|
renderMenuItems?: (defaults: CopilotMenuDefaults) => ReactNode[];
|
|
21
21
|
};
|
|
22
22
|
export declare function Chat(props: ChatProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
type ChatWelcomeContent = {
|
|
24
|
+
title: string;
|
|
25
|
+
subtitle: string;
|
|
26
|
+
};
|
|
23
27
|
export type ChatWelcomeArgs = {
|
|
24
28
|
context?: ChatContext;
|
|
25
29
|
userName?: string | null;
|
|
@@ -27,4 +31,6 @@ export type ChatWelcomeArgs = {
|
|
|
27
31
|
welcomeSubtitle?: string;
|
|
28
32
|
assistantName: string;
|
|
29
33
|
};
|
|
34
|
+
export declare function getChatWelcomeContent(args: ChatWelcomeArgs): ChatWelcomeContent;
|
|
35
|
+
export {};
|
|
30
36
|
//# sourceMappingURL=Chat.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chat.d.ts","sourceRoot":"","sources":["../../../src/components/chat-view/Chat.tsx"],"names":[],"mappings":"AACA,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAGxF,OAAO,EAOL,KAAK,YAAY,EAClB,MAAM,+BAA+B,CAAC;AAMvC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAgCvC,OAAO,KAAK,EAAE,SAAS,EAAE,mBAAmB,EAAE,SAAS,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAYpG,MAAM,MAAM,SAAS,GAAG;IACtB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,IAAI,EAAE,IAAI,CAAC;IACX,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;IAC/B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,eAAe,CAAC,EAAE,CAAC,QAAQ,EAAE,mBAAmB,KAAK,SAAS,EAAE,CAAC;CAClE,CAAC;AAuCF,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,2CAKpC;
|
|
1
|
+
{"version":3,"file":"Chat.d.ts","sourceRoot":"","sources":["../../../src/components/chat-view/Chat.tsx"],"names":[],"mappings":"AACA,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAGxF,OAAO,EAOL,KAAK,YAAY,EAClB,MAAM,+BAA+B,CAAC;AAMvC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAgCvC,OAAO,KAAK,EAAE,SAAS,EAAE,mBAAmB,EAAE,SAAS,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAYpG,MAAM,MAAM,SAAS,GAAG;IACtB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,IAAI,EAAE,IAAI,CAAC;IACX,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;IAC/B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,eAAe,CAAC,EAAE,CAAC,QAAQ,EAAE,mBAAmB,KAAK,SAAS,EAAE,CAAC;CAClE,CAAC;AAuCF,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,2CAKpC;AAiBD,KAAK,kBAAkB,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAE9D,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,eAAe,GAAG,kBAAkB,CAqB/E"}
|
|
@@ -87,15 +87,15 @@ function referenceToFilePart(reference, uploadsUrl) {
|
|
|
87
87
|
},
|
|
88
88
|
};
|
|
89
89
|
}
|
|
90
|
-
function getChatWelcomeContent(args) {
|
|
90
|
+
export function getChatWelcomeContent(args) {
|
|
91
91
|
return match(args.context)
|
|
92
92
|
.with({ kind: ChatContextKind.RuleEdit }, ({ ruleIri }) => ({
|
|
93
|
-
title:
|
|
94
|
-
subtitle: `Describe the changes you'd like to make to ${getRuleDisplayName(ruleIri)}.
|
|
93
|
+
title: `Refine with ${args.assistantName}`,
|
|
94
|
+
subtitle: `Describe the changes you'd like to make to ${getRuleDisplayName(ruleIri)}. ${args.assistantName} stages them for your review — nothing goes live until you commit.`,
|
|
95
95
|
}))
|
|
96
96
|
.with({ kind: ChatContextKind.RuleCreate }, () => ({
|
|
97
|
-
title:
|
|
98
|
-
subtitle:
|
|
97
|
+
title: `Create a rule with ${args.assistantName}`,
|
|
98
|
+
subtitle: `Describe the rule you want in your own words. ${args.assistantName} drafts it and stages it for your review — nothing goes live until you commit.`,
|
|
99
99
|
}))
|
|
100
100
|
.with({ kind: ChatContextKind.Plan }, ({ planGraphIri }) => ({
|
|
101
101
|
title: extractPlanName(planGraphIri),
|
|
@@ -291,7 +291,7 @@ function ChatContent(props) {
|
|
|
291
291
|
.with({ ruleEditContext: P.nonNullable }, () => "Describe the change you'd like to make to this rule…")
|
|
292
292
|
.with({ isRuleCreateContext: true }, () => "Describe the rule you'd like to create…")
|
|
293
293
|
.otherwise(() => `Ask me anything about ${datastoreName ?? "your datastore"}...`);
|
|
294
|
-
const chatPanel = (_jsx("div", { ref: dropZoneRef, className: "relative h-full w-full min-w-0", children: _jsx("div", { ref: chatPanelRef, className: "h-full w-full overflow-y-auto overscroll-contain bg-base-background", children: _jsx(Conversation, { scrollRef: chatPanelRef, children: _jsxs("div", { className: "min-h-full flex flex-col", children: [_jsxs("div", { className: "sticky top-0 z-20", children: [connectionNotice, isCopilot && (_jsx(CopilotHeader, { isOperator: isOperator, datastoreId: datastore?.id, onClear: chatData?.clearHistory, onClose: onCloseAction, conversationId: activeConversation?.id, messages: chatData?.messages ?? [], isEmbedded: isEmbedded, renderMenuItems: renderMenuItems, title: title })), !isCopilot && ruleEditContext && (_jsx(RuleEditBanner, { ruleIri: ruleEditContext.ruleIri, ruleName: ruleEditName, onExit: () => startNewChat() }))] }), showGraphContextPanel && (_jsx("div", { className: "sticky top-0 z-10 h-0", children: _jsx(GraphContextPanel, { mergedGraph: graphContext.mergedGraph, graphCount: graphContext.graphCount, nodeCount: graphContext.nodeCount, sparqlQueries: graphContext.sparqlQueries }) })), _jsxs("div", { className: "flex-1 flex flex-col min-h-0", children: [!hasMessages && (_jsx("div", { "data-testid": "chat-welcome", className: "flex-1 flex flex-col items-center justify-center px-6 py-12", children: _jsxs("div", { className: "w-full max-w-4xl space-y-8 text-center", children: [_jsx(ChatWelcome, { channel: "MANTA", title: welcome.title, subtitle: welcome.subtitle, mark: mark }), _jsx(ConversationStarters, { onSubmit: handleConversationStarterSubmit, disabled: isChatInputDisabled })] }) })), hasMessages && (_jsx(MessagesContainer, { messages: displayMessages, toolsUsedInSession: toolsUsedInSession, onAddToolResult: addToolResult || (() => { }), status: status, thinkingSeconds: thinkingSeconds, activeTurnKey: activeTurnKey, compact: isCopilot, animateOnMount: !hasPendingMessage, turnError: turnError, onRetryTurn: () => void handleRetryTurn(), onStartNewChat: startNewChat }))] }), _jsxs("div", { className: cn("sticky bottom-0 z-20 py-2 px-4 space-y-2 w-full bg-base-background", !isCopilot && "max-w-3xl mx-auto", isCopilot && "pb-4"), children: [hasMessages && (_jsx("div", { className: "pointer-events-none absolute -top-10 left-0 right-0 h-10 bg-linear-to-t from-base-background to-transparent" })), _jsx(ConversationScrollButton, { className: "absolute -top-12 left-1/2 -translate-x-1/2 z-30" }), !isEmbedded && latestShowcase && (_jsx(ReviewCta, { title: humanizePlanName(latestShowcase.planName), subtitle: planStatusLabel(latestShowcase.status), className: "plan-badge-border gap-4 px-4 py-2 rounded-full", onClick: () => void handleSelectPlan(latestShowcase.planIri) })), !isEmbedded && isRuleCreateContext && _jsx(StagedRuleCta, { messages: agentMessages }), _jsxs(ChatInput, { initialValue: composerDraft.initialValue, dropTargetRef: dropZoneRef, onSubmit: isChatInputDisabled ? undefined : composerDraft.onSubmit, onRejected: handleFilesRejected, topContent: _jsx(ChatInputFilePreview, { progress: uploadProgress }), children: [!hasPendingQuestionnaire && _jsx(ChatInputAttachButton, {}), _jsx(ChatInputTextarea, { placeholder: composerPlaceholder, className: "pl-5", autoFocus: shouldAutoFocusInput, disabled: hasPendingQuestionnaire, "data-chat-input": true }), _jsx(ChatInputSubmit, { icon: ArrowUp, "aria-label": "Send", isLoading: isUploading, disabled: isChatInputDisabled, stopGeneration: !isResumeProbe && (isChatStreaming || chatStatus === "submitted") ? stop : undefined })] }, composerDraft.key), !isCopilot && (_jsx(ChatInputFooter, { infoText:
|
|
294
|
+
const chatPanel = (_jsx("div", { ref: dropZoneRef, className: "relative h-full w-full min-w-0", children: _jsx("div", { ref: chatPanelRef, className: "h-full w-full overflow-y-auto overscroll-contain bg-base-background", children: _jsx(Conversation, { scrollRef: chatPanelRef, children: _jsxs("div", { className: "min-h-full flex flex-col", children: [_jsxs("div", { className: "sticky top-0 z-20", children: [connectionNotice, isCopilot && (_jsx(CopilotHeader, { isOperator: isOperator, datastoreId: datastore?.id, onClear: chatData?.clearHistory, onClose: onCloseAction, conversationId: activeConversation?.id, messages: chatData?.messages ?? [], isEmbedded: isEmbedded, renderMenuItems: renderMenuItems, title: title })), !isCopilot && ruleEditContext && (_jsx(RuleEditBanner, { ruleIri: ruleEditContext.ruleIri, ruleName: ruleEditName, onExit: () => startNewChat() }))] }), showGraphContextPanel && (_jsx("div", { className: "sticky top-0 z-10 h-0", children: _jsx(GraphContextPanel, { mergedGraph: graphContext.mergedGraph, graphCount: graphContext.graphCount, nodeCount: graphContext.nodeCount, sparqlQueries: graphContext.sparqlQueries }) })), _jsxs("div", { className: "flex-1 flex flex-col min-h-0", children: [!hasMessages && (_jsx("div", { "data-testid": "chat-welcome", className: "flex-1 flex flex-col items-center justify-center px-6 py-12", children: _jsxs("div", { className: "w-full max-w-4xl space-y-8 text-center", children: [_jsx(ChatWelcome, { channel: "MANTA", title: welcome.title, subtitle: welcome.subtitle, mark: mark }), _jsx(ConversationStarters, { onSubmit: handleConversationStarterSubmit, disabled: isChatInputDisabled })] }) })), hasMessages && (_jsx(MessagesContainer, { messages: displayMessages, toolsUsedInSession: toolsUsedInSession, onAddToolResult: addToolResult || (() => { }), status: status, thinkingSeconds: thinkingSeconds, activeTurnKey: activeTurnKey, compact: isCopilot, animateOnMount: !hasPendingMessage, turnError: turnError, onRetryTurn: () => void handleRetryTurn(), onStartNewChat: startNewChat }))] }), _jsxs("div", { className: cn("sticky bottom-0 z-20 py-2 px-4 space-y-2 w-full bg-base-background", !isCopilot && "max-w-3xl mx-auto", isCopilot && "pb-4"), children: [hasMessages && (_jsx("div", { className: "pointer-events-none absolute -top-10 left-0 right-0 h-10 bg-linear-to-t from-base-background to-transparent" })), _jsx(ConversationScrollButton, { className: "absolute -top-12 left-1/2 -translate-x-1/2 z-30" }), !isEmbedded && latestShowcase && (_jsx(ReviewCta, { title: humanizePlanName(latestShowcase.planName), subtitle: planStatusLabel(latestShowcase.status), className: "plan-badge-border gap-4 px-4 py-2 rounded-full", onClick: () => void handleSelectPlan(latestShowcase.planIri) })), !isEmbedded && isRuleCreateContext && _jsx(StagedRuleCta, { messages: agentMessages }), _jsxs(ChatInput, { initialValue: composerDraft.initialValue, dropTargetRef: dropZoneRef, onSubmit: isChatInputDisabled ? undefined : composerDraft.onSubmit, onRejected: handleFilesRejected, topContent: _jsx(ChatInputFilePreview, { progress: uploadProgress }), children: [!hasPendingQuestionnaire && _jsx(ChatInputAttachButton, {}), _jsx(ChatInputTextarea, { placeholder: composerPlaceholder, className: "pl-5", autoFocus: shouldAutoFocusInput, disabled: hasPendingQuestionnaire, "data-chat-input": true }), _jsx(ChatInputSubmit, { icon: ArrowUp, "aria-label": "Send", isLoading: isUploading, disabled: isChatInputDisabled, stopGeneration: !isResumeProbe && (isChatStreaming || chatStatus === "submitted") ? stop : undefined })] }, composerDraft.key), !isCopilot && (_jsx(ChatInputFooter, { infoText: `${assistantName} can make mistakes.`, version: kg.knowledgeGraphState?.dataVersion?.uniqueId ?? "unknown", circularProgressTooltip: "Context used (tokens)", min: agentState?.contextTokens ?? 0, max: contextWindow, actions: _jsxs(_Fragment, { children: [isOperator && modelPickerOptions.length > 1 && (_jsx(ChatModelPicker, { models: modelPickerOptions, selectedId: selectedModel, onChange: setSelectedModel })), showDebugMessages && _jsx(DebugMessagesButton, { messages: agentMessages })] }) }))] })] }) }) }) }));
|
|
295
295
|
if (isConnectingOrSyncing) {
|
|
296
296
|
return (_jsxs("div", { className: "relative", children: [_jsx(LoadingView, {}), activeChat?.connectionState === "closed" && (_jsx("div", { className: "absolute inset-x-0 top-0 z-20", children: connectionNotice }))] }));
|
|
297
297
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatHeaders.d.ts","sourceRoot":"","sources":["../../../src/components/chat-view/ChatHeaders.tsx"],"names":[],"mappings":"AACA,OAAO,EAAgB,KAAK,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAIjF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMvC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"ChatHeaders.d.ts","sourceRoot":"","sources":["../../../src/components/chat-view/ChatHeaders.tsx"],"names":[],"mappings":"AACA,OAAO,EAAgB,KAAK,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAIjF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMvC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAM3D,KAAK,mBAAmB,GAAG;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,2CA8BxD;AAED,KAAK,kBAAkB,GAAG;IACxB,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,eAAe,CAAC,EAAE,CAAC,QAAQ,EAAE,mBAAmB,KAAK,SAAS,EAAE,CAAC;IACjE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAMF,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,2CA+FtD"}
|
|
@@ -10,6 +10,7 @@ import { Button } from "#components/button/index";
|
|
|
10
10
|
import { Dropdown, DropdownContent, DropdownItem, DropdownTrigger } from "#components/dropdown/index";
|
|
11
11
|
import { isDevBuild } from "#lib/build-config";
|
|
12
12
|
import { cn } from "#lib/utils";
|
|
13
|
+
import { useAssistantName } from "#providers/AssistantNameProvider";
|
|
13
14
|
import { useMantaClient } from "#providers/index";
|
|
14
15
|
import { getRuleDisplayName, getRuleHref } from "#routes/rules/components/rules.utils";
|
|
15
16
|
export function RuleEditBanner(props) {
|
|
@@ -17,13 +18,13 @@ export function RuleEditBanner(props) {
|
|
|
17
18
|
const displayName = ruleName ?? getRuleDisplayName(ruleIri);
|
|
18
19
|
return (_jsxs("div", { className: cn("shrink-0 flex h-12 items-center justify-between gap-3 border-b border-default-border bg-base-background px-4", className), children: [_jsxs("span", { className: "typography-small text-muted-foreground truncate", children: ["Editing rule", " ", _jsx(Link, { to: getRuleHref({ ruleIri }), className: "text-default-foreground hover:underline", children: displayName })] }), _jsx(Button, { type: "button", variant: "ghost", size: "sm", rounded: "md", iconOnly: true, icon: X, "aria-label": "Exit rule edit", onClick: onExit, className: "text-muted-foreground hover:text-default-foreground" })] }));
|
|
19
20
|
}
|
|
20
|
-
const defaultCopilotTitle = "Manta Co-pilot";
|
|
21
21
|
function defaultCopilotMenuItems(defaults) {
|
|
22
22
|
return [defaults.openInManta, defaults.debugMessages, defaults.clearChat];
|
|
23
23
|
}
|
|
24
24
|
export function CopilotHeader(props) {
|
|
25
25
|
const { isOperator, datastoreId, onClear, onClose, conversationId, messages, isEmbedded, renderMenuItems = defaultCopilotMenuItems, className, title, } = props;
|
|
26
26
|
const { mantaBaseUrl, datastorePath } = useMantaClient();
|
|
27
|
+
const assistantName = useAssistantName();
|
|
27
28
|
const [debugOpen, setDebugOpen] = useState(false);
|
|
28
29
|
const canClear = Boolean(conversationId && isPresent(messages) && onClear);
|
|
29
30
|
const showDebugMessages = isOperator || isDevBuild;
|
|
@@ -38,5 +39,5 @@ export function CopilotHeader(props) {
|
|
|
38
39
|
debugMessages: showDebugMessages ? (_jsx(DropdownItem, { icon: _jsx(Bug, { className: "size-4" }), onClick: () => setDebugOpen(true), children: "Debug messages" }, "debug-messages")) : null,
|
|
39
40
|
clearChat: canClear ? (_jsx(DropdownItem, { icon: _jsx(Trash2, { className: "size-4" }), onClick: onClear, className: "text-error-foreground", children: "Clear chat" }, "clear-chat")) : null,
|
|
40
41
|
}).filter(isPresent);
|
|
41
|
-
return (_jsxs("div", { className: cn("shrink-0 flex h-16 items-center justify-between border-b border-default-border bg-base-background px-6", className), children: [_jsx("span", { className: "typography-small-medium text-default-foreground", children: isPresent(title) ? title :
|
|
42
|
+
return (_jsxs("div", { className: cn("shrink-0 flex h-16 items-center justify-between border-b border-default-border bg-base-background px-6", className), children: [_jsx("span", { className: "typography-small-medium text-default-foreground", children: isPresent(title) ? title : `${assistantName} Co-pilot` }), _jsxs("div", { className: "flex items-center gap-2", children: [isPresent(menuItems) && (_jsxs(Dropdown, { children: [_jsx(DropdownTrigger, { asChild: true, children: _jsx(Button, { type: "button", variant: "ghost", size: "sm", rounded: "md", iconOnly: true, icon: Ellipsis, "aria-label": "Open menu", className: "text-muted-foreground hover:text-default-foreground" }) }), _jsx(DropdownContent, { align: "end", children: menuItems })] })), onClose && (_jsx(Button, { type: "button", variant: "ghost", size: "sm", rounded: "md", iconOnly: true, icon: X, "aria-label": "Close", onClick: onClose, className: "text-muted-foreground hover:text-default-foreground" }))] }), _jsx(DebugMessagesDialog, { messages: messages, open: debugOpen, onOpenChange: setDebugOpen })] }));
|
|
42
43
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmbeddedDatastorePicker.d.ts","sourceRoot":"","sources":["../../../src/components/embedded-chat/EmbeddedDatastorePicker.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"EmbeddedDatastorePicker.d.ts","sourceRoot":"","sources":["../../../src/components/embedded-chat/EmbeddedDatastorePicker.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAKjD,MAAM,MAAM,4BAA4B,GAAG;IACzC,UAAU,EAAE,SAAS,EAAE,CAAC;IACxB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,iBAAiB,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,IAAI,CAAC;CACnD,CAAC;AAGF,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,4BAA4B,2CA6H1E"}
|
|
@@ -1,27 +1,33 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useDatastoreTreeQuery } from "@manta-eu/client";
|
|
2
3
|
import { isPresent } from "@manta-eu/lib/present";
|
|
3
4
|
import { LoaderCircle } from "lucide-react";
|
|
4
5
|
import { useCallback, useMemo, useState } from "react";
|
|
6
|
+
import { Banner } from "#components/banner/index";
|
|
5
7
|
import { SearchInput } from "#components/input/index";
|
|
6
8
|
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "#components/tooltip/index";
|
|
7
9
|
import { useDatastoreSelection } from "#hooks/useDatastoreSelection";
|
|
8
10
|
import { datastorePickerRows, DatastoreRowContent, datastoreRowIndent, datastoreRowTestIdPrefix, filterDatastoreRows, searchThreshold, } from "#ldo-ui";
|
|
9
11
|
import { cn } from "#lib/utils";
|
|
10
12
|
import { useAssistantName } from "#providers/AssistantNameProvider";
|
|
13
|
+
import { useMantaClient } from "#providers/MantaClientProvider";
|
|
11
14
|
// No sidebar to hang the profile-menu picker off, so an operator picks the tenant before the chat opens.
|
|
12
15
|
export function EmbeddedDatastorePicker(props) {
|
|
13
|
-
const { datastores, canSwitchDatastore, onDatastoreChosen } = props;
|
|
16
|
+
const { datastores, isOperator, canSwitchDatastore, onDatastoreChosen } = props;
|
|
14
17
|
const assistantName = useAssistantName();
|
|
15
18
|
const [search, setSearch] = useState("");
|
|
16
19
|
const { setSelectedDatastore, isSwitching } = useDatastoreSelection({ canSwitchDatastore });
|
|
17
|
-
const
|
|
20
|
+
const { mantaClient } = useMantaClient();
|
|
21
|
+
const { data, isLoading: isLoadingTree, isError: isTreeFailed, refetch: refetchTree, } = useDatastoreTreeQuery(mantaClient, undefined, { enabled: isOperator === true });
|
|
22
|
+
const datastoreTree = data?.datastoreTree;
|
|
23
|
+
const rows = useMemo(() => datastorePickerRows({ isOperator, userDatastores: datastores, datastoreTree }), [datastores, isOperator, datastoreTree]);
|
|
18
24
|
const visibleRows = useMemo(() => filterDatastoreRows(rows, search), [rows, search]);
|
|
19
25
|
const choose = useCallback(async (row) => {
|
|
20
26
|
if (!(await setSelectedDatastore(row.id)))
|
|
21
27
|
return;
|
|
22
28
|
onDatastoreChosen(datastores.find((datastore) => datastore.id === row.id) ?? { id: row.id, name: row.name });
|
|
23
29
|
}, [datastores, setSelectedDatastore, onDatastoreChosen]);
|
|
24
|
-
return (_jsx(TooltipProvider, { delayDuration: 300, children: _jsxs("div", { className: "flex h-full flex-col gap-4 bg-background p-6 text-default-foreground", children: [_jsxs("div", { className: "flex flex-col gap-1", children: [_jsx("h2", { className: "typography-large-body-semibold leading-none", children: "Select a datastore" }), _jsxs("p", { className: "typography-small text-muted-foreground", children: ["Choose which datastore ", assistantName, " should answer for."] })] }), rows.length > searchThreshold && (_jsx(SearchInput, { autoFocus: true, placeholder: "Search datastores...", value: search, onChange: (event) => setSearch(event.target.value) })), isSwitching && (_jsxs("div", { className: "flex items-center gap-2 typography-caption text-muted-foreground", children: [_jsx(LoaderCircle, { className: "size-4 animate-spin" }), "Switching datastore..."] })), isPresent(visibleRows) ? (_jsx("ul", { className: "flex min-h-0 flex-1 flex-col gap-1 overflow-y-auto", "data-testid": "embedded-datastore-picker", children: visibleRows.map((row) => {
|
|
30
|
+
return (_jsx(TooltipProvider, { delayDuration: 300, children: _jsxs("div", { className: "flex h-full flex-col gap-4 bg-background p-6 text-default-foreground", children: [_jsxs("div", { className: "flex flex-col gap-1", children: [_jsx("h2", { className: "typography-large-body-semibold leading-none", children: "Select a datastore" }), _jsxs("p", { className: "typography-small text-muted-foreground", children: ["Choose which datastore ", assistantName, " should answer for."] })] }), isLoadingTree && (_jsxs("div", { className: "flex items-center gap-2 typography-caption text-muted-foreground", children: [_jsx(LoaderCircle, { className: "size-4 animate-spin" }), "Loading datastores..."] })), isTreeFailed && (_jsx(Banner, { type: "error", size: "loose", label: "Could not load your datastores", description: "Only the default datastore is listed until they load.", actionLabel: "Retry", onAction: () => void refetchTree(), testId: "embedded-datastore-tree-error", buttonTestId: "embedded-datastore-tree-retry" })), rows.length > searchThreshold && (_jsx(SearchInput, { autoFocus: true, placeholder: "Search datastores...", value: search, onChange: (event) => setSearch(event.target.value) })), isSwitching && (_jsxs("div", { className: "flex items-center gap-2 typography-caption text-muted-foreground", children: [_jsx(LoaderCircle, { className: "size-4 animate-spin" }), "Switching datastore..."] })), isPresent(visibleRows) ? (_jsx("ul", { className: "flex min-h-0 flex-1 flex-col gap-1 overflow-y-auto", "data-testid": "embedded-datastore-picker", children: visibleRows.map((row) => {
|
|
25
31
|
const className = cn("flex w-full items-center gap-2 rounded-sm-v4 p-2 text-left", row.heading
|
|
26
32
|
? "cursor-default"
|
|
27
33
|
: "hover:bg-accent focus-visible:bg-accent focus-visible:outline-none disabled:opacity-60");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/embedded-chat/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/embedded-chat/index.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAoB,KAAK,sBAAsB,EAA0C,MAAM,iBAAiB,CAAC;AAOxH,YAAY,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD,wBAAgB,YAAY,CAAC,KAAK,EAAE,sBAAsB,2CAazD"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { isEmpty } from "ramda";
|
|
3
2
|
import { useState } from "react";
|
|
4
3
|
import { MemoryRouter, useInRouterContext } from "react-router";
|
|
5
4
|
import { Chat } from "../chat-view/index.js";
|
|
@@ -37,14 +36,8 @@ function EmbeddedContent(props) {
|
|
|
37
36
|
onAction: onLogout,
|
|
38
37
|
}) }) }) }));
|
|
39
38
|
}
|
|
40
|
-
if (isOperator && isEmpty(datastores)) {
|
|
41
|
-
return (_jsx("div", { className: "flex min-h-screen items-center justify-center p-4", children: _jsx("div", { className: "w-full max-w-md space-y-4", children: _jsx(Banner, { type: "error", size: "loose", label: "Configuration Error", description: "No datastores available for operator access. Please contact your administrator.", ...(onLogout && {
|
|
42
|
-
actionLabel: "Sign Out",
|
|
43
|
-
onAction: onLogout,
|
|
44
|
-
}) }) }) }));
|
|
45
|
-
}
|
|
46
39
|
if (isOperator && !activeDatastore) {
|
|
47
|
-
return (_jsx(EmbeddedDatastorePicker, { datastores: datastores, canSwitchDatastore: canSwitchDatastore, onDatastoreChosen: setChosenDatastore }));
|
|
40
|
+
return (_jsx(EmbeddedDatastorePicker, { datastores: datastores, isOperator: isOperator, canSwitchDatastore: canSwitchDatastore, onDatastoreChosen: setChosenDatastore }));
|
|
48
41
|
}
|
|
49
42
|
return (_jsx(ChatManagerProvider, { datastoreId: activeDatastore?.id, onSelectPlan: onSelectPlan, children: _jsx(KnowledgeGraphStateProvider, { datastoreId: activeDatastore?.id, children: _jsx(KnowledgeGraphStartupGate, { embedded: true, children: _jsx(Chat, { datastore: activeDatastore, user: user, onLogout: onLogout, onCloseAction: onClose, isCopilot: true, isEmbedded: true, isOperator: isOperator, pageContext: props.pageContext, title: props.title, mark: props.mark, initialPrompt: props.initialPrompt, initialDraft: props.initialDraft, welcomeSubtitle: props.welcomeSubtitle, renderMenuItems: props.renderMenuItems }) }) }) }, activeDatastore?.id));
|
|
50
43
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sidebar.d.ts","sourceRoot":"","sources":["../../../src/components/layouts/Sidebar.tsx"],"names":[],"mappings":"AAoDA,OAAO,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AA6BvD,KAAK,YAAY,GAAG;IAClB,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,UAAU,CAAC,EAAE,SAAS,EAAE,CAAC;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,mBAAmB,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;CACrD,CAAC;AAEF,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"Sidebar.d.ts","sourceRoot":"","sources":["../../../src/components/layouts/Sidebar.tsx"],"names":[],"mappings":"AAoDA,OAAO,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AA6BvD,KAAK,YAAY,GAAG;IAClB,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,UAAU,CAAC,EAAE,SAAS,EAAE,CAAC;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,mBAAmB,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;CACrD,CAAC;AAEF,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,2CAoY1C"}
|
|
@@ -49,7 +49,9 @@ export function Sidebar(props) {
|
|
|
49
49
|
const { pathname } = useLocation();
|
|
50
50
|
const { isKnowledgeGraphUnavailable } = useKnowledgeGraphState();
|
|
51
51
|
const { user, datastore, datastores, isOperator, isSwitching, canSwitchDatastore, onLogout, onDatastoreSelected } = props;
|
|
52
|
-
const
|
|
52
|
+
const authContext = use(AuthContext);
|
|
53
|
+
const canManageTeam = authContext?.canManageTeam ?? false;
|
|
54
|
+
const canManageStreams = authContext?.canManageStreams ?? isOperator ?? false;
|
|
53
55
|
const { state: sidebarState, isMobile, toggleSidebar, setOpenMobile } = useSidebar();
|
|
54
56
|
const isSidebarExpanded = isMobile || sidebarState === "expanded";
|
|
55
57
|
useEffect(() => {
|
|
@@ -116,7 +118,7 @@ export function Sidebar(props) {
|
|
|
116
118
|
isActive: pathname === "/data" || pathname.startsWith("/data/"),
|
|
117
119
|
href: "/data",
|
|
118
120
|
},
|
|
119
|
-
...(
|
|
121
|
+
...(canManageStreams
|
|
120
122
|
? [
|
|
121
123
|
{
|
|
122
124
|
title: "Streams",
|
|
@@ -126,13 +128,18 @@ export function Sidebar(props) {
|
|
|
126
128
|
},
|
|
127
129
|
]
|
|
128
130
|
: []),
|
|
129
|
-
].map((item) => ({ ...item, disabled: isKnowledgeGraphUnavailable, tooltip: navItemTooltip })), [ModifierIcon, startNewChat, isKnowledgeGraphUnavailable,
|
|
131
|
+
].map((item) => ({ ...item, disabled: isKnowledgeGraphUnavailable, tooltip: navItemTooltip })), [ModifierIcon, startNewChat, isKnowledgeGraphUnavailable, canManageStreams, pathname, setOpen, navItemTooltip]);
|
|
130
132
|
const userName = isPresent(user?.name) ? user.name : isPresent(user?.email) ? user.email : "User";
|
|
131
133
|
// An operator with no explicit pick is still on the realm default, not a blank name.
|
|
132
134
|
const datastoreName = datastore?.name ?? (isOperator ? realmVocabLabel(realmDatastoreId) : "");
|
|
133
135
|
const chatId = activeConversation?.id;
|
|
134
136
|
const canManageDatastores = enableDatastoreManagement && !!isOperator && !!onDatastoreSelected;
|
|
135
|
-
const showDatastorePicker = canPickDatastore({
|
|
137
|
+
const showDatastorePicker = canPickDatastore({
|
|
138
|
+
canSwitchDatastore,
|
|
139
|
+
canSelect: !!onDatastoreSelected,
|
|
140
|
+
datastores,
|
|
141
|
+
isOperator,
|
|
142
|
+
});
|
|
136
143
|
// Deferred until the menu's close animation finishes, so navigating doesn't cut it short.
|
|
137
144
|
const pendingMenuNavigateRef = useRef(null);
|
|
138
145
|
const handleProfileMenuCloseAutoFocus = useCallback(() => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActioningView.d.ts","sourceRoot":"","sources":["../../../src/components/planning/ActioningView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,yBAAyB,EAC/B,MAAM,kBAAkB,CAAC;AAI1B,OAAO,EAA6C,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAclF,OAAO,EAA0B,KAAK,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"ActioningView.d.ts","sourceRoot":"","sources":["../../../src/components/planning/ActioningView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,yBAAyB,EAC/B,MAAM,kBAAkB,CAAC;AAI1B,OAAO,EAA6C,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAclF,OAAO,EAA0B,KAAK,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AAmB1G,KAAK,kBAAkB,GAAG;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,yBAAyB,GAAG,IAAI,CAAC;IACvC,SAAS,EAAE,OAAO,CAAC;IACnB,gBAAgB,EAAE,GAAG,CAAC;IACtB,gBAAgB,CAAC,EAAE,4BAA4B,CAAC;IAChD,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,oBAAoB,CAAC,EAAE,SAAS,CAAC;CAClC,CAAC;AAEF,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,2CAkOtD"}
|
|
@@ -16,11 +16,17 @@ import { UnavailablePlanNotice } from "./UnavailablePlanNotice.js";
|
|
|
16
16
|
import { Loader } from "#components/loader/index";
|
|
17
17
|
import { useActionPlanDetail } from "#hooks/useActionPlanDetail";
|
|
18
18
|
import { useActionPlanExecution } from "#hooks/useActionPlanExecution";
|
|
19
|
-
import { useActionPlanDiff, useActionPlanExecutionProvenance, useManualActions } from "#ldo-ui";
|
|
19
|
+
import { useActionPlanDiff, useActionPlanExecutionProvenance, useManualActions, } from "#ldo-ui";
|
|
20
|
+
import { extractLabel } from "#lib/iri-labels";
|
|
20
21
|
import { getPendingManualActions } from "#lib/manual-actions";
|
|
21
22
|
import { cn } from "#lib/utils";
|
|
22
23
|
import { useMantaClient } from "#providers/MantaClientProvider";
|
|
23
24
|
import { invalidateActionPlanQueries } from "#shared/query-keys";
|
|
25
|
+
const resolutionStatuses = {
|
|
26
|
+
COMPLETED: GQLManualActionResolveStatus.Completed,
|
|
27
|
+
RETRY: GQLManualActionResolveStatus.Retry,
|
|
28
|
+
REJECTED: GQLManualActionResolveStatus.Rejected,
|
|
29
|
+
};
|
|
24
30
|
export function ActioningView(props) {
|
|
25
31
|
const { planGraphIri, diff, isLoading, executionControl, executePromptNonce, datastoreId, userId, hideTopBar = false, chatIri, completedChangesSlot, } = props;
|
|
26
32
|
const planName = extractPlanName(planGraphIri);
|
|
@@ -71,7 +77,7 @@ export function ActioningView(props) {
|
|
|
71
77
|
const { mantaClient } = useMantaClient();
|
|
72
78
|
const resolveManualAction = useResolveManualActionMutation(mantaClient);
|
|
73
79
|
const canResolveManualAction = !!datastoreId && !!userId;
|
|
74
|
-
const handleManualActionResolve = useCallback((subjectIri,
|
|
80
|
+
const handleManualActionResolve = useCallback((subjectIri, resolution) => {
|
|
75
81
|
if (!userId) {
|
|
76
82
|
toast.error("Cannot resolve manual action: missing user context.");
|
|
77
83
|
return;
|
|
@@ -80,7 +86,7 @@ export function ActioningView(props) {
|
|
|
80
86
|
namedGraphIri: planGraphIri,
|
|
81
87
|
subjectIri,
|
|
82
88
|
resolvedBy: userId,
|
|
83
|
-
status:
|
|
89
|
+
status: resolutionStatuses[resolution],
|
|
84
90
|
}, {
|
|
85
91
|
onSuccess: async () => {
|
|
86
92
|
await invalidateActionPlanQueries(queryClient, planGraphIri);
|
|
@@ -91,7 +97,6 @@ export function ActioningView(props) {
|
|
|
91
97
|
},
|
|
92
98
|
});
|
|
93
99
|
}, [userId, planGraphIri, resolveManualAction, queryClient]);
|
|
94
|
-
const handleManualActionSkip = useCallback((subjectIri) => handleManualActionResolve(subjectIri, "REJECTED"), [handleManualActionResolve]);
|
|
95
100
|
const handleExecute = useCallback((nextDryRun) => {
|
|
96
101
|
void execute(nextDryRun);
|
|
97
102
|
}, [execute]);
|
|
@@ -110,7 +115,7 @@ export function ActioningView(props) {
|
|
|
110
115
|
map.set(ma.subjectIri, [
|
|
111
116
|
{
|
|
112
117
|
subjectIri: ma.subjectIri,
|
|
113
|
-
label: ma.subjectLabel || ma.typeName || "Manual action",
|
|
118
|
+
label: (ma.aboutIri && extractLabel(ma.aboutIri)) || ma.subjectLabel || ma.typeName || "Manual action",
|
|
114
119
|
properties: [],
|
|
115
120
|
},
|
|
116
121
|
]);
|
|
@@ -149,5 +154,5 @@ export function ActioningView(props) {
|
|
|
149
154
|
}, [entityTypes, manualActions]);
|
|
150
155
|
const completedChanges = executionStatus === "completed" ? completedChangesSlot : null;
|
|
151
156
|
return (_jsxs("div", { className: cn("flex flex-col", !hideTopBar && "h-full bg-background"), children: [!hideTopBar && (_jsx(ExecutionTopBar, { planName: planName, status: executionStatus, workflowId: workflowId, triggerError: triggerError, onExecute: hasCurrentFacts ? handleExecute : undefined, onRerun: hasCurrentFacts ? handleConfirmRerun : undefined, isExecuteDialogOpen: isExecuteDialogOpen, onExecuteDialogOpenChange: setIsExecuteDialogOpen, isDryRun: isDryRun })), !hideTopBar && isDryRunCompleted && _jsx(DryRunCompleteBanner, {}), _jsx("div", { className: cn(!hideTopBar && "flex-1 overflow-y-auto"), children: _jsxs("div", { className: cn("space-y-6", hideTopBar ? "mx-auto w-full max-w-7xl px-8" : "mx-auto max-w-[960px] px-16 py-8"), children: [!hideTopBar && plan && !plan.hasCurrentFacts && (_jsx(UnavailablePlanNotice, { hasExecutionHistory: plan.hasExecutionHistory })), executionStatus === "failed" && (provenance?.planErrorMessage || triggerError) && (_jsx(FailedBanner, { message: provenance?.planErrorMessage ?? triggerError ?? "Execution failed" })), isLoading && !isPresent(effectiveEntityTypes) && (_jsx("div", { className: "flex items-center justify-center py-12", children: _jsx(Loader, { className: "size-6" }) })), plan && (_jsx(SummaryBar, { plan: plan, executionStatus: executionStatus, startedAtMs: planStartedAtMs, endedAtMs: planEndedAtMs })), completedChanges ??
|
|
152
|
-
(isPresent(effectiveEntityTypes) && (_jsx(ExecutionSections, { entityTypes: effectiveEntityTypes, provenance: provenance ?? null, manualActions: manualActions, manualActionEntities: manualActionEntities, activeStartedAtMs: activeStartedAtMs, onManualActionResolve: handleManualActionResolve,
|
|
157
|
+
(isPresent(effectiveEntityTypes) && (_jsx(ExecutionSections, { entityTypes: effectiveEntityTypes, provenance: provenance ?? null, manualActions: manualActions, manualActionEntities: manualActionEntities, activeStartedAtMs: activeStartedAtMs, onManualActionResolve: handleManualActionResolve, isResolvingManualAction: resolveManualAction.isPending || !canResolveManualAction })))] }) })] }));
|
|
153
158
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { EntityTypeEntry } from "./ActionPlanDetailView.js";
|
|
2
2
|
import { type SectionStatus } from "./execution-section-model.js";
|
|
3
3
|
import { type ManualActionEntity } from "./ManualActionCard.js";
|
|
4
|
-
import type { ExecutionProvenanceActivity, ManualAction } from "#ldo-ui";
|
|
4
|
+
import type { ExecutionProvenanceActivity, ManualAction, ManualActionResolution } from "#ldo-ui";
|
|
5
5
|
export type ExecutionSectionItemProps = {
|
|
6
6
|
entry: EntityTypeEntry;
|
|
7
7
|
activities: ExecutionProvenanceActivity[];
|
|
@@ -11,8 +11,7 @@ export type ExecutionSectionItemProps = {
|
|
|
11
11
|
onToggle: () => void;
|
|
12
12
|
manualActions?: ManualAction[];
|
|
13
13
|
manualActionEntities?: Map<string, ManualActionEntity[]>;
|
|
14
|
-
onManualActionResolve?: (subjectIri: string,
|
|
15
|
-
onManualActionSkip?: (subjectIri: string) => void;
|
|
14
|
+
onManualActionResolve?: (subjectIri: string, resolution: ManualActionResolution) => void;
|
|
16
15
|
isResolvingManualAction?: boolean;
|
|
17
16
|
};
|
|
18
17
|
export declare function ExecutionSectionItem(props: ExecutionSectionItemProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExecutionSectionItem.d.ts","sourceRoot":"","sources":["../../../src/components/planning/ExecutionSectionItem.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAoD,KAAK,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAEjH,OAAO,EAAoB,KAAK,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC/E,OAAO,KAAK,EAAE,2BAA2B,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"ExecutionSectionItem.d.ts","sourceRoot":"","sources":["../../../src/components/planning/ExecutionSectionItem.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAoD,KAAK,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAEjH,OAAO,EAAoB,KAAK,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC/E,OAAO,KAAK,EAAE,2BAA2B,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAIjG,MAAM,MAAM,yBAAyB,GAAG;IACtC,KAAK,EAAE,eAAe,CAAC;IACvB,UAAU,EAAE,2BAA2B,EAAE,CAAC;IAC1C,MAAM,EAAE,aAAa,CAAC;IACtB,mBAAmB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;IAC/B,oBAAoB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,kBAAkB,EAAE,CAAC,CAAC;IACzD,qBAAqB,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,sBAAsB,KAAK,IAAI,CAAC;IACzF,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,2CAoFpE"}
|
|
@@ -3,7 +3,7 @@ import { humanDuration } from "@manta-eu/lib/humanize";
|
|
|
3
3
|
import { isPresent } from "@manta-eu/lib/present";
|
|
4
4
|
import { AlertCircle, Check, ChevronDown, ClockFading, Loader2 } from "lucide-react";
|
|
5
5
|
import { isNotNil } from "ramda";
|
|
6
|
-
import {
|
|
6
|
+
import { useEffect, useState } from "react";
|
|
7
7
|
import { match } from "ts-pattern";
|
|
8
8
|
import { resolveStepIcon } from "./action-plan-icons.js";
|
|
9
9
|
import { findResolvedManualActionStatus, parseTimestampMs } from "./execution-section-model.js";
|
|
@@ -12,14 +12,11 @@ import { ManualActionCard } from "./ManualActionCard.js";
|
|
|
12
12
|
import { getPendingManualActions, getResolvedManualActions } from "#lib/manual-actions";
|
|
13
13
|
import { cn } from "#lib/utils";
|
|
14
14
|
export function ExecutionSectionItem(props) {
|
|
15
|
-
const { entry, activities, status, fallbackStartedAtMs = null, isExpanded, onToggle, manualActions = [], manualActionEntities, onManualActionResolve,
|
|
16
|
-
const handleApprove = useCallback((subjectIri) => onManualActionResolve?.(subjectIri, "COMPLETED"), [onManualActionResolve]);
|
|
17
|
-
const handleReject = useCallback((subjectIri) => onManualActionResolve?.(subjectIri, "REJECTED"), [onManualActionResolve]);
|
|
18
|
-
const handleSkip = useCallback((subjectIri) => onManualActionSkip?.(subjectIri), [onManualActionSkip]);
|
|
15
|
+
const { entry, activities, status, fallbackStartedAtMs = null, isExpanded, onToggle, manualActions = [], manualActionEntities, onManualActionResolve, isResolvingManualAction = false, } = props;
|
|
19
16
|
const pendingManualActions = getPendingManualActions(manualActions);
|
|
20
17
|
const resolvedManualActions = getResolvedManualActions(manualActions);
|
|
21
18
|
const hasContent = isPresent(activities) || isPresent(pendingManualActions);
|
|
22
|
-
return (_jsxs("div", { children: [_jsxs("button", { type: "button", onClick: onToggle, className: "flex w-full items-center gap-3 pl-2 pr-3 py-3 text-left transition-colors hover:bg-muted/30", children: [_jsx("div", { className: "flex shrink-0 items-center p-1.5 rounded-lg", children: _jsx(ChevronDown, { className: cn("size-5 shrink-0 text-muted-foreground transition-transform", !isExpanded && "-rotate-90") }) }), _jsx("div", { className: "flex size-9 shrink-0 items-center justify-center rounded-lg bg-faint", children: resolveStepIcon(entry.typeName, "size-5 text-muted-foreground") }), _jsxs("div", { className: "flex-1 min-w-0 flex flex-col gap-0.5", children: [_jsx("span", { className: cn("typography-small-medium block truncate", status === "pending" ? "text-muted-foreground" : "text-default-foreground"), children: entry.typeName }), entry.description && (_jsx("span", { className: "typography-tiny text-muted-foreground block truncate", children: entry.description }))] }), _jsxs("div", { className: "flex items-center gap-3 shrink-0", children: [_jsx(SectionElapsed, { activities: activities, status: status, estimatedTime: entry.estimatedTime ?? null, fallbackStartedAtMs: fallbackStartedAtMs }), _jsx(SectionStatusIcon, { status: status })] })] }), isExpanded && hasContent && (_jsxs("div", { className: "bg-faint border-t border-default-border py-1.5", children: [activities.map((activity) => (_jsx(ExecutionActivityRow, { activity: activity, manualActionStatus: findResolvedManualActionStatus(activity, resolvedManualActions) }, activity.iri))), pendingManualActions.map((ma) => (_jsx(ManualActionCard, { manualAction: ma, entities: manualActionEntities?.get(ma.subjectIri) ?? [], description: entry.description ?? undefined, isResolving: isResolvingManualAction,
|
|
19
|
+
return (_jsxs("div", { children: [_jsxs("button", { type: "button", onClick: onToggle, className: "flex w-full items-center gap-3 pl-2 pr-3 py-3 text-left transition-colors hover:bg-muted/30", children: [_jsx("div", { className: "flex shrink-0 items-center p-1.5 rounded-lg", children: _jsx(ChevronDown, { className: cn("size-5 shrink-0 text-muted-foreground transition-transform", !isExpanded && "-rotate-90") }) }), _jsx("div", { className: "flex size-9 shrink-0 items-center justify-center rounded-lg bg-faint", children: resolveStepIcon(entry.typeName, "size-5 text-muted-foreground") }), _jsxs("div", { className: "flex-1 min-w-0 flex flex-col gap-0.5", children: [_jsx("span", { className: cn("typography-small-medium block truncate", status === "pending" ? "text-muted-foreground" : "text-default-foreground"), children: entry.typeName }), entry.description && (_jsx("span", { className: "typography-tiny text-muted-foreground block truncate", children: entry.description }))] }), _jsxs("div", { className: "flex items-center gap-3 shrink-0", children: [_jsx(SectionElapsed, { activities: activities, status: status, estimatedTime: entry.estimatedTime ?? null, fallbackStartedAtMs: fallbackStartedAtMs }), _jsx(SectionStatusIcon, { status: status })] })] }), isExpanded && hasContent && (_jsxs("div", { className: "bg-faint border-t border-default-border py-1.5", children: [activities.map((activity) => (_jsx(ExecutionActivityRow, { activity: activity, manualActionStatus: findResolvedManualActionStatus(activity, resolvedManualActions) }, activity.iri))), pendingManualActions.map((ma) => (_jsx(ManualActionCard, { manualAction: ma, entities: manualActionEntities?.get(ma.subjectIri) ?? [], description: ma.description ?? entry.description ?? undefined, isResolving: isResolvingManualAction, onResolve: (resolution) => onManualActionResolve?.(ma.subjectIri, resolution) }, ma.subjectIri)))] }))] }));
|
|
23
20
|
}
|
|
24
21
|
function SectionStatusIcon(props) {
|
|
25
22
|
return match(props.status)
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import type { EntityTypeEntry } from "./ActionPlanDetailView.js";
|
|
2
2
|
import type { ManualActionEntity } from "./ManualActionCard.js";
|
|
3
|
-
import type { ActionPlanExecutionProvenanceResult, ManualAction } from "#ldo-ui";
|
|
3
|
+
import type { ActionPlanExecutionProvenanceResult, ManualAction, ManualActionResolution } from "#ldo-ui";
|
|
4
4
|
export type ExecutionSectionsProps = {
|
|
5
5
|
entityTypes: EntityTypeEntry[];
|
|
6
6
|
provenance: ActionPlanExecutionProvenanceResult | null;
|
|
7
7
|
manualActions?: ManualAction[];
|
|
8
8
|
manualActionEntities?: Map<string, ManualActionEntity[]>;
|
|
9
9
|
activeStartedAtMs?: number | null;
|
|
10
|
-
onManualActionResolve?: (subjectIri: string,
|
|
11
|
-
onManualActionSkip?: (subjectIri: string) => void;
|
|
10
|
+
onManualActionResolve?: (subjectIri: string, resolution: ManualActionResolution) => void;
|
|
12
11
|
isResolvingManualAction?: boolean;
|
|
13
12
|
};
|
|
14
13
|
export declare function ExecutionSections(props: ExecutionSectionsProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExecutionSections.d.ts","sourceRoot":"","sources":["../../../src/components/planning/ExecutionSections.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAI9D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EAAE,mCAAmC,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"ExecutionSections.d.ts","sourceRoot":"","sources":["../../../src/components/planning/ExecutionSections.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAI9D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EAAE,mCAAmC,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAEzG,MAAM,MAAM,sBAAsB,GAAG;IACnC,WAAW,EAAE,eAAe,EAAE,CAAC;IAC/B,UAAU,EAAE,mCAAmC,GAAG,IAAI,CAAC;IACvD,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;IAC/B,oBAAoB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,kBAAkB,EAAE,CAAC,CAAC;IACzD,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,qBAAqB,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,sBAAsB,KAAK,IAAI,CAAC;IACzF,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,2CAkE9D"}
|
|
@@ -5,7 +5,7 @@ import { buildSections, matchesManualActionSection } from "./execution-section-m
|
|
|
5
5
|
import { ExecutionActivityRow } from "./ExecutionActivityRow.js";
|
|
6
6
|
import { ExecutionSectionItem } from "./ExecutionSectionItem.js";
|
|
7
7
|
export function ExecutionSections(props) {
|
|
8
|
-
const { entityTypes, provenance, manualActions = [], manualActionEntities, activeStartedAtMs = null, onManualActionResolve,
|
|
8
|
+
const { entityTypes, provenance, manualActions = [], manualActionEntities, activeStartedAtMs = null, onManualActionResolve, isResolvingManualAction = false, } = props;
|
|
9
9
|
const [expandedIndex, setExpandedIndex] = useState(0);
|
|
10
10
|
const [lastAutoExpandedRunning, setLastAutoExpandedRunning] = useState(-1);
|
|
11
11
|
const activities = provenance?.activities ?? [];
|
|
@@ -26,6 +26,6 @@ export function ExecutionSections(props) {
|
|
|
26
26
|
const effectiveStatus = activeFallbackApplies ? "running" : section.status;
|
|
27
27
|
const fallbackStartedAtMs = activeFallbackApplies ? activeStartedAtMs : null;
|
|
28
28
|
const sectionManualActions = manualActions.filter((manualAction) => matchesManualActionSection(manualAction, section.entry, sections.length));
|
|
29
|
-
return (_jsx(ExecutionSectionItem, { entry: section.entry, activities: section.activities, status: effectiveStatus, fallbackStartedAtMs: fallbackStartedAtMs, isExpanded: expandedIndex === index, onToggle: () => setExpandedIndex((prev) => (prev === index ? null : index)), manualActions: sectionManualActions, manualActionEntities: manualActionEntities, onManualActionResolve: onManualActionResolve,
|
|
29
|
+
return (_jsx(ExecutionSectionItem, { entry: section.entry, activities: section.activities, status: effectiveStatus, fallbackStartedAtMs: fallbackStartedAtMs, isExpanded: expandedIndex === index, onToggle: () => setExpandedIndex((prev) => (prev === index ? null : index)), manualActions: sectionManualActions, manualActionEntities: manualActionEntities, onManualActionResolve: onManualActionResolve, isResolvingManualAction: isResolvingManualAction }, section.key));
|
|
30
30
|
}) }));
|
|
31
31
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ManualAction } from "#ldo-ui";
|
|
1
|
+
import type { ManualAction, ManualActionResolution } from "#ldo-ui";
|
|
2
2
|
export type ManualActionEntity = {
|
|
3
3
|
subjectIri: string;
|
|
4
4
|
label: string;
|
|
@@ -14,10 +14,9 @@ type ManualActionCardProps = {
|
|
|
14
14
|
entities: ManualActionEntity[];
|
|
15
15
|
description?: string | null;
|
|
16
16
|
isResolving: boolean;
|
|
17
|
-
|
|
18
|
-
onReject: () => void;
|
|
19
|
-
onSkip?: () => void;
|
|
17
|
+
onResolve: (resolution: ManualActionResolution) => void;
|
|
20
18
|
};
|
|
21
19
|
export declare function ManualActionCard(props: ManualActionCardProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export declare function resolutionChoices(retryable: boolean, defaultResolution: "COMPLETED" | "RETRY"): ManualActionResolution[];
|
|
22
21
|
export {};
|
|
23
22
|
//# sourceMappingURL=ManualActionCard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ManualActionCard.d.ts","sourceRoot":"","sources":["../../../src/components/planning/ManualActionCard.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ManualActionCard.d.ts","sourceRoot":"","sources":["../../../src/components/planning/ManualActionCard.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAGpE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,cAAc,EAAE,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,CAAC;AAEF,KAAK,qBAAqB,GAAG;IAC3B,YAAY,EAAE,YAAY,CAAC;IAC3B,QAAQ,EAAE,kBAAkB,EAAE,CAAC;IAC/B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,CAAC,UAAU,EAAE,sBAAsB,KAAK,IAAI,CAAC;CACzD,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,2CAsB5D;AAwID,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,OAAO,EAClB,iBAAiB,EAAE,WAAW,GAAG,OAAO,GACvC,sBAAsB,EAAE,CAI1B"}
|