Handle single Scattermind action thread handoffs
This commit is contained in:
@@ -1505,14 +1505,6 @@ function optionsFromBody(body = {}) {
|
||||
actionThreadSource.sourceSection || 'threadsToHold',
|
||||
'Thread to hold'
|
||||
);
|
||||
if (actionThreadOptions.length >= 2) return normalizeCandidateGroup([{ items: actionThreadOptions, sourceSection: actionThreadSource.sourceSection || 'threadsToHold' }]);
|
||||
const closingNoteSource = [
|
||||
{ text: closingNoteFromSource(conceptMap), sourceSection: 'concept-map.closingNote' },
|
||||
{ text: closingNoteFromSource(snapshot), sourceSection: 'snapshot.closingNote' },
|
||||
{ text: closingNoteFromSource(envelope), sourceSection: 'ranker-input.closingNote' },
|
||||
{ text: closingNoteFromSource(featureSet), sourceSection: 'feature-set.closingNote' },
|
||||
{ text: closingNoteFromSource(body), sourceSection: 'closingNote' },
|
||||
].find(entry => entry.text) || { text: '', sourceSection: '' };
|
||||
const questionSource = firstArraySource([
|
||||
{ items: conceptMap.questions_to_sit_with || conceptMap.questionsToSitWith || conceptMap.evidenceQuestions || conceptMap.evidence_questions || conceptMap.decisionQuestions || conceptMap.decision_questions || conceptMap.questionsToAnswer || conceptMap.questions_to_answer || conceptMap.followupQuestions || conceptMap.followup_questions || conceptMap.openQuestions || conceptMap.open_questions, sourceSection: 'concept-map.questionsToSitWith' },
|
||||
{ items: snapshot.questions_to_sit_with || snapshot.questionsToSitWith || snapshot.evidenceQuestions || snapshot.evidence_questions || snapshot.decisionQuestions || snapshot.decision_questions || snapshot.questionsToAnswer || snapshot.questions_to_answer || snapshot.followupQuestions || snapshot.followup_questions || snapshot.openQuestions || snapshot.open_questions, sourceSection: 'snapshot.questionsToSitWith' },
|
||||
@@ -1525,6 +1517,20 @@ function optionsFromBody(body = {}) {
|
||||
questionSource.sourceSection || 'questionsToSitWith',
|
||||
'Question to sit with'
|
||||
);
|
||||
if (actionThreadOptions.length >= 2) return normalizeCandidateGroup([{ items: actionThreadOptions, sourceSection: actionThreadSource.sourceSection || 'threadsToHold' }]);
|
||||
if (actionThreadOptions.length === 1 && questionOptions.length) {
|
||||
return normalizeCandidateGroup([
|
||||
{ items: actionThreadOptions, sourceSection: actionThreadSource.sourceSection || 'threadsToHold' },
|
||||
{ items: questionOptions, sourceSection: questionSource.sourceSection || 'questionsToSitWith', defaultLane: 'validate-next' },
|
||||
]);
|
||||
}
|
||||
const closingNoteSource = [
|
||||
{ text: closingNoteFromSource(conceptMap), sourceSection: 'concept-map.closingNote' },
|
||||
{ text: closingNoteFromSource(snapshot), sourceSection: 'snapshot.closingNote' },
|
||||
{ text: closingNoteFromSource(envelope), sourceSection: 'ranker-input.closingNote' },
|
||||
{ text: closingNoteFromSource(featureSet), sourceSection: 'feature-set.closingNote' },
|
||||
{ text: closingNoteFromSource(body), sourceSection: 'closingNote' },
|
||||
].find(entry => entry.text) || { text: '', sourceSection: '' };
|
||||
const closingNoteOption = optionFromClosingNote(
|
||||
closingNoteSource.text,
|
||||
closingNoteSource.sourceSection || 'closingNote',
|
||||
|
||||
Reference in New Issue
Block a user