@bigbinary/neeto-team-members-frontend 4.4.26 → 4.4.27
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/en.json +14 -5
- package/dist/Groups.js +2 -2
- package/dist/ManageMember.js +5 -5
- package/dist/Profile.js +318 -140
- package/dist/Profile.js.map +1 -1
- package/dist/Roles.js +2 -2
- package/dist/{RolesRadioGroup-Cwdovd4_.js → RolesRadioGroup-Bxt7zZkh.js} +2 -2
- package/dist/{RolesRadioGroup-Cwdovd4_.js.map → RolesRadioGroup-Bxt7zZkh.js.map} +1 -1
- package/dist/{RolesRadioGroup-Cj_ehpnj.js → RolesRadioGroup-CGjcYVyV.js} +2 -2
- package/dist/{RolesRadioGroup-Cj_ehpnj.js.map → RolesRadioGroup-CGjcYVyV.js.map} +1 -1
- package/dist/RolesRadioGroup.js +2 -2
- package/dist/TeamMembers.js +5 -5
- package/dist/cjs/Groups.js +2 -2
- package/dist/cjs/ManageMember.js +5 -5
- package/dist/cjs/Profile.js +316 -138
- package/dist/cjs/Profile.js.map +1 -1
- package/dist/cjs/Roles.js +2 -2
- package/dist/cjs/RolesRadioGroup.js +2 -2
- package/dist/cjs/TeamMembers.js +5 -5
- package/dist/cjs/constants.js +1 -1
- package/dist/cjs/hooks.js +3 -3
- package/dist/cjs/index.js +10 -9
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/utils.js +2 -2
- package/dist/{constants-BYGIelYc.js → constants-BdTiHt55.js} +3 -3
- package/dist/{constants-BYGIelYc.js.map → constants-BdTiHt55.js.map} +1 -1
- package/dist/{constants-CmhmtttG.js → constants-CVJk8LWV.js} +3 -3
- package/dist/{constants-CmhmtttG.js.map → constants-CVJk8LWV.js.map} +1 -1
- package/dist/constants.js +1 -1
- package/dist/hooks.js +3 -3
- package/dist/{index-DIett4kG.js → index-CKp_a6SU.js} +4 -4
- package/dist/{index-DIett4kG.js.map → index-CKp_a6SU.js.map} +1 -1
- package/dist/{index-C54nXmSx.js → index-CWyeI4Kz.js} +2 -2
- package/dist/{index-C54nXmSx.js.map → index-CWyeI4Kz.js.map} +1 -1
- package/dist/{index-C3B4Tkzb.js → index-Dvjcz-b3.js} +2 -2
- package/dist/{index-C3B4Tkzb.js.map → index-Dvjcz-b3.js.map} +1 -1
- package/dist/{index-BzXDzsrQ.js → index-yFl2aYDN.js} +4 -4
- package/dist/{index-BzXDzsrQ.js.map → index-yFl2aYDN.js.map} +1 -1
- package/dist/index.js +10 -9
- package/dist/index.js.map +1 -1
- package/dist/{useMembersSidenav-Cr62csJp.js → useMembersSidenav-DZL248nl.js} +2 -2
- package/dist/{useMembersSidenav-Cr62csJp.js.map → useMembersSidenav-DZL248nl.js.map} +1 -1
- package/dist/{useMembersSidenav-DF1oXHi4.js → useMembersSidenav-DoqlX-eu.js} +2 -2
- package/dist/{useMembersSidenav-DF1oXHi4.js.map → useMembersSidenav-DoqlX-eu.js.map} +1 -1
- package/dist/{useTeamsApi-BC2K4Ol1.js → useTeamsApi-DMq-AW7A.js} +2 -2
- package/dist/{useTeamsApi-BC2K4Ol1.js.map → useTeamsApi-DMq-AW7A.js.map} +1 -1
- package/dist/{useTeamsApi-1Zy6Vd6v.js → useTeamsApi-DReZnkbo.js} +2 -2
- package/dist/{useTeamsApi-1Zy6Vd6v.js.map → useTeamsApi-DReZnkbo.js.map} +1 -1
- package/dist/utils.js +2 -2
- package/package.json +1 -1
package/dist/TeamMembers.js
CHANGED
|
@@ -18,11 +18,11 @@ import { mergeLeft, isNil, assoc, pluck, filter, includes, trim, toLower, revers
|
|
|
18
18
|
import { useTranslation, Trans } from 'react-i18next';
|
|
19
19
|
import { useHistory } from 'react-router-dom';
|
|
20
20
|
import { w as withReactQuery } from './withReactQuery-CHybbL5V.js';
|
|
21
|
-
import { u as useFetchRoles } from './index-
|
|
22
|
-
import { e as useFetchFilterOptions, f as useBulkUpdateMembers, u as useFetchMembers, d as useUpdateMember } from './useTeamsApi-
|
|
21
|
+
import { u as useFetchRoles } from './index-Dvjcz-b3.js';
|
|
22
|
+
import { e as useFetchFilterOptions, f as useBulkUpdateMembers, u as useFetchMembers, d as useUpdateMember } from './useTeamsApi-DReZnkbo.js';
|
|
23
23
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
24
24
|
import { buildFiltersFromURL } from '@bigbinary/neeto-filters-frontend/utils';
|
|
25
|
-
import { d as defaultNeetoFiltersColumns, D as DEFAULT_FILTER_VALUES, b as buildFilterColumns, a as DEFAULT_IS_OPEN_VALUES, c as DEFAULT_SELECTED_ROWS, h as handlePageChange, T as TEAM_MEMBERS_HIDDEN_COLUMNS, g as getFilteredRoles, e as getColumnData, f as generateNoDataContent, i as DEFAULT_RADIX, r as renderPaginationProps, M as ManageMember, j as renderUpdateAlert } from './index-
|
|
25
|
+
import { d as defaultNeetoFiltersColumns, D as DEFAULT_FILTER_VALUES, b as buildFilterColumns, a as DEFAULT_IS_OPEN_VALUES, c as DEFAULT_SELECTED_ROWS, h as handlePageChange, T as TEAM_MEMBERS_HIDDEN_COLUMNS, g as getFilteredRoles, e as getColumnData, f as generateNoDataContent, i as DEFAULT_RADIX, r as renderPaginationProps, M as ManageMember, j as renderUpdateAlert } from './index-CKp_a6SU.js';
|
|
26
26
|
import { n } from './inject-css-DmrvuTKK.js';
|
|
27
27
|
import { noop, isNotEmpty, hyphenate, findBy } from '@bigbinary/neeto-cist';
|
|
28
28
|
import Button from '@bigbinary/neetoui/Button';
|
|
@@ -39,7 +39,7 @@ import '@tanstack/react-query';
|
|
|
39
39
|
import './queryClient-Dsu-gu4Y.js';
|
|
40
40
|
import '@babel/runtime/helpers/objectWithoutProperties';
|
|
41
41
|
import 'axios';
|
|
42
|
-
import './constants-
|
|
42
|
+
import './constants-BdTiHt55.js';
|
|
43
43
|
import 'formik';
|
|
44
44
|
import 'qs';
|
|
45
45
|
import 'classnames';
|
|
@@ -52,7 +52,7 @@ import '@bigbinary/neetoui/formik/Form';
|
|
|
52
52
|
import '@bigbinary/neetoui/Checkbox';
|
|
53
53
|
import '@bigbinary/neetoui/formik/Select';
|
|
54
54
|
import '@bigbinary/neetoui/formik/Switch';
|
|
55
|
-
import './RolesRadioGroup-
|
|
55
|
+
import './RolesRadioGroup-Bxt7zZkh.js';
|
|
56
56
|
import '@bigbinary/neetoui/Label';
|
|
57
57
|
import '@bigbinary/neetoui/formik/Radio';
|
|
58
58
|
import 'yup';
|
package/dist/cjs/Groups.js
CHANGED
|
@@ -13,7 +13,7 @@ var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
|
|
|
13
13
|
var reactQuery = require('@tanstack/react-query');
|
|
14
14
|
var ramda = require('ramda');
|
|
15
15
|
var axios = require('axios');
|
|
16
|
-
var constants = require('../constants-
|
|
16
|
+
var constants = require('../constants-CVJk8LWV.js');
|
|
17
17
|
var Pane = require('@bigbinary/neetoui/Pane');
|
|
18
18
|
var Typography = require('@bigbinary/neetoui/Typography');
|
|
19
19
|
var utils = require('@bigbinary/neeto-commons-frontend/utils');
|
|
@@ -39,7 +39,7 @@ var Tooltip = require('@bigbinary/neetoui/Tooltip');
|
|
|
39
39
|
var utils$1 = require('./utils.js');
|
|
40
40
|
require('@bigbinary/neeto-commons-frontend/constants');
|
|
41
41
|
require('../_commonjsHelpers-BJu3ubxk.js');
|
|
42
|
-
require('../useTeamsApi-
|
|
42
|
+
require('../useTeamsApi-DMq-AW7A.js');
|
|
43
43
|
require('@babel/runtime/helpers/objectWithoutProperties');
|
|
44
44
|
require('qs');
|
|
45
45
|
require('../queryClient-4vAFE3bx.js');
|
package/dist/cjs/ManageMember.js
CHANGED
|
@@ -17,17 +17,17 @@ require('@bigbinary/neetoui/formik/ActionBlock');
|
|
|
17
17
|
require('@bigbinary/neetoui/formik/Form');
|
|
18
18
|
require('ramda');
|
|
19
19
|
require('react-i18next');
|
|
20
|
-
require('../index-
|
|
21
|
-
require('../useTeamsApi-
|
|
22
|
-
var ManageMember = require('../index-
|
|
23
|
-
require('../RolesRadioGroup-
|
|
20
|
+
require('../index-CWyeI4Kz.js');
|
|
21
|
+
require('../useTeamsApi-DMq-AW7A.js');
|
|
22
|
+
var ManageMember = require('../index-yFl2aYDN.js');
|
|
23
|
+
require('../RolesRadioGroup-CGjcYVyV.js');
|
|
24
24
|
require('react/jsx-runtime');
|
|
25
25
|
require('@babel/runtime/helpers/objectWithoutProperties');
|
|
26
26
|
require('@tanstack/react-query');
|
|
27
27
|
require('@bigbinary/neeto-cist');
|
|
28
28
|
require('@bigbinary/neeto-commons-frontend/react-utils');
|
|
29
29
|
require('axios');
|
|
30
|
-
require('../constants-
|
|
30
|
+
require('../constants-CVJk8LWV.js');
|
|
31
31
|
require('i18next');
|
|
32
32
|
require('@bigbinary/neeto-commons-frontend/constants');
|
|
33
33
|
require('@babel/runtime/helpers/toConsumableArray');
|
package/dist/cjs/Profile.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
4
|
+
var require$$0 = require('react');
|
|
5
|
+
var MenuHorizontal = require('@bigbinary/neeto-icons/MenuHorizontal');
|
|
6
|
+
var Dropdown = require('@bigbinary/neetoui/Dropdown');
|
|
4
7
|
var Pane = require('@bigbinary/neetoui/Pane');
|
|
5
8
|
var Typography = require('@bigbinary/neetoui/Typography');
|
|
6
9
|
var reactI18next = require('react-i18next');
|
|
@@ -8,14 +11,10 @@ var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
|
8
11
|
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
9
12
|
var _asyncToGenerator = require('@babel/runtime/helpers/asyncToGenerator');
|
|
10
13
|
var _regeneratorRuntime = require('@babel/runtime/regenerator');
|
|
11
|
-
var require$$0 = require('react');
|
|
12
14
|
var hooks = require('@bigbinary/neeto-image-uploader-frontend/hooks');
|
|
13
15
|
var neetoTimeZones = require('@bigbinary/neeto-time-zones');
|
|
14
16
|
var neetoCist = require('@bigbinary/neeto-cist');
|
|
15
|
-
var Button = require('@bigbinary/neetoui/Button');
|
|
16
|
-
var Callout = require('@bigbinary/neetoui/Callout');
|
|
17
17
|
var Label = require('@bigbinary/neetoui/Label');
|
|
18
|
-
var Radio = require('@bigbinary/neetoui/Radio');
|
|
19
18
|
var Spinner = require('@bigbinary/neetoui/Spinner');
|
|
20
19
|
var Toastr = require('@bigbinary/neetoui/Toastr');
|
|
21
20
|
var Input = require('@bigbinary/neetoui/formik/Input');
|
|
@@ -23,7 +22,7 @@ var Select = require('@bigbinary/neetoui/formik/Select');
|
|
|
23
22
|
var Form = require('@bigbinary/neetoui/formik/Form');
|
|
24
23
|
var ActionBlock = require('@bigbinary/neetoui/formik/ActionBlock');
|
|
25
24
|
var ramda = require('ramda');
|
|
26
|
-
var constants = require('../constants-
|
|
25
|
+
var constants = require('../constants-CVJk8LWV.js');
|
|
27
26
|
var reactQuery = require('@tanstack/react-query');
|
|
28
27
|
var constants$1 = require('@bigbinary/neeto-commons-frontend/constants');
|
|
29
28
|
var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
|
|
@@ -32,13 +31,14 @@ var i18next = require('i18next');
|
|
|
32
31
|
var initializers = require('@bigbinary/neeto-commons-frontend/initializers');
|
|
33
32
|
var yup = require('yup');
|
|
34
33
|
var formik = require('formik');
|
|
35
|
-
var
|
|
34
|
+
var Edit = require('@bigbinary/neeto-icons/Edit');
|
|
36
35
|
var Avatar = require('@bigbinary/neetoui/Avatar');
|
|
37
36
|
var jsxRuntime = require('react/jsx-runtime');
|
|
38
37
|
var injectCss = require('../inject-css-vQvjPR2x.js');
|
|
39
38
|
var withImmutableActions = require('@bigbinary/neeto-commons-frontend/react-utils/withImmutableActions');
|
|
40
39
|
var zustand = require('zustand');
|
|
41
40
|
var shallow = require('zustand/shallow');
|
|
41
|
+
var CopyToClipboardButton = require('@bigbinary/neeto-molecules/CopyToClipboardButton');
|
|
42
42
|
|
|
43
43
|
function _interopNamespaceDefault(e) {
|
|
44
44
|
var n = Object.create(null);
|
|
@@ -102,7 +102,6 @@ var PROFILE_VALIDATION_SCHEMA = yup__namespace.object().shape({
|
|
|
102
102
|
});
|
|
103
103
|
var MY_PROFILE_PATH = "/auth/profile/edit";
|
|
104
104
|
var ALLOWED_PROFILE_IMAGE_MIME_TYPES = ["image/jpeg", "image/png"];
|
|
105
|
-
var IMAGE_DELETE_BUTTON_SIZE = 16;
|
|
106
105
|
var STATIC_PROFILE_IMAGE_MAX_SIZE_IN_BYTES = initializers.globalProps.endUserUploadedFileSizeLimitInMb * 1024 * 1024;
|
|
107
106
|
var VALIDATION_ERRORS = {
|
|
108
107
|
invalid_type: i18next.t("neetoTeamMembers.profile.file.invalidType.image"),
|
|
@@ -157,9 +156,12 @@ var useCountries = function useCountries() {
|
|
|
157
156
|
};
|
|
158
157
|
};
|
|
159
158
|
|
|
159
|
+
var Menu$1 = Dropdown.Menu,
|
|
160
|
+
MenuItem$1 = Dropdown.MenuItem;
|
|
160
161
|
var ProfileImage = function ProfileImage() {
|
|
161
162
|
var _useTranslation = reactI18next.useTranslation(),
|
|
162
163
|
t = _useTranslation.t;
|
|
164
|
+
var fileInputRef = require$$0.useRef(null);
|
|
163
165
|
var _useField = formik.useField("avatar"),
|
|
164
166
|
_useField2 = _slicedToArray(_useField, 3),
|
|
165
167
|
field = _useField2[0];
|
|
@@ -181,6 +183,10 @@ var ProfileImage = function ProfileImage() {
|
|
|
181
183
|
file: imageFile
|
|
182
184
|
});
|
|
183
185
|
};
|
|
186
|
+
var handleChangeImage = function handleChangeImage() {
|
|
187
|
+
var _fileInputRef$current;
|
|
188
|
+
return (_fileInputRef$current = fileInputRef.current) === null || _fileInputRef$current === void 0 ? void 0 : _fileInputRef$current.click();
|
|
189
|
+
};
|
|
184
190
|
var handleRemoveImage = function handleRemoveImage() {
|
|
185
191
|
return setValue({
|
|
186
192
|
imageUrl: "",
|
|
@@ -200,17 +206,30 @@ var ProfileImage = function ProfileImage() {
|
|
|
200
206
|
return null;
|
|
201
207
|
};
|
|
202
208
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
203
|
-
className: "mb-
|
|
209
|
+
className: "mb-4 flex flex-col items-center gap-2",
|
|
204
210
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
205
|
-
className: "flex-shrink-0",
|
|
206
|
-
children: [
|
|
207
|
-
className: "
|
|
208
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
211
|
+
className: "relative flex-shrink-0",
|
|
212
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
213
|
+
className: "absolute bottom-0 right-0 z-10",
|
|
214
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Dropdown
|
|
215
|
+
// eslint-disable-next-line @bigbinary/neeto/use-neetoui-classes
|
|
216
|
+
, {
|
|
217
|
+
buttonProps: {
|
|
218
|
+
className: "rounded-full"
|
|
219
|
+
},
|
|
220
|
+
buttonSize: "small",
|
|
221
|
+
buttonStyle: "tertiary",
|
|
222
|
+
icon: Edit,
|
|
223
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(Menu$1, {
|
|
224
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(MenuItem$1.Button, {
|
|
225
|
+
"data-cy": "profile-image-upload-button",
|
|
226
|
+
onClick: handleChangeImage,
|
|
227
|
+
children: avatarDetails !== null && avatarDetails !== void 0 && avatarDetails.imageUrl ? t("neetoTeamMembers.profile.avatar.changeProfilePicture") : t("neetoTeamMembers.profile.avatar.uploadProfilePicture")
|
|
228
|
+
}), /*#__PURE__*/jsxRuntime.jsx(MenuItem$1.Button, {
|
|
229
|
+
"data-cy": "profile-image-remove-button",
|
|
230
|
+
onClick: handleRemoveImage,
|
|
231
|
+
children: t("neetoTeamMembers.buttons.remove")
|
|
232
|
+
})]
|
|
214
233
|
})
|
|
215
234
|
})
|
|
216
235
|
}), /*#__PURE__*/jsxRuntime.jsx(Avatar, {
|
|
@@ -218,40 +237,26 @@ var ProfileImage = function ProfileImage() {
|
|
|
218
237
|
user: avatarDetails
|
|
219
238
|
})]
|
|
220
239
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
221
|
-
className: "
|
|
222
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
223
|
-
className: "neeto-ui-text-
|
|
224
|
-
children: t("neetoTeamMembers.profile.avatar.profilePicture")
|
|
225
|
-
}), /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
226
|
-
className: "neeto-ui-text-gray-700 mb-2",
|
|
240
|
+
className: "flex flex-col items-center",
|
|
241
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
242
|
+
className: "neeto-ui-text-gray-600 text-center",
|
|
227
243
|
style: "body3",
|
|
228
244
|
children: /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, {
|
|
229
|
-
components: {
|
|
230
|
-
code: /*#__PURE__*/jsxRuntime.jsx("code", {})
|
|
231
|
-
},
|
|
232
245
|
i18nKey: "neetoTeamMembers.profile.avatar.profilePictureUploadMessage",
|
|
233
246
|
values: {
|
|
234
247
|
limit: initializers.globalProps.endUserUploadedFileSizeLimitInMb
|
|
235
248
|
}
|
|
236
249
|
})
|
|
237
|
-
}), /*#__PURE__*/jsxRuntime.
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
accept: "image/*",
|
|
248
|
-
"data-cy": "profile-image-upload-file-field",
|
|
249
|
-
id: "uploadProfileImage",
|
|
250
|
-
name: "profile_image_path",
|
|
251
|
-
type: "file",
|
|
252
|
-
onChange: onProfileImageChange
|
|
253
|
-
}, avatarDetails === null || avatarDetails === void 0 ? void 0 : avatarDetails.imageUrl)]
|
|
254
|
-
})]
|
|
250
|
+
}), /*#__PURE__*/jsxRuntime.jsx("input", {
|
|
251
|
+
hidden: true,
|
|
252
|
+
accept: "image/*",
|
|
253
|
+
"data-cy": "profile-image-upload-file-field",
|
|
254
|
+
id: "uploadProfileImage",
|
|
255
|
+
name: "profile_image_path",
|
|
256
|
+
ref: fileInputRef,
|
|
257
|
+
type: "file",
|
|
258
|
+
onChange: onProfileImageChange
|
|
259
|
+
}, avatarDetails === null || avatarDetails === void 0 ? void 0 : avatarDetails.imageUrl)]
|
|
255
260
|
})]
|
|
256
261
|
});
|
|
257
262
|
};
|
|
@@ -427,16 +432,15 @@ var ChangeProfile = function ChangeProfile(_ref) {
|
|
|
427
432
|
},
|
|
428
433
|
children: function children(_ref5) {
|
|
429
434
|
var setFieldValue = _ref5.setFieldValue,
|
|
430
|
-
values = _ref5.values,
|
|
431
435
|
errors = _ref5.errors,
|
|
432
436
|
touched = _ref5.touched;
|
|
433
437
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
434
|
-
children: [/*#__PURE__*/jsxRuntime.
|
|
438
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Pane.Body, {
|
|
435
439
|
className: "w-full",
|
|
436
|
-
children:
|
|
437
|
-
className: "w-full
|
|
440
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
441
|
+
className: "w-full pb-6",
|
|
438
442
|
children: [/*#__PURE__*/jsxRuntime.jsx(ProfileImage, {}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
439
|
-
className: "
|
|
443
|
+
className: "neeto-ui-border-gray-200 mt-4 w-full space-y-4 border-t pt-4",
|
|
440
444
|
children: [/*#__PURE__*/jsxRuntime.jsx(Input, {
|
|
441
445
|
autoFocus: true,
|
|
442
446
|
required: true,
|
|
@@ -455,92 +459,67 @@ var ChangeProfile = function ChangeProfile(_ref) {
|
|
|
455
459
|
type: "text",
|
|
456
460
|
placeholder: t("neetoTeamMembers.profile.inputs.placeholder.lastName")
|
|
457
461
|
})]
|
|
458
|
-
}), /*#__PURE__*/jsxRuntime.jsx(Select, {
|
|
459
|
-
required: true,
|
|
460
|
-
"data-cy": "ntm-profile-country-select",
|
|
461
|
-
label: t("neetoTeamMembers.profile.inputs.label.selectCountry"),
|
|
462
|
-
name: "countryId",
|
|
463
|
-
options: countryDropdownOptions,
|
|
464
|
-
value: selectedCountryOption,
|
|
465
|
-
onChange: function onChange(option) {
|
|
466
|
-
var dependentFields = handleCountryChange(option);
|
|
467
|
-
setFieldValue("dateFormat", dependentFields === null || dependentFields === void 0 ? void 0 : dependentFields.dateFormat);
|
|
468
|
-
setFieldValue("countryId", option === null || option === void 0 ? void 0 : option.value);
|
|
469
|
-
}
|
|
470
|
-
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
471
|
-
className: "space-y-2",
|
|
472
|
-
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
473
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(Label, {
|
|
474
|
-
required: true,
|
|
475
|
-
className: "mb-2",
|
|
476
|
-
children: t("neetoTeamMembers.profile.inputs.label.selectTimeZone")
|
|
477
|
-
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
478
|
-
className: "w-full flex-grow",
|
|
479
|
-
"data-cy": "ntm-profile-time-zone-select",
|
|
480
|
-
ref: function ref(node) {
|
|
481
|
-
return timezoneRef({
|
|
482
|
-
node: node,
|
|
483
|
-
setFieldValue: setFieldValue
|
|
484
|
-
});
|
|
485
|
-
}
|
|
486
|
-
})]
|
|
487
|
-
}), touched.timeZone && errors.timeZone && /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
488
|
-
children: errors.timeZone
|
|
489
|
-
})]
|
|
490
|
-
}), /*#__PURE__*/jsxRuntime.jsx(Select, {
|
|
491
|
-
required: true,
|
|
492
|
-
"data-cy": "ntm-time-format-select",
|
|
493
|
-
name: "timeFormat",
|
|
494
|
-
options: constants.TIME_FORMAT_OPTIONS,
|
|
495
|
-
label: t("neetoTeamMembers.profile.inputs.label.selectTimeFormat"),
|
|
496
|
-
onChange: function onChange(option) {
|
|
497
|
-
setFieldValue("timeFormat", option.value);
|
|
498
|
-
}
|
|
499
462
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
500
|
-
|
|
463
|
+
className: "neeto-ui-border-gray-200 mt-4 w-full space-y-4 border-t pt-4",
|
|
464
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Select, {
|
|
501
465
|
required: true,
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
466
|
+
"data-cy": "ntm-profile-country-select",
|
|
467
|
+
name: "countryId",
|
|
468
|
+
options: countryDropdownOptions,
|
|
469
|
+
value: selectedCountryOption,
|
|
470
|
+
label: t("neetoTeamMembers.profile.inputs.label.selectCountry"),
|
|
471
|
+
onChange: function onChange(option) {
|
|
472
|
+
var dependentFields = handleCountryChange(option);
|
|
473
|
+
setFieldValue("dateFormat", dependentFields === null || dependentFields === void 0 ? void 0 : dependentFields.dateFormat);
|
|
474
|
+
setFieldValue("countryId", option === null || option === void 0 ? void 0 : option.value);
|
|
475
|
+
}
|
|
476
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
477
|
+
className: "space-y-2",
|
|
478
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
479
|
+
className: "space-y-2",
|
|
480
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Label, {
|
|
481
|
+
required: true,
|
|
482
|
+
children: t("neetoTeamMembers.profile.inputs.label.selectTimeZone")
|
|
483
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
484
|
+
className: "w-full flex-grow",
|
|
485
|
+
"data-cy": "ntm-profile-time-zone-select",
|
|
486
|
+
ref: function ref(node) {
|
|
487
|
+
return timezoneRef({
|
|
488
|
+
node: node,
|
|
489
|
+
setFieldValue: setFieldValue
|
|
490
|
+
});
|
|
517
491
|
}
|
|
518
|
-
})
|
|
492
|
+
})]
|
|
493
|
+
}), touched.timeZone && errors.timeZone && /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
494
|
+
className: "neeto-ui-text-error-800",
|
|
495
|
+
lineHeight: "none",
|
|
496
|
+
style: "body3",
|
|
497
|
+
children: errors.timeZone
|
|
498
|
+
})]
|
|
499
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Select, {
|
|
500
|
+
required: true,
|
|
501
|
+
"data-cy": "ntm-time-format-select",
|
|
502
|
+
name: "timeFormat",
|
|
503
|
+
options: constants.TIME_FORMAT_OPTIONS,
|
|
504
|
+
label: t("neetoTeamMembers.profile.inputs.label.selectTimeFormat"),
|
|
505
|
+
onChange: function onChange(option) {
|
|
506
|
+
setFieldValue("timeFormat", option.value);
|
|
507
|
+
}
|
|
508
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
509
|
+
className: "space-y-2",
|
|
510
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Select, {
|
|
511
|
+
required: true,
|
|
512
|
+
"data-cy": "ntm-date-format-select",
|
|
513
|
+
name: "dateFormat",
|
|
514
|
+
options: constants.DATE_FORMAT_OPTIONS,
|
|
515
|
+
label: t("neetoTeamMembers.profile.inputs.label.dateFormat"),
|
|
516
|
+
onChange: function onChange(option) {
|
|
517
|
+
setFieldValue("dateFormat", option.value);
|
|
518
|
+
}
|
|
519
519
|
})
|
|
520
520
|
})]
|
|
521
521
|
})]
|
|
522
|
-
})
|
|
523
|
-
className: "neeto-ui-border-gray-200 w-full"
|
|
524
|
-
}), /*#__PURE__*/jsxRuntime.jsx(Callout, {
|
|
525
|
-
className: "neeto-ui-bg-gray-100 neeto-ui-border-gray-300 mt-8 w-full",
|
|
526
|
-
children: /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
527
|
-
style: "body2",
|
|
528
|
-
weight: "light",
|
|
529
|
-
children: /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, {
|
|
530
|
-
i18nKey: "neetoTeamMembers.profile.common.toUpdateProfile",
|
|
531
|
-
components: {
|
|
532
|
-
button: /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
533
|
-
className: "neeto-ui-font-size-inherit",
|
|
534
|
-
"data-cy": "ntm-visit-auth-button",
|
|
535
|
-
"data-test-id": "ntm-visit-auth-button",
|
|
536
|
-
href: MY_PROFILE_PATH,
|
|
537
|
-
style: "link",
|
|
538
|
-
target: "_blank"
|
|
539
|
-
})
|
|
540
|
-
}
|
|
541
|
-
})
|
|
542
|
-
})
|
|
543
|
-
})]
|
|
522
|
+
})
|
|
544
523
|
}), /*#__PURE__*/jsxRuntime.jsx(Pane.Footer, {
|
|
545
524
|
children: /*#__PURE__*/jsxRuntime.jsx(ActionBlock, {
|
|
546
525
|
isSubmitting: isUpdatingProfile || isUploading,
|
|
@@ -587,30 +566,229 @@ var useProfileUpdatePaneState = function useProfileUpdatePaneState() {
|
|
|
587
566
|
}, shallow.shallow);
|
|
588
567
|
};
|
|
589
568
|
|
|
569
|
+
var Preview = function Preview() {
|
|
570
|
+
var _findBy, _findBy2, _globalProps$user;
|
|
571
|
+
var _useTranslation = reactI18next.useTranslation(),
|
|
572
|
+
t = _useTranslation.t;
|
|
573
|
+
var _useState = require$$0.useState(""),
|
|
574
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
575
|
+
time = _useState2[0],
|
|
576
|
+
setTime = _useState2[1];
|
|
577
|
+
var _useFetchProfile = useFetchProfile(),
|
|
578
|
+
_useFetchProfile$data = _useFetchProfile.data,
|
|
579
|
+
_useFetchProfile$data2 = _useFetchProfile$data === void 0 ? {} : _useFetchProfile$data,
|
|
580
|
+
_useFetchProfile$data3 = _useFetchProfile$data2.user,
|
|
581
|
+
user = _useFetchProfile$data3 === void 0 ? {} : _useFetchProfile$data3,
|
|
582
|
+
isFetchingUserDetails = _useFetchProfile.isFetching;
|
|
583
|
+
var _user$firstName = user.firstName,
|
|
584
|
+
firstName = _user$firstName === void 0 ? "" : _user$firstName,
|
|
585
|
+
_user$lastName = user.lastName,
|
|
586
|
+
lastName = _user$lastName === void 0 ? "" : _user$lastName,
|
|
587
|
+
_user$email = user.email,
|
|
588
|
+
email = _user$email === void 0 ? "" : _user$email,
|
|
589
|
+
_user$dateFormat = user.dateFormat,
|
|
590
|
+
dateFormat = _user$dateFormat === void 0 ? user.dateFormat || constants.DATE_FORMAT_OPTIONS[0].value : _user$dateFormat,
|
|
591
|
+
_user$timeZone = user.timeZone,
|
|
592
|
+
timeZone = _user$timeZone === void 0 ? "" : _user$timeZone,
|
|
593
|
+
_user$profileImageUrl = user.profileImageUrl,
|
|
594
|
+
profileImageUrl = _user$profileImageUrl === void 0 ? "" : _user$profileImageUrl,
|
|
595
|
+
_user$countryName = user.countryName,
|
|
596
|
+
countryName = _user$countryName === void 0 ? "" : _user$countryName,
|
|
597
|
+
_user$timeFormat = user.timeFormat,
|
|
598
|
+
timeFormat = _user$timeFormat === void 0 ? user.timeFormat || constants.TIME_FORMAT_OPTIONS[0].value : _user$timeFormat;
|
|
599
|
+
var name = "".concat(firstName, " ").concat(lastName).trim();
|
|
600
|
+
require$$0.useEffect(function () {
|
|
601
|
+
var updateTime = function updateTime() {
|
|
602
|
+
var now = new Date();
|
|
603
|
+
var options = {
|
|
604
|
+
timeZone: timeZone,
|
|
605
|
+
hour: "2-digit",
|
|
606
|
+
minute: "2-digit",
|
|
607
|
+
hour12: timeFormat === "12h" || true
|
|
608
|
+
};
|
|
609
|
+
var formattedTime = new Intl.DateTimeFormat("en-US", options).format(now);
|
|
610
|
+
setTime(formattedTime);
|
|
611
|
+
};
|
|
612
|
+
var interval = setInterval(updateTime, 1000);
|
|
613
|
+
return function () {
|
|
614
|
+
return clearInterval(interval);
|
|
615
|
+
};
|
|
616
|
+
}, [timeZone]);
|
|
617
|
+
if (!time || isFetchingUserDetails) {
|
|
618
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
619
|
+
className: "flex h-full w-full items-center justify-center",
|
|
620
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Spinner, {})
|
|
621
|
+
});
|
|
622
|
+
}
|
|
623
|
+
return /*#__PURE__*/jsxRuntime.jsx(Pane.Body, {
|
|
624
|
+
className: "w-full",
|
|
625
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
626
|
+
className: "w-full",
|
|
627
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
628
|
+
className: "mb-4 flex flex-col items-center justify-center",
|
|
629
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Avatar, {
|
|
630
|
+
className: "mb-1",
|
|
631
|
+
size: "extraLarge",
|
|
632
|
+
user: {
|
|
633
|
+
name: name,
|
|
634
|
+
imageUrl: profileImageUrl
|
|
635
|
+
}
|
|
636
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
637
|
+
style: "h3",
|
|
638
|
+
weight: "semibold",
|
|
639
|
+
children: name
|
|
640
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
641
|
+
className: "flex items-center gap-1",
|
|
642
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
643
|
+
className: "neeto-ui-text-gray-600",
|
|
644
|
+
style: "body2",
|
|
645
|
+
children: email
|
|
646
|
+
}), /*#__PURE__*/jsxRuntime.jsx(CopyToClipboardButton, {
|
|
647
|
+
size: "small",
|
|
648
|
+
style: "text",
|
|
649
|
+
value: email
|
|
650
|
+
})]
|
|
651
|
+
})]
|
|
652
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
653
|
+
className: "neeto-ui-border-gray-200 space-y-4 border-t py-4",
|
|
654
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
655
|
+
className: "flex flex-col gap-1",
|
|
656
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Label, {
|
|
657
|
+
children: t("neetoTeamMembers.labels.firstName")
|
|
658
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
659
|
+
className: "neeto-ui-text-gray-600",
|
|
660
|
+
style: "body2",
|
|
661
|
+
children: firstName
|
|
662
|
+
})]
|
|
663
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
664
|
+
className: "flex flex-col gap-1",
|
|
665
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Label, {
|
|
666
|
+
children: t("neetoTeamMembers.labels.lastName")
|
|
667
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
668
|
+
className: "neeto-ui-text-gray-600",
|
|
669
|
+
style: "body2",
|
|
670
|
+
children: lastName
|
|
671
|
+
})]
|
|
672
|
+
})]
|
|
673
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
674
|
+
className: "neeto-ui-border-gray-200 space-y-4 border-t py-4",
|
|
675
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
676
|
+
className: "flex flex-col gap-1",
|
|
677
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Label, {
|
|
678
|
+
children: t("neetoTeamMembers.labels.country")
|
|
679
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
680
|
+
className: "neeto-ui-text-gray-600",
|
|
681
|
+
style: "body2",
|
|
682
|
+
children: countryName || "-"
|
|
683
|
+
})]
|
|
684
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
685
|
+
className: "flex flex-col gap-1",
|
|
686
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Label, {
|
|
687
|
+
children: t("neetoTeamMembers.labels.timeZone")
|
|
688
|
+
}), /*#__PURE__*/jsxRuntime.jsxs(Typography, {
|
|
689
|
+
className: "neeto-ui-text-gray-600",
|
|
690
|
+
style: "body2",
|
|
691
|
+
children: [neetoTimeZones.ianaTimezoneToHumanReadable(timeZone), " - ", time]
|
|
692
|
+
})]
|
|
693
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
694
|
+
className: "flex flex-col gap-1",
|
|
695
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Label, {
|
|
696
|
+
children: t("neetoTeamMembers.labels.preferredTimeFormat")
|
|
697
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
698
|
+
className: "neeto-ui-text-gray-600",
|
|
699
|
+
style: "body2",
|
|
700
|
+
children: ((_findBy = neetoCist.findBy({
|
|
701
|
+
value: timeFormat
|
|
702
|
+
}, constants.TIME_FORMAT_OPTIONS)) === null || _findBy === void 0 ? void 0 : _findBy.label) || "-"
|
|
703
|
+
})]
|
|
704
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
705
|
+
className: "flex flex-col gap-1",
|
|
706
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Label, {
|
|
707
|
+
children: t("neetoTeamMembers.labels.preferredDateFormat")
|
|
708
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
709
|
+
className: "neeto-ui-text-gray-600",
|
|
710
|
+
style: "body2",
|
|
711
|
+
children: ((_findBy2 = neetoCist.findBy({
|
|
712
|
+
value: dateFormat
|
|
713
|
+
}, constants.DATE_FORMAT_OPTIONS)) === null || _findBy2 === void 0 ? void 0 : _findBy2.label) || "-"
|
|
714
|
+
})]
|
|
715
|
+
})]
|
|
716
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
717
|
+
className: "neeto-ui-border-gray-200 space-y-4 border-t py-4",
|
|
718
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
719
|
+
className: "flex flex-col gap-1",
|
|
720
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Label, {
|
|
721
|
+
children: t("neetoTeamMembers.labels.billingAndSubscriptions")
|
|
722
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
723
|
+
className: "neeto-ui-text-gray-700",
|
|
724
|
+
style: "body2",
|
|
725
|
+
children: /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, {
|
|
726
|
+
i18nKey: "neetoTeamMembers.common.subscriptionType",
|
|
727
|
+
values: {
|
|
728
|
+
subscription: neetoCist.capitalize((_globalProps$user = initializers.globalProps.user) === null || _globalProps$user === void 0 ? void 0 : _globalProps$user.subscriptionPlan)
|
|
729
|
+
}
|
|
730
|
+
})
|
|
731
|
+
})]
|
|
732
|
+
})
|
|
733
|
+
})]
|
|
734
|
+
})
|
|
735
|
+
});
|
|
736
|
+
};
|
|
737
|
+
|
|
738
|
+
var Menu = Dropdown.Menu,
|
|
739
|
+
MenuItem = Dropdown.MenuItem;
|
|
590
740
|
var Profile = function Profile() {
|
|
741
|
+
var _useTranslation = reactI18next.useTranslation(),
|
|
742
|
+
t = _useTranslation.t;
|
|
591
743
|
var _useProfileUpdatePane = useProfileUpdatePaneState(),
|
|
592
744
|
_useProfileUpdatePane2 = _slicedToArray(_useProfileUpdatePane, 2),
|
|
593
745
|
isOpen = _useProfileUpdatePane2[0],
|
|
594
746
|
setIsOpen = _useProfileUpdatePane2[1];
|
|
595
|
-
var
|
|
596
|
-
|
|
747
|
+
var _useState = require$$0.useState(false),
|
|
748
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
749
|
+
isEditMode = _useState2[0],
|
|
750
|
+
setIsEditMode = _useState2[1];
|
|
597
751
|
var onClose = function onClose() {
|
|
598
|
-
|
|
752
|
+
setIsOpen(false);
|
|
753
|
+
setIsEditMode(false);
|
|
754
|
+
};
|
|
755
|
+
var enableEditMode = function enableEditMode() {
|
|
756
|
+
return setIsEditMode(true);
|
|
599
757
|
};
|
|
600
758
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
601
759
|
className: "w-full",
|
|
602
760
|
children: /*#__PURE__*/jsxRuntime.jsxs(Pane, {
|
|
603
761
|
isOpen: isOpen,
|
|
604
762
|
onClose: onClose,
|
|
763
|
+
className: "max-w-96",
|
|
605
764
|
children: [/*#__PURE__*/jsxRuntime.jsx(Pane.Header, {
|
|
606
|
-
children: /*#__PURE__*/jsxRuntime.
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
765
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
766
|
+
className: "flex justify-between",
|
|
767
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
768
|
+
style: "h2",
|
|
769
|
+
weight: "semibold",
|
|
770
|
+
children: t("neetoTeamMembers.profile.common.myProfile")
|
|
771
|
+
}), !isEditMode && /*#__PURE__*/jsxRuntime.jsx(Dropdown, {
|
|
772
|
+
buttonSize: "small",
|
|
773
|
+
buttonStyle: "secondary",
|
|
774
|
+
icon: MenuHorizontal,
|
|
775
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(Menu, {
|
|
776
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(MenuItem.Button, {
|
|
777
|
+
onClick: enableEditMode,
|
|
778
|
+
children: t("neetoTeamMembers.buttons.editBasicInfo")
|
|
779
|
+
}), /*#__PURE__*/jsxRuntime.jsx(MenuItem.Button, {
|
|
780
|
+
href: MY_PROFILE_PATH,
|
|
781
|
+
children: t("neetoTeamMembers.buttons.updateEmail")
|
|
782
|
+
}), /*#__PURE__*/jsxRuntime.jsx(MenuItem.Button, {
|
|
783
|
+
href: MY_PROFILE_PATH,
|
|
784
|
+
children: t("neetoTeamMembers.buttons.manageBillingAndSubscriptions")
|
|
785
|
+
})]
|
|
786
|
+
})
|
|
787
|
+
})]
|
|
610
788
|
})
|
|
611
|
-
}), /*#__PURE__*/jsxRuntime.jsx(ChangeProfile, {
|
|
789
|
+
}), isEditMode ? /*#__PURE__*/jsxRuntime.jsx(ChangeProfile, {
|
|
612
790
|
onClose: onClose
|
|
613
|
-
})]
|
|
791
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(Preview, {})]
|
|
614
792
|
})
|
|
615
793
|
});
|
|
616
794
|
};
|