@bigbinary/neeto-team-members-frontend 5.0.32 → 5.0.34
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/app/javascript/src/translations/ar.json +2 -1
- package/app/javascript/src/translations/bg.json +2 -1
- package/app/javascript/src/translations/ca.json +2 -1
- package/app/javascript/src/translations/cs.json +2 -1
- package/app/javascript/src/translations/da.json +2 -1
- package/app/javascript/src/translations/de.json +2 -1
- package/app/javascript/src/translations/en.json +1 -0
- package/app/javascript/src/translations/es-MX.json +2 -1
- package/app/javascript/src/translations/es.json +2 -1
- package/app/javascript/src/translations/et.json +2 -1
- package/app/javascript/src/translations/fi.json +2 -1
- package/app/javascript/src/translations/fil.json +2 -1
- package/app/javascript/src/translations/fr.json +2 -1
- package/app/javascript/src/translations/he.json +2 -1
- package/app/javascript/src/translations/hi.json +2 -1
- package/app/javascript/src/translations/hr.json +2 -1
- package/app/javascript/src/translations/hu.json +2 -1
- package/app/javascript/src/translations/id.json +2 -1
- package/app/javascript/src/translations/it.json +2 -1
- package/app/javascript/src/translations/ja.json +2 -1
- package/app/javascript/src/translations/ko.json +2 -1
- package/app/javascript/src/translations/nl.json +2 -1
- package/app/javascript/src/translations/pl.json +2 -1
- package/app/javascript/src/translations/pt-BR.json +2 -1
- package/app/javascript/src/translations/pt.json +2 -1
- package/app/javascript/src/translations/ro.json +2 -1
- package/app/javascript/src/translations/ru.json +2 -1
- package/app/javascript/src/translations/sk.json +2 -1
- package/app/javascript/src/translations/sl.json +2 -1
- package/app/javascript/src/translations/sv.json +2 -1
- package/app/javascript/src/translations/th.json +2 -1
- package/app/javascript/src/translations/tr.json +2 -1
- package/app/javascript/src/translations/uk.json +2 -1
- package/app/javascript/src/translations/vi.json +2 -1
- package/app/javascript/src/translations/zh-CN.json +2 -1
- package/app/javascript/src/translations/zh-TW.json +2 -1
- package/dist/.ready +1 -1
- package/dist/{Permissions-3L2jJkiY.js → Permissions-Ds61VDtG.js} +4 -4
- package/dist/Permissions-Ds61VDtG.js.map +1 -0
- package/dist/{Permissions-CpmpfRk1.js → Permissions-rFYQmsMn.js} +4 -4
- package/dist/Permissions-rFYQmsMn.js.map +1 -0
- package/dist/{RolesRadioGroup-fBmS68cW.js → RolesRadioGroup-bXyHmk_Q.js} +35 -38
- package/dist/RolesRadioGroup-bXyHmk_Q.js.map +1 -0
- package/dist/{RolesRadioGroup-tSNC-Wtu.js → RolesRadioGroup-n1NclSyf.js} +35 -38
- package/dist/RolesRadioGroup-n1NclSyf.js.map +1 -0
- package/dist/cjs/v2/Groups.js +1 -1
- package/dist/cjs/v2/Groups.js.map +1 -1
- package/dist/cjs/v2/ManageMember.js +5 -3
- package/dist/cjs/v2/ManageMember.js.map +1 -1
- package/dist/cjs/v2/MembersDropdown.js +1 -1
- package/dist/cjs/v2/MembersInvite.js +1 -1
- package/dist/cjs/v2/MembersInvite.js.map +1 -1
- package/dist/cjs/v2/Permissions.js +1 -1
- package/dist/cjs/v2/Profile.js +189 -202
- package/dist/cjs/v2/Profile.js.map +1 -1
- package/dist/cjs/v2/Roles.js +2 -2
- package/dist/cjs/v2/RolesRadioGroup.js +1 -1
- package/dist/cjs/v2/TeamMembers.js +5 -3
- package/dist/cjs/v2/TeamMembers.js.map +1 -1
- package/dist/cjs/v2/TeamsAndMembersDropdown.js +12 -18
- package/dist/cjs/v2/TeamsAndMembersDropdown.js.map +1 -1
- package/dist/cjs/v2/TeamsDropdown.js +1 -1
- package/dist/{index-SkKQWXyo.js → index-B2PgGcMs.js} +183 -104
- package/dist/index-B2PgGcMs.js.map +1 -0
- package/dist/{index-DCtowiCJ.js → index-BBIYGX2C.js} +183 -104
- package/dist/index-BBIYGX2C.js.map +1 -0
- package/dist/{index-DqqXniGT.js → index-BaW7CGuF.js} +3 -3
- package/dist/index-BaW7CGuF.js.map +1 -0
- package/dist/{index-DeYRFiJy.js → index-C8Aaixo-.js} +3 -3
- package/dist/index-C8Aaixo-.js.map +1 -0
- package/dist/timezone-selector-BGpvIcKU.js +175 -0
- package/dist/timezone-selector-BGpvIcKU.js.map +1 -0
- package/dist/timezone-selector-ojZT6BkF.js +165 -0
- package/dist/timezone-selector-ojZT6BkF.js.map +1 -0
- package/dist/v2/Groups.js +1 -1
- package/dist/v2/Groups.js.map +1 -1
- package/dist/v2/ManageMember.js +5 -3
- package/dist/v2/ManageMember.js.map +1 -1
- package/dist/v2/MembersDropdown.js +1 -1
- package/dist/v2/MembersInvite.js +1 -1
- package/dist/v2/MembersInvite.js.map +1 -1
- package/dist/v2/Permissions.js +1 -1
- package/dist/v2/Profile.js +184 -199
- package/dist/v2/Profile.js.map +1 -1
- package/dist/v2/Roles.js +2 -2
- package/dist/v2/RolesRadioGroup.js +1 -1
- package/dist/v2/TeamMembers.js +5 -3
- package/dist/v2/TeamMembers.js.map +1 -1
- package/dist/v2/TeamsAndMembersDropdown.js +12 -18
- package/dist/v2/TeamsAndMembersDropdown.js.map +1 -1
- package/dist/v2/TeamsDropdown.js +1 -1
- package/package.json +1 -1
- package/dist/Permissions-3L2jJkiY.js.map +0 -1
- package/dist/Permissions-CpmpfRk1.js.map +0 -1
- package/dist/RolesRadioGroup-fBmS68cW.js.map +0 -1
- package/dist/RolesRadioGroup-tSNC-Wtu.js.map +0 -1
- package/dist/index-DCtowiCJ.js.map +0 -1
- package/dist/index-DeYRFiJy.js.map +0 -1
- package/dist/index-DqqXniGT.js.map +0 -1
- package/dist/index-SkKQWXyo.js.map +0 -1
- package/dist/useCountries-CQdvJz0R.js +0 -249
- package/dist/useCountries-CQdvJz0R.js.map +0 -1
- package/dist/useCountries-DePOPtue.js +0 -235
- package/dist/useCountries-DePOPtue.js.map +0 -1
package/dist/cjs/v2/Profile.js
CHANGED
|
@@ -3,13 +3,14 @@
|
|
|
3
3
|
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var neetoAtoms = require('@bigbinary/neeto-atoms');
|
|
6
|
-
var
|
|
6
|
+
var MoreDropdown = require('@bigbinary/neeto-molecules/v2/MoreDropdown');
|
|
7
7
|
var reactI18next = require('react-i18next');
|
|
8
8
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
9
9
|
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
10
10
|
var _asyncToGenerator = require('@babel/runtime/helpers/asyncToGenerator');
|
|
11
11
|
var _regeneratorRuntime = require('@babel/runtime/regenerator');
|
|
12
12
|
var formik = require('@bigbinary/neeto-atoms/formik');
|
|
13
|
+
var Card = require('@bigbinary/neeto-atoms/primitives/Card');
|
|
13
14
|
var neetoTimeZones = require('@bigbinary/neeto-time-zones');
|
|
14
15
|
var neetoCist = require('@bigbinary/neeto-cist');
|
|
15
16
|
var constants$1 = require('@bigbinary/neeto-commons-frontend/constants');
|
|
@@ -23,14 +24,17 @@ require('formik');
|
|
|
23
24
|
var jsxRuntime = require('react/jsx-runtime');
|
|
24
25
|
var reactQuery = require('@tanstack/react-query');
|
|
25
26
|
var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
|
|
26
|
-
var
|
|
27
|
+
var timezoneSelector = require('../../timezone-selector-BGpvIcKU.js');
|
|
27
28
|
var i18next = require('i18next');
|
|
28
29
|
var initializers = require('@bigbinary/neeto-commons-frontend/initializers');
|
|
29
30
|
var yup = require('yup');
|
|
30
31
|
var withImmutableActions = require('@bigbinary/neeto-commons-frontend/react-utils/withImmutableActions');
|
|
31
32
|
var zustand = require('zustand');
|
|
32
33
|
var shallow = require('zustand/shallow');
|
|
34
|
+
var lucideReact = require('lucide-react');
|
|
35
|
+
var CopyToClipboardButton = require('@bigbinary/neeto-molecules/v2/CopyToClipboardButton');
|
|
33
36
|
require('axios');
|
|
37
|
+
require('../../inject-css-B6qYtOJe.js');
|
|
34
38
|
|
|
35
39
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
36
40
|
|
|
@@ -53,24 +57,26 @@ function _interopNamespace(e) {
|
|
|
53
57
|
}
|
|
54
58
|
|
|
55
59
|
var _slicedToArray__default = /*#__PURE__*/_interopDefault(_slicedToArray);
|
|
60
|
+
var MoreDropdown__default = /*#__PURE__*/_interopDefault(MoreDropdown);
|
|
56
61
|
var _defineProperty__default = /*#__PURE__*/_interopDefault(_defineProperty);
|
|
57
62
|
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefault(_objectWithoutProperties);
|
|
58
63
|
var _asyncToGenerator__default = /*#__PURE__*/_interopDefault(_asyncToGenerator);
|
|
59
64
|
var _regeneratorRuntime__default = /*#__PURE__*/_interopDefault(_regeneratorRuntime);
|
|
60
65
|
var yup__namespace = /*#__PURE__*/_interopNamespace(yup);
|
|
61
66
|
var withImmutableActions__default = /*#__PURE__*/_interopDefault(withImmutableActions);
|
|
67
|
+
var CopyToClipboardButton__default = /*#__PURE__*/_interopDefault(CopyToClipboardButton);
|
|
62
68
|
|
|
63
69
|
function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
64
70
|
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), true).forEach(function (r) { _defineProperty__default.default(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
65
71
|
var useFetchProfile = function useFetchProfile(options) {
|
|
66
72
|
return reactQuery.useQuery(_objectSpread$1({
|
|
67
73
|
queryKey: [constants.QUERY_KEYS.USER_PROFILE],
|
|
68
|
-
queryFn:
|
|
74
|
+
queryFn: timezoneSelector.profileApi.fetchUserDetails,
|
|
69
75
|
staleTime: constants$1.DEFAULT_STALE_TIME
|
|
70
76
|
}, options));
|
|
71
77
|
};
|
|
72
78
|
var useUpdateProfileMutation = function useUpdateProfileMutation(options) {
|
|
73
|
-
return reactUtils.useMutationWithInvalidation(
|
|
79
|
+
return reactUtils.useMutationWithInvalidation(timezoneSelector.profileApi.updateUser, _objectSpread$1(_objectSpread$1({
|
|
74
80
|
keysToInvalidate: [[constants.QUERY_KEYS.USER_PROFILE]]
|
|
75
81
|
}, options), {}, {
|
|
76
82
|
onSuccess: function onSuccess() {
|
|
@@ -146,7 +152,7 @@ var ChangeProfile = function ChangeProfile(_ref) {
|
|
|
146
152
|
language = _user$language === void 0 ? "" : _user$language;
|
|
147
153
|
var isTimezoneFieldDisabled = !isOwner && !timezoneChangeEnabled;
|
|
148
154
|
var setFieldValueRef = React.useRef(null);
|
|
149
|
-
var _useCountries =
|
|
155
|
+
var _useCountries = timezoneSelector.useCountries(),
|
|
150
156
|
countryDropdownOptions = _useCountries.countryDropdownOptions,
|
|
151
157
|
selectedCountryOption = _useCountries.selectedCountryOption,
|
|
152
158
|
isFetchingCountriesList = _useCountries.isFetchingCountriesList,
|
|
@@ -259,6 +265,7 @@ var ChangeProfile = function ChangeProfile(_ref) {
|
|
|
259
265
|
});
|
|
260
266
|
}
|
|
261
267
|
return /*#__PURE__*/jsxRuntime.jsx(Select.FormikForm, {
|
|
268
|
+
className: "flex flex-col h-full flex-1 overflow-y-auto",
|
|
262
269
|
formProps: {
|
|
263
270
|
"data-testid": "ntm-profile-form"
|
|
264
271
|
},
|
|
@@ -273,12 +280,19 @@ var ChangeProfile = function ChangeProfile(_ref) {
|
|
|
273
280
|
touched = _ref4.touched;
|
|
274
281
|
setFieldValueRef.current = setFieldValue;
|
|
275
282
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
276
|
-
children: [/*#__PURE__*/jsxRuntime.
|
|
277
|
-
className: "w-full flex-1 overflow-y-auto p-4",
|
|
278
|
-
children: /*#__PURE__*/jsxRuntime.
|
|
279
|
-
className: "w-full
|
|
280
|
-
|
|
281
|
-
|
|
283
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs(neetoAtoms.Sheet.Body, {
|
|
284
|
+
className: "flex min-h-0 w-full flex-1 flex-col gap-2 overflow-y-auto p-4",
|
|
285
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Card.Card, {
|
|
286
|
+
className: "w-full shrink-0 ring-0",
|
|
287
|
+
size: "sm",
|
|
288
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Card.CardContent, {
|
|
289
|
+
children: /*#__PURE__*/jsxRuntime.jsx(timezoneSelector.ProfileImage, {})
|
|
290
|
+
})
|
|
291
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Card.Card, {
|
|
292
|
+
className: "w-full shrink-0 ring-0",
|
|
293
|
+
size: "sm",
|
|
294
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(Card.CardContent, {
|
|
295
|
+
className: "space-y-6",
|
|
282
296
|
children: [/*#__PURE__*/jsxRuntime.jsx(formik.Input, {
|
|
283
297
|
autoFocus: true,
|
|
284
298
|
required: true,
|
|
@@ -294,51 +308,42 @@ var ChangeProfile = function ChangeProfile(_ref) {
|
|
|
294
308
|
name: "lastName",
|
|
295
309
|
type: "text",
|
|
296
310
|
placeholder: t("neetoTeamMembers.profile.inputs.placeholder.lastName")
|
|
297
|
-
})
|
|
298
|
-
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
299
|
-
className: "mt-4 w-full space-y-4 border-t border-border pt-4",
|
|
300
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(Select.FormikSelect, {
|
|
311
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Select.FormikSelect, {
|
|
301
312
|
required: true,
|
|
302
313
|
"data-testid": "ntm-profile-country-select",
|
|
303
314
|
label: t("neetoTeamMembers.profile.inputs.label.country"),
|
|
304
315
|
name: "countryId",
|
|
305
316
|
options: countryDropdownOptions,
|
|
306
317
|
value: selectedCountryOption,
|
|
307
|
-
onChange: function onChange(
|
|
318
|
+
onChange: function onChange(value) {
|
|
319
|
+
var option = neetoCist.findBy({
|
|
320
|
+
value: value
|
|
321
|
+
}, countryDropdownOptions);
|
|
308
322
|
var dependentFields = handleCountryChange(option);
|
|
309
323
|
setFieldValue("dateFormat", dependentFields === null || dependentFields === void 0 ? void 0 : dependentFields.dateFormat);
|
|
310
|
-
setFieldValue("countryId", option === null || option === void 0 ? void 0 : option.value);
|
|
311
324
|
}
|
|
312
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
options: constants$1.LANGUAGE_OPTIONS,
|
|
319
|
-
label: t("neetoTeamMembers.profile.inputs.label.language"),
|
|
320
|
-
onChange: function onChange(option) {
|
|
321
|
-
setFieldValue("language", option.value);
|
|
322
|
-
}
|
|
323
|
-
})
|
|
325
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Select.FormikSelect, {
|
|
326
|
+
required: true,
|
|
327
|
+
"data-testid": "ntm-language-select",
|
|
328
|
+
label: t("neetoTeamMembers.profile.inputs.label.language"),
|
|
329
|
+
name: "language",
|
|
330
|
+
options: constants$1.LANGUAGE_OPTIONS
|
|
324
331
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
325
332
|
className: "space-y-2",
|
|
326
|
-
children: [/*#__PURE__*/jsxRuntime.jsxs(
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
children:
|
|
330
|
-
className: "text-destructive",
|
|
331
|
-
children: " *"
|
|
332
|
-
})]
|
|
333
|
-
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
334
|
-
"data-testid": "ntm-profile-time-zone-select",
|
|
335
|
-
ref: timezoneRef,
|
|
336
|
-
className: neetoAtoms.cn("w-full grow", {
|
|
337
|
-
"pointer-events-none bg-muted": isTimezoneFieldDisabled
|
|
338
|
-
})
|
|
333
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs(neetoAtoms.Label, {
|
|
334
|
+
children: [t("neetoTeamMembers.profile.inputs.label.timeZone"), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
335
|
+
className: "text-destructive",
|
|
336
|
+
children: " *"
|
|
339
337
|
})]
|
|
338
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
339
|
+
"data-testid": "ntm-profile-time-zone-select",
|
|
340
|
+
ref: timezoneRef,
|
|
341
|
+
className: neetoAtoms.cn("w-full grow", {
|
|
342
|
+
"pointer-events-none bg-muted": isTimezoneFieldDisabled
|
|
343
|
+
})
|
|
340
344
|
}), touched.timeZone && errors.timeZone && /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
|
|
341
|
-
className: "text-
|
|
345
|
+
className: "text-destructive",
|
|
346
|
+
variant: "caption",
|
|
342
347
|
children: errors.timeZone
|
|
343
348
|
})]
|
|
344
349
|
}), /*#__PURE__*/jsxRuntime.jsx(Select.FormikSelect, {
|
|
@@ -346,27 +351,18 @@ var ChangeProfile = function ChangeProfile(_ref) {
|
|
|
346
351
|
"data-testid": "ntm-time-format-select",
|
|
347
352
|
name: "timeFormat",
|
|
348
353
|
options: constants.TIME_FORMAT_OPTIONS,
|
|
349
|
-
label: t("neetoTeamMembers.profile.inputs.label.preferredTimeFormat")
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
required: true,
|
|
357
|
-
"data-testid": "ntm-date-format-select",
|
|
358
|
-
name: "dateFormat",
|
|
359
|
-
options: constants.DATE_FORMAT_OPTIONS,
|
|
360
|
-
label: t("neetoTeamMembers.profile.inputs.label.preferredDateFormat"),
|
|
361
|
-
onChange: function onChange(option) {
|
|
362
|
-
setFieldValue("dateFormat", option.value);
|
|
363
|
-
}
|
|
364
|
-
})
|
|
354
|
+
label: t("neetoTeamMembers.profile.inputs.label.preferredTimeFormat")
|
|
355
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Select.FormikSelect, {
|
|
356
|
+
required: true,
|
|
357
|
+
"data-testid": "ntm-date-format-select",
|
|
358
|
+
name: "dateFormat",
|
|
359
|
+
options: constants.DATE_FORMAT_OPTIONS,
|
|
360
|
+
label: t("neetoTeamMembers.profile.inputs.label.preferredDateFormat")
|
|
365
361
|
})]
|
|
366
|
-
})
|
|
367
|
-
})
|
|
368
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
369
|
-
className: "border-t border-border
|
|
362
|
+
})
|
|
363
|
+
})]
|
|
364
|
+
}), /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Sheet.Footer, {
|
|
365
|
+
className: "border-t border-border",
|
|
370
366
|
children: /*#__PURE__*/jsxRuntime.jsx(ActionBlock.FormikActionBlock, {
|
|
371
367
|
isSubmitting: isUpdatingProfile || isUploading,
|
|
372
368
|
cancelButtonProps: {
|
|
@@ -414,6 +410,24 @@ var sanitizeValue = function sanitizeValue(value, defaultValue) {
|
|
|
414
410
|
return ramda.isNil(value) || ramda.is(String, value) && ramda.trim(value) === "" ? defaultValue : value;
|
|
415
411
|
};
|
|
416
412
|
|
|
413
|
+
var Field = function Field(_ref) {
|
|
414
|
+
var label = _ref.label,
|
|
415
|
+
children = _ref.children,
|
|
416
|
+
testId = _ref.testId;
|
|
417
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
418
|
+
className: "flex flex-col gap-1 py-3 first:pt-0 last:pb-0",
|
|
419
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
|
|
420
|
+
color: "muted",
|
|
421
|
+
variant: "caption",
|
|
422
|
+
weight: "medium",
|
|
423
|
+
children: label
|
|
424
|
+
}), /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
|
|
425
|
+
"data-testid": testId,
|
|
426
|
+
variant: "body2",
|
|
427
|
+
children: children
|
|
428
|
+
})]
|
|
429
|
+
});
|
|
430
|
+
};
|
|
417
431
|
var Preview = function Preview() {
|
|
418
432
|
var _globalProps$user, _Intl$DateTimeFormat$, _findBy2, _findBy3, _findBy4;
|
|
419
433
|
var _useTranslation = reactI18next.useTranslation(),
|
|
@@ -465,12 +479,12 @@ var Preview = function Preview() {
|
|
|
465
479
|
children: /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Spinner, {})
|
|
466
480
|
});
|
|
467
481
|
}
|
|
468
|
-
return /*#__PURE__*/jsxRuntime.
|
|
469
|
-
className: "w-full flex-1 overflow-y-auto
|
|
470
|
-
children: /*#__PURE__*/jsxRuntime.
|
|
471
|
-
className: "
|
|
472
|
-
|
|
473
|
-
|
|
482
|
+
return /*#__PURE__*/jsxRuntime.jsxs(neetoAtoms.Sheet.Body, {
|
|
483
|
+
className: "flex min-h-0 w-full flex-1 flex-col gap-2 overflow-y-auto p-4",
|
|
484
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Card.Card, {
|
|
485
|
+
className: "w-full shrink-0 ring-0",
|
|
486
|
+
size: "sm",
|
|
487
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Card.CardContent, {
|
|
474
488
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
475
489
|
className: "flex items-center gap-3",
|
|
476
490
|
children: [/*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Avatar, {
|
|
@@ -482,16 +496,17 @@ var Preview = function Preview() {
|
|
|
482
496
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
483
497
|
className: "flex flex-col",
|
|
484
498
|
children: [/*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
|
|
485
|
-
className: "text-base font-semibold",
|
|
486
499
|
"data-testid": "profile-full-name-field",
|
|
500
|
+
variant: "h4",
|
|
487
501
|
children: name
|
|
488
502
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
489
503
|
className: "flex items-center gap-1",
|
|
490
504
|
children: [/*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
|
|
491
|
-
|
|
505
|
+
color: "muted",
|
|
492
506
|
"data-testid": "profile-email-field",
|
|
507
|
+
variant: "body3",
|
|
493
508
|
children: email
|
|
494
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
509
|
+
}), /*#__PURE__*/jsxRuntime.jsx(CopyToClipboardButton__default.default, {
|
|
495
510
|
size: "icon-xs",
|
|
496
511
|
value: email,
|
|
497
512
|
variant: "ghost"
|
|
@@ -499,102 +514,69 @@ var Preview = function Preview() {
|
|
|
499
514
|
})]
|
|
500
515
|
})]
|
|
501
516
|
})
|
|
502
|
-
})
|
|
503
|
-
|
|
517
|
+
})
|
|
518
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Card.Card, {
|
|
519
|
+
className: "w-full shrink-0 ring-0",
|
|
520
|
+
size: "sm",
|
|
521
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(Card.CardContent, {
|
|
522
|
+
className: "divide-y divide-border",
|
|
523
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Field, {
|
|
524
|
+
label: t("neetoTeamMembers.labels.firstName"),
|
|
525
|
+
testId: "profile-first-name-field",
|
|
526
|
+
children: firstName
|
|
527
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Field, {
|
|
528
|
+
label: t("neetoTeamMembers.labels.lastName"),
|
|
529
|
+
testId: "profile-last-name-field",
|
|
530
|
+
children: lastName
|
|
531
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Field, {
|
|
532
|
+
label: t("neetoTeamMembers.labels.country"),
|
|
533
|
+
testId: "profile-country-field",
|
|
534
|
+
children: countryName
|
|
535
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Field, {
|
|
536
|
+
label: t("neetoTeamMembers.labels.language"),
|
|
537
|
+
testId: "profile-preferred-language-field",
|
|
538
|
+
children: ((_findBy2 = neetoCist._findBy({
|
|
539
|
+
value: language
|
|
540
|
+
}, constants$1.LANGUAGE_OPTIONS)) === null || _findBy2 === void 0 ? void 0 : _findBy2.label) || "-"
|
|
541
|
+
}), /*#__PURE__*/jsxRuntime.jsxs(Field, {
|
|
542
|
+
label: t("neetoTeamMembers.labels.timeZone"),
|
|
543
|
+
testId: "profile-time-zone-field",
|
|
544
|
+
children: [neetoTimeZones.ianaTimezoneToHumanReadable(timeZone), timeZoneAbbreviation ? " (".concat(timeZoneAbbreviation, ")") : "", " ", time]
|
|
545
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Field, {
|
|
546
|
+
label: t("neetoTeamMembers.labels.preferredTimeFormat"),
|
|
547
|
+
testId: "profile-preferred-time-format-field",
|
|
548
|
+
children: ((_findBy3 = neetoCist._findBy({
|
|
549
|
+
value: timeFormat
|
|
550
|
+
}, constants.TIME_FORMAT_OPTIONS)) === null || _findBy3 === void 0 ? void 0 : _findBy3.label) || "-"
|
|
551
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Field, {
|
|
552
|
+
label: t("neetoTeamMembers.labels.preferredDateFormat"),
|
|
553
|
+
testId: "profile-preferred-date-format-field",
|
|
554
|
+
children: ((_findBy4 = neetoCist._findBy({
|
|
555
|
+
value: dateFormat
|
|
556
|
+
}, constants.DATE_FORMAT_OPTIONS)) === null || _findBy4 === void 0 ? void 0 : _findBy4.label) || "-"
|
|
557
|
+
})]
|
|
558
|
+
})
|
|
559
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Card.Card, {
|
|
560
|
+
className: "w-full shrink-0 ring-0",
|
|
561
|
+
size: "sm",
|
|
562
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(Card.CardContent, {
|
|
563
|
+
className: "grid grid-cols-[1fr_auto] items-center gap-2",
|
|
504
564
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
505
|
-
className: "flex flex-col gap-1
|
|
565
|
+
className: "flex flex-col gap-1",
|
|
506
566
|
children: [/*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
|
|
507
|
-
|
|
508
|
-
|
|
567
|
+
color: "muted",
|
|
568
|
+
variant: "caption",
|
|
569
|
+
weight: "medium",
|
|
570
|
+
children: t("neetoTeamMembers.labels.currentPlan")
|
|
509
571
|
}), /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
children:
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
className: "flex flex-col gap-1 py-3",
|
|
516
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
|
|
517
|
-
className: "text-xs font-medium text-muted-foreground",
|
|
518
|
-
children: t("neetoTeamMembers.labels.lastName")
|
|
519
|
-
}), /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
|
|
520
|
-
className: "text-[15px] text-foreground",
|
|
521
|
-
"data-testid": "profile-last-name-field",
|
|
522
|
-
children: lastName
|
|
523
|
-
})]
|
|
524
|
-
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
525
|
-
className: "flex flex-col gap-1 py-3",
|
|
526
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
|
|
527
|
-
className: "text-xs font-medium text-muted-foreground",
|
|
528
|
-
children: t("neetoTeamMembers.labels.country")
|
|
529
|
-
}), /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
|
|
530
|
-
className: "text-[15px] text-foreground",
|
|
531
|
-
"data-testid": "profile-country-field",
|
|
532
|
-
children: countryName
|
|
533
|
-
})]
|
|
534
|
-
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
535
|
-
className: "flex flex-col gap-1 py-3",
|
|
536
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
|
|
537
|
-
className: "text-xs font-medium text-muted-foreground",
|
|
538
|
-
children: t("neetoTeamMembers.labels.language")
|
|
539
|
-
}), /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
|
|
540
|
-
className: "text-[15px] text-foreground",
|
|
541
|
-
"data-testid": "profile-preferred-language-field",
|
|
542
|
-
children: ((_findBy2 = neetoCist._findBy({
|
|
543
|
-
value: language
|
|
544
|
-
}, constants$1.LANGUAGE_OPTIONS)) === null || _findBy2 === void 0 ? void 0 : _findBy2.label) || "-"
|
|
545
|
-
})]
|
|
546
|
-
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
547
|
-
className: "flex flex-col gap-1 py-3",
|
|
548
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
|
|
549
|
-
className: "text-xs font-medium text-muted-foreground",
|
|
550
|
-
children: t("neetoTeamMembers.labels.timeZone")
|
|
551
|
-
}), /*#__PURE__*/jsxRuntime.jsxs(neetoAtoms.Typography, {
|
|
552
|
-
className: "text-[15px] text-foreground",
|
|
553
|
-
"data-testid": "profile-time-zone-field",
|
|
554
|
-
children: [neetoTimeZones.ianaTimezoneToHumanReadable(timeZone), timeZoneAbbreviation ? " (".concat(timeZoneAbbreviation, ")") : "", " ", time]
|
|
555
|
-
})]
|
|
556
|
-
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
557
|
-
className: "flex flex-col gap-1 py-3",
|
|
558
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
|
|
559
|
-
className: "text-xs font-medium text-muted-foreground",
|
|
560
|
-
children: t("neetoTeamMembers.labels.preferredTimeFormat")
|
|
561
|
-
}), /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
|
|
562
|
-
className: "text-[15px] text-foreground",
|
|
563
|
-
"data-testid": "profile-preferred-time-format-field",
|
|
564
|
-
children: ((_findBy3 = neetoCist._findBy({
|
|
565
|
-
value: timeFormat
|
|
566
|
-
}, constants.TIME_FORMAT_OPTIONS)) === null || _findBy3 === void 0 ? void 0 : _findBy3.label) || "-"
|
|
567
|
-
})]
|
|
568
|
-
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
569
|
-
className: "flex flex-col gap-1 pt-3",
|
|
570
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
|
|
571
|
-
className: "text-xs font-medium text-muted-foreground",
|
|
572
|
-
children: t("neetoTeamMembers.labels.preferredDateFormat")
|
|
573
|
-
}), /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
|
|
574
|
-
className: "text-[15px] text-foreground",
|
|
575
|
-
"data-testid": "profile-preferred-date-format-field",
|
|
576
|
-
children: ((_findBy4 = neetoCist._findBy({
|
|
577
|
-
value: dateFormat
|
|
578
|
-
}, constants.DATE_FORMAT_OPTIONS)) === null || _findBy4 === void 0 ? void 0 : _findBy4.label) || "-"
|
|
572
|
+
"data-testid": "profile-subscription-type",
|
|
573
|
+
variant: "body2",
|
|
574
|
+
children: t("neetoTeamMembers.common.subscriptionType", {
|
|
575
|
+
subscription: subscription
|
|
576
|
+
})
|
|
579
577
|
})]
|
|
580
|
-
})
|
|
581
|
-
|
|
582
|
-
className: "neeto-ui-rounded-md bg-background p-3",
|
|
583
|
-
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
584
|
-
className: "flex items-center justify-between",
|
|
585
|
-
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
586
|
-
className: "flex flex-col gap-1",
|
|
587
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
|
|
588
|
-
className: "text-xs font-medium text-muted-foreground",
|
|
589
|
-
children: t("neetoTeamMembers.labels.currentPlan")
|
|
590
|
-
}), /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
|
|
591
|
-
className: "text-[15px] text-foreground",
|
|
592
|
-
"data-testid": "profile-subscription-type",
|
|
593
|
-
children: t("neetoTeamMembers.common.subscriptionType", {
|
|
594
|
-
subscription: subscription
|
|
595
|
-
})
|
|
596
|
-
})]
|
|
597
|
-
}), /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Button, {
|
|
578
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Card.CardAction, {
|
|
579
|
+
children: /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Button, {
|
|
598
580
|
asChild: true,
|
|
599
581
|
"data-testid": "profile-upgrade-button",
|
|
600
582
|
size: "sm",
|
|
@@ -604,10 +586,10 @@ var Preview = function Preview() {
|
|
|
604
586
|
className: "size-4"
|
|
605
587
|
}), t("neetoTeamMembers.buttons.upgrade")]
|
|
606
588
|
})
|
|
607
|
-
})
|
|
608
|
-
})
|
|
609
|
-
})
|
|
610
|
-
})
|
|
589
|
+
})
|
|
590
|
+
})]
|
|
591
|
+
})
|
|
592
|
+
})]
|
|
611
593
|
});
|
|
612
594
|
};
|
|
613
595
|
var Preview$1 = /*#__PURE__*/React.memo(Preview);
|
|
@@ -630,47 +612,52 @@ var Profile = function Profile() {
|
|
|
630
612
|
var enableEditMode = function enableEditMode() {
|
|
631
613
|
return setIsEditMode(true);
|
|
632
614
|
};
|
|
615
|
+
var menuItems = [{
|
|
616
|
+
key: "edit-basic-info",
|
|
617
|
+
"data-testid": "edit-basic-info-menu-button",
|
|
618
|
+
label: t("neetoTeamMembers.buttons.editBasicInfo"),
|
|
619
|
+
onClick: enableEditMode
|
|
620
|
+
}, {
|
|
621
|
+
key: "update-email",
|
|
622
|
+
"data-testid": "update-email-menu-button",
|
|
623
|
+
label: t("neetoTeamMembers.buttons.updateEmail"),
|
|
624
|
+
onClick: function onClick() {
|
|
625
|
+
return window.open(MY_PROFILE_PATH, "_self");
|
|
626
|
+
}
|
|
627
|
+
}, {
|
|
628
|
+
key: "manage-billing-subscriptions",
|
|
629
|
+
"data-testid": "manage-billing-subscriptions-menu-button",
|
|
630
|
+
label: t("neetoTeamMembers.buttons.manageBillingAndSubscriptions"),
|
|
631
|
+
onClick: function onClick() {
|
|
632
|
+
return window.open(MY_PROFILE_PATH, "_self");
|
|
633
|
+
}
|
|
634
|
+
}];
|
|
633
635
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
634
636
|
className: "w-full",
|
|
635
637
|
children: /*#__PURE__*/jsxRuntime.jsxs(neetoAtoms.Sheet, {
|
|
636
638
|
isOpen: isOpen,
|
|
637
639
|
onClose: onClose,
|
|
638
|
-
className: "max-w-96 bg-
|
|
639
|
-
children: [/*#__PURE__*/jsxRuntime.
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
className: "text-xl font-semibold",
|
|
640
|
+
className: "ntm-timezone-shadcn-overrides max-w-96 gap-0 bg-sidebar",
|
|
641
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs(neetoAtoms.Sheet.Header, {
|
|
642
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Sheet.Title, {
|
|
643
|
+
asChild: true,
|
|
644
|
+
children: /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
|
|
645
|
+
variant: "h3",
|
|
645
646
|
children: t("neetoTeamMembers.profile.common.myProfile")
|
|
646
|
-
})
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
647
|
+
})
|
|
648
|
+
}), !isEditMode && /*#__PURE__*/jsxRuntime.jsx(MoreDropdown__default.default, {
|
|
649
|
+
menuItems: menuItems,
|
|
650
|
+
isVertical: true,
|
|
651
|
+
dropdownProps: {
|
|
650
652
|
position: "bottom-end",
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
children: /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.DropdownMenu.MenuItem.Button, {
|
|
660
|
-
"data-testid": "update-email-menu-button",
|
|
661
|
-
href: MY_PROFILE_PATH,
|
|
662
|
-
children: t("neetoTeamMembers.buttons.updateEmail")
|
|
663
|
-
})
|
|
664
|
-
}), /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.DropdownMenu.MenuItem, {
|
|
665
|
-
children: /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.DropdownMenu.MenuItem.Button, {
|
|
666
|
-
"data-testid": "manage-billing-subscriptions-menu-button",
|
|
667
|
-
href: MY_PROFILE_PATH,
|
|
668
|
-
children: t("neetoTeamMembers.buttons.manageBillingAndSubscriptions")
|
|
669
|
-
})
|
|
670
|
-
})]
|
|
671
|
-
})
|
|
672
|
-
})]
|
|
673
|
-
})
|
|
653
|
+
strategy: "fixed"
|
|
654
|
+
},
|
|
655
|
+
dropdownButtonProps: {
|
|
656
|
+
"data-testid": "profile-more-dropdown-button",
|
|
657
|
+
size: "icon-sm",
|
|
658
|
+
className: "absolute top-3 end-12"
|
|
659
|
+
}
|
|
660
|
+
})]
|
|
674
661
|
}), isEditMode ? /*#__PURE__*/jsxRuntime.jsx(ChangeProfile, {
|
|
675
662
|
onClose: onClose
|
|
676
663
|
}) : /*#__PURE__*/jsxRuntime.jsx(Preview$1, {})]
|