mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-16 18:48:28 +00:00
Added the value card sort to the BeyondFacts Lab (#1206)
This commit is contained in:
1 parent
1361b984eb
commit
3ca4b3878b
42 files changed
+2111
-114
No files matched your search
@@ -113,12 +113,18 @@ public sealed partial class BeyondFactsLabStore
|
||||
throw new InvalidDataException("This version of AI Studio cannot open the form.", exception);
|
||||
}
|
||||
|
||||
if (form is null || form.SchemaVersion is < 1 or > BflStepFormData.CURRENT_SCHEMA_VERSION || IsNull(form.Values))
|
||||
if (form is null || form.SchemaVersion is < 1 or > BflStepFormData.CURRENT_SCHEMA_VERSION || IsNull(form.Values) || form.CardSort is { } cardSort && IsBroken(cardSort))
|
||||
throw new InvalidDataException("This version of AI Studio cannot open the form.");
|
||||
|
||||
return form;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tells whether a stored card sort lacks one of its parts, which JSON can make null.
|
||||
/// </summary>
|
||||
/// <param name="cardSort">The card sort.</param>
|
||||
private static bool IsBroken(BflCardSort cardSort) => IsNull(cardSort.Categories) || IsNull(cardSort.OwnValues) || IsNull(cardSort.Focus) || cardSort.Focus.Any(IsNull) || cardSort.OwnValues.Any(value => IsNull(value) || IsNull(value.Id) || IsNull(value.Name) || IsNull(value.Definition));
|
||||
|
||||
/// <summary>
|
||||
/// Gets the file of the form of a step.
|
||||
/// </summary>
|
||||
|
||||
Reference in new issue
Block a user