diff --git a/app/(app)/create/CreateFlowLayoutClient.tsx b/app/(app)/create/CreateFlowLayoutClient.tsx
index fa465cd..9e46c6b 100644
--- a/app/(app)/create/CreateFlowLayoutClient.tsx
+++ b/app/(app)/create/CreateFlowLayoutClient.tsx
@@ -199,9 +199,7 @@ function CreateFlowLayoutContent({
const editingPublishedRuleIdTrimmed =
state.editingPublishedRuleId?.trim() ?? "";
const isConfirmStakeholdersManagePublished =
- currentStep === "confirm-stakeholders" &&
- manageStakeholdersIntent &&
- editingPublishedRuleIdTrimmed.length > 0;
+ currentStep === "confirm-stakeholders" && manageStakeholdersIntent;
const { draftSaveBannerMessage, setDraftSaveBannerMessage } =
useCreateFlowDraftSaveBanner();
const { markAttempted, clearAttempted } = useCreateFlowContinueAttempt();
@@ -277,6 +275,7 @@ function CreateFlowLayoutContent({
: createFlowStepPathWithSyncDraft("final-review");
const {
+ publishBannerTitle,
publishBannerMessage,
setPublishBannerMessage,
isPublishing,
@@ -450,7 +449,10 @@ function CreateFlowLayoutContent({
}, [currentStep]);
useEffect(() => {
- if (currentStep !== "edit-rule") return;
+ const editingFromCompleted =
+ currentStep === "final-review" &&
+ (state.editingPublishedRuleId?.trim() ?? "").length > 0;
+ if (currentStep !== "edit-rule" && !editingFromCompleted) return;
const last = readLastPublishedRule();
if (!last) {
router.replace(CREATE_ROUTES.completed);
@@ -515,6 +517,33 @@ function CreateFlowLayoutContent({
state.customMethodCardMetaById,
]);
+ useEffect(() => {
+ if (currentStep !== "confirm-stakeholders") return;
+ if (!manageStakeholdersIntent) return;
+ if (editingPublishedRuleIdTrimmed.length > 0) return;
+ const last = readLastPublishedRule();
+ if (!last) {
+ router.replace(CREATE_ROUTES.completed);
+ return;
+ }
+ const patch = createFlowStateFromPublishedRule(last);
+ const pinPatch = methodSectionsPinsFromPublishedHydratePatch(patch);
+ updateState({
+ ...patch,
+ methodSectionsPinCommitted: {
+ ...state.methodSectionsPinCommitted,
+ ...pinPatch,
+ },
+ });
+ }, [
+ currentStep,
+ manageStakeholdersIntent,
+ editingPublishedRuleIdTrimmed.length,
+ router,
+ updateState,
+ state.methodSectionsPinCommitted,
+ ]);
+
useEffect(() => {
if (currentStep !== "completed") {
setCompletedFlowBanner(null);
@@ -705,6 +734,7 @@ function CreateFlowLayoutContent({
key: "publish",
status: "danger" as const,
title:
+ publishBannerTitle ??
messages.create.reviewAndComplete.publish.publishBannerTitle,
description: publishBannerMessage,
onClose: () => setPublishBannerMessage(null),
@@ -862,7 +892,7 @@ function CreateFlowLayoutContent({
editingPublishedRuleId: last.id,
sections: [],
});
- router.push(createFlowStepPath("edit-rule"));
+ router.push(createFlowStepPath("final-review"));
}
: undefined
}
@@ -1125,12 +1155,14 @@ function CreateFlowLayoutContent({
buttonType="filled"
palette="default"
size="xsmall"
- disabled={isPublishing}
+ disabled={
+ isPublishing || editingPublishedRuleIdTrimmed.length === 0
+ }
className={CREATE_FLOW_FOOTER_BUTTON_CLASS}
onClick={() => {
router.push(
createFlowStepPathAfterStrippingReviewReturn(
- "edit-rule",
+ reviewReturnTarget ?? "completed",
searchParams,
),
);
@@ -1141,6 +1173,39 @@ function CreateFlowLayoutContent({
.footerDone
}
+ ) : currentStep === "confirm-stakeholders" ? (
+
+
+
+
) : nextStep || isFinalReviewLike ? (