Added the value card sort to the BeyondFacts Lab (#1206)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2026-11-15 13:06:06 +01:00
1 parent 1361b984eb
commit 3ca4b3878b
42 files changed
+2111 -114

No files matched your search

@@ -144,7 +144,7 @@ public partial class BflShareDialog : MSGComponentBase
}
var researchTopics = research.Where(entry => !string.IsNullOrWhiteSpace(entry.Value.Text)).Select(entry => entry.Key).ToList();
this.source = new BflShareInput(forms, workStates, results, conversations, materials, researchTopics, false, APP_VERSION, DateTimeOffset.UtcNow, Culture);
this.source = new BflShareInput(forms, workStates, results, conversations, materials, researchTopics, false, APP_VERSION, DateTimeOffset.UtcNow, Culture, await this.LoadValueDeckAsync());
this.otherNames = string.Join('\n', BflShareNames.Suggest(forms, workStates, research.GetValueOrDefault(BflResearchTopic.PARTICIPANTS)));
}
catch (Exception exception) when (exception is IOException or UnauthorizedAccessException or InvalidDataException)
@@ -158,6 +158,23 @@ public partial class BflShareDialog : MSGComponentBase
}
}
/// <summary>
/// Reads the value deck in the language of the app, with which the session shows the card sort.
/// </summary>
/// <returns>The deck, or null when the app comes without a readable one; the session then leaves the card sort out.</returns>
private async Task<BflValueDeck?> LoadValueDeckAsync()
{
try
{
return await BflValueDeck.LoadAsync(Culture);
}
catch (Exception exception) when (exception is FileNotFoundException or FormatException)
{
this.Logger.LogError(exception, "Could not read the value deck of the BeyondFacts Lab to share the card sort.");
return null;
}
}
/// <summary>
/// Puts the session together and anonymizes it with the names and terms the person listed; asks first when that
/// would discard changes of the person in the preview.