Keep every picked card on the finished Rule, and wait for its words before Continue.
This commit is contained in:
1 parent
a846169960
commit
a2815ae05f
16 files changed
+417
-114
No files matched your search
@@ -3,6 +3,7 @@ import {
|
||||
buildFinalReviewCategoryRowsDetailed,
|
||||
type FinalReviewCategoryNames,
|
||||
} from "../../../../lib/create/buildFinalReviewCategories";
|
||||
import { finalReviewChipBlocksContinue } from "../../../../lib/create/finalReviewChipWarnings";
|
||||
import type { TemplateFacetGroupKey } from "../../../../lib/create/templateReviewMapping";
|
||||
import type { CreateFlowState, CreateFlowStep } from "../types";
|
||||
|
||||
@@ -75,8 +76,9 @@ const FINAL_REVIEW_REQUIRED_GROUPS: readonly TemplateFacetGroupKey[] = [
|
||||
] as const;
|
||||
|
||||
/**
|
||||
* Continue on final review waits for a community name and at least one card
|
||||
* on each of the four questions. Skipped values do not block.
|
||||
* Continue on final review waits for a community name, at least one card on
|
||||
* each of the four questions, every picked card's words, and every picked
|
||||
* value's meaning. Skipped values and missing signals do not block.
|
||||
*/
|
||||
export function isFinalReviewContinueBlocked(state: CreateFlowState): boolean {
|
||||
const title = typeof state.title === "string" ? state.title.trim() : "";
|
||||
@@ -85,10 +87,16 @@ export function isFinalReviewContinueBlocked(state: CreateFlowState): boolean {
|
||||
state,
|
||||
FINAL_REVIEW_BLOCK_NAMES,
|
||||
);
|
||||
return FINAL_REVIEW_REQUIRED_GROUPS.some((groupKey) => {
|
||||
const missingRequiredCard = FINAL_REVIEW_REQUIRED_GROUPS.some((groupKey) => {
|
||||
const row = rows.find((candidate) => candidate.groupKey === groupKey);
|
||||
return !row || row.entries.length === 0;
|
||||
});
|
||||
if (missingRequiredCard) return true;
|
||||
return rows.some((row) =>
|
||||
row.entries.some((entry) =>
|
||||
finalReviewChipBlocksContinue(state, entry.groupKey, entry.overrideKey),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user