@logora/debate 0.3.119 → 0.4.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.
|
@@ -1,52 +1,73 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
),
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
1
|
+
import { jsx as d, Fragment as q } from "react/jsx-runtime";
|
|
2
|
+
import { useState as E, useEffect as f } from "react";
|
|
3
|
+
import { useConfig as _ } from "../../data/config_provider/useConfig.js";
|
|
4
|
+
import { useAuthInterceptor as J } from "../use_auth/useAuthInterceptor.js";
|
|
5
|
+
import { authTokenHandler as S } from "../use_auth/authTokenHandler.js";
|
|
6
|
+
import { useAuthActions as T } from "../use_auth/useAuthActions.js";
|
|
7
|
+
import { useAuthRequired as W } from "../../hooks/use_auth_required/useAuthRequired.js";
|
|
8
|
+
import { useAuth as y } from "../use_auth/useAuth.js";
|
|
9
|
+
import { AuthProviderFactory as z } from "../providers/AuthProviderFactory.js";
|
|
10
|
+
import { UpdateUserInfoModal as L } from "../../user/update_user_info_modal/UpdateUserInfoModal.js";
|
|
11
|
+
import { httpClient as a } from "../../data/axios_client/httpClient.js";
|
|
12
|
+
const N = ({ authUrl: s, authType: r, provider: g, assertion: p }) => {
|
|
13
|
+
const i = "logora_user_token", e = _();
|
|
14
|
+
J(a, s, i);
|
|
15
|
+
const [w, u] = E(!1), { getToken: A, removeToken: v } = S(
|
|
16
|
+
a,
|
|
17
|
+
s,
|
|
18
|
+
i
|
|
19
|
+
), { loginUser: c, logoutUser: C, fetchUser: P } = T(
|
|
20
|
+
a,
|
|
21
|
+
s,
|
|
22
|
+
i
|
|
23
|
+
), U = W(), { setIsLoggingIn: k } = y();
|
|
24
|
+
f(() => {
|
|
25
|
+
I();
|
|
26
|
+
}, []);
|
|
27
|
+
const h = (o) => {
|
|
28
|
+
r !== "social" && r !== "oauth2_server" && e.auth?.showOnboarding === !0 ? u(!0) : U(o);
|
|
29
|
+
};
|
|
30
|
+
f(() => {
|
|
23
31
|
if (typeof window < "u")
|
|
24
|
-
return window.addEventListener(
|
|
25
|
-
"logora:authentication:require",
|
|
26
|
-
i
|
|
27
|
-
), () => {
|
|
28
|
-
window.removeEventListener(
|
|
29
|
-
"logora:authentication:require",
|
|
30
|
-
i
|
|
31
|
-
);
|
|
32
|
+
return window.addEventListener("logora:authentication:require", h), () => {
|
|
33
|
+
window.removeEventListener("logora:authentication:require", h);
|
|
32
34
|
};
|
|
33
35
|
}, []);
|
|
34
|
-
const
|
|
35
|
-
const
|
|
36
|
+
const I = () => {
|
|
37
|
+
const o = l(), t = A();
|
|
36
38
|
if (t) {
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
+
const n = t.session_id;
|
|
40
|
+
o.isSameUser(n) ? P() : (v(), m(o));
|
|
39
41
|
} else
|
|
40
|
-
|
|
41
|
-
},
|
|
42
|
-
if (
|
|
43
|
-
const t =
|
|
44
|
-
|
|
42
|
+
m(o);
|
|
43
|
+
}, m = (o) => {
|
|
44
|
+
if (o.shouldInitAuth()) {
|
|
45
|
+
const t = o.getAuthorizationParams();
|
|
46
|
+
if (t) {
|
|
47
|
+
if (r !== "social" && r !== "oauth2_server" && e.auth?.showOnboarding === !0) {
|
|
48
|
+
k(!1);
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
c(t);
|
|
52
|
+
}
|
|
45
53
|
} else
|
|
46
|
-
|
|
47
|
-
},
|
|
48
|
-
|
|
54
|
+
C();
|
|
55
|
+
}, b = (o) => {
|
|
56
|
+
const n = l().getAuthorizationParams();
|
|
57
|
+
c({ ...n, ...o }), u(!1);
|
|
58
|
+
}, l = () => z.create(r, g, p);
|
|
59
|
+
return /* @__PURE__ */ d(q, { children: w && /* @__PURE__ */ d(
|
|
60
|
+
L,
|
|
61
|
+
{
|
|
62
|
+
pendingAuth: !0,
|
|
63
|
+
onConsentConfirmed: b,
|
|
64
|
+
showTerms: e.auth?.hideCgu !== !0,
|
|
65
|
+
showEmailConsent: e.auth?.showEmailConsent,
|
|
66
|
+
termsUrl: e.provider?.cguUrl || "https://www.logora.com/blog-posts/cgu",
|
|
67
|
+
privacyUrl: e.provider?.privacyUrl || "https://www.logora.com/blog-posts/privacy-policy"
|
|
68
|
+
}
|
|
69
|
+
) });
|
|
49
70
|
};
|
|
50
71
|
export {
|
|
51
|
-
|
|
72
|
+
N as AuthInitializer
|
|
52
73
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { authTokenHandler as
|
|
1
|
+
import { authTokenHandler as E } from "./authTokenHandler.js";
|
|
2
2
|
import { useAuth as w } from "./useAuth.js";
|
|
3
3
|
import { useDataProvider as v } from "../../data/data_provider/useDataProvider.js";
|
|
4
|
-
const
|
|
5
|
-
const { removeToken: a, fetchToken: d } =
|
|
6
|
-
|
|
4
|
+
const A = "logora:emailConsent", L = (c, u, f) => {
|
|
5
|
+
const { removeToken: a, fetchToken: d } = E(
|
|
6
|
+
c,
|
|
7
7
|
u,
|
|
8
8
|
f
|
|
9
9
|
), { setCurrentUser: n, setIsLoggedIn: s, setIsLoggingIn: t, setAuthError: r } = w(), l = v(), h = (e) => {
|
|
@@ -12,23 +12,23 @@ const I = "logora:emailConsent", L = (i, u, f) => {
|
|
|
12
12
|
return;
|
|
13
13
|
}
|
|
14
14
|
d(e).then((o) => {
|
|
15
|
-
|
|
15
|
+
i();
|
|
16
16
|
}).catch((o) => {
|
|
17
17
|
r(o);
|
|
18
18
|
});
|
|
19
19
|
}, g = () => {
|
|
20
|
-
s(!1), t(!1), n({}), a(),
|
|
21
|
-
},
|
|
20
|
+
s(!1), t(!1), n({}), a(), sessionStorage.removeItem(A), p();
|
|
21
|
+
}, i = () => {
|
|
22
22
|
l.getOneWithToken("me", "").then((e) => {
|
|
23
23
|
if (e.data.success) {
|
|
24
24
|
const o = e.data.data.resource;
|
|
25
|
-
n(o), s(!0), t(!1),
|
|
25
|
+
n(o), s(!0), t(!1), m(o);
|
|
26
26
|
} else
|
|
27
27
|
r(!0), s(!1), t(!1), n({}), a();
|
|
28
28
|
}).catch((e) => {
|
|
29
29
|
r(!0), s(!1), t(!1), n({}), a();
|
|
30
30
|
});
|
|
31
|
-
},
|
|
31
|
+
}, m = (e) => {
|
|
32
32
|
typeof window < "u" && window.dispatchEvent(
|
|
33
33
|
new CustomEvent("logora:authentication:success", {
|
|
34
34
|
detail: {
|
|
@@ -36,16 +36,16 @@ const I = "logora:emailConsent", L = (i, u, f) => {
|
|
|
36
36
|
}
|
|
37
37
|
})
|
|
38
38
|
);
|
|
39
|
-
},
|
|
39
|
+
}, p = () => {
|
|
40
40
|
typeof window < "u" && window.dispatchEvent(new CustomEvent("logora:authentication:logout"));
|
|
41
41
|
};
|
|
42
42
|
return {
|
|
43
43
|
loginUser: h,
|
|
44
44
|
logoutUser: g,
|
|
45
|
-
fetchUser:
|
|
45
|
+
fetchUser: i
|
|
46
46
|
};
|
|
47
47
|
};
|
|
48
48
|
export {
|
|
49
|
-
|
|
49
|
+
A as EMAIL_CONSENT_STORAGE_KEY,
|
|
50
50
|
L as useAuthActions
|
|
51
51
|
};
|
|
@@ -1,225 +1,238 @@
|
|
|
1
|
-
import { jsx as a, jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { useIntl as
|
|
1
|
+
import { jsx as a, jsxs as d, Fragment as S } from "react/jsx-runtime";
|
|
2
|
+
import { useState as l } from "react";
|
|
3
|
+
import { useIntl as ee, FormattedMessage as ae } from "react-intl";
|
|
4
4
|
import t from "./UpdateUserInfoModal.module.scss.js";
|
|
5
|
-
import { useAuth as
|
|
6
|
-
import { useDataProvider as
|
|
7
|
-
import { useConfig as
|
|
8
|
-
import { useResponsive as
|
|
9
|
-
import { useFormValidation as
|
|
10
|
-
import { useModal as
|
|
5
|
+
import { useAuth as te } from "../../auth/use_auth/useAuth.js";
|
|
6
|
+
import { useDataProvider as se } from "../../data/data_provider/useDataProvider.js";
|
|
7
|
+
import { useConfig as re } from "../../data/config_provider/useConfig.js";
|
|
8
|
+
import { useResponsive as ie } from "../../hooks/use_responsive/useResponsive.js";
|
|
9
|
+
import { useFormValidation as le } from "../../forms/use_form_validation/useFormValidation.js";
|
|
10
|
+
import { useModal as oe } from "../../dialog/modal/useModal.js";
|
|
11
11
|
import { Modal as ne } from "../../dialog/modal/Modal.js";
|
|
12
|
-
import { Loader as
|
|
13
|
-
import { Icon as oe } from "../../icons/icon/Icon.js";
|
|
14
|
-
import { Button as I } from "../../action/button/Button.js";
|
|
15
|
-
import { TextInput as A } from "../../input/text_input/TextInput.js";
|
|
16
|
-
import { Select as de } from "../../input/select/Select.js";
|
|
17
|
-
import { Toggle as S } from "../../input/toggle/Toggle.js";
|
|
12
|
+
import { Loader as de } from "../../progress/loader/Loader.js";
|
|
18
13
|
import { AvatarSelector as ce } from "../avatar_selector/AvatarSelector.js";
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
14
|
+
import { Icon as me } from "../../icons/icon/Icon.js";
|
|
15
|
+
import { Button as D } from "../../action/button/Button.js";
|
|
16
|
+
import { TextInput as O } from "../../input/text_input/TextInput.js";
|
|
17
|
+
import { Select as ue } from "../../input/select/Select.js";
|
|
18
|
+
import { Toggle as F } from "../../input/toggle/Toggle.js";
|
|
19
|
+
const De = ({
|
|
20
|
+
termsUrl: L,
|
|
21
|
+
privacyUrl: B,
|
|
22
|
+
showEmailConsent: v = !1,
|
|
23
|
+
showTerms: h = !1,
|
|
24
|
+
pendingAuth: n = !1,
|
|
25
|
+
onConsentConfirmed: y = null
|
|
24
26
|
}) => {
|
|
25
|
-
const
|
|
26
|
-
(e) => `${
|
|
27
|
-
), [
|
|
28
|
-
|
|
29
|
-
), [
|
|
30
|
-
|
|
31
|
-
), [
|
|
27
|
+
const o = te(), A = se(), r = ee(), i = re(), $ = [...Array(i.avatars?.maxFileName || 0).keys()].map(
|
|
28
|
+
(e) => `${i.avatars?.baseUrl}/${e + 1}.${i.avatars?.fileExtension}`
|
|
29
|
+
), [m, j] = l(o.currentUser.first_name || ""), [b, R] = l(
|
|
30
|
+
o.currentUser.description || ""
|
|
31
|
+
), [u, q] = l(o.currentUser.last_name || ""), [M, z] = l(o.currentUser.language), [E, N] = l(!1), [x, C] = l(
|
|
32
|
+
o.currentUser.image_url
|
|
33
|
+
), [f, T] = l(null), [k, P] = l(!1), [V, W] = l(!1), { isMobile: I } = ie(), { errors: c, validate: G } = le(), { hideModal: w } = oe(), [p, H] = l(!1), [_, J] = l(!1), K = (e) => {
|
|
32
34
|
const s = new FileReader();
|
|
33
35
|
s.onloadend = () => {
|
|
34
|
-
|
|
36
|
+
C(s.result);
|
|
35
37
|
}, s.readAsDataURL(e);
|
|
36
|
-
},
|
|
38
|
+
}, Q = [
|
|
37
39
|
{ first_name: ["required", null] },
|
|
38
40
|
{ first_name: ["minChar", 2] },
|
|
39
41
|
{ last_name: ["required", null] },
|
|
40
42
|
{ last_name: ["minChar", 2] },
|
|
41
|
-
{ language: ["required", null] },
|
|
42
|
-
...
|
|
43
|
-
],
|
|
43
|
+
...n ? [] : [{ language: ["required", null] }],
|
|
44
|
+
...h ? [{ accepts_terms: ["enforceValue", !0] }] : []
|
|
45
|
+
], X = (e) => {
|
|
44
46
|
e.preventDefault();
|
|
45
47
|
const s = {};
|
|
46
|
-
if (
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
48
|
+
if (m && (s.first_name = m), u && (s.last_name = u), M && (s.language = M), f && k && (s.image = f), f && !k && (s.origin_image_url = f), b && (s.description = b), v && (s.accepts_provider_email = _), h && (s.accepts_terms = p), s.is_onboarded = !0, G(s, Q))
|
|
49
|
+
if (W(!0), n && y)
|
|
50
|
+
y({
|
|
51
|
+
first_name: m,
|
|
52
|
+
last_name: u,
|
|
53
|
+
accepts_terms: p,
|
|
54
|
+
accepts_provider_email: v ? _ : !1,
|
|
55
|
+
is_onboarded: !0
|
|
56
|
+
});
|
|
57
|
+
else {
|
|
58
|
+
const U = new FormData();
|
|
59
|
+
Object.entries(s).forEach(([g, Z]) => {
|
|
60
|
+
U.append(g, Z);
|
|
61
|
+
}), A.update("users", o.currentUser.slug, U).then((g) => {
|
|
62
|
+
g.data.success && o.setCurrentUser(g.data.data.resource), w();
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}, Y = (e) => {
|
|
56
66
|
const s = /^(https?|ftp):\/\/[^\s/$.?#].[^\s]*$/i;
|
|
57
|
-
|
|
67
|
+
T(e), N(!1), s.test(e) ? (C(e), P(!1)) : (P(!0), K(e));
|
|
58
68
|
};
|
|
59
69
|
return /* @__PURE__ */ a(
|
|
60
70
|
ne,
|
|
61
71
|
{
|
|
62
72
|
"data-vid": "update_user_info_modal",
|
|
63
|
-
title:
|
|
73
|
+
title: n ? r.formatMessage({
|
|
74
|
+
id: "modal.update_user_info_modal.complete_registration",
|
|
75
|
+
defaultMessage: "Complete your registration"
|
|
76
|
+
}) : r.formatMessage({
|
|
64
77
|
id: "modal.update_user_info_modal.modal_title",
|
|
65
78
|
defaultMessage: "Update your profile"
|
|
66
79
|
}),
|
|
67
80
|
style: {
|
|
68
|
-
width:
|
|
69
|
-
minWidth:
|
|
81
|
+
width: I ? "unset" : "max-content",
|
|
82
|
+
minWidth: I ? "unset" : "500px",
|
|
70
83
|
maxWidth: "800px"
|
|
71
84
|
},
|
|
72
85
|
showCloseButton: !1,
|
|
73
86
|
disableClickOutside: !0,
|
|
74
|
-
children:
|
|
87
|
+
children: V ? /* @__PURE__ */ a(de, {}) : E && !n ? /* @__PURE__ */ d(S, { children: [
|
|
75
88
|
/* @__PURE__ */ a(
|
|
76
89
|
ce,
|
|
77
90
|
{
|
|
78
|
-
onChooseAvatar:
|
|
79
|
-
avatarUrlList:
|
|
80
|
-
userName:
|
|
81
|
-
allowUserImage:
|
|
91
|
+
onChooseAvatar: Y,
|
|
92
|
+
avatarUrlList: $,
|
|
93
|
+
userName: o.currentUser.full_name,
|
|
94
|
+
allowUserImage: i.avatars?.allowUserImage
|
|
82
95
|
}
|
|
83
96
|
),
|
|
84
97
|
/* @__PURE__ */ a(
|
|
85
98
|
"div",
|
|
86
99
|
{
|
|
87
100
|
className: t.backButton,
|
|
88
|
-
onClick: () =>
|
|
89
|
-
children:
|
|
101
|
+
onClick: () => N(!1),
|
|
102
|
+
children: r.formatMessage({
|
|
90
103
|
id: "user.user_edit.back",
|
|
91
104
|
defaultMessage: "Back"
|
|
92
105
|
})
|
|
93
106
|
}
|
|
94
107
|
)
|
|
95
|
-
] }) : /* @__PURE__ */
|
|
96
|
-
/* @__PURE__ */
|
|
97
|
-
/* @__PURE__ */
|
|
98
|
-
|
|
108
|
+
] }) : /* @__PURE__ */ d(S, { children: [
|
|
109
|
+
/* @__PURE__ */ d("div", { className: t.container, children: [
|
|
110
|
+
/* @__PURE__ */ d("div", { className: t.userImageContainer, children: [
|
|
111
|
+
x ? /* @__PURE__ */ a(
|
|
99
112
|
"img",
|
|
100
113
|
{
|
|
101
114
|
className: t.userPictureUpload,
|
|
102
|
-
src:
|
|
103
|
-
alt:
|
|
115
|
+
src: x,
|
|
116
|
+
alt: r.formatMessage({
|
|
104
117
|
id: "alt.my_profile_picture",
|
|
105
118
|
defaultMessage: "Ma photo de profil"
|
|
106
119
|
})
|
|
107
120
|
}
|
|
108
121
|
) : /* @__PURE__ */ a("div", { className: t.userPictureUpload, children: /* @__PURE__ */ a(
|
|
109
|
-
|
|
122
|
+
me,
|
|
110
123
|
{
|
|
111
124
|
name: "camera",
|
|
112
125
|
height: 20,
|
|
113
126
|
width: 20,
|
|
114
|
-
alt:
|
|
127
|
+
alt: r.formatMessage({
|
|
115
128
|
id: "user.user_edit.profile_picture",
|
|
116
129
|
defaultMessage: "Profile picture"
|
|
117
130
|
})
|
|
118
131
|
}
|
|
119
132
|
) }),
|
|
120
|
-
/* @__PURE__ */ a(
|
|
121
|
-
|
|
133
|
+
!n && /* @__PURE__ */ a(
|
|
134
|
+
D,
|
|
122
135
|
{
|
|
123
136
|
"data-testid": "avatar-button",
|
|
124
137
|
"data-tid": "action_save_profile",
|
|
125
|
-
onClick: () =>
|
|
138
|
+
onClick: () => N(!0),
|
|
126
139
|
style: { whiteSpace: "nowrap" },
|
|
127
|
-
children:
|
|
140
|
+
children: r.formatMessage({
|
|
128
141
|
id: "user.user_edit.avatar",
|
|
129
142
|
defaultMessage: "Select an avatar"
|
|
130
143
|
})
|
|
131
144
|
}
|
|
132
145
|
)
|
|
133
146
|
] }),
|
|
134
|
-
/* @__PURE__ */
|
|
135
|
-
/* @__PURE__ */
|
|
147
|
+
/* @__PURE__ */ d("div", { className: t.inputsContainer, children: [
|
|
148
|
+
/* @__PURE__ */ d("div", { className: t.nameContainer, children: [
|
|
136
149
|
/* @__PURE__ */ a("div", { className: t.updateProfileInput, children: /* @__PURE__ */ a(
|
|
137
|
-
|
|
150
|
+
O,
|
|
138
151
|
{
|
|
139
152
|
type: "text",
|
|
140
153
|
name: "first_name",
|
|
141
|
-
"aria-label":
|
|
154
|
+
"aria-label": r.formatMessage({
|
|
142
155
|
id: "auth.signup_form.first_name.aria_label",
|
|
143
156
|
defaultMessage: "First name"
|
|
144
157
|
}),
|
|
145
|
-
placeholder:
|
|
158
|
+
placeholder: r.formatMessage({
|
|
146
159
|
id: "auth_signup_form_first_name_placeholder",
|
|
147
160
|
defaultMessage: "First name"
|
|
148
161
|
}),
|
|
149
|
-
onChange: (e) =>
|
|
150
|
-
value:
|
|
151
|
-
error: !!
|
|
152
|
-
message:
|
|
162
|
+
onChange: (e) => i.actions?.disableOnboardingNameUpdate === !0 ? null : j(e.target.value),
|
|
163
|
+
value: m,
|
|
164
|
+
error: !!c.first_name,
|
|
165
|
+
message: c.first_name,
|
|
153
166
|
"data-testid": "first-name",
|
|
154
|
-
disabled:
|
|
167
|
+
disabled: i.actions?.disableOnboardingNameUpdate === !0
|
|
155
168
|
}
|
|
156
169
|
) }),
|
|
157
170
|
/* @__PURE__ */ a("div", { className: t.updateProfileInput, children: /* @__PURE__ */ a(
|
|
158
|
-
|
|
171
|
+
O,
|
|
159
172
|
{
|
|
160
173
|
type: "text",
|
|
161
174
|
name: "last_name",
|
|
162
|
-
"aria-label":
|
|
175
|
+
"aria-label": r.formatMessage({
|
|
163
176
|
id: "auth.signup_form.last_name.aria_label",
|
|
164
177
|
defaultMessage: "Last name"
|
|
165
178
|
}),
|
|
166
|
-
placeholder:
|
|
179
|
+
placeholder: r.formatMessage({
|
|
167
180
|
id: "auth_signup_form_last_name_placeholder",
|
|
168
181
|
defaultMessage: "Last name"
|
|
169
182
|
}),
|
|
170
|
-
onChange: (e) =>
|
|
171
|
-
value:
|
|
172
|
-
error: !!
|
|
173
|
-
message:
|
|
183
|
+
onChange: (e) => i.actions?.disableOnboardingNameUpdate === !0 ? null : q(e.target.value),
|
|
184
|
+
value: u,
|
|
185
|
+
error: !!c.last_name,
|
|
186
|
+
message: c.last_name,
|
|
174
187
|
"data-testid": "last-name",
|
|
175
|
-
disabled:
|
|
188
|
+
disabled: i.actions?.disableOnboardingNameUpdate === !0
|
|
176
189
|
}
|
|
177
190
|
) })
|
|
178
191
|
] }),
|
|
179
|
-
|
|
192
|
+
i.actions?.disableNameUpdate == !0 && i.actions?.disableOnboardingNameUpdate != !0 && /* @__PURE__ */ a("div", { className: t.hint, children: r.formatMessage({
|
|
180
193
|
id: "user.user_edit.user_name_hint",
|
|
181
194
|
defaultMessage: "last name"
|
|
182
195
|
}) }),
|
|
183
|
-
|
|
184
|
-
|
|
196
|
+
!n && i.translation?.translationMethods && Object.keys(i.translation.translationMethods).length > 0 && /* @__PURE__ */ a(
|
|
197
|
+
ue,
|
|
185
198
|
{
|
|
186
199
|
selectClassName: t.langSelect,
|
|
187
200
|
options: Object.keys(
|
|
188
|
-
|
|
201
|
+
i.translation.translationMethods
|
|
189
202
|
).map((e) => ({
|
|
190
203
|
name: e,
|
|
191
204
|
value: e,
|
|
192
205
|
text: `${e.toUpperCase()}`
|
|
193
206
|
})),
|
|
194
|
-
defaultOption:
|
|
195
|
-
onChange: (e) =>
|
|
207
|
+
defaultOption: M,
|
|
208
|
+
onChange: (e) => z(e.value)
|
|
196
209
|
}
|
|
197
210
|
),
|
|
198
|
-
/* @__PURE__ */ a("div", { className: t.userDescription, children: /* @__PURE__ */ a(
|
|
211
|
+
!n && /* @__PURE__ */ a("div", { className: t.userDescription, children: /* @__PURE__ */ a(
|
|
199
212
|
"textarea",
|
|
200
213
|
{
|
|
201
214
|
className: t.textArea,
|
|
202
|
-
placeholder:
|
|
215
|
+
placeholder: r.formatMessage({
|
|
203
216
|
id: "user.user_edit.user_description",
|
|
204
217
|
defaultMessage: "Describe yourself in a few words"
|
|
205
218
|
}),
|
|
206
|
-
value:
|
|
207
|
-
onChange: (e) =>
|
|
219
|
+
value: b,
|
|
220
|
+
onChange: (e) => R(e.target.value),
|
|
208
221
|
maxLength: 500,
|
|
209
222
|
"data-testid": "description"
|
|
210
223
|
}
|
|
211
224
|
) })
|
|
212
225
|
] })
|
|
213
226
|
] }),
|
|
214
|
-
|
|
215
|
-
|
|
227
|
+
h && /* @__PURE__ */ a("div", { className: t.toggle, children: /* @__PURE__ */ a(
|
|
228
|
+
F,
|
|
216
229
|
{
|
|
217
230
|
type: "checkbox",
|
|
218
231
|
name: "accepts_terms",
|
|
219
232
|
style: { fontSize: 18 },
|
|
220
|
-
checked:
|
|
233
|
+
checked: p,
|
|
221
234
|
label: /* @__PURE__ */ a(
|
|
222
|
-
|
|
235
|
+
ae,
|
|
223
236
|
{
|
|
224
237
|
id: "modal.update_user_info_modal.accepts_terms",
|
|
225
238
|
defaultMessage: "I declare I have read the <var1>General Conditions of Use</var1> and the <var2>Privacy policy</var2> of the debate space and accept them.",
|
|
@@ -229,7 +242,7 @@ const Ie = ({
|
|
|
229
242
|
{
|
|
230
243
|
className: t.cgu,
|
|
231
244
|
target: "_blank",
|
|
232
|
-
href:
|
|
245
|
+
href: L,
|
|
233
246
|
rel: "noreferrer",
|
|
234
247
|
children: e
|
|
235
248
|
}
|
|
@@ -239,7 +252,7 @@ const Ie = ({
|
|
|
239
252
|
{
|
|
240
253
|
className: t.cgu,
|
|
241
254
|
target: "_blank",
|
|
242
|
-
href:
|
|
255
|
+
href: B,
|
|
243
256
|
rel: "noreferrer",
|
|
244
257
|
children: e
|
|
245
258
|
}
|
|
@@ -247,36 +260,36 @@ const Ie = ({
|
|
|
247
260
|
}
|
|
248
261
|
}
|
|
249
262
|
),
|
|
250
|
-
onInputChanged: (e) =>
|
|
251
|
-
message:
|
|
263
|
+
onInputChanged: (e) => H(!p),
|
|
264
|
+
message: c.accepts_terms,
|
|
252
265
|
"data-testid": "accepts-terms-input"
|
|
253
266
|
}
|
|
254
267
|
) }),
|
|
255
|
-
|
|
256
|
-
|
|
268
|
+
v && /* @__PURE__ */ a("div", { className: t.toggle, children: /* @__PURE__ */ a(
|
|
269
|
+
F,
|
|
257
270
|
{
|
|
258
271
|
type: "checkbox",
|
|
259
272
|
name: "accepts_provider_email",
|
|
260
273
|
style: { fontSize: 18 },
|
|
261
|
-
checked:
|
|
262
|
-
label:
|
|
274
|
+
checked: _,
|
|
275
|
+
label: r.formatMessage(
|
|
263
276
|
{
|
|
264
277
|
id: "modal.update_user_info_modal.consent_label",
|
|
265
278
|
defaultMessage: "I agree to receive emails from the editor"
|
|
266
279
|
},
|
|
267
|
-
{ provider:
|
|
280
|
+
{ provider: i.provider?.companyName }
|
|
268
281
|
),
|
|
269
|
-
onInputChanged: (e) =>
|
|
282
|
+
onInputChanged: (e) => J(!_),
|
|
270
283
|
"data-testid": "accepts-email-input"
|
|
271
284
|
}
|
|
272
285
|
) }),
|
|
273
286
|
/* @__PURE__ */ a("div", { className: t.userSaveBox, children: /* @__PURE__ */ a(
|
|
274
|
-
|
|
287
|
+
D,
|
|
275
288
|
{
|
|
276
289
|
"data-testid": "save-button",
|
|
277
290
|
"data-tid": "action_save_profile",
|
|
278
|
-
onClick: (e) =>
|
|
279
|
-
children:
|
|
291
|
+
onClick: (e) => X(e),
|
|
292
|
+
children: r.formatMessage({
|
|
280
293
|
id: "user.user_edit.save",
|
|
281
294
|
defaultMessage: "Save"
|
|
282
295
|
})
|
|
@@ -287,5 +300,5 @@ const Ie = ({
|
|
|
287
300
|
);
|
|
288
301
|
};
|
|
289
302
|
export {
|
|
290
|
-
|
|
303
|
+
De as UpdateUserInfoModal
|
|
291
304
|
};
|