@camunda/camunda-composite-components 0.2.12 → 0.2.13-rc.1
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.
|
@@ -17,9 +17,7 @@ export const C3HelpCenter = ({ autoStartSurvey, origin, flags, onRequestClose, m
|
|
|
17
17
|
const [resolvedTheme, setResolvedTheme] = useState(defaultTheme);
|
|
18
18
|
const [persona, setPersona] = useState(undefined);
|
|
19
19
|
const [userId, setUserId] = useState("");
|
|
20
|
-
const [token, setToken] = useState("");
|
|
21
20
|
const [audience, setAudience] = useState("");
|
|
22
|
-
const [organizationId, setOrganizationId] = useState(null);
|
|
23
21
|
const [organization, setOrganization] = useState(null);
|
|
24
22
|
const [clusters, setClusters] = useState([]);
|
|
25
23
|
const [helpCenterConfig, setHelpCenterConfig] = useState(defaultHelpCenterConfig);
|
|
@@ -71,6 +69,8 @@ export const C3HelpCenter = ({ autoStartSurvey, origin, flags, onRequestClose, m
|
|
|
71
69
|
setOrganization(org);
|
|
72
70
|
}
|
|
73
71
|
if (autoStartSurvey && !(persona?.wasShown ?? false)) {
|
|
72
|
+
setShowSurvey(true);
|
|
73
|
+
setIsHelpCenterOpen(true);
|
|
74
74
|
onRequestOpen?.();
|
|
75
75
|
}
|
|
76
76
|
if (decodedAudience && userToken) {
|
|
@@ -79,16 +79,8 @@ export const C3HelpCenter = ({ autoStartSurvey, origin, flags, onRequestClose, m
|
|
|
79
79
|
}
|
|
80
80
|
};
|
|
81
81
|
React.useEffect(() => {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
const decodedTokenChanged = !tokenChanged && !orgChanged;
|
|
85
|
-
if (tokenChanged)
|
|
86
|
-
setToken(userToken);
|
|
87
|
-
if (orgChanged)
|
|
88
|
-
setOrganizationId(activeOrganizationId);
|
|
89
|
-
if (tokenChanged || decodedTokenChanged || orgChanged)
|
|
90
|
-
fetchData();
|
|
91
|
-
}, [userToken, decodedToken, activeOrganizationId]);
|
|
82
|
+
fetchData();
|
|
83
|
+
}, [JSON.stringify(decodedToken), activeOrganizationId]);
|
|
92
84
|
React.useEffect(() => {
|
|
93
85
|
const tabs = helpCenterConfig.tabs;
|
|
94
86
|
const firstTab = tabs[0].id;
|
|
@@ -169,5 +161,5 @@ export const C3HelpCenter = ({ autoStartSurvey, origin, flags, onRequestClose, m
|
|
|
169
161
|
onRequestClose?.();
|
|
170
162
|
};
|
|
171
163
|
return (React.createElement(Layer, null,
|
|
172
|
-
React.createElement(ComposedModal, { open: isOpen, size: "lg", onClose: closeFn, className: "help-center", "aria-label": "HelpCenter" }, showSurvey || !persona ? (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: audience, organization: organization, clusters: clusters || [], flags: flags, onRequestResumeSurvey: onRequestResumeSurvey, onRequestRetakeSurvey: onRequestRetakeSurvey, onRequestClose: closeFn, mixpanelTrack: mixpanelTrack, email: email, theme: resolvedTheme, origin: origin, initialTab: activeTab })))));
|
|
164
|
+
React.createElement(ComposedModal, { open: isOpen, size: "lg", onClose: closeFn, className: "help-center", "aria-label": "HelpCenter" }, showSurvey || !persona || !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: audience, organization: organization, clusters: clusters || [], flags: flags, onRequestResumeSurvey: onRequestResumeSurvey, onRequestRetakeSurvey: onRequestRetakeSurvey, onRequestClose: closeFn, mixpanelTrack: mixpanelTrack, email: email, theme: resolvedTheme, origin: origin, initialTab: activeTab })))));
|
|
173
165
|
};
|
|
@@ -7,19 +7,15 @@ export const C3OnboardingSurvey = (props) => {
|
|
|
7
7
|
const { userToken, decodedToken, activeOrganizationId } = useC3UserConfiguration() || {};
|
|
8
8
|
const [persona, setPersona] = useState(props.persona);
|
|
9
9
|
const [userId, setUserId] = useState("");
|
|
10
|
-
const [token, setToken] = useState("");
|
|
11
10
|
const [audience, setAudience] = useState("");
|
|
12
11
|
const [onboardConfig, setOnboardConfig] = useState(defaultOnboardingConfig);
|
|
13
12
|
const [isLoadingConfig, setIsLoadingConfig] = useState(false);
|
|
14
13
|
const [givenName, setGivenName] = useState("");
|
|
15
14
|
const [email, setEmail] = useState("");
|
|
16
15
|
React.useEffect(() => {
|
|
17
|
-
if (!
|
|
16
|
+
if (!decodedToken)
|
|
18
17
|
return;
|
|
19
|
-
setToken(userToken);
|
|
20
18
|
(async () => {
|
|
21
|
-
if (!decodedToken)
|
|
22
|
-
return;
|
|
23
19
|
const { userId, meta, audience, persona } = decodedToken;
|
|
24
20
|
if (props.persona === undefined && persona) {
|
|
25
21
|
setPersona(persona);
|
|
@@ -44,7 +40,7 @@ export const C3OnboardingSurvey = (props) => {
|
|
|
44
40
|
setIsLoadingConfig(false);
|
|
45
41
|
}
|
|
46
42
|
})();
|
|
47
|
-
}, [
|
|
43
|
+
}, [JSON.stringify(decodedToken)]);
|
|
48
44
|
React.useEffect(() => {
|
|
49
45
|
setPersona(props.persona);
|
|
50
46
|
}, [props.persona]);
|
|
@@ -82,7 +78,6 @@ export const C3OnboardingSurvey = (props) => {
|
|
|
82
78
|
accessToken: userToken,
|
|
83
79
|
});
|
|
84
80
|
if (notifyHubspot) {
|
|
85
|
-
console.log(newPersona, email, activeOrganizationId);
|
|
86
81
|
await submitSurvey({
|
|
87
82
|
audience,
|
|
88
83
|
token: userToken,
|