oro-sdk 6.1.0 → 6.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/oro-sdk.cjs.development.js +11 -8
- package/dist/oro-sdk.cjs.development.js.map +1 -1
- package/dist/oro-sdk.cjs.production.min.js +1 -1
- package/dist/oro-sdk.cjs.production.min.js.map +1 -1
- package/dist/oro-sdk.esm.js +11 -8
- package/dist/oro-sdk.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/helpers/workflow.ts +10 -6
@@ -802,9 +802,8 @@ function _getWorkflowDataByCategory() {
|
|
802
802
|
return pageAnswers.map(function (_ref5) {
|
803
803
|
var questionId = _ref5[0],
|
804
804
|
v = _ref5[1];
|
805
|
-
|
806
|
-
|
807
|
-
return [questionId, v, previousAnswer];
|
805
|
+
if (workflowData.previousAnswers && workflowData.previousAnswers[pageIndex][questionId]) return [questionId, v, workflowData.previousAnswers[pageIndex][questionId]];
|
806
|
+
return [questionId, v, undefined];
|
808
807
|
});
|
809
808
|
});
|
810
809
|
}
|
@@ -1064,19 +1063,23 @@ function fillWorkflowFromPopulatedWorkflow(workflow, populatedWorkflow) {
|
|
1064
1063
|
*/
|
1065
1064
|
function detectChangesInWorkflowAnswers(workflow) {
|
1066
1065
|
return _extends({}, workflow, {
|
1067
|
-
previousAnswers: workflow.previousAnswers ?
|
1068
|
-
return Object.entries(pageAnswers).map(function (_ref) {
|
1066
|
+
previousAnswers: workflow.previousAnswers ? workflow.previousAnswers.map(function (pageAnswers, pageId) {
|
1067
|
+
return Object.fromEntries(Object.entries(pageAnswers).map(function (_ref) {
|
1069
1068
|
var question = _ref[0],
|
1070
1069
|
answer = _ref[1];
|
1071
1070
|
var selectedAnswer = undefined;
|
1072
1071
|
if (workflow.selectedAnswers && workflow.selectedAnswers[pageId][question]) selectedAnswer = workflow.selectedAnswers[pageId][question];
|
1072
|
+
var changed = !!selectedAnswer && !equalsAnswer(selectedAnswer, answer.previousAnswer);
|
1073
1073
|
return [question, _extends({}, answer, {
|
1074
|
-
changed:
|
1074
|
+
changed: changed
|
1075
1075
|
})];
|
1076
|
-
});
|
1077
|
-
})
|
1076
|
+
}));
|
1077
|
+
}) : undefined
|
1078
1078
|
});
|
1079
1079
|
}
|
1080
|
+
function equalsAnswer(answer1, answer2) {
|
1081
|
+
return JSON.stringify(answer1) === JSON.stringify(answer2);
|
1082
|
+
}
|
1080
1083
|
|
1081
1084
|
/**
|
1082
1085
|
* Creates a consultation if one has not been created and fails to be retrieved by the payment intent
|