@camunda/camunda-composite-components 0.2.17-rc.1 → 0.2.17-rc.3
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.
|
@@ -64,10 +64,6 @@ export const C3HelpCenter = ({ autoStartSurvey, origin, flags, onRequestClose, m
|
|
|
64
64
|
if (userId)
|
|
65
65
|
setUserId(userId);
|
|
66
66
|
if (autoStartSurvey && !tokenPersona?.wasShown) {
|
|
67
|
-
if (showSurvey || !tokenPersona?.wasShown) {
|
|
68
|
-
console.log("show survey", showSurvey);
|
|
69
|
-
setShowSurvey(true);
|
|
70
|
-
}
|
|
71
67
|
setIsHelpCenterOpen(true);
|
|
72
68
|
onRequestOpen?.();
|
|
73
69
|
}
|
|
@@ -86,14 +82,21 @@ export const C3HelpCenter = ({ autoStartSurvey, origin, flags, onRequestClose, m
|
|
|
86
82
|
const tabs = helpCenterConfig.tabs;
|
|
87
83
|
const firstTab = tabs[0].id;
|
|
88
84
|
if (isOpen) {
|
|
85
|
+
if (persona && !persona.wasShown && decodedAudience) {
|
|
86
|
+
updatePersona({
|
|
87
|
+
newPersona: { ...persona, wasShown: true },
|
|
88
|
+
audience: decodedAudience,
|
|
89
|
+
accessToken: userToken,
|
|
90
|
+
orgId: activeOrganizationId,
|
|
91
|
+
userId,
|
|
92
|
+
});
|
|
93
|
+
setPersona({ wasShown: true });
|
|
94
|
+
}
|
|
89
95
|
mixpanelTrack?.(`helpcenter:open`, {
|
|
90
96
|
to: activeTab ?? firstTab,
|
|
91
97
|
from: origin,
|
|
92
98
|
});
|
|
93
99
|
}
|
|
94
|
-
else {
|
|
95
|
-
setShowSurvey(false);
|
|
96
|
-
}
|
|
97
100
|
}, [isOpen]);
|
|
98
101
|
const onRequestRetakeSurvey = () => {
|
|
99
102
|
if (!userToken || !activeOrganizationId || !decodedAudience)
|
|
@@ -151,6 +154,7 @@ export const C3HelpCenter = ({ autoStartSurvey, origin, flags, onRequestClose, m
|
|
|
151
154
|
}
|
|
152
155
|
};
|
|
153
156
|
const closeFn = () => {
|
|
157
|
+
setIsHelpCenterOpen(false);
|
|
154
158
|
if (persona && userToken && activeOrganizationId && decodedAudience) {
|
|
155
159
|
updatePersona({
|
|
156
160
|
newPersona: persona,
|
|
@@ -160,10 +164,10 @@ export const C3HelpCenter = ({ autoStartSurvey, origin, flags, onRequestClose, m
|
|
|
160
164
|
userId,
|
|
161
165
|
});
|
|
162
166
|
}
|
|
163
|
-
setIsHelpCenterOpen(false);
|
|
164
167
|
onRequestClose?.();
|
|
165
168
|
fetchConfig();
|
|
166
169
|
reloadClusters();
|
|
170
|
+
setShowSurvey(false);
|
|
167
171
|
};
|
|
168
172
|
return (React.createElement(Layer, null,
|
|
169
173
|
React.createElement(ComposedModal, { open: isOpen, size: "lg", onClose: closeFn, className: "help-center", "aria-label": "HelpCenter" }, showSurvey || !persona?.wasShown ? (React.createElement(C3OnboardingSurvey, { personaCallback: personaCallback, persona: persona, mixpanelTrack: mixpanelTrack, onRequestClose: closeFn, onRequestSkip: onRequestSkipSurvey, theme: resolvedTheme, origin: origin, modal: true })) : (React.createElement(HelpCenter, { configuration: helpCenterConfig, persona: persona, audience: decodedAudience || "", organization: activeOrg, clusters: clusters || [], flags: flags, onRequestResumeSurvey: onRequestResumeSurvey, onRequestRetakeSurvey: onRequestRetakeSurvey, onRequestClose: closeFn, mixpanelTrack: mixpanelTrack, email: email, theme: resolvedTheme, origin: origin, initialTab: activeTab })))));
|