react-native-my-survey-sdk 2.2.15 → 2.2.16
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/package.json
CHANGED
|
@@ -118,15 +118,19 @@ export function parseSurvey(data: APISurveyResponse['data']): XeboSurvey {
|
|
|
118
118
|
console.log('[Xebo] Dropdown options.row:', JSON.stringify(q.options?.row));
|
|
119
119
|
console.log('[Xebo] Full dropdown q.options:', JSON.stringify(q.options));
|
|
120
120
|
}
|
|
121
|
-
const
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
121
|
+
const rawOptions = q.options as any;
|
|
122
|
+
const rowSource: any[] = Array.isArray(rawOptions)
|
|
123
|
+
? rawOptions
|
|
124
|
+
: (rawOptions?.row ?? rawOptions?.items ?? rawOptions?.choices ?? []);
|
|
125
|
+
const rows: XeboChoice[] = rowSource.map((r: any) => ({
|
|
126
|
+
id: r.uuid ?? r.id,
|
|
127
|
+
text: stripHTML(r.text ?? r.label ?? r.value ?? ''),
|
|
128
|
+
value: r.uuid ?? r.id,
|
|
125
129
|
}));
|
|
126
|
-
const cols: XeboChoice[] = (
|
|
127
|
-
id: c.uuid,
|
|
128
|
-
text: stripHTML(c.text),
|
|
129
|
-
value: c.uuid,
|
|
130
|
+
const cols: XeboChoice[] = (rawOptions?.col ?? rawOptions?.columns ?? []).map((c: any) => ({
|
|
131
|
+
id: c.uuid ?? c.id,
|
|
132
|
+
text: stripHTML(c.text ?? c.label ?? ''),
|
|
133
|
+
value: c.uuid ?? c.id,
|
|
130
134
|
}));
|
|
131
135
|
|
|
132
136
|
// Build conditional follow-ups for NPS Pro
|