@parhelia/core 0.1.12928 → 0.1.12931
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agents-view/AgentCard.js +4 -1
- package/dist/agents-view/AgentCard.js.map +1 -1
- package/dist/agents-view/AgentProfileIcon.js +8 -8
- package/dist/agents-view/AgentProfileIcon.js.map +1 -1
- package/dist/agents-view/AgentsView.js +1 -1
- package/dist/components/WorkspaceHomeView.d.ts +13 -0
- package/dist/components/WorkspaceHomeView.js +13 -0
- package/dist/components/WorkspaceHomeView.js.map +1 -0
- package/dist/components/ui/styled-dialog-title.d.ts +3 -1
- package/dist/components/ui/styled-dialog-title.js +2 -2
- package/dist/components/ui/styled-dialog-title.js.map +1 -1
- package/dist/config/config.js +7 -19
- package/dist/config/config.js.map +1 -1
- package/dist/config/notificationRoutes.js +1 -1
- package/dist/config/notificationRoutes.js.map +1 -1
- package/dist/editor/ConfirmationDialog.js +1 -1
- package/dist/editor/ConfirmationDialog.js.map +1 -1
- package/dist/editor/ImageEditButton.js +14 -2
- package/dist/editor/ImageEditButton.js.map +1 -1
- package/dist/editor/ImageEditor.js +1 -1
- package/dist/editor/ImageEditor.js.map +1 -1
- package/dist/editor/PictureEditor.js +1 -1
- package/dist/editor/PictureEditor.js.map +1 -1
- package/dist/editor/ai/Agents.js +15 -79
- package/dist/editor/ai/Agents.js.map +1 -1
- package/dist/editor/ai/terminal/components/AgentMemoryPanel.d.ts +12 -0
- package/dist/editor/ai/terminal/components/AgentMemoryPanel.js +131 -0
- package/dist/editor/ai/terminal/components/AgentMemoryPanel.js.map +1 -0
- package/dist/editor/ai/terminal/components/AgentPromptTrayPopovers.js +10 -2
- package/dist/editor/ai/terminal/components/AgentPromptTrayPopovers.js.map +1 -1
- package/dist/editor/ai/terminal/components/AgentTerminalContextPanels.js +11 -0
- package/dist/editor/ai/terminal/components/AgentTerminalContextPanels.js.map +1 -1
- package/dist/editor/ai/terminal/components/AgentTerminalStatusBar.js +27 -20
- package/dist/editor/ai/terminal/components/AgentTerminalStatusBar.js.map +1 -1
- package/dist/editor/ai/terminal/useAgentSettingsData.js +4 -4
- package/dist/editor/ai/terminal/useAgentSettingsData.js.map +1 -1
- package/dist/editor/client/EditorShell.js +11 -51
- package/dist/editor/client/EditorShell.js.map +1 -1
- package/dist/editor/client/editContext.d.ts +3 -1
- package/dist/editor/client/operations.js +20 -1
- package/dist/editor/client/operations.js.map +1 -1
- package/dist/editor/commands/componentCommands.js +2 -1
- package/dist/editor/commands/componentCommands.js.map +1 -1
- package/dist/editor/context-menu/InsertMenu.js +1 -1
- package/dist/editor/context-menu/InsertMenu.js.map +1 -1
- package/dist/editor/menubar/PageSelector.js +1 -1
- package/dist/editor/menubar/PageSelector.js.map +1 -1
- package/dist/editor/menubar/toolbar-sections/EditControls.js +1 -2
- package/dist/editor/menubar/toolbar-sections/EditControls.js.map +1 -1
- package/dist/editor/menubar/toolbar-sections/ManualBrowser.js +6 -0
- package/dist/editor/menubar/toolbar-sections/ManualBrowser.js.map +1 -1
- package/dist/editor/menubar/toolbar-sections/UtilityControls.js +5 -5
- package/dist/editor/menubar/toolbar-sections/UtilityControls.js.map +1 -1
- package/dist/editor/page-editor-chrome/DragInsertionOverlay.d.ts +8 -1
- package/dist/editor/page-editor-chrome/DragInsertionOverlay.js +154 -34
- package/dist/editor/page-editor-chrome/DragInsertionOverlay.js.map +1 -1
- package/dist/editor/page-editor-chrome/EmptyImageFieldIndicators.d.ts +10 -0
- package/dist/editor/page-editor-chrome/EmptyImageFieldIndicators.js +236 -0
- package/dist/editor/page-editor-chrome/EmptyImageFieldIndicators.js.map +1 -0
- package/dist/editor/page-editor-chrome/PageEditorChrome.js +2 -1
- package/dist/editor/page-editor-chrome/PageEditorChrome.js.map +1 -1
- package/dist/editor/page-editor-chrome/PictureEditorOverlay.d.ts +3 -0
- package/dist/editor/page-editor-chrome/PictureEditorOverlay.js +1 -1
- package/dist/editor/page-editor-chrome/PictureEditorOverlay.js.map +1 -1
- package/dist/editor/page-editor-chrome/PlaceholderDropZone.js +6 -2
- package/dist/editor/page-editor-chrome/PlaceholderDropZone.js.map +1 -1
- package/dist/editor/page-editor-chrome/overlay/placeholderZones.d.ts +10 -0
- package/dist/editor/page-editor-chrome/overlay/placeholderZones.js +18 -0
- package/dist/editor/page-editor-chrome/overlay/placeholderZones.js.map +1 -1
- package/dist/editor/page-viewer/EditorForm.js +40 -2
- package/dist/editor/page-viewer/EditorForm.js.map +1 -1
- package/dist/editor/page-viewer/MiniMap.js +70 -5
- package/dist/editor/page-viewer/MiniMap.js.map +1 -1
- package/dist/editor/page-viewer/PageViewerFrame.js +123 -29
- package/dist/editor/page-viewer/PageViewerFrame.js.map +1 -1
- package/dist/editor/page-viewer/minimapVisibility.d.ts +33 -0
- package/dist/editor/page-viewer/minimapVisibility.js +72 -0
- package/dist/editor/page-viewer/minimapVisibility.js.map +1 -0
- package/dist/editor/page-viewer/renderUrl.js +29 -7
- package/dist/editor/page-viewer/renderUrl.js.map +1 -1
- package/dist/editor/reviews/CreateReviewConfirmStep.js +5 -4
- package/dist/editor/reviews/CreateReviewConfirmStep.js.map +1 -1
- package/dist/editor/reviews/CreateReviewDialog.js +120 -202
- package/dist/editor/reviews/CreateReviewDialog.js.map +1 -1
- package/dist/editor/reviews/CreateReviewItemsStep.d.ts +18 -0
- package/dist/editor/reviews/CreateReviewItemsStep.js +6 -0
- package/dist/editor/reviews/CreateReviewItemsStep.js.map +1 -0
- package/dist/editor/reviews/CreateReviewLanguagesStep.d.ts +9 -0
- package/dist/editor/reviews/CreateReviewLanguagesStep.js +36 -0
- package/dist/editor/reviews/CreateReviewLanguagesStep.js.map +1 -0
- package/dist/editor/reviews/CreateReviewReviewersStep.d.ts +17 -0
- package/dist/editor/reviews/CreateReviewReviewersStep.js +33 -0
- package/dist/editor/reviews/CreateReviewReviewersStep.js.map +1 -0
- package/dist/editor/reviews/CreateReviewSettingsStep.d.ts +21 -0
- package/dist/editor/reviews/CreateReviewSettingsStep.js +33 -0
- package/dist/editor/reviews/CreateReviewSettingsStep.js.map +1 -0
- package/dist/editor/reviews/MultiReviewManager.js +1 -4
- package/dist/editor/reviews/MultiReviewManager.js.map +1 -1
- package/dist/editor/reviews/openCommentsFeedback.d.ts +2 -6
- package/dist/editor/reviews/openCommentsFeedback.js +3 -11
- package/dist/editor/reviews/openCommentsFeedback.js.map +1 -1
- package/dist/editor/services/agentService.d.ts +36 -0
- package/dist/editor/services/agentService.js +42 -0
- package/dist/editor/services/agentService.js.map +1 -1
- package/dist/editor/services/aiService.d.ts +4 -2
- package/dist/editor/services/aiService.js.map +1 -1
- package/dist/editor/services/editService.d.ts +1 -1
- package/dist/editor/services/editService.js +2 -2
- package/dist/editor/services/editService.js.map +1 -1
- package/dist/editor/services/reviewsService.d.ts +6 -0
- package/dist/editor/services/reviewsService.js +15 -0
- package/dist/editor/services/reviewsService.js.map +1 -1
- package/dist/editor/settings/panels/AgentProfileConfigPanel.js +2 -1
- package/dist/editor/settings/panels/AgentProfileConfigPanel.js.map +1 -1
- package/dist/editor/sidebar/ComponentTree.js +21 -1
- package/dist/editor/sidebar/ComponentTree.js.map +1 -1
- package/dist/editor/tree-indicators/GutterColumns.js +24 -6
- package/dist/editor/tree-indicators/GutterColumns.js.map +1 -1
- package/dist/editor/ui/ItemCollectionEditor.js +4 -4
- package/dist/editor/ui/ItemCollectionEditor.js.map +1 -1
- package/dist/editor/ui/PerfectTree.js +5 -5
- package/dist/editor/ui/PerfectTree.js.map +1 -1
- package/dist/editor/ui/PublishItemDialog.js +1 -1
- package/dist/editor/ui/PublishItemDialog.js.map +1 -1
- package/dist/editor/ui/PublishRestrictionsDialog.js +179 -148
- package/dist/editor/ui/PublishRestrictionsDialog.js.map +1 -1
- package/dist/editor/utils/keyboardNavigation.js +7 -0
- package/dist/editor/utils/keyboardNavigation.js.map +1 -1
- package/dist/editor/views/SingleEditView.js +32 -2
- package/dist/editor/views/SingleEditView.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/revision.d.ts +2 -2
- package/dist/revision.js +2 -2
- package/dist/task-board/components/TaskBoardHomeView.js +3 -6
- package/dist/task-board/components/TaskBoardHomeView.js.map +1 -1
- package/package.json +1 -1
|
@@ -63,14 +63,36 @@ export function applyParheliaRenderContext(renderUrl, pageItemDescriptor, siteNa
|
|
|
63
63
|
renderUrl.searchParams.set("sc_site", siteName);
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
66
|
+
// Proxied rendering-host requests (/parhelia/proxy/{name}/...) must not carry
|
|
67
|
+
// sc_* context params: they run through Sitecore's httpRequestBegin pipeline
|
|
68
|
+
// on the shell site, where language resolvers reject languages that are not
|
|
69
|
+
// registered for that site (500 before the proxy controller runs). The host
|
|
70
|
+
// app reads the plain itemid/lang/version params instead.
|
|
71
|
+
const isProxiedHostPath = renderUrl.pathname.startsWith("/parhelia/proxy/");
|
|
72
|
+
if (isProxiedHostPath) {
|
|
73
|
+
renderUrl.searchParams.delete("sc_itemid");
|
|
74
|
+
renderUrl.searchParams.delete("sc_lang");
|
|
75
|
+
renderUrl.searchParams.delete("sc_version");
|
|
76
|
+
if (!renderUrl.searchParams.has("itemid")) {
|
|
77
|
+
renderUrl.searchParams.set("itemid", pageItemDescriptor.id);
|
|
78
|
+
}
|
|
79
|
+
if (!renderUrl.searchParams.has("lang")) {
|
|
80
|
+
renderUrl.searchParams.set("lang", pageItemDescriptor.language);
|
|
81
|
+
}
|
|
82
|
+
if (!renderUrl.searchParams.has("version")) {
|
|
83
|
+
renderUrl.searchParams.set("version", String(pageItemDescriptor.version));
|
|
84
|
+
}
|
|
71
85
|
}
|
|
72
|
-
|
|
73
|
-
renderUrl.searchParams.
|
|
86
|
+
else {
|
|
87
|
+
if (!renderUrl.searchParams.has("sc_itemid")) {
|
|
88
|
+
renderUrl.searchParams.set("sc_itemid", pageItemDescriptor.id);
|
|
89
|
+
}
|
|
90
|
+
if (!renderUrl.searchParams.has("sc_lang")) {
|
|
91
|
+
renderUrl.searchParams.set("sc_lang", pageItemDescriptor.language);
|
|
92
|
+
}
|
|
93
|
+
if (!renderUrl.searchParams.has("sc_version")) {
|
|
94
|
+
renderUrl.searchParams.set("sc_version", String(pageItemDescriptor.version));
|
|
95
|
+
}
|
|
74
96
|
}
|
|
75
97
|
const routePath = inferRoutePathFromSitecoreItemPath(pageItemDescriptor.path);
|
|
76
98
|
if (!routePath)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderUrl.js","sourceRoot":"","sources":["../../../src/editor/page-viewer/renderUrl.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,MAAM,UAAU,cAAc,CAAC,QAAgB;IAC7C,OAAO,QAAQ,KAAK,WAAW,IAAI,QAAQ,KAAK,WAAW,CAAC;AAC9D,CAAC;AAED,MAAM,UAAU,yBAAyB,CAAC,GAAQ;IAChD,IACE,cAAc,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC;QACxC,cAAc,CAAC,GAAG,CAAC,QAAQ,CAAC,EAC5B,CAAC;QACD,wEAAwE;QACxE,8DAA8D;QAC9D,GAAG,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC;IAC1C,CAAC;AACH,CAAC;AAED,MAAM,UAAU,2BAA2B,CAAC,GAAQ;IAClD,OAAO,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,sBAAsB,CAAC,CAAC;AACvD,CAAC;AAED,MAAM,UAAU,sCAAsC,CAAC,GAAQ;IAC7D,IACE,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC,mBAAmB,CAAC;QACtD,2BAA2B,CAAC,GAAG,CAAC,EAChC,CAAC;QACD,GAAG,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC;QACxC,GAAG,CAAC,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AAC,CAAC;IACjD,CAAC;IAED,IAAI,gBAAgB,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC;QACzC,SAAS,CAAC,QAAQ,GAAG,SAAS,CAAC;IACjC,CAAC;AACH,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Loader2 } from "lucide-react";
|
|
3
3
|
import { Input } from "../../components/ui/input";
|
|
4
|
+
import { CountBadge } from "../../components/ui/badge";
|
|
4
5
|
export function CreateReviewConfirmStep({ title, setTitle, isGeneratingTitle, languageSummary, reviewers, items, requiredApprovals, updateWorkflowOnCompletion, expirationDays, showSecretFields, }) {
|
|
5
6
|
const reviewTitle = title || "Untitled Review";
|
|
6
7
|
const reviewerName = reviewers[0]?.name || reviewers[0]?.email || "Reviewer";
|
|
@@ -29,9 +30,9 @@ Please open your invitation link to start reviewing:
|
|
|
29
30
|
[Invitation Link]
|
|
30
31
|
|
|
31
32
|
Thank you.`;
|
|
32
|
-
return (_jsxs("div", { className: "
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
return (_jsxs("div", { className: "grid gap-6 p-4 md:grid-cols-2 md:gap-x-10 md:p-6", children: [_jsxs("div", { className: "flex flex-col gap-4", children: [_jsxs("div", { className: "flex flex-col gap-1.5", children: [_jsxs("p", { className: "text-neutral-grey-50 text-xs font-medium tracking-wider", children: ["Review Name", _jsx("span", { className: "text-muted-foreground ml-1 text-[11px] font-normal normal-case", children: "(optional)" })] }), _jsx(Input, { id: "title", "data-testid": "review-title-input", value: title, onChange: (e) => setTitle(e.target.value), placeholder: "e.g., Homepage Q4 Review", className: "bg-white" }), isGeneratingTitle && (_jsxs("div", { className: "text-muted-foreground flex items-center gap-2 text-xs", children: [_jsx(Loader2, { className: "h-3 w-3 animate-spin" }), "Generating suggested name..."] }))] }), _jsx("div", { className: "border-border-default border-t" }), _jsxs("div", { className: "flex flex-col gap-1.5", children: [_jsx("p", { className: "text-neutral-grey-50 text-xs font-medium tracking-wider", children: "Languages" }), _jsx("p", { className: "text-neutral-grey-100 text-sm font-medium", children: languageSummary })] }), _jsx("div", { className: "border-border-default border-t" }), _jsxs("div", { className: "flex flex-col gap-1.5", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("p", { className: "text-neutral-grey-50 text-xs font-medium tracking-wider", children: "Reviewers" }), _jsx(CountBadge, { children: reviewers.length })] }), _jsx("div", { className: "flex flex-wrap gap-1.5", children: reviewers.map((reviewer) => (_jsxs("span", { className: "border-border-default bg-neutral-grey-5 text-neutral-grey-100 rounded-full border px-2.5 py-0.5 text-xs", children: [reviewer.name || reviewer.email, " (", reviewer.email, ")"] }, reviewer.email))) })] }), _jsx("div", { className: "border-border-default border-t" }), _jsxs("div", { className: "flex flex-col gap-1.5", children: [_jsx("p", { className: "text-neutral-grey-50 text-xs font-medium tracking-wider", children: "Settings" }), _jsxs("div", { className: "text-neutral-grey-100 grid gap-x-4 gap-y-1 text-xs sm:grid-cols-2", children: [_jsxs("p", { children: ["Required approvals:", " ", _jsx("span", { className: "text-neutral-grey-100 font-medium", children: requiredApprovals || "1" })] }), _jsxs("p", { children: ["Update workflow:", " ", _jsx("span", { className: "text-neutral-grey-100 font-medium", children: updateWorkflowOnCompletion ? "Yes" : "No" })] }), _jsxs("p", { children: ["Expiration:", " ", _jsx("span", { className: "text-neutral-grey-100 font-medium", children: expirationDays ? `${expirationDays} day(s)` : "None" })] }), _jsxs("p", { children: ["Secret required:", " ", _jsx("span", { className: "text-neutral-grey-100 font-medium", children: showSecretFields ? "Yes" : "No" })] })] })] }), _jsx("div", { className: "border-border-default border-t" }), _jsxs("div", { className: "flex flex-col gap-1.5", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("p", { className: "text-neutral-grey-50 text-xs font-medium tracking-wider", children: "Pages & Items" }), _jsx(CountBadge, { children: items.length })] }), _jsx("div", { className: "divide-border-default max-h-40 divide-y overflow-y-auto", children: items.map((item, index) => (_jsxs("div", { className: "flex items-baseline gap-2 py-1.5 text-xs first:pt-0 last:pb-0", children: [_jsx("p", { className: "text-neutral-grey-100 shrink-0 font-medium", children: item.descriptor.displayName ||
|
|
34
|
+
item.descriptor.name ||
|
|
35
|
+
item.descriptor.path ||
|
|
36
|
+
item.descriptor.id }), item.includeSubitems && (_jsx("span", { className: "text-primary shrink-0 font-medium", children: "Includes subitems" })), item.descriptor.path && (_jsx("p", { className: "text-muted-foreground min-w-0 truncate", children: item.descriptor.path }))] }, `${item.descriptor.id}-${index}`))) })] })] }), _jsxs("div", { className: "flex flex-col gap-1.5", children: [_jsx("p", { className: "text-neutral-grey-50 text-xs font-medium tracking-wider", children: "Email Preview" }), _jsxs("div", { className: "border-border-default flex flex-col gap-1.5 border-l-2 pl-3", children: [_jsxs("p", { className: "text-neutral-grey-100 text-xs", children: [_jsx("span", { className: "font-medium", children: "Subject:" }), " ", emailSubject] }), _jsx("pre", { className: "text-neutral-grey-100 font-sans text-xs leading-snug whitespace-pre-wrap", children: emailBody }), _jsx("p", { className: "text-muted-foreground text-[11px]", children: "Each reviewer receives a personalized invitation link." })] })] })] }));
|
|
36
37
|
}
|
|
37
38
|
//# sourceMappingURL=CreateReviewConfirmStep.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateReviewConfirmStep.js","sourceRoot":"","sources":["../../../src/editor/reviews/CreateReviewConfirmStep.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"CreateReviewConfirmStep.js","sourceRoot":"","sources":["../../../src/editor/reviews/CreateReviewConfirmStep.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAClD,OAAO,EA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AE,CAmBjC,CACP,CAAC,GACE,IACF,IACF,EAGN,eAAK,SAAS,EAAC,uBAAuB,aACpC,YAAG,SAAS,EAAC,yDAAyD,8BAElE,EACJ,eAAK,SAAS,EAAC,6DAA6D,aAC1E,aAAG,SAAS,EAAC,+BAA+B,aAC1C,eAAM,SAAS,EAAC,aAAa,yBAAgB,OAAE,YAAY,IACzD,EACJ,cAAK,SAAS,EAAC,0EAA0E,YACtF,SAAS,GACN,EACN,YAAG,SAAS,EAAC,mCAAmC,uEAE5C,IACA,IACF,IACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -3,15 +3,56 @@ import { useState, useEffect, useMemo } from "react";
|
|
|
3
3
|
import { Dialog, DialogContent } from "../../components/ui/dialog";
|
|
4
4
|
import { StyledDialogTitle } from "../../components/ui/styled-dialog-title";
|
|
5
5
|
import { Button } from "../../components/ui/button";
|
|
6
|
-
import { Loader2, ClipboardCheck,
|
|
6
|
+
import { Loader2, ClipboardCheck, CheckCircle2, AlertTriangle, ArrowRight, } from "lucide-react";
|
|
7
|
+
import { cn } from "../../lib/utils";
|
|
7
8
|
import { useEditContext } from "../client/editContext";
|
|
8
9
|
import DialogButtons from "../ui/DialogButtons";
|
|
9
|
-
import {
|
|
10
|
+
import { CreateReviewItemsStep } from "./CreateReviewItemsStep";
|
|
11
|
+
import { CreateReviewReviewersStep } from "./CreateReviewReviewersStep";
|
|
12
|
+
import { CreateReviewLanguagesStep } from "./CreateReviewLanguagesStep";
|
|
13
|
+
import { CreateReviewSettingsStep } from "./CreateReviewSettingsStep";
|
|
10
14
|
import { CreateReviewConfirmStep } from "./CreateReviewConfirmStep";
|
|
11
15
|
import { CreateReviewSuccessStep } from "./CreateReviewSuccessStep";
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
16
|
+
import { suggestReviewName } from "../services/reviewsService";
|
|
17
|
+
const WIZARD_STEPS = [
|
|
18
|
+
{
|
|
19
|
+
id: "items",
|
|
20
|
+
name: "Items",
|
|
21
|
+
description: "Select the content items to include in this review.",
|
|
22
|
+
nextButtonLabel: "Select Items",
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
id: "reviewers",
|
|
26
|
+
name: "Reviewers",
|
|
27
|
+
description: "Add the people who will review and approve the content.",
|
|
28
|
+
nextButtonLabel: "Add Reviewers",
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
id: "languages",
|
|
32
|
+
name: "Languages",
|
|
33
|
+
description: "Choose which language versions to include in the review.",
|
|
34
|
+
nextButtonLabel: "Select Languages",
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
id: "settings",
|
|
38
|
+
name: "Settings",
|
|
39
|
+
description: "Configure optional expiration, approval, and security settings.",
|
|
40
|
+
nextButtonLabel: "Configure Settings",
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
id: "confirm",
|
|
44
|
+
name: "Confirm",
|
|
45
|
+
description: "Review the details before sending invitation emails.",
|
|
46
|
+
nextButtonLabel: "Confirm Details",
|
|
47
|
+
},
|
|
48
|
+
];
|
|
49
|
+
function StepIndicatorDots({ steps, currentStepIndex, }) {
|
|
50
|
+
if (steps.length <= 1)
|
|
51
|
+
return null;
|
|
52
|
+
return (_jsx("div", { className: "pointer-events-none absolute top-full left-1/2 mt-8 flex -translate-x-1/2 justify-center gap-3", "aria-hidden": "true", "data-testid": "create-review-step-dots", children: steps.map((step, index) => (_jsx("div", { className: cn("h-1.5 rounded-full transition-all duration-300", index === currentStepIndex
|
|
53
|
+
? "w-8 bg-white"
|
|
54
|
+
: "w-1.5 bg-neutral-grey-10") }, step.id))) }));
|
|
55
|
+
}
|
|
15
56
|
function getExecutionErrorMessage(result, fallback) {
|
|
16
57
|
const summary = result.summary?.trim();
|
|
17
58
|
const details = result.details?.trim();
|
|
@@ -20,22 +61,13 @@ function getExecutionErrorMessage(result, fallback) {
|
|
|
20
61
|
}
|
|
21
62
|
return summary || details || fallback;
|
|
22
63
|
}
|
|
23
|
-
function withTimeout(promise, timeoutMs, timeoutMessage) {
|
|
24
|
-
let timeoutId = null;
|
|
25
|
-
const timeoutPromise = new Promise((_, reject) => {
|
|
26
|
-
timeoutId = setTimeout(() => reject(new Error(timeoutMessage)), timeoutMs);
|
|
27
|
-
});
|
|
28
|
-
return Promise.race([promise, timeoutPromise]).finally(() => {
|
|
29
|
-
if (timeoutId)
|
|
30
|
-
clearTimeout(timeoutId);
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
64
|
export function CreateReviewDialog({ open, onOpenChange, onCreated, initialItems, }) {
|
|
34
65
|
const editContext = useEditContext();
|
|
35
|
-
const [
|
|
66
|
+
const [stepIndex, setStepIndex] = useState(0);
|
|
67
|
+
const [showSuccess, setShowSuccess] = useState(false);
|
|
36
68
|
const [title, setTitle] = useState("");
|
|
37
69
|
const [language, setLanguage] = useState(editContext?.currentItemDescriptor?.language || "en");
|
|
38
|
-
const [languageMode, setLanguageMode] = useState("
|
|
70
|
+
const [languageMode, setLanguageMode] = useState("multiple");
|
|
39
71
|
const [selectedLanguages, setSelectedLanguages] = useState([
|
|
40
72
|
editContext?.currentItemDescriptor?.language || "en",
|
|
41
73
|
]);
|
|
@@ -47,7 +79,6 @@ export function CreateReviewDialog({ open, onOpenChange, onCreated, initialItems
|
|
|
47
79
|
const [items, setItems] = useState([]);
|
|
48
80
|
const [loading, setLoading] = useState(false);
|
|
49
81
|
const [error, setError] = useState(null);
|
|
50
|
-
const [showErrors, setShowErrors] = useState(false);
|
|
51
82
|
const [expirationDays, setExpirationDays] = useState("");
|
|
52
83
|
const [secret, setSecret] = useState("");
|
|
53
84
|
const [secretConfirm, setSecretConfirm] = useState("");
|
|
@@ -57,7 +88,6 @@ export function CreateReviewDialog({ open, onOpenChange, onCreated, initialItems
|
|
|
57
88
|
const [shareCommentsAndSuggestions, setShareCommentsAndSuggestions] = useState(false);
|
|
58
89
|
const [selectedInTree, setSelectedInTree] = useState([]);
|
|
59
90
|
const [selectedFromList, setSelectedFromList] = useState([]);
|
|
60
|
-
const [advancedSettingsOpen, setAdvancedSettingsOpen] = useState(false);
|
|
61
91
|
const [createdReviewId, setCreatedReviewId] = useState(null);
|
|
62
92
|
const [sentInvitationCount, setSentInvitationCount] = useState(0);
|
|
63
93
|
const [sentInvitationEmails, setSentInvitationEmails] = useState([]);
|
|
@@ -69,42 +99,24 @@ export function CreateReviewDialog({ open, onOpenChange, onCreated, initialItems
|
|
|
69
99
|
// This ensures the array reference only changes when items actually change,
|
|
70
100
|
// not on every render (e.g., when typing in the Review Name field)
|
|
71
101
|
const itemIds = useMemo(() => items.map((item) => item.descriptor.id), [items]);
|
|
72
|
-
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
if (reviewers.length === 0)
|
|
79
|
-
return false;
|
|
80
|
-
// Validate language selection based on mode
|
|
81
|
-
if (languageMode === "single" && !language)
|
|
82
|
-
return false;
|
|
83
|
-
if (languageMode === "multiple" && selectedLanguages.length === 0)
|
|
84
|
-
return false;
|
|
85
|
-
// Validate secret confirmation
|
|
86
|
-
if (showSecretFields && secret !== secretConfirm)
|
|
87
|
-
return false;
|
|
88
|
-
// Validate requiredApprovals
|
|
89
|
-
const requiredApprovalsNum = requiredApprovals
|
|
90
|
-
? parseInt(requiredApprovals, 10)
|
|
91
|
-
: 1;
|
|
92
|
-
if (isNaN(requiredApprovalsNum) || requiredApprovalsNum < 1)
|
|
93
|
-
return false;
|
|
94
|
-
if (requiredApprovalsNum > reviewers.length)
|
|
102
|
+
const currentStep = WIZARD_STEPS[stepIndex] ?? WIZARD_STEPS[0];
|
|
103
|
+
const isLastStep = stepIndex === WIZARD_STEPS.length - 1;
|
|
104
|
+
const nextStep = WIZARD_STEPS[stepIndex + 1];
|
|
105
|
+
const requiredApprovalsValid = useMemo(() => {
|
|
106
|
+
const num = requiredApprovals ? parseInt(requiredApprovals, 10) : 1;
|
|
107
|
+
if (isNaN(num) || num < 1)
|
|
95
108
|
return false;
|
|
96
|
-
return
|
|
97
|
-
}, [
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
]);
|
|
109
|
+
return num <= reviewers.length;
|
|
110
|
+
}, [requiredApprovals, reviewers.length]);
|
|
111
|
+
const stepValidity = {
|
|
112
|
+
items: items.length > 0,
|
|
113
|
+
reviewers: reviewers.length > 0,
|
|
114
|
+
languages: languageMode === "all" ? true : selectedLanguages.length > 0,
|
|
115
|
+
settings: requiredApprovalsValid &&
|
|
116
|
+
(!showSecretFields || secret === secretConfirm),
|
|
117
|
+
confirm: true,
|
|
118
|
+
};
|
|
119
|
+
const canProceed = stepValidity[currentStep.id];
|
|
108
120
|
useEffect(() => {
|
|
109
121
|
if (open && editContext?.currentItemDescriptor && items.length === 0) {
|
|
110
122
|
// Initialize with current page if available - but only if items haven't been set yet
|
|
@@ -192,104 +204,21 @@ export function CreateReviewDialog({ open, onOpenChange, onCreated, initialItems
|
|
|
192
204
|
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
193
205
|
return emailRegex.test(email);
|
|
194
206
|
};
|
|
195
|
-
const extractReviewTitleFromAgentResponse = (content) => {
|
|
196
|
-
if (!content)
|
|
197
|
-
return "";
|
|
198
|
-
const fencedTitleMatch = content.match(/```(?:suggestion|title)\s*\n([\s\S]*?)```/i);
|
|
199
|
-
const fencedGenericMatch = content.match(/```\s*\n([\s\S]*?)```/);
|
|
200
|
-
const raw = (fencedTitleMatch?.[1] || fencedGenericMatch?.[1] || content)
|
|
201
|
-
.trim()
|
|
202
|
-
.replace(/^["']|["']$/g, "");
|
|
203
|
-
if (!raw)
|
|
204
|
-
return "";
|
|
205
|
-
return raw.split("\n")[0]?.trim() || "";
|
|
206
|
-
};
|
|
207
|
-
const buildReviewTitleSuggestionPrompt = () => {
|
|
208
|
-
const languageScope = languageMode === "all"
|
|
209
|
-
? "all languages"
|
|
210
|
-
: languageMode === "multiple"
|
|
211
|
-
? selectedLanguages.join(", ")
|
|
212
|
-
: language;
|
|
213
|
-
const itemNames = items
|
|
214
|
-
.slice(0, 5)
|
|
215
|
-
.map((item) => item.descriptor.displayName ||
|
|
216
|
-
item.descriptor.name ||
|
|
217
|
-
item.descriptor.path ||
|
|
218
|
-
item.descriptor.id)
|
|
219
|
-
.filter(Boolean)
|
|
220
|
-
.join(", ");
|
|
221
|
-
const reviewerNames = reviewers
|
|
222
|
-
.slice(0, 3)
|
|
223
|
-
.map((reviewer) => reviewer.name || reviewer.email)
|
|
224
|
-
.filter(Boolean)
|
|
225
|
-
.join(", ");
|
|
226
|
-
return `Generate a concise review name for a Sitecore content review.
|
|
227
|
-
|
|
228
|
-
Context:
|
|
229
|
-
- Language scope: ${languageScope}
|
|
230
|
-
- Items: ${itemNames || "N/A"}
|
|
231
|
-
- Number of reviewers: ${reviewers.length}
|
|
232
|
-
- First reviewers: ${reviewerNames || "N/A"}
|
|
233
|
-
- Includes subitems: ${items.some((x) => x.includeSubitems) ? "yes" : "no"}
|
|
234
|
-
|
|
235
|
-
Rules:
|
|
236
|
-
- Return a short, clear title (4-10 words).
|
|
237
|
-
- Do not use quotes.
|
|
238
|
-
- Do not include prefixes like "Review:".
|
|
239
|
-
- Output ONLY the title inside a \`\`\`suggestion fenced code block.
|
|
240
|
-
|
|
241
|
-
Example:
|
|
242
|
-
\`\`\`suggestion
|
|
243
|
-
Homepage and Navigation Content Review
|
|
244
|
-
\`\`\``;
|
|
245
|
-
};
|
|
246
207
|
const generateReviewTitleSuggestion = async () => {
|
|
247
208
|
if (title.trim())
|
|
248
209
|
return null;
|
|
249
|
-
|
|
210
|
+
const itemIds = items.map((item) => item.descriptor.id).filter(Boolean);
|
|
211
|
+
if (itemIds.length === 0)
|
|
250
212
|
return null;
|
|
251
|
-
|
|
252
|
-
const newAgentId = crypto.randomUUID();
|
|
213
|
+
const languages = languageMode === "all" ? ["*"] : [...selectedLanguages].sort();
|
|
253
214
|
setIsGeneratingTitle(true);
|
|
254
215
|
try {
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
const selectedProfile = profiles.find((profile) => configuredProfileId &&
|
|
261
|
-
profile.id.toLowerCase() === configuredProfileId.toLowerCase()) || profiles[0];
|
|
262
|
-
if (!selectedProfile)
|
|
263
|
-
return null;
|
|
264
|
-
await withTimeout(startAgent({
|
|
265
|
-
agentId: newAgentId,
|
|
266
|
-
message: buildReviewTitleSuggestionPrompt(),
|
|
267
|
-
sessionId: editContext.sessionId,
|
|
268
|
-
profileId: selectedProfile.id,
|
|
269
|
-
mode: "autonomous",
|
|
270
|
-
context: {
|
|
271
|
-
items: items.map((item) => ({
|
|
272
|
-
id: item.descriptor.id,
|
|
273
|
-
language: item.descriptor.language,
|
|
274
|
-
version: item.descriptor.version,
|
|
275
|
-
name: item.descriptor.name,
|
|
276
|
-
path: item.descriptor.path,
|
|
277
|
-
})),
|
|
278
|
-
additionalData: {
|
|
279
|
-
intent: "review-title-suggestion",
|
|
280
|
-
reviewerCount: reviewers.length,
|
|
281
|
-
},
|
|
282
|
-
},
|
|
283
|
-
}), REVIEW_TITLE_SUGGESTION_TIMEOUT_MS, "Timed out while starting title suggestion agent");
|
|
284
|
-
const result = await awaitAgentResponse({
|
|
285
|
-
agentId: newAgentId,
|
|
286
|
-
addSocketMessageListener: editContext.addSocketMessageListener,
|
|
287
|
-
timeout: REVIEW_TITLE_SUGGESTION_TIMEOUT_MS,
|
|
216
|
+
return await suggestReviewName({
|
|
217
|
+
itemIds,
|
|
218
|
+
languages,
|
|
219
|
+
reviewerCount: reviewers.length,
|
|
220
|
+
includeSubitems: items.some((x) => x.includeSubitems),
|
|
288
221
|
});
|
|
289
|
-
if (!result.success)
|
|
290
|
-
return null;
|
|
291
|
-
const extractedTitle = extractReviewTitleFromAgentResponse(result.content);
|
|
292
|
-
return extractedTitle || null;
|
|
293
222
|
}
|
|
294
223
|
catch (err) {
|
|
295
224
|
console.error("Failed to generate review title suggestion:", err);
|
|
@@ -297,12 +226,6 @@ Homepage and Navigation Content Review
|
|
|
297
226
|
}
|
|
298
227
|
finally {
|
|
299
228
|
setIsGeneratingTitle(false);
|
|
300
|
-
try {
|
|
301
|
-
await closeAgent(newAgentId);
|
|
302
|
-
}
|
|
303
|
-
catch (err) {
|
|
304
|
-
console.error("Failed to close review title suggestion agent:", err);
|
|
305
|
-
}
|
|
306
229
|
}
|
|
307
230
|
};
|
|
308
231
|
const emailAlreadyExists = (email) => {
|
|
@@ -310,20 +233,16 @@ Homepage and Navigation Content Review
|
|
|
310
233
|
};
|
|
311
234
|
const addReviewer = () => {
|
|
312
235
|
if (!newReviewer.name || !newReviewer.email) {
|
|
313
|
-
setShowErrors(true);
|
|
314
236
|
return;
|
|
315
237
|
}
|
|
316
238
|
if (!isValidEmail(newReviewer.email)) {
|
|
317
|
-
setShowErrors(true);
|
|
318
239
|
return;
|
|
319
240
|
}
|
|
320
241
|
if (emailAlreadyExists(newReviewer.email)) {
|
|
321
|
-
setShowErrors(true);
|
|
322
242
|
return;
|
|
323
243
|
}
|
|
324
244
|
setReviewers([...reviewers, { ...newReviewer }]);
|
|
325
245
|
setNewReviewer({ name: "", email: "" });
|
|
326
|
-
setShowErrors(false);
|
|
327
246
|
};
|
|
328
247
|
const removeReviewer = (index) => {
|
|
329
248
|
setReviewers(reviewers.filter((_, i) => i !== index));
|
|
@@ -337,7 +256,8 @@ Homepage and Navigation Content Review
|
|
|
337
256
|
setItems(items.filter((_, i) => i !== index));
|
|
338
257
|
};
|
|
339
258
|
const resetDialogState = () => {
|
|
340
|
-
|
|
259
|
+
setStepIndex(0);
|
|
260
|
+
setShowSuccess(false);
|
|
341
261
|
setTitle("");
|
|
342
262
|
setReviewers([]);
|
|
343
263
|
setItems([]);
|
|
@@ -348,14 +268,12 @@ Homepage and Navigation Content Review
|
|
|
348
268
|
setRequiredApprovals("1");
|
|
349
269
|
setUpdateWorkflowOnCompletion(false);
|
|
350
270
|
setShareCommentsAndSuggestions(false);
|
|
351
|
-
setShowErrors(false);
|
|
352
271
|
setError(null);
|
|
353
|
-
setLanguageMode("
|
|
272
|
+
setLanguageMode("multiple");
|
|
354
273
|
setSelectedLanguages([
|
|
355
274
|
editContext?.currentItemDescriptor?.language || "en",
|
|
356
275
|
]);
|
|
357
276
|
setLanguage(editContext?.currentItemDescriptor?.language || "en");
|
|
358
|
-
setAdvancedSettingsOpen(false);
|
|
359
277
|
setSelectedInTree([]);
|
|
360
278
|
setSelectedFromList([]);
|
|
361
279
|
setNewReviewer({ name: "", email: "" });
|
|
@@ -371,9 +289,6 @@ Homepage and Navigation Content Review
|
|
|
371
289
|
if (reviewers.length === 0) {
|
|
372
290
|
return "Please add at least one reviewer";
|
|
373
291
|
}
|
|
374
|
-
if (languageMode === "single" && !language) {
|
|
375
|
-
return "Language is required";
|
|
376
|
-
}
|
|
377
292
|
if (languageMode === "multiple" && selectedLanguages.length === 0) {
|
|
378
293
|
return "Please select at least one language";
|
|
379
294
|
}
|
|
@@ -391,16 +306,16 @@ Homepage and Navigation Content Review
|
|
|
391
306
|
}
|
|
392
307
|
return null;
|
|
393
308
|
};
|
|
394
|
-
const
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
const validationError = validateForm();
|
|
398
|
-
if (validationError) {
|
|
399
|
-
setError(validationError);
|
|
309
|
+
const handleNext = () => {
|
|
310
|
+
if (isLastStep) {
|
|
311
|
+
void handleCreate();
|
|
400
312
|
return;
|
|
401
313
|
}
|
|
402
|
-
|
|
403
|
-
|
|
314
|
+
setError(null);
|
|
315
|
+
const nextIndex = stepIndex + 1;
|
|
316
|
+
setStepIndex(nextIndex);
|
|
317
|
+
// Kick off the title suggestion when the user reaches the confirm step
|
|
318
|
+
if (WIZARD_STEPS[nextIndex]?.id === "confirm" && !title.trim()) {
|
|
404
319
|
void (async () => {
|
|
405
320
|
const suggestedTitle = await generateReviewTitleSuggestion();
|
|
406
321
|
if (suggestedTitle) {
|
|
@@ -409,8 +324,13 @@ Homepage and Navigation Content Review
|
|
|
409
324
|
})();
|
|
410
325
|
}
|
|
411
326
|
};
|
|
327
|
+
const handlePrevious = () => {
|
|
328
|
+
if (stepIndex > 0) {
|
|
329
|
+
setError(null);
|
|
330
|
+
setStepIndex(stepIndex - 1);
|
|
331
|
+
}
|
|
332
|
+
};
|
|
412
333
|
const handleCreate = async () => {
|
|
413
|
-
setShowErrors(true);
|
|
414
334
|
setError(null);
|
|
415
335
|
const validationError = validateForm();
|
|
416
336
|
if (validationError) {
|
|
@@ -429,25 +349,8 @@ Homepage and Navigation Content Review
|
|
|
429
349
|
expirationUtc = expirationDate.toISOString();
|
|
430
350
|
}
|
|
431
351
|
// Build languages array based on mode
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
languages = ["*"];
|
|
435
|
-
}
|
|
436
|
-
else if (languageMode === "multiple") {
|
|
437
|
-
languages = selectedLanguages;
|
|
438
|
-
}
|
|
439
|
-
else {
|
|
440
|
-
languages = [language];
|
|
441
|
-
}
|
|
442
|
-
const requestItems = languageMode === "single"
|
|
443
|
-
? items.map((item) => ({
|
|
444
|
-
...item,
|
|
445
|
-
descriptor: {
|
|
446
|
-
...item.descriptor,
|
|
447
|
-
language,
|
|
448
|
-
},
|
|
449
|
-
}))
|
|
450
|
-
: items;
|
|
352
|
+
const languages = languageMode === "all" ? ["*"] : selectedLanguages;
|
|
353
|
+
const requestItems = items;
|
|
451
354
|
const requiredApprovalsNum = requiredApprovals
|
|
452
355
|
? parseInt(requiredApprovals, 10)
|
|
453
356
|
: 1;
|
|
@@ -504,7 +407,7 @@ Homepage and Navigation Content Review
|
|
|
504
407
|
setSentInvitationCount(0);
|
|
505
408
|
setSentInvitationEmails([]);
|
|
506
409
|
}
|
|
507
|
-
|
|
410
|
+
setShowSuccess(true);
|
|
508
411
|
}
|
|
509
412
|
else {
|
|
510
413
|
setError("Failed to create review");
|
|
@@ -653,16 +556,31 @@ Homepage and Navigation Content Review
|
|
|
653
556
|
};
|
|
654
557
|
const languageSummary = languageMode === "all"
|
|
655
558
|
? "All languages"
|
|
656
|
-
:
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
559
|
+
: `${selectedLanguages.length} selected (${selectedLanguages.join(", ")})`;
|
|
560
|
+
const renderStepContent = (stepId) => {
|
|
561
|
+
switch (stepId) {
|
|
562
|
+
case "items":
|
|
563
|
+
return (_jsx(CreateReviewItemsStep, { items: items, language: language, rootItemIds: rootItemIds, selectedInTree: selectedInTree, setSelectedInTree: setSelectedInTree, selectedFromList: selectedFromList, setSelectedFromList: setSelectedFromList, addToList: addToList, removeFromList: removeFromList, handleAddItem: handleAddItem, removeItem: removeItem, toggleSubitems: toggleSubitems }));
|
|
564
|
+
case "reviewers":
|
|
565
|
+
return (_jsx(CreateReviewReviewersStep, { items: items, itemIds: itemIds, language: language, reviewers: reviewers, setReviewers: setReviewers, newReviewer: newReviewer, setNewReviewer: setNewReviewer, addReviewer: addReviewer, removeReviewer: removeReviewer, isValidEmail: isValidEmail, emailAlreadyExists: emailAlreadyExists }));
|
|
566
|
+
case "languages":
|
|
567
|
+
return (_jsx(CreateReviewLanguagesStep, { selectedLanguages: selectedLanguages, setSelectedLanguages: setSelectedLanguages, itemLanguages: editContext?.itemLanguages || [] }));
|
|
568
|
+
case "settings":
|
|
569
|
+
return (_jsx(CreateReviewSettingsStep, { reviewers: reviewers, requiredApprovals: requiredApprovals, setRequiredApprovals: setRequiredApprovals, updateWorkflowOnCompletion: updateWorkflowOnCompletion, setUpdateWorkflowOnCompletion: setUpdateWorkflowOnCompletion, shareCommentsAndSuggestions: shareCommentsAndSuggestions, setShareCommentsAndSuggestions: setShareCommentsAndSuggestions, expirationDays: expirationDays, setExpirationDays: setExpirationDays, showSecretFields: showSecretFields, setShowSecretFields: setShowSecretFields, secret: secret, setSecret: setSecret, secretConfirm: secretConfirm, setSecretConfirm: setSecretConfirm }));
|
|
570
|
+
case "confirm":
|
|
571
|
+
return (_jsx(CreateReviewConfirmStep, { title: title, setTitle: setTitle, isGeneratingTitle: isGeneratingTitle, languageSummary: languageSummary, reviewers: reviewers, items: items, requiredApprovals: requiredApprovals, updateWorkflowOnCompletion: updateWorkflowOnCompletion, expirationDays: expirationDays, showSecretFields: showSecretFields }));
|
|
572
|
+
}
|
|
573
|
+
};
|
|
574
|
+
return (_jsx(Dialog, { open: open, onOpenChange: handleDialogOpenChange, children: _jsxs(DialogContent, { className: "flex max-h-[900px] min-h-0 max-w-5xl flex-col overflow-visible", "data-testid": "create-review-dialog", onPointerDownOutside: (e) => e.preventDefault(), "aria-describedby": "create-review-wizard-description", style: {
|
|
575
|
+
width: "min(90vw, 1280px)",
|
|
576
|
+
height: "min(85vh, 900px)",
|
|
577
|
+
}, children: [_jsx(StyledDialogTitle, { icon: showSuccess ? (_jsx(CheckCircle2, { strokeWidth: 1 })) : (_jsx(ClipboardCheck, { strokeWidth: 1 })), title: showSuccess ? "Review Created" : `Create Review · ${currentStep.name}`, subtitle: showSuccess
|
|
578
|
+
? "Invitation emails have been sent"
|
|
579
|
+
: currentStep.description }), _jsx("div", { id: "create-review-wizard-description", className: "sr-only", children: currentStep.description }), _jsxs("div", { className: "flex min-h-0 flex-1 flex-col", children: [_jsx("div", { className: "min-h-0 flex-1 overflow-y-auto", "data-testid": "create-review-step-content", children: showSuccess ? (_jsx(CreateReviewSuccessStep, { sentInvitationCount: sentInvitationCount, sentInvitationEmails: sentInvitationEmails })) : (_jsx("div", { className: "relative h-full", children: WIZARD_STEPS.map((step, index) => {
|
|
580
|
+
const isActive = index === stepIndex;
|
|
581
|
+
return (_jsx("div", { className: "h-full", style: { display: isActive ? "block" : "none" }, "aria-hidden": !isActive, "data-testid": `step-content-${step.id}`, children: renderStepContent(step.id) }, step.id));
|
|
582
|
+
}) })) }), !showSuccess && error && (_jsx("div", { className: "border-border-default shrink-0 border-t bg-white px-6 py-3", children: _jsx("div", { role: "alert", className: "border-destructive/20 bg-destructive/10 text-destructive rounded-xl border p-4 text-sm font-medium shadow-sm", children: _jsxs("div", { className: "flex gap-3", children: [_jsx(AlertTriangle, { className: "h-5 w-5 shrink-0" }), _jsx("p", { children: error })] }) }) })), _jsx(DialogButtons, { "data-testid": "create-review-dialog-buttons", className: "rounded-b-2xl", children: showSuccess ? (_jsx(Button, { onClick: handleDone, className: "min-w-[120px] shadow-sm", children: "Done" })) : (_jsxs(_Fragment, { children: [_jsx(Button, { variant: "ghost", onClick: handleDialogCancel, disabled: loading, className: "w-auto min-w-24 flex-none", "data-testid": "create-review-cancel-button", children: "Cancel" }), _jsxs("div", { className: "ml-auto flex min-w-0 flex-wrap items-center justify-end gap-3", children: [stepIndex > 0 && (_jsx(Button, { onClick: handlePrevious, variant: "outline", disabled: loading, className: "w-auto min-w-32 flex-none", "data-testid": "create-review-previous-button", children: "Previous" })), _jsx(Button, { onClick: handleNext, disabled: !canProceed || loading, className: "w-auto min-w-40 flex-none gap-2 shadow-sm", "data-testid": isLastStep
|
|
583
|
+
? "create-review-submit-button"
|
|
584
|
+
: "create-review-next-button", children: isLastStep ? (loading ? (_jsxs(_Fragment, { children: [_jsx(Loader2, { className: "mr-2 h-4 w-4 animate-spin" }), "Creating..."] })) : ("Create & Send Emails")) : (_jsxs(_Fragment, { children: [nextStep?.nextButtonLabel ?? "Next", _jsx(ArrowRight, { className: "h-4 w-4", strokeWidth: 2 })] })) })] })] })) })] }), !showSuccess && (_jsx(StepIndicatorDots, { steps: WIZARD_STEPS, currentStepIndex: stepIndex }))] }) }));
|
|
667
585
|
}
|
|
668
586
|
//# sourceMappingURL=CreateReviewDialog.js.map
|