Let Use without changes from a template collect identity instead of the full questionnaire.
Direct catalog picks walk name, description, and photo, then stakeholders; leftover drafts no longer skip that path. In-flow template picks keep community identity. Exit on a direct template preview leaves immediately because nothing has been collected yet. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -34,9 +34,12 @@ const blurActiveElement = (): void => {
|
||||
*
|
||||
* Resolves the active step from `/create/{screenId}` via
|
||||
* {@link parseCreateFlowScreenFromPathname} (flowSteps). Footer Back uses
|
||||
* {@link resolveCreateFlowBackTarget} so template **Use without changes**
|
||||
* (which skips the custom-rule segment) returns to `/create/review-template/{slug}`
|
||||
* from `confirm-stakeholders` instead of `conflict-management`.
|
||||
* {@link resolveCreateFlowBackTarget}: template **Use without changes** that
|
||||
* still needs identity (direct from a template) walks name / description /
|
||||
* photo, then Back from `community-name` returns to
|
||||
* `/create/review-template/{slug}`. In-flow picks (`?fromFlow=1`) skip
|
||||
* identity and land on `confirm-stakeholders`; Back from that step returns
|
||||
* to the template instead of `conflict-management`.
|
||||
*
|
||||
* Template review footer Back uses {@link buildTemplateReviewHref}’s
|
||||
* `?fromFlow=1` marker (and persisted `templateReviewEntryFromCreateFlow`) so
|
||||
@@ -83,17 +86,27 @@ export function useCreateFlowNavigation(
|
||||
updateState,
|
||||
]);
|
||||
|
||||
const nextStep = getNextStep(validStep, options);
|
||||
const previousStep = getPreviousStep(validStep, options);
|
||||
const identityOnly =
|
||||
state.pendingTemplateAction?.mode === "useWithoutChanges";
|
||||
const navigationOptions = useMemo(
|
||||
(): CreateFlowNavigationOptions => ({
|
||||
skipCommunitySave: options?.skipCommunitySave,
|
||||
useWithoutChangesIdentityOnly: identityOnly,
|
||||
}),
|
||||
[options?.skipCommunitySave, identityOnly],
|
||||
);
|
||||
|
||||
const nextStep = getNextStep(validStep, navigationOptions);
|
||||
const previousStep = getPreviousStep(validStep, navigationOptions);
|
||||
|
||||
const backTarget = useMemo(
|
||||
() =>
|
||||
resolveCreateFlowBackTarget(
|
||||
validStep,
|
||||
options,
|
||||
navigationOptions,
|
||||
state.templateReviewBackSlug,
|
||||
),
|
||||
[validStep, options?.skipCommunitySave, state.templateReviewBackSlug],
|
||||
[validStep, navigationOptions, state.templateReviewBackSlug],
|
||||
);
|
||||
|
||||
const goToNextStep = useCallback(() => {
|
||||
|
||||
Reference in New Issue
Block a user