@bigbinary/neeto-team-members-frontend 3.1.3 → 3.1.5
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/README.md +2 -1
- package/app/javascript/src/translations/en.json +2 -0
- package/dist/index.cjs.js +1449 -1245
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +1399 -1196
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { globalProps, taxonomies } from '@bigbinary/neeto-commons-frontend/initializers';
|
|
2
|
-
import
|
|
2
|
+
import require$$0, { useState, useMemo, useEffect, createElement, useRef, Fragment as Fragment$1, memo, useCallback } from 'react';
|
|
3
3
|
import Pane from '@bigbinary/neetoui/Pane';
|
|
4
4
|
import Typography from '@bigbinary/neetoui/Typography';
|
|
5
5
|
import { useTranslation, Trans } from 'react-i18next';
|
|
@@ -27,6 +27,7 @@ import { object, string } from 'yup';
|
|
|
27
27
|
import { replace as replace$1, is, prop, append, equals, concat, groupBy, pluck, not, map, identical, modify, includes, __, isEmpty, filter as filter$1, identity, clamp, curry, mergeLeft, isNil, toLower, assoc, trim, isNotNil, keys, pick, move, head, reverse } from 'ramda';
|
|
28
28
|
import { useField, useFormikContext } from 'formik';
|
|
29
29
|
import Avatar from '@bigbinary/neetoui/Avatar';
|
|
30
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
30
31
|
import withImmutableActions from '@bigbinary/neeto-commons-frontend/react-utils/withImmutableActions';
|
|
31
32
|
import { create as create$2 } from 'zustand';
|
|
32
33
|
import { shallow } from 'zustand/shallow';
|
|
@@ -47,9 +48,10 @@ import SubHeaderMolecule from '@bigbinary/neeto-molecules/SubHeader';
|
|
|
47
48
|
import TableWrapper from '@bigbinary/neeto-molecules/TableWrapper';
|
|
48
49
|
import Table$1 from '@bigbinary/neetoui/Table';
|
|
49
50
|
import { useHistory } from 'react-router-dom';
|
|
50
|
-
import require$$0 from 'util';
|
|
51
|
+
import require$$0$1 from 'util';
|
|
51
52
|
import Dropdown from '@bigbinary/neetoui/Dropdown';
|
|
52
53
|
import Tag from '@bigbinary/neetoui/Tag';
|
|
54
|
+
import useFetchNeetoApps from '@bigbinary/neeto-commons-frontend/react-utils/useFetchNeetoApps';
|
|
53
55
|
import Switch from '@bigbinary/neetoui/formik/Switch';
|
|
54
56
|
import Modal from '@bigbinary/neetoui/Modal';
|
|
55
57
|
import MultiEmailInput from '@bigbinary/neetoui/formik/MultiEmailInput';
|
|
@@ -599,6 +601,9 @@ var DATE_FORMAT_OPTIONS = [{
|
|
|
599
601
|
}, {
|
|
600
602
|
label: t$1("neetoTeamMembers.profile.common.ddmmyy"),
|
|
601
603
|
value: "%d/%m/%Y"
|
|
604
|
+
}, {
|
|
605
|
+
label: t$1("neetoTeamMembers.profile.common.yymmdd"),
|
|
606
|
+
value: "%Y/%m/%d"
|
|
602
607
|
}];
|
|
603
608
|
var SUBSCRIPTION_PLANS = Object.freeze({
|
|
604
609
|
PRO: "pro",
|
|
@@ -622,16 +627,16 @@ var profileApi = {
|
|
|
622
627
|
updateUser: updateUser
|
|
623
628
|
};
|
|
624
629
|
|
|
625
|
-
function ownKeys$
|
|
626
|
-
function _objectSpread$
|
|
630
|
+
function ownKeys$j(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; }
|
|
631
|
+
function _objectSpread$j(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$j(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$j(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
627
632
|
var useFetchProfile = function useFetchProfile(options) {
|
|
628
|
-
return useQuery([QUERY_KEYS.USER_PROFILE], profileApi.fetchUserDetails, _objectSpread$
|
|
633
|
+
return useQuery([QUERY_KEYS.USER_PROFILE], profileApi.fetchUserDetails, _objectSpread$j({
|
|
629
634
|
staleTime: DEFAULT_STALE_TIME,
|
|
630
635
|
refetchOnWindowFocus: true
|
|
631
636
|
}, options));
|
|
632
637
|
};
|
|
633
638
|
var useUpdateProfileMutation = function useUpdateProfileMutation(options) {
|
|
634
|
-
return useMutationWithInvalidation(profileApi.updateUser, _objectSpread$
|
|
639
|
+
return useMutationWithInvalidation(profileApi.updateUser, _objectSpread$j(_objectSpread$j({
|
|
635
640
|
keysToInvalidate: [[QUERY_KEYS.USER_PROFILE]]
|
|
636
641
|
}, options), {}, {
|
|
637
642
|
onSuccess: function onSuccess() {
|
|
@@ -657,10 +662,10 @@ var VALIDATION_ERRORS = {
|
|
|
657
662
|
})
|
|
658
663
|
};
|
|
659
664
|
|
|
660
|
-
function ownKeys$
|
|
661
|
-
function _objectSpread$
|
|
665
|
+
function ownKeys$i(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; }
|
|
666
|
+
function _objectSpread$i(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$i(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$i(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
662
667
|
var useFetchCountries = function useFetchCountries(options) {
|
|
663
|
-
return useQuery([QUERY_KEYS.COUNTRIES_LIST], profileApi.fetchCountries, _objectSpread$
|
|
668
|
+
return useQuery([QUERY_KEYS.COUNTRIES_LIST], profileApi.fetchCountries, _objectSpread$i({
|
|
664
669
|
staleTime: DEFAULT_STALE_TIME
|
|
665
670
|
}, options));
|
|
666
671
|
};
|
|
@@ -806,57 +811,65 @@ var ProfileImage = function ProfileImage() {
|
|
|
806
811
|
}
|
|
807
812
|
return null;
|
|
808
813
|
};
|
|
809
|
-
return /*#__PURE__*/
|
|
810
|
-
className: "mb-8 flex flex-row justify-start"
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
814
|
+
return /*#__PURE__*/jsxs("div", {
|
|
815
|
+
className: "mb-8 flex flex-row justify-start",
|
|
816
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
817
|
+
className: "flex-shrink-0",
|
|
818
|
+
children: [isPresent(avatarDetails === null || avatarDetails === void 0 ? void 0 : avatarDetails.imageUrl) && /*#__PURE__*/jsx("div", {
|
|
819
|
+
className: "relative z-10",
|
|
820
|
+
children: /*#__PURE__*/jsx("div", {
|
|
821
|
+
className: "neeto-ui-bg-gray-300 neeto-ui-rounded-full absolute right-0 top-0 cursor-pointer p-0.5",
|
|
822
|
+
"data-cy": "profile-image-remove-button",
|
|
823
|
+
onClick: handleRemoveImage,
|
|
824
|
+
children: /*#__PURE__*/jsx(Delete$1, {
|
|
825
|
+
size: IMAGE_DELETE_BUTTON_SIZE
|
|
826
|
+
})
|
|
827
|
+
})
|
|
828
|
+
}), /*#__PURE__*/jsx(Avatar, {
|
|
829
|
+
size: "extraLarge",
|
|
830
|
+
user: avatarDetails
|
|
831
|
+
})]
|
|
832
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
833
|
+
className: "ml-4 flex flex-col",
|
|
834
|
+
children: [/*#__PURE__*/jsx(Label, {
|
|
835
|
+
className: "neeto-ui-text-black mb-1 font-medium",
|
|
836
|
+
children: t("neetoTeamMembers.profile.avatar.profilePicture")
|
|
837
|
+
}), /*#__PURE__*/jsx(Typography, {
|
|
838
|
+
className: "neeto-ui-text-gray-700 mb-2",
|
|
839
|
+
style: "body3",
|
|
840
|
+
children: /*#__PURE__*/jsx(Trans, {
|
|
841
|
+
components: {
|
|
842
|
+
code: /*#__PURE__*/jsx("code", {})
|
|
843
|
+
},
|
|
844
|
+
i18nKey: "neetoTeamMembers.profile.avatar.profilePictureUploadMessage",
|
|
845
|
+
values: {
|
|
846
|
+
limit: globalProps.endUserUploadedFileSizeLimitInMb
|
|
847
|
+
}
|
|
848
|
+
})
|
|
849
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
850
|
+
className: "neeto-ui-file-upload flex flex-row ",
|
|
851
|
+
"data-cy": "profile-image-upload-container",
|
|
852
|
+
children: [/*#__PURE__*/jsx("label", {
|
|
853
|
+
className: "neeto-ui-btn--style-secondary neeto-ui-btn m-0 mr-3 ",
|
|
854
|
+
"data-cy": "profile-image-upload-label",
|
|
855
|
+
htmlFor: "uploadProfileImage",
|
|
856
|
+
children: avatarDetails !== null && avatarDetails !== void 0 && avatarDetails.imageUrl ? t("neetoTeamMembers.profile.avatar.changeProfilePicture") : t("neetoTeamMembers.profile.avatar.uploadProfilePicture")
|
|
857
|
+
}), /*#__PURE__*/jsx("input", {
|
|
858
|
+
hidden: true,
|
|
859
|
+
accept: "image/*",
|
|
860
|
+
"data-cy": "profile-image-upload-file-field",
|
|
861
|
+
id: "uploadProfileImage",
|
|
862
|
+
name: "profile_image_path",
|
|
863
|
+
type: "file",
|
|
864
|
+
onChange: onProfileImageChange
|
|
865
|
+
}, avatarDetails === null || avatarDetails === void 0 ? void 0 : avatarDetails.imageUrl)]
|
|
866
|
+
})]
|
|
867
|
+
})]
|
|
868
|
+
});
|
|
856
869
|
};
|
|
857
870
|
|
|
858
|
-
function ownKeys$
|
|
859
|
-
function _objectSpread$
|
|
871
|
+
function ownKeys$h(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; }
|
|
872
|
+
function _objectSpread$h(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$h(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$h(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
860
873
|
var ChangeProfile = function ChangeProfile(_ref) {
|
|
861
874
|
var onClose = _ref.onClose;
|
|
862
875
|
var _useTranslation = useTranslation(),
|
|
@@ -954,7 +967,7 @@ var ChangeProfile = function ChangeProfile(_ref) {
|
|
|
954
967
|
url: url
|
|
955
968
|
};
|
|
956
969
|
case 14:
|
|
957
|
-
payload = _objectSpread$
|
|
970
|
+
payload = _objectSpread$h(_objectSpread$h({}, values), {}, {
|
|
958
971
|
timeZone: selectedTimeZoneOption === null || selectedTimeZoneOption === void 0 ? void 0 : selectedTimeZoneOption.name,
|
|
959
972
|
avatar: avatar
|
|
960
973
|
});
|
|
@@ -979,9 +992,11 @@ var ChangeProfile = function ChangeProfile(_ref) {
|
|
|
979
992
|
};
|
|
980
993
|
}();
|
|
981
994
|
if (isUpdatingProfile || isFetchingCountriesList || isFetchingUserDetails) {
|
|
982
|
-
return /*#__PURE__*/
|
|
995
|
+
return /*#__PURE__*/jsx(Container, {
|
|
996
|
+
children: /*#__PURE__*/jsx(PageLoader, {})
|
|
997
|
+
});
|
|
983
998
|
}
|
|
984
|
-
return /*#__PURE__*/
|
|
999
|
+
return /*#__PURE__*/jsx(Form, {
|
|
985
1000
|
formProps: {
|
|
986
1001
|
"data-cy": "ntm-profile-form"
|
|
987
1002
|
},
|
|
@@ -989,105 +1004,119 @@ var ChangeProfile = function ChangeProfile(_ref) {
|
|
|
989
1004
|
initialValues: initialFormValues,
|
|
990
1005
|
validationSchema: PROFILE_VALIDATION_SCHEMA,
|
|
991
1006
|
onSubmit: handleSubmit
|
|
992
|
-
}
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1007
|
+
},
|
|
1008
|
+
children: function children(_ref3) {
|
|
1009
|
+
var setFieldValue = _ref3.setFieldValue,
|
|
1010
|
+
values = _ref3.values;
|
|
1011
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
1012
|
+
children: [/*#__PURE__*/jsxs(Pane.Body, {
|
|
1013
|
+
className: "w-full",
|
|
1014
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
1015
|
+
className: "w-full space-y-6 pb-6",
|
|
1016
|
+
children: [/*#__PURE__*/jsx(ProfileImage, {}), /*#__PURE__*/jsxs("div", {
|
|
1017
|
+
className: "grid grid-cols-2 gap-4",
|
|
1018
|
+
children: [/*#__PURE__*/jsx(Input, {
|
|
1019
|
+
autoFocus: true,
|
|
1020
|
+
required: true,
|
|
1021
|
+
"data-cy": "profile-first-name-text-field",
|
|
1022
|
+
"data-test-id": "ntm-profile-first-name",
|
|
1023
|
+
label: t("neetoTeamMembers.profile.inputs.label.firstName"),
|
|
1024
|
+
name: "firstName",
|
|
1025
|
+
type: "text",
|
|
1026
|
+
placeholder: t("neetoTeamMembers.profile.inputs.placeholder.firstName")
|
|
1027
|
+
}), /*#__PURE__*/jsx(Input, {
|
|
1028
|
+
required: true,
|
|
1029
|
+
"data-cy": "profile-last-name-text-field",
|
|
1030
|
+
"data-test-id": "ntm-profile-last-name",
|
|
1031
|
+
label: t("neetoTeamMembers.profile.inputs.label.lastName"),
|
|
1032
|
+
name: "lastName",
|
|
1033
|
+
type: "text",
|
|
1034
|
+
placeholder: t("neetoTeamMembers.profile.inputs.placeholder.lastName")
|
|
1035
|
+
})]
|
|
1036
|
+
}), /*#__PURE__*/jsx(Select, {
|
|
1037
|
+
required: true,
|
|
1038
|
+
"data-cy": "ntm-profile-country-select",
|
|
1039
|
+
label: t("neetoTeamMembers.profile.inputs.label.selectCountry"),
|
|
1040
|
+
name: "countryId",
|
|
1041
|
+
options: countryDropdownOptions,
|
|
1042
|
+
value: selectedCountryOption,
|
|
1043
|
+
onChange: function onChange(option) {
|
|
1044
|
+
var dependentFields = handleCountryChange(option);
|
|
1045
|
+
setFieldValue("dateFormat", dependentFields === null || dependentFields === void 0 ? void 0 : dependentFields.dateFormat);
|
|
1046
|
+
setFieldValue("timeZone", dependentFields === null || dependentFields === void 0 ? void 0 : dependentFields.timeZone);
|
|
1047
|
+
}
|
|
1048
|
+
}), /*#__PURE__*/jsx("div", {
|
|
1049
|
+
className: "space-y-2",
|
|
1050
|
+
children: /*#__PURE__*/jsx(Select, {
|
|
1051
|
+
required: true,
|
|
1052
|
+
"data-cy": "ntm-profile-time-zone-select",
|
|
1053
|
+
name: "timeZoneId",
|
|
1054
|
+
options: timeZoneDropdownOptions,
|
|
1055
|
+
value: selectedTimeZoneOption,
|
|
1056
|
+
label: t("neetoTeamMembers.profile.inputs.label.selectTimeZone"),
|
|
1057
|
+
onChange: function onChange(option) {
|
|
1058
|
+
setFieldValue("timeZone", option === null || option === void 0 ? void 0 : option.name);
|
|
1059
|
+
handleTimeZoneChange(option);
|
|
1060
|
+
}
|
|
1061
|
+
})
|
|
1062
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
1063
|
+
children: [/*#__PURE__*/jsx(Label, {
|
|
1064
|
+
required: true,
|
|
1065
|
+
children: t("neetoTeamMembers.profile.inputs.label.dateFormat")
|
|
1066
|
+
}), /*#__PURE__*/jsx(Radio, {
|
|
1067
|
+
className: "mt-2 space-x-4",
|
|
1068
|
+
children: DATE_FORMAT_OPTIONS.map(function (_ref4) {
|
|
1069
|
+
var label = _ref4.label,
|
|
1070
|
+
value = _ref4.value;
|
|
1071
|
+
return /*#__PURE__*/createElement(Radio.Item, {
|
|
1072
|
+
label: label,
|
|
1073
|
+
value: value,
|
|
1074
|
+
checked: values.dateFormat === value,
|
|
1075
|
+
"data-cy": "ntm-profile-date-format-radio",
|
|
1076
|
+
key: value,
|
|
1077
|
+
name: "dateFormat",
|
|
1078
|
+
onChange: function onChange(event) {
|
|
1079
|
+
return setFieldValue("dateFormat", event.target.value);
|
|
1080
|
+
}
|
|
1081
|
+
});
|
|
1082
|
+
})
|
|
1083
|
+
})]
|
|
1084
|
+
})]
|
|
1085
|
+
}), /*#__PURE__*/jsxs(Callout, {
|
|
1086
|
+
className: "neeto-ui-bg-gray-100 neeto-ui-border-gray-300 mt-8 flex w-full items-center",
|
|
1087
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
1088
|
+
style: "body2",
|
|
1089
|
+
children: t("neetoTeamMembers.profile.common.toUpdateProfile")
|
|
1090
|
+
}), /*#__PURE__*/jsx(Button, {
|
|
1091
|
+
"data-cy": "ntm-visit-auth-button",
|
|
1092
|
+
"data-test-id": "ntm-visit-auth-button",
|
|
1093
|
+
href: MY_PROFILE_PATH,
|
|
1094
|
+
icon: ExternalLink,
|
|
1095
|
+
label: t("neetoTeamMembers.profile.common.neetoAuth"),
|
|
1096
|
+
style: "link",
|
|
1097
|
+
target: "_blank"
|
|
1098
|
+
})]
|
|
1099
|
+
})]
|
|
1100
|
+
}), /*#__PURE__*/jsx(Pane.Footer, {
|
|
1101
|
+
className: "flex items-center space-x-2",
|
|
1102
|
+
children: /*#__PURE__*/jsx(ActionBlock, {
|
|
1103
|
+
cancelButtonProps: {
|
|
1104
|
+
"data-test-id": "ntm-profile-cancel-button",
|
|
1105
|
+
"data-cy": "ntm-profile-cancel-button",
|
|
1106
|
+
disabled: false,
|
|
1107
|
+
style: "text",
|
|
1108
|
+
className: "ml-2",
|
|
1109
|
+
onClick: onClose
|
|
1110
|
+
},
|
|
1111
|
+
submitButtonProps: {
|
|
1112
|
+
"data-cy": "ntm-profile-submit-button",
|
|
1113
|
+
"data-test-id": "ntm-profile-save-changes-button",
|
|
1114
|
+
loading: isUpdatingProfile || isUploading
|
|
1115
|
+
}
|
|
1116
|
+
})
|
|
1117
|
+
})]
|
|
1061
1118
|
});
|
|
1062
|
-
}
|
|
1063
|
-
className: "neeto-ui-bg-gray-100 neeto-ui-border-gray-300 mt-8 flex w-full items-center"
|
|
1064
|
-
}, /*#__PURE__*/React.createElement(Typography, {
|
|
1065
|
-
style: "body2"
|
|
1066
|
-
}, t("neetoTeamMembers.profile.common.toUpdateProfile")), /*#__PURE__*/React.createElement(Button, {
|
|
1067
|
-
"data-cy": "ntm-visit-auth-button",
|
|
1068
|
-
"data-test-id": "ntm-visit-auth-button",
|
|
1069
|
-
href: MY_PROFILE_PATH,
|
|
1070
|
-
icon: ExternalLink,
|
|
1071
|
-
label: t("neetoTeamMembers.profile.common.neetoAuth"),
|
|
1072
|
-
style: "link",
|
|
1073
|
-
target: "_blank"
|
|
1074
|
-
}))), /*#__PURE__*/React.createElement(Pane.Footer, {
|
|
1075
|
-
className: "flex items-center space-x-2"
|
|
1076
|
-
}, /*#__PURE__*/React.createElement(ActionBlock, {
|
|
1077
|
-
cancelButtonProps: {
|
|
1078
|
-
"data-test-id": "ntm-profile-cancel-button",
|
|
1079
|
-
"data-cy": "ntm-profile-cancel-button",
|
|
1080
|
-
disabled: false,
|
|
1081
|
-
style: "text",
|
|
1082
|
-
className: "ml-2",
|
|
1083
|
-
onClick: onClose
|
|
1084
|
-
},
|
|
1085
|
-
submitButtonProps: {
|
|
1086
|
-
"data-cy": "ntm-profile-submit-button",
|
|
1087
|
-
"data-test-id": "ntm-profile-save-changes-button",
|
|
1088
|
-
loading: isUpdatingProfile || isUploading
|
|
1089
|
-
}
|
|
1090
|
-
})));
|
|
1119
|
+
}
|
|
1091
1120
|
});
|
|
1092
1121
|
};
|
|
1093
1122
|
|
|
@@ -1128,17 +1157,22 @@ var Profile$1 = function Profile() {
|
|
|
1128
1157
|
var onClose = function onClose() {
|
|
1129
1158
|
return setIsOpen(false);
|
|
1130
1159
|
};
|
|
1131
|
-
return /*#__PURE__*/
|
|
1132
|
-
className: "w-full"
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1160
|
+
return /*#__PURE__*/jsx("div", {
|
|
1161
|
+
className: "w-full",
|
|
1162
|
+
children: /*#__PURE__*/jsxs(Pane, {
|
|
1163
|
+
isOpen: isOpen,
|
|
1164
|
+
onClose: onClose,
|
|
1165
|
+
children: [/*#__PURE__*/jsx(Pane.Header, {
|
|
1166
|
+
children: /*#__PURE__*/jsx(Typography, {
|
|
1167
|
+
style: "h2",
|
|
1168
|
+
weight: "semibold",
|
|
1169
|
+
children: t("neetoTeamMembers.profile.common.myProfile")
|
|
1170
|
+
})
|
|
1171
|
+
}), /*#__PURE__*/jsx(ChangeProfile, {
|
|
1172
|
+
onClose: onClose
|
|
1173
|
+
})]
|
|
1174
|
+
})
|
|
1175
|
+
});
|
|
1142
1176
|
};
|
|
1143
1177
|
|
|
1144
1178
|
var dist = {exports: {}};
|
|
@@ -1147,7 +1181,7 @@ dist.exports;
|
|
|
1147
1181
|
|
|
1148
1182
|
(function (module, exports) {
|
|
1149
1183
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
1150
|
-
module.exports = factory(
|
|
1184
|
+
module.exports = factory(require$$0);
|
|
1151
1185
|
})(commonjsGlobal, function(__WEBPACK_EXTERNAL_MODULE_4__) {
|
|
1152
1186
|
return /******/ (function(modules) { // webpackBootstrap
|
|
1153
1187
|
/******/ // The module cache
|
|
@@ -2528,15 +2562,17 @@ var queryClient = new QueryClient({
|
|
|
2528
2562
|
}
|
|
2529
2563
|
});
|
|
2530
2564
|
|
|
2531
|
-
|
|
2565
|
+
function ownKeys$g(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; }
|
|
2566
|
+
function _objectSpread$g(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$g(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$g(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2532
2567
|
var withReactQuery = function withReactQuery(Component) {
|
|
2533
2568
|
var QueryWrapper = function QueryWrapper(props) {
|
|
2534
|
-
return /*#__PURE__*/
|
|
2535
|
-
client: queryClient
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2569
|
+
return /*#__PURE__*/jsxs(QueryClientProvider, {
|
|
2570
|
+
client: queryClient,
|
|
2571
|
+
children: [/*#__PURE__*/jsx(Component, _objectSpread$g({}, props)), /*#__PURE__*/jsx(ReactQueryDevtools, {
|
|
2572
|
+
initialIsOpen: false,
|
|
2573
|
+
position: "bottom-right"
|
|
2574
|
+
})]
|
|
2575
|
+
});
|
|
2540
2576
|
};
|
|
2541
2577
|
return QueryWrapper;
|
|
2542
2578
|
};
|
|
@@ -2548,11 +2584,11 @@ var permissionsApi = {
|
|
|
2548
2584
|
fetch: fetch$3
|
|
2549
2585
|
};
|
|
2550
2586
|
|
|
2551
|
-
function ownKeys$
|
|
2552
|
-
function _objectSpread$
|
|
2587
|
+
function ownKeys$f(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; }
|
|
2588
|
+
function _objectSpread$f(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$f(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$f(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2553
2589
|
var useFetchPermissions = function useFetchPermissions() {
|
|
2554
2590
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
2555
|
-
return useQuery(QUERY_KEYS.PERMISSIONS, permissionsApi.fetch, _objectSpread$
|
|
2591
|
+
return useQuery(QUERY_KEYS.PERMISSIONS, permissionsApi.fetch, _objectSpread$f({
|
|
2556
2592
|
select: function select(response) {
|
|
2557
2593
|
return response === null || response === void 0 ? void 0 : response.permissions;
|
|
2558
2594
|
}
|
|
@@ -2624,11 +2660,11 @@ var _excluded$3 = ["onSuccess"],
|
|
|
2624
2660
|
_excluded2$2 = ["onSuccess"],
|
|
2625
2661
|
_excluded3 = ["onSuccess"],
|
|
2626
2662
|
_excluded4 = ["onSuccess"];
|
|
2627
|
-
function ownKeys$
|
|
2628
|
-
function _objectSpread$
|
|
2663
|
+
function ownKeys$e(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; }
|
|
2664
|
+
function _objectSpread$e(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$e(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$e(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2629
2665
|
var useFetchRoles = function useFetchRoles() {
|
|
2630
2666
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
2631
|
-
return useQuery(QUERY_KEYS.ROLES, organizationRolesApi.fetch, _objectSpread$
|
|
2667
|
+
return useQuery(QUERY_KEYS.ROLES, organizationRolesApi.fetch, _objectSpread$e({
|
|
2632
2668
|
select: function select(response) {
|
|
2633
2669
|
return response === null || response === void 0 ? void 0 : response.organizationRoles;
|
|
2634
2670
|
}
|
|
@@ -2636,12 +2672,12 @@ var useFetchRoles = function useFetchRoles() {
|
|
|
2636
2672
|
};
|
|
2637
2673
|
var useFetchGlobalRoles = function useFetchGlobalRoles() {
|
|
2638
2674
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
2639
|
-
return useQuery(QUERY_KEYS.GLOBAL_ROLES, globalRolesApi.fetch, _objectSpread$
|
|
2675
|
+
return useQuery(QUERY_KEYS.GLOBAL_ROLES, globalRolesApi.fetch, _objectSpread$e({}, options));
|
|
2640
2676
|
};
|
|
2641
2677
|
var useCreateRole = function useCreateRole(_ref) {
|
|
2642
2678
|
var _onSuccess = _ref.onSuccess,
|
|
2643
2679
|
options = _objectWithoutProperties(_ref, _excluded$3);
|
|
2644
|
-
return useMutation(organizationRolesApi.create, _objectSpread$
|
|
2680
|
+
return useMutation(organizationRolesApi.create, _objectSpread$e({
|
|
2645
2681
|
onSuccess: function onSuccess() {
|
|
2646
2682
|
queryClient.invalidateQueries(QUERY_KEYS.TEAMS_DEPENDENCIES);
|
|
2647
2683
|
queryClient.invalidateQueries(QUERY_KEYS.ROLES);
|
|
@@ -2656,7 +2692,7 @@ var useUpdateRole = function useUpdateRole(_ref2) {
|
|
|
2656
2692
|
var id = _ref3.id,
|
|
2657
2693
|
payload = _ref3.payload;
|
|
2658
2694
|
return organizationRolesApi.update(id, payload);
|
|
2659
|
-
}, _objectSpread$
|
|
2695
|
+
}, _objectSpread$e({
|
|
2660
2696
|
onSuccess: function onSuccess() {
|
|
2661
2697
|
queryClient.invalidateQueries(QUERY_KEYS.TEAMS);
|
|
2662
2698
|
queryClient.invalidateQueries(QUERY_KEYS.TEAMS_DEPENDENCIES);
|
|
@@ -2673,7 +2709,7 @@ var useDestroyRole = function useDestroyRole(_ref4) {
|
|
|
2673
2709
|
var id = _ref5.id,
|
|
2674
2710
|
payload = _ref5.payload;
|
|
2675
2711
|
return organizationRolesApi.destroy(id, payload);
|
|
2676
|
-
}, _objectSpread$
|
|
2712
|
+
}, _objectSpread$e({
|
|
2677
2713
|
onSuccess: function onSuccess() {
|
|
2678
2714
|
queryClient.invalidateQueries(QUERY_KEYS.TEAMS);
|
|
2679
2715
|
queryClient.invalidateQueries(QUERY_KEYS.TEAMS_DEPENDENCIES);
|
|
@@ -2685,7 +2721,7 @@ var useDestroyRole = function useDestroyRole(_ref4) {
|
|
|
2685
2721
|
var useBulkUpdateRoles = function useBulkUpdateRoles(_ref6) {
|
|
2686
2722
|
var _onSuccess4 = _ref6.onSuccess,
|
|
2687
2723
|
options = _objectWithoutProperties(_ref6, _excluded4);
|
|
2688
|
-
return useMutation(organizationRolesApi.bulkUpdate, _objectSpread$
|
|
2724
|
+
return useMutation(organizationRolesApi.bulkUpdate, _objectSpread$e({
|
|
2689
2725
|
onSuccess: function onSuccess() {
|
|
2690
2726
|
queryClient.invalidateQueries(QUERY_KEYS.TEAMS);
|
|
2691
2727
|
queryClient.invalidateQueries(QUERY_KEYS.TEAMS_DEPENDENCIES);
|
|
@@ -2714,16 +2750,19 @@ var AddRoleButton = function AddRoleButton(_ref) {
|
|
|
2714
2750
|
var _useTranslation = useTranslation(),
|
|
2715
2751
|
t = _useTranslation.t;
|
|
2716
2752
|
var isCreatePermissionGranted = config.permissions.create;
|
|
2717
|
-
return /*#__PURE__*/
|
|
2753
|
+
return /*#__PURE__*/jsx(Tooltip, {
|
|
2718
2754
|
content: t("neetoTeamMembers.tooltips.noPermissionToAddRole"),
|
|
2719
2755
|
disabled: isCreatePermissionGranted,
|
|
2720
|
-
position: "bottom"
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2756
|
+
position: "bottom",
|
|
2757
|
+
children: /*#__PURE__*/jsx("span", {
|
|
2758
|
+
children: /*#__PURE__*/jsx(Button, {
|
|
2759
|
+
"data-cy": "ntm-add-role-button",
|
|
2760
|
+
disabled: !isCreatePermissionGranted,
|
|
2761
|
+
label: t("neetoTeamMembers.labels.addNewRole"),
|
|
2762
|
+
onClick: onClick
|
|
2763
|
+
})
|
|
2764
|
+
})
|
|
2765
|
+
});
|
|
2727
2766
|
};
|
|
2728
2767
|
|
|
2729
2768
|
var Header$3 = function Header(_ref) {
|
|
@@ -2737,43 +2776,49 @@ var Header$3 = function Header(_ref) {
|
|
|
2737
2776
|
var _useTranslation = useTranslation(),
|
|
2738
2777
|
t = _useTranslation.t;
|
|
2739
2778
|
var isUpdatePermissionGranted = config.permissions.update;
|
|
2740
|
-
return /*#__PURE__*/
|
|
2779
|
+
return /*#__PURE__*/jsx(NeetoHeader, {
|
|
2741
2780
|
breadcrumbs: renderBreadcrumbs(config === null || config === void 0 || (_config$header = config.header) === null || _config$header === void 0 ? void 0 : _config$header.breadcrumbs),
|
|
2742
2781
|
className: "ntm-roles-header",
|
|
2743
2782
|
searchProps: isNotEmpty(roles) ? renderSearchProps() : null,
|
|
2744
|
-
actionBlock: isDirty ? /*#__PURE__*/
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2783
|
+
actionBlock: isDirty ? /*#__PURE__*/jsxs(Fragment, {
|
|
2784
|
+
children: [/*#__PURE__*/jsx(Tooltip, {
|
|
2785
|
+
content: t("neetoTeamMembers.tooltips.noPermissionToEditRoles"),
|
|
2786
|
+
disabled: isUpdatePermissionGranted,
|
|
2787
|
+
position: "bottom",
|
|
2788
|
+
children: /*#__PURE__*/jsx("span", {
|
|
2789
|
+
children: /*#__PURE__*/jsx(Button, {
|
|
2790
|
+
"data-cy": "ntm-role-submission-button",
|
|
2791
|
+
disabled: !isUpdatePermissionGranted,
|
|
2792
|
+
label: t("neetoTeamMembers.buttons.saveChanges"),
|
|
2793
|
+
type: "submit",
|
|
2794
|
+
onClick: handleSubmit
|
|
2795
|
+
})
|
|
2796
|
+
})
|
|
2797
|
+
}), /*#__PURE__*/jsx(Button, {
|
|
2798
|
+
"data-cy": "ntm-role-reset-button",
|
|
2799
|
+
label: t("neetoTeamMembers.buttons.reset"),
|
|
2800
|
+
style: "text",
|
|
2801
|
+
type: "reset",
|
|
2802
|
+
onClick: handleReset
|
|
2803
|
+
})]
|
|
2804
|
+
}) : /*#__PURE__*/jsx(AddRoleButton, {
|
|
2761
2805
|
config: config,
|
|
2762
2806
|
onClick: function onClick() {
|
|
2763
2807
|
return setIsNewRolePaneOpen(true);
|
|
2764
2808
|
}
|
|
2765
2809
|
}),
|
|
2766
|
-
title: /*#__PURE__*/
|
|
2767
|
-
className: "neeto-ui-flex neeto-ui-items-center neeto-ui-gap-6"
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2810
|
+
title: /*#__PURE__*/jsxs("span", {
|
|
2811
|
+
className: "neeto-ui-flex neeto-ui-items-center neeto-ui-gap-6",
|
|
2812
|
+
children: [t("neetoTeamMembers.common.role", PLURAL), (config === null || config === void 0 ? void 0 : config.helpUrl) && /*#__PURE__*/jsx(Button, {
|
|
2813
|
+
className: "neeto-ui-mt-1",
|
|
2814
|
+
"data-cy": "ntm-roles-permission-more-info-button",
|
|
2815
|
+
href: config === null || config === void 0 ? void 0 : config.helpUrl,
|
|
2816
|
+
icon: ExternalLink,
|
|
2817
|
+
label: t("neetoTeamMembers.helpers.moreInfoAboutPermissions"),
|
|
2818
|
+
style: "link",
|
|
2819
|
+
target: "_blank"
|
|
2820
|
+
})]
|
|
2821
|
+
})
|
|
2777
2822
|
});
|
|
2778
2823
|
};
|
|
2779
2824
|
|
|
@@ -2866,8 +2911,8 @@ var ROLE_FORMIK_PROPS = {
|
|
|
2866
2911
|
validationSchema: ADD_ROLE_FORM_VALIDATION_SCHEMA
|
|
2867
2912
|
};
|
|
2868
2913
|
|
|
2869
|
-
function ownKeys$
|
|
2870
|
-
function _objectSpread$
|
|
2914
|
+
function ownKeys$d(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; }
|
|
2915
|
+
function _objectSpread$d(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$d(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$d(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2871
2916
|
var sortPermissionsBySequence = function sortPermissionsBySequence() {
|
|
2872
2917
|
var _permissions$;
|
|
2873
2918
|
var permissions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
@@ -2909,7 +2954,7 @@ var getModifiedPermissions = function getModifiedPermissions() {
|
|
|
2909
2954
|
var attachChildrenRecursively = function attachChildrenRecursively(permission, permissionsNameMap, permissionRelationConfig) {
|
|
2910
2955
|
var _ref = permissionRelationConfig[permission.name] || {},
|
|
2911
2956
|
children = _ref.children;
|
|
2912
|
-
return children ? _objectSpread$
|
|
2957
|
+
return children ? _objectSpread$d(_objectSpread$d({}, permission), {}, {
|
|
2913
2958
|
children: children.flatMap(function (childName) {
|
|
2914
2959
|
return attachChildrenRecursively(permissionsNameMap[childName][0], permissionsNameMap, permissionRelationConfig);
|
|
2915
2960
|
})
|
|
@@ -2935,8 +2980,8 @@ var getChildrenRemovedFromRoot = function getChildrenRemovedFromRoot(_ref3) {
|
|
|
2935
2980
|
});
|
|
2936
2981
|
};
|
|
2937
2982
|
|
|
2938
|
-
function ownKeys$
|
|
2939
|
-
function _objectSpread$
|
|
2983
|
+
function ownKeys$c(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; }
|
|
2984
|
+
function _objectSpread$c(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$c(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$c(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2940
2985
|
var Permissions = function Permissions(_ref) {
|
|
2941
2986
|
var _ref$permissions = _ref.permissions,
|
|
2942
2987
|
permissions = _ref$permissions === void 0 ? [] : _ref$permissions,
|
|
@@ -3009,59 +3054,69 @@ var Permissions = function Permissions(_ref) {
|
|
|
3009
3054
|
return pluck("description", permissionsNameMap[name]);
|
|
3010
3055
|
}).join(", ")
|
|
3011
3056
|
});
|
|
3012
|
-
return /*#__PURE__*/
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3057
|
+
return /*#__PURE__*/jsx(Fragment$1, {
|
|
3058
|
+
children: /*#__PURE__*/jsx(Tooltip, {
|
|
3059
|
+
content: tooltipMessage,
|
|
3060
|
+
disabled: !tooltipMessage || isChecked,
|
|
3061
|
+
position: "left-start",
|
|
3062
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
3063
|
+
className: "ntm-roles-permission__card",
|
|
3064
|
+
children: [/*#__PURE__*/jsx(Checkbox, {
|
|
3065
|
+
checked: isChecked,
|
|
3066
|
+
className: "flex-grow-0",
|
|
3067
|
+
"data-cy": "ntm-roles-permission-checkbox",
|
|
3068
|
+
disabled: isCheckingDisabled,
|
|
3069
|
+
label: description,
|
|
3070
|
+
onChange: function onChange() {
|
|
3071
|
+
return handleTogglePermission(id);
|
|
3072
|
+
}
|
|
3073
|
+
}), /*#__PURE__*/jsx("div", {
|
|
3074
|
+
className: "ntm-roles-permission__sub-blocks neeto-ui-relative neeto-ui-pl-6",
|
|
3075
|
+
children: sortedChildren === null || sortedChildren === void 0 ? void 0 : sortedChildren.map(function (childPermission) {
|
|
3076
|
+
return renderPermission(_objectSpread$c(_objectSpread$c({}, childPermission), {}, {
|
|
3077
|
+
isParentChecked: isChecked
|
|
3078
|
+
}));
|
|
3079
|
+
})
|
|
3080
|
+
})]
|
|
3081
|
+
})
|
|
3082
|
+
})
|
|
3083
|
+
}, id);
|
|
3036
3084
|
};
|
|
3037
|
-
return /*#__PURE__*/
|
|
3038
|
-
className: "ntm-roles-pane__body-wrapper"
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3085
|
+
return /*#__PURE__*/jsxs("div", {
|
|
3086
|
+
className: "ntm-roles-pane__body-wrapper",
|
|
3087
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
3088
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
3089
|
+
lineHeight: "normal",
|
|
3090
|
+
style: "h4",
|
|
3091
|
+
weight: "semibold",
|
|
3092
|
+
children: t("neetoTeamMembers.common.permission", SINGULAR)
|
|
3093
|
+
}), /*#__PURE__*/jsx(Typography, {
|
|
3094
|
+
lineHeight: "normal",
|
|
3095
|
+
style: "body2",
|
|
3096
|
+
children: t("neetoTeamMembers.helpers.configPermissions")
|
|
3097
|
+
})]
|
|
3098
|
+
}), Object.keys(groupedPermissions).map(function (category) {
|
|
3099
|
+
return /*#__PURE__*/jsxs("div", {
|
|
3100
|
+
className: "ntm-roles-permission",
|
|
3101
|
+
"data-cy": "ntm-roles-permission-card",
|
|
3102
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
3103
|
+
className: "ntm-roles-permission__heading neeto-ui-mb-2",
|
|
3104
|
+
"data-cy": "ntm-roles-permission-category-title",
|
|
3105
|
+
lineHeight: "normal",
|
|
3106
|
+
style: "h5",
|
|
3107
|
+
weight: "bold",
|
|
3108
|
+
children: category
|
|
3109
|
+
}), /*#__PURE__*/jsx("div", {
|
|
3110
|
+
className: "ntm-roles-permission-category-card",
|
|
3111
|
+
children: groupedPermissions[category].map(renderPermission)
|
|
3112
|
+
})]
|
|
3113
|
+
}, category);
|
|
3114
|
+
})]
|
|
3115
|
+
});
|
|
3061
3116
|
};
|
|
3062
3117
|
|
|
3063
|
-
function ownKeys$
|
|
3064
|
-
function _objectSpread$
|
|
3118
|
+
function ownKeys$b(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; }
|
|
3119
|
+
function _objectSpread$b(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$b(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$b(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
3065
3120
|
var ManageRoles = function ManageRoles(_ref) {
|
|
3066
3121
|
var config = _ref.config,
|
|
3067
3122
|
_ref$isOpen = _ref.isOpen,
|
|
@@ -3089,7 +3144,7 @@ var ManageRoles = function ManageRoles(_ref) {
|
|
|
3089
3144
|
var isSubmitting = isCreatingRole || isUpdatingRole;
|
|
3090
3145
|
var handleSubmit = function handleSubmit(formValues) {
|
|
3091
3146
|
var payload = {
|
|
3092
|
-
organizationRole: _objectSpread$
|
|
3147
|
+
organizationRole: _objectSpread$b(_objectSpread$b({}, formValues), {}, {
|
|
3093
3148
|
name: formValues.name.trim(),
|
|
3094
3149
|
description: formValues.description.trim()
|
|
3095
3150
|
})
|
|
@@ -3100,68 +3155,82 @@ var ManageRoles = function ManageRoles(_ref) {
|
|
|
3100
3155
|
}) : createRole(payload);
|
|
3101
3156
|
};
|
|
3102
3157
|
var initialValues = isEdit ? selectedRole : ADD_ROLE_FORM_INITIAL_VALUES;
|
|
3103
|
-
var formikProps = _objectSpread$
|
|
3158
|
+
var formikProps = _objectSpread$b(_objectSpread$b({}, ROLE_FORMIK_PROPS), {}, {
|
|
3104
3159
|
initialValues: initialValues,
|
|
3105
3160
|
onSubmit: handleSubmit
|
|
3106
3161
|
});
|
|
3107
3162
|
var isReadOnly = selectedRole.kind === "system";
|
|
3108
3163
|
var isDisabled = ADMIN_ROLES.includes(selectedRole.name) && isReadOnly;
|
|
3109
|
-
return /*#__PURE__*/
|
|
3164
|
+
return /*#__PURE__*/jsxs(Pane, {
|
|
3110
3165
|
initialFocusRef: inputReference,
|
|
3111
3166
|
isOpen: isOpen,
|
|
3112
|
-
onClose: onClose
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3167
|
+
onClose: onClose,
|
|
3168
|
+
children: [/*#__PURE__*/jsx(Pane.Header, {
|
|
3169
|
+
children: /*#__PURE__*/jsx(Typography, {
|
|
3170
|
+
"data-cy": "ntm-add-role-title",
|
|
3171
|
+
style: "h2",
|
|
3172
|
+
children: isEdit ? t("neetoTeamMembers.labels.editRole") : t("neetoTeamMembers.labels.addNewRole")
|
|
3173
|
+
})
|
|
3174
|
+
}), /*#__PURE__*/jsx(Form, {
|
|
3175
|
+
formikProps: formikProps,
|
|
3176
|
+
ref: formReference,
|
|
3177
|
+
children: function children(_ref2) {
|
|
3178
|
+
var _config$permissionRel;
|
|
3179
|
+
var dirty = _ref2.dirty;
|
|
3180
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
3181
|
+
children: [/*#__PURE__*/jsx(ScrollToErrorField, {
|
|
3182
|
+
formRef: formReference
|
|
3183
|
+
}), /*#__PURE__*/jsx(Pane.Body, {
|
|
3184
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
3185
|
+
className: "ntm-roles-pane__body",
|
|
3186
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
3187
|
+
className: "ntm-roles-pane__body-wrapper",
|
|
3188
|
+
children: [/*#__PURE__*/jsx(Input, {
|
|
3189
|
+
required: true,
|
|
3190
|
+
unlimitedChars: true,
|
|
3191
|
+
"data-cy": "ntm-add-role-name-text-field",
|
|
3192
|
+
label: t("neetoTeamMembers.common.name"),
|
|
3193
|
+
maxLength: ROLE_NAME_MAX_LENGTH,
|
|
3194
|
+
name: "name",
|
|
3195
|
+
placeholder: t("neetoTeamMembers.placeholders.enterName"),
|
|
3196
|
+
readOnly: isReadOnly,
|
|
3197
|
+
ref: inputReference
|
|
3198
|
+
}), /*#__PURE__*/jsx(Textarea, {
|
|
3199
|
+
unlimitedChars: true,
|
|
3200
|
+
"data-cy": "ntm-add-role-description-text-field",
|
|
3201
|
+
label: t("neetoTeamMembers.common.description"),
|
|
3202
|
+
maxLength: ROLE_DESCRIPTION_MAX_LENGTH,
|
|
3203
|
+
name: "description",
|
|
3204
|
+
readOnly: isDisabled,
|
|
3205
|
+
placeholder: t("neetoTeamMembers.placeholders.enterDescription")
|
|
3206
|
+
})]
|
|
3207
|
+
}), /*#__PURE__*/jsx(Permissions, {
|
|
3208
|
+
isDisabled: isDisabled,
|
|
3209
|
+
permissions: permissions,
|
|
3210
|
+
permissionRelationConfig: (_config$permissionRel = config === null || config === void 0 ? void 0 : config.permissionRelation) !== null && _config$permissionRel !== void 0 ? _config$permissionRel : {}
|
|
3211
|
+
})]
|
|
3212
|
+
})
|
|
3213
|
+
}), /*#__PURE__*/jsx(Pane.Footer, {
|
|
3214
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
3215
|
+
className: "ntm-roles-pane__footer",
|
|
3216
|
+
children: [/*#__PURE__*/jsx(Button, {
|
|
3217
|
+
"data-cy": "ntm-add-role-submit-button",
|
|
3218
|
+
disabled: !dirty || isSubmitting || isDisabled,
|
|
3219
|
+
label: t("neetoTeamMembers.buttons.saveChanges"),
|
|
3220
|
+
loading: isSubmitting,
|
|
3221
|
+
type: "submit"
|
|
3222
|
+
}), /*#__PURE__*/jsx(Button, {
|
|
3223
|
+
"data-cy": "ntm-add-role-cancel-button",
|
|
3224
|
+
label: t("neetoTeamMembers.buttons.cancel"),
|
|
3225
|
+
style: "text",
|
|
3226
|
+
onClick: onClose
|
|
3227
|
+
})]
|
|
3228
|
+
})
|
|
3229
|
+
})]
|
|
3230
|
+
});
|
|
3231
|
+
}
|
|
3232
|
+
})]
|
|
3233
|
+
});
|
|
3165
3234
|
};
|
|
3166
3235
|
|
|
3167
3236
|
var DEFAULT_MANAGE_ROLE_VALUES = {
|
|
@@ -3318,34 +3387,37 @@ var Row = function Row(_ref) {
|
|
|
3318
3387
|
var isCheckboxChecked = function isCheckboxChecked(role) {
|
|
3319
3388
|
return !allPermissionsOfCategory ? includes(permission === null || permission === void 0 ? void 0 : permission.id, role.permissionIds) : allPermissionIdsOfCategory.every(includes(__, role.permissionIds));
|
|
3320
3389
|
};
|
|
3321
|
-
return /*#__PURE__*/
|
|
3390
|
+
return /*#__PURE__*/jsx("div", {
|
|
3322
3391
|
className: classnames("ntm-roles-table__row", {
|
|
3323
3392
|
"ntm-roles-table__row--highlighted": !!allPermissionsOfCategory
|
|
3393
|
+
}),
|
|
3394
|
+
children: roles.map(function (role) {
|
|
3395
|
+
return /*#__PURE__*/jsx("div", {
|
|
3396
|
+
className: "ntm-roles-table__cell",
|
|
3397
|
+
style: {
|
|
3398
|
+
height: getRowClientHeight(permission)
|
|
3399
|
+
},
|
|
3400
|
+
children: /*#__PURE__*/jsx(Tooltip, {
|
|
3401
|
+
content: renderRolesTooltipContent(role.name),
|
|
3402
|
+
position: "top",
|
|
3403
|
+
disabled: isUpdatePermissionGranted && !identical(role.name, "Admin"),
|
|
3404
|
+
children: /*#__PURE__*/jsx("div", {
|
|
3405
|
+
className: "ntm-roles-table-cell__checkbox-wrapper",
|
|
3406
|
+
children: /*#__PURE__*/jsx(Checkbox, {
|
|
3407
|
+
disabled: true,
|
|
3408
|
+
checked: isCheckboxChecked(role),
|
|
3409
|
+
className: "ntm-roles-table-cell__checkbox",
|
|
3410
|
+
"data-cy": "ntm-roles-table-permission-checkbox",
|
|
3411
|
+
onChange: function onChange(_ref2) {
|
|
3412
|
+
var checked = _ref2.target.checked;
|
|
3413
|
+
return handleSubmit(role, checked);
|
|
3414
|
+
}
|
|
3415
|
+
})
|
|
3416
|
+
})
|
|
3417
|
+
})
|
|
3418
|
+
}, role.id);
|
|
3324
3419
|
})
|
|
3325
|
-
}
|
|
3326
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
3327
|
-
className: "ntm-roles-table__cell",
|
|
3328
|
-
key: role.id,
|
|
3329
|
-
style: {
|
|
3330
|
-
height: getRowClientHeight(permission)
|
|
3331
|
-
}
|
|
3332
|
-
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
3333
|
-
content: renderRolesTooltipContent(role.name),
|
|
3334
|
-
position: "top",
|
|
3335
|
-
disabled: isUpdatePermissionGranted && !identical(role.name, "Admin")
|
|
3336
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
3337
|
-
className: "ntm-roles-table-cell__checkbox-wrapper"
|
|
3338
|
-
}, /*#__PURE__*/React.createElement(Checkbox, {
|
|
3339
|
-
disabled: true,
|
|
3340
|
-
checked: isCheckboxChecked(role),
|
|
3341
|
-
className: "ntm-roles-table-cell__checkbox",
|
|
3342
|
-
"data-cy": "ntm-roles-table-permission-checkbox",
|
|
3343
|
-
onChange: function onChange(_ref2) {
|
|
3344
|
-
var checked = _ref2.target.checked;
|
|
3345
|
-
return handleSubmit(role, checked);
|
|
3346
|
-
}
|
|
3347
|
-
}))));
|
|
3348
|
-
}));
|
|
3420
|
+
});
|
|
3349
3421
|
};
|
|
3350
3422
|
|
|
3351
3423
|
var TableHeader = function TableHeader(_ref) {
|
|
@@ -3370,44 +3442,48 @@ var TableHeader = function TableHeader(_ref) {
|
|
|
3370
3442
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3371
3443
|
}, []);
|
|
3372
3444
|
useEffect(getOverflowStatus, [getOverflowStatus, scrollSyncElement, roles]);
|
|
3373
|
-
return /*#__PURE__*/
|
|
3445
|
+
return /*#__PURE__*/jsx(distExports.ScrollSyncPane, {
|
|
3374
3446
|
group: "horizontal",
|
|
3375
|
-
ref: scrollSyncElement
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3447
|
+
ref: scrollSyncElement,
|
|
3448
|
+
children: /*#__PURE__*/jsx("div", {
|
|
3449
|
+
className: "ntm-roles-table__header",
|
|
3450
|
+
"data-cy": "ntm-roles-table-header",
|
|
3451
|
+
children: roles === null || roles === void 0 ? void 0 : roles.map(function (role, index) {
|
|
3452
|
+
var isSystemRole = identical("system", role.kind);
|
|
3453
|
+
var isAdminRole = ADMIN_ROLES.includes(role.name) && isSystemRole;
|
|
3454
|
+
return /*#__PURE__*/jsx("div", {
|
|
3455
|
+
className: "ntm-roles-table__cell",
|
|
3456
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
3457
|
+
className: "ntm-roles-table-header-cell__container",
|
|
3458
|
+
"data-cy": "ntm-roles-table-role-header",
|
|
3459
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
3460
|
+
className: "ntm-roles-table-header__role-name",
|
|
3461
|
+
"data-cy": "ntm-roles-table-header-role-title",
|
|
3462
|
+
lineHeight: "normal",
|
|
3463
|
+
style: "h4",
|
|
3464
|
+
weight: "semibold",
|
|
3465
|
+
children: role.name
|
|
3466
|
+
}), !isAdminRole && /*#__PURE__*/jsx(MoreDropdown, {
|
|
3467
|
+
dropdownProps: {
|
|
3468
|
+
autoWidth: true
|
|
3469
|
+
},
|
|
3470
|
+
dropdownButtonProps: {
|
|
3471
|
+
className: "ntm-roles-table-header__dropdown",
|
|
3472
|
+
"data-cy": "ntm-roles-table-header-role-dropdown-button"
|
|
3473
|
+
},
|
|
3474
|
+
menuItems: getMenuItems({
|
|
3475
|
+
isDeletePermissionGranted: isDeletePermissionGranted,
|
|
3476
|
+
isUpdatePermissionGranted: isUpdatePermissionGranted,
|
|
3477
|
+
role: role,
|
|
3478
|
+
setManageRole: setManageRole,
|
|
3479
|
+
isSystemRole: isSystemRole
|
|
3480
|
+
})
|
|
3481
|
+
})]
|
|
3482
|
+
})
|
|
3483
|
+
}, "ntm-roles-".concat(index));
|
|
3408
3484
|
})
|
|
3409
|
-
})
|
|
3410
|
-
})
|
|
3485
|
+
})
|
|
3486
|
+
});
|
|
3411
3487
|
};
|
|
3412
3488
|
var TableHeader$1 = /*#__PURE__*/memo(TableHeader);
|
|
3413
3489
|
|
|
@@ -3436,13 +3512,13 @@ var Delete = function Delete(_ref) {
|
|
|
3436
3512
|
payload: payload
|
|
3437
3513
|
});
|
|
3438
3514
|
};
|
|
3439
|
-
return /*#__PURE__*/
|
|
3515
|
+
return /*#__PURE__*/jsx(Alert, {
|
|
3440
3516
|
cancelButtonLabel: t("neetoTeamMembers.buttons.cancel"),
|
|
3441
3517
|
isOpen: isOpen,
|
|
3442
3518
|
isSubmitting: isDeleting,
|
|
3443
3519
|
submitButtonLabel: t("neetoTeamMembers.buttons.delete"),
|
|
3444
3520
|
title: t("neetoTeamMembers.labels.deleteRole"),
|
|
3445
|
-
message: /*#__PURE__*/
|
|
3521
|
+
message: /*#__PURE__*/jsx(Trans, {
|
|
3446
3522
|
i18nKey: "neetoTeamMembers.alerts.messages.deletingRole",
|
|
3447
3523
|
values: {
|
|
3448
3524
|
name: selectedRole === null || selectedRole === void 0 ? void 0 : selectedRole.name
|
|
@@ -3469,59 +3545,61 @@ var Columns = function Columns(_ref) {
|
|
|
3469
3545
|
var onClose = function onClose() {
|
|
3470
3546
|
return setManageRole(DEFAULT_MANAGE_ROLE_VALUES);
|
|
3471
3547
|
};
|
|
3472
|
-
return /*#__PURE__*/
|
|
3473
|
-
className: "ntm-roles-table__columns"
|
|
3474
|
-
|
|
3475
|
-
config: config,
|
|
3476
|
-
roles: filteredRoles,
|
|
3477
|
-
setIsScrollPresent: setIsScrollPresent,
|
|
3478
|
-
setManageRole: setManageRole
|
|
3479
|
-
}), /*#__PURE__*/React.createElement(distExports.ScrollSyncPane, {
|
|
3480
|
-
group: ["horizontal", "vertical"]
|
|
3481
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
3482
|
-
className: "ntm-roles-table__rows"
|
|
3483
|
-
}, categories.map(function (category, index) {
|
|
3484
|
-
var groupedPermissions = filteredGroupPermissions.get(category);
|
|
3485
|
-
var isPermissionVisible = groupedPermissions.get("isPermissionVisible");
|
|
3486
|
-
var permissions = groupedPermissions.get("permissions");
|
|
3487
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
3488
|
-
key: index
|
|
3489
|
-
}, /*#__PURE__*/React.createElement(Row, {
|
|
3490
|
-
allPermissionsOfCategory: groupedPermissions,
|
|
3548
|
+
return /*#__PURE__*/jsxs("div", {
|
|
3549
|
+
className: "ntm-roles-table__columns",
|
|
3550
|
+
children: [/*#__PURE__*/jsx(TableHeader$1, {
|
|
3491
3551
|
config: config,
|
|
3492
3552
|
roles: filteredRoles,
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
|
|
3512
|
-
|
|
3513
|
-
|
|
3514
|
-
|
|
3553
|
+
setIsScrollPresent: setIsScrollPresent,
|
|
3554
|
+
setManageRole: setManageRole
|
|
3555
|
+
}), /*#__PURE__*/jsx(distExports.ScrollSyncPane, {
|
|
3556
|
+
group: ["horizontal", "vertical"],
|
|
3557
|
+
children: /*#__PURE__*/jsx("div", {
|
|
3558
|
+
className: "ntm-roles-table__rows",
|
|
3559
|
+
children: categories.map(function (category, index) {
|
|
3560
|
+
var groupedPermissions = filteredGroupPermissions.get(category);
|
|
3561
|
+
var isPermissionVisible = groupedPermissions.get("isPermissionVisible");
|
|
3562
|
+
var permissions = groupedPermissions.get("permissions");
|
|
3563
|
+
return /*#__PURE__*/jsxs("div", {
|
|
3564
|
+
children: [/*#__PURE__*/jsx(Row, {
|
|
3565
|
+
allPermissionsOfCategory: groupedPermissions,
|
|
3566
|
+
config: config,
|
|
3567
|
+
roles: filteredRoles,
|
|
3568
|
+
setModifiedRoles: setModifiedRoles
|
|
3569
|
+
}), isPermissionVisible && permissions.map(function (permission) {
|
|
3570
|
+
return /*#__PURE__*/jsx(Row, {
|
|
3571
|
+
config: config,
|
|
3572
|
+
permission: permission,
|
|
3573
|
+
roles: filteredRoles,
|
|
3574
|
+
setModifiedRoles: setModifiedRoles
|
|
3575
|
+
}, permission.id);
|
|
3576
|
+
})]
|
|
3577
|
+
}, index);
|
|
3578
|
+
})
|
|
3579
|
+
})
|
|
3580
|
+
}), /*#__PURE__*/jsx(ManageRoles, {
|
|
3581
|
+
config: config,
|
|
3582
|
+
isOpen: manageRole.isEdit,
|
|
3583
|
+
permissions: permissions,
|
|
3584
|
+
selectedRole: manageRole.selectedRole,
|
|
3585
|
+
onClose: onClose
|
|
3586
|
+
}), /*#__PURE__*/jsx(Delete, {
|
|
3587
|
+
isOpen: manageRole.isDelete,
|
|
3588
|
+
roles: roles,
|
|
3589
|
+
selectedRole: manageRole.selectedRole,
|
|
3590
|
+
onClose: onClose
|
|
3591
|
+
})]
|
|
3592
|
+
});
|
|
3515
3593
|
};
|
|
3516
3594
|
|
|
3517
3595
|
var ToggleDropdown = function ToggleDropdown(_ref) {
|
|
3518
3596
|
var isVisible = _ref.isVisible;
|
|
3519
|
-
return isVisible ? /*#__PURE__*/
|
|
3597
|
+
return isVisible ? /*#__PURE__*/jsx(Up, {
|
|
3520
3598
|
className: "ntm-roles-table-sidebar__drop-down-button",
|
|
3521
3599
|
"data-cy": "ntm-permission-category-hide-button",
|
|
3522
3600
|
size: 16,
|
|
3523
3601
|
strokeWidth: 2
|
|
3524
|
-
}) : /*#__PURE__*/
|
|
3602
|
+
}) : /*#__PURE__*/jsx(Down, {
|
|
3525
3603
|
className: "ntm-roles-table-sidebar__drop-down-button",
|
|
3526
3604
|
"data-cy": "ntm-permission-category-show-button",
|
|
3527
3605
|
size: 16,
|
|
@@ -3533,15 +3611,16 @@ var renderDescription = function renderDescription(permissions) {
|
|
|
3533
3611
|
return permissions === null || permissions === void 0 ? void 0 : permissions.map(function (_ref) {
|
|
3534
3612
|
var id = _ref.id,
|
|
3535
3613
|
description = _ref.description;
|
|
3536
|
-
return /*#__PURE__*/
|
|
3614
|
+
return /*#__PURE__*/jsx("div", {
|
|
3537
3615
|
className: "ntm-roles-table-sidebar__list-item",
|
|
3538
3616
|
"data-name": description,
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3617
|
+
children: /*#__PURE__*/jsx(Typography, {
|
|
3618
|
+
"data-cy": "ntm-permission-category-description",
|
|
3619
|
+
lineHeight: "normal",
|
|
3620
|
+
style: "body2",
|
|
3621
|
+
children: description
|
|
3622
|
+
})
|
|
3623
|
+
}, id);
|
|
3545
3624
|
});
|
|
3546
3625
|
};
|
|
3547
3626
|
var getSearchWrapperStyle = function getSearchWrapperStyle() {
|
|
@@ -3562,45 +3641,51 @@ var Sidebar = function Sidebar(_ref) {
|
|
|
3562
3641
|
t = _useTranslation.t;
|
|
3563
3642
|
var categories = Array.from(filteredGroupPermissions.keys());
|
|
3564
3643
|
var searchWrapperStyle = isScrollPresent ? getSearchWrapperStyle() : {};
|
|
3565
|
-
return /*#__PURE__*/
|
|
3566
|
-
className: "ntm-roles-table__sidebar"
|
|
3567
|
-
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
|
|
3588
|
-
|
|
3589
|
-
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
|
|
3644
|
+
return /*#__PURE__*/jsxs("div", {
|
|
3645
|
+
className: "ntm-roles-table__sidebar",
|
|
3646
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
3647
|
+
className: "ntm-roles-table-sidebar__search",
|
|
3648
|
+
style: searchWrapperStyle,
|
|
3649
|
+
children: /*#__PURE__*/jsx(Input$1, {
|
|
3650
|
+
"data-cy": "ntm-search-permissions-input",
|
|
3651
|
+
prefix: /*#__PURE__*/jsx(Search, {}),
|
|
3652
|
+
type: "search",
|
|
3653
|
+
value: searchTerm,
|
|
3654
|
+
placeholder: t("neetoTeamMembers.placeholders.searchPermission", PLURAL),
|
|
3655
|
+
onChange: function onChange(_ref2) {
|
|
3656
|
+
var value = _ref2.target.value;
|
|
3657
|
+
return setSearchTerm(value);
|
|
3658
|
+
}
|
|
3659
|
+
})
|
|
3660
|
+
}), /*#__PURE__*/jsx(distExports.ScrollSyncPane, {
|
|
3661
|
+
group: "vertical",
|
|
3662
|
+
children: /*#__PURE__*/jsx("div", {
|
|
3663
|
+
className: "ntm-roles-table-sidebar__list",
|
|
3664
|
+
children: categories.map(function (category, index) {
|
|
3665
|
+
var groupedPermissions = filteredGroupPermissions.get(category);
|
|
3666
|
+
var isPermissionVisible = groupedPermissions.get("isPermissionVisible");
|
|
3667
|
+
var permissions = groupedPermissions.get("permissions");
|
|
3668
|
+
return /*#__PURE__*/jsxs("div", {
|
|
3669
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
3670
|
+
className: "ntm-roles-table-sidebar__list-item ntm-roles-table-sidebar__list-item--highlighted cursor-pointer",
|
|
3671
|
+
onClick: function onClick() {
|
|
3672
|
+
return toggleDropdown(category);
|
|
3673
|
+
},
|
|
3674
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
3675
|
+
"data-cy": "ntm-permission-category-title",
|
|
3676
|
+
lineHeight: "normal",
|
|
3677
|
+
style: "h4",
|
|
3678
|
+
weight: "semibold",
|
|
3679
|
+
children: category
|
|
3680
|
+
}), /*#__PURE__*/jsx(ToggleDropdown, {
|
|
3681
|
+
isVisible: isPermissionVisible
|
|
3682
|
+
})]
|
|
3683
|
+
}), isPermissionVisible && renderDescription(permissions)]
|
|
3684
|
+
}, index);
|
|
3685
|
+
})
|
|
3686
|
+
})
|
|
3687
|
+
})]
|
|
3688
|
+
});
|
|
3604
3689
|
};
|
|
3605
3690
|
|
|
3606
3691
|
var Table = function Table(_ref) {
|
|
@@ -3646,54 +3731,61 @@ var Table = function Table(_ref) {
|
|
|
3646
3731
|
var newValue = filterPermissionsBySearch(searchTerm, permissionGroups);
|
|
3647
3732
|
setFilteredGroupPermissions(newValue);
|
|
3648
3733
|
}, [permissionGroups, searchTerm]);
|
|
3649
|
-
return /*#__PURE__*/
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3734
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
3735
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
3736
|
+
className: "ntm-roles-table__wrapper",
|
|
3737
|
+
children: /*#__PURE__*/jsx("div", {
|
|
3738
|
+
className: "ntm-roles-table__container",
|
|
3739
|
+
children: isEmpty(filteredRoles) ? /*#__PURE__*/jsx("div", {
|
|
3740
|
+
className: "ntm-empty-state",
|
|
3741
|
+
children: /*#__PURE__*/jsx(NoData, {
|
|
3742
|
+
title: t("neetoTeamMembers.labels.roleNotFound", PLURAL),
|
|
3743
|
+
primaryButtonProps: {
|
|
3744
|
+
"data-cy": "ntm-add-role-button",
|
|
3745
|
+
disabled: !isCreatePermissionGranted,
|
|
3746
|
+
label: t("neetoTeamMembers.labels.addNewRole"),
|
|
3747
|
+
onClick: function onClick() {
|
|
3748
|
+
return setIsNewRolePaneOpen(true);
|
|
3749
|
+
}
|
|
3750
|
+
}
|
|
3751
|
+
})
|
|
3752
|
+
}) : /*#__PURE__*/jsxs(Fragment, {
|
|
3753
|
+
children: [/*#__PURE__*/jsx(Sidebar, {
|
|
3754
|
+
filteredGroupPermissions: filteredGroupPermissions,
|
|
3755
|
+
isScrollPresent: isScrollPresent,
|
|
3756
|
+
searchTerm: searchTerm,
|
|
3757
|
+
setSearchTerm: setSearchTerm,
|
|
3758
|
+
toggleDropdown: toggleDropdown
|
|
3759
|
+
}), /*#__PURE__*/jsx(Columns, {
|
|
3760
|
+
config: config,
|
|
3761
|
+
filteredGroupPermissions: filteredGroupPermissions,
|
|
3762
|
+
filteredRoles: filteredRoles,
|
|
3763
|
+
permissions: permissions,
|
|
3764
|
+
roles: roles,
|
|
3765
|
+
setIsScrollPresent: setIsScrollPresent,
|
|
3766
|
+
setModifiedRoles: setModifiedRoles
|
|
3767
|
+
})]
|
|
3768
|
+
})
|
|
3769
|
+
})
|
|
3770
|
+
}), /*#__PURE__*/jsx(ManageRoles, {
|
|
3771
|
+
config: config,
|
|
3772
|
+
permissions: permissions,
|
|
3773
|
+
selectedRole: selectedRole,
|
|
3774
|
+
isOpen: isEditPaneOpen,
|
|
3775
|
+
onClose: function onClose() {
|
|
3776
|
+
setSelectedRole(undefined);
|
|
3777
|
+
setIsEditPaneOpen(false);
|
|
3663
3778
|
}
|
|
3664
|
-
}
|
|
3665
|
-
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
filteredRoles: filteredRoles,
|
|
3675
|
-
permissions: permissions,
|
|
3676
|
-
roles: roles,
|
|
3677
|
-
setIsScrollPresent: setIsScrollPresent,
|
|
3678
|
-
setModifiedRoles: setModifiedRoles
|
|
3679
|
-
})))), /*#__PURE__*/React.createElement(ManageRoles, {
|
|
3680
|
-
config: config,
|
|
3681
|
-
permissions: permissions,
|
|
3682
|
-
selectedRole: selectedRole,
|
|
3683
|
-
isOpen: isEditPaneOpen,
|
|
3684
|
-
onClose: function onClose() {
|
|
3685
|
-
setSelectedRole(undefined);
|
|
3686
|
-
setIsEditPaneOpen(false);
|
|
3687
|
-
}
|
|
3688
|
-
}), /*#__PURE__*/React.createElement(Delete, {
|
|
3689
|
-
roles: roles,
|
|
3690
|
-
selectedRole: selectedRole,
|
|
3691
|
-
isOpen: isDeleteAlertOpen,
|
|
3692
|
-
onClose: function onClose() {
|
|
3693
|
-
setSelectedRole(undefined);
|
|
3694
|
-
setIsDeleteAlertOpen(false);
|
|
3695
|
-
}
|
|
3696
|
-
}));
|
|
3779
|
+
}), /*#__PURE__*/jsx(Delete, {
|
|
3780
|
+
roles: roles,
|
|
3781
|
+
selectedRole: selectedRole,
|
|
3782
|
+
isOpen: isDeleteAlertOpen,
|
|
3783
|
+
onClose: function onClose() {
|
|
3784
|
+
setSelectedRole(undefined);
|
|
3785
|
+
setIsDeleteAlertOpen(false);
|
|
3786
|
+
}
|
|
3787
|
+
})]
|
|
3788
|
+
});
|
|
3697
3789
|
};
|
|
3698
3790
|
|
|
3699
3791
|
var Roles = function Roles(_ref) {
|
|
@@ -3746,35 +3838,41 @@ var Roles = function Roles(_ref) {
|
|
|
3746
3838
|
return setModifiedRoles(roles);
|
|
3747
3839
|
};
|
|
3748
3840
|
if (isRolesLoading || isPermissionsLoading) {
|
|
3749
|
-
return /*#__PURE__*/
|
|
3750
|
-
className: "ntm-members-page-loader"
|
|
3751
|
-
|
|
3841
|
+
return /*#__PURE__*/jsx("div", {
|
|
3842
|
+
className: "ntm-members-page-loader",
|
|
3843
|
+
children: /*#__PURE__*/jsx(PageLoader, {})
|
|
3844
|
+
});
|
|
3752
3845
|
}
|
|
3753
|
-
return /*#__PURE__*/
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
|
|
3846
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
3847
|
+
children: [/*#__PURE__*/jsx(distExports.ScrollSync, {
|
|
3848
|
+
children: /*#__PURE__*/jsxs(Container, {
|
|
3849
|
+
isHeaderFixed: true,
|
|
3850
|
+
children: [/*#__PURE__*/jsx(Header$3, {
|
|
3851
|
+
config: config,
|
|
3852
|
+
handleReset: handleReset,
|
|
3853
|
+
handleSubmit: handleSubmit,
|
|
3854
|
+
isDirty: isDirty,
|
|
3855
|
+
roles: roles,
|
|
3856
|
+
setIsNewRolePaneOpen: setIsNewRolePaneOpen
|
|
3857
|
+
}), /*#__PURE__*/jsx(Table, {
|
|
3858
|
+
config: config,
|
|
3859
|
+
filteredRoles: filteredRoles,
|
|
3860
|
+
permissionGroups: permissionGroups,
|
|
3861
|
+
permissions: permissions,
|
|
3862
|
+
roles: roles,
|
|
3863
|
+
setIsNewRolePaneOpen: setIsNewRolePaneOpen,
|
|
3864
|
+
setModifiedRoles: setModifiedRoles
|
|
3865
|
+
})]
|
|
3866
|
+
})
|
|
3867
|
+
}), /*#__PURE__*/jsx(ManageRoles, {
|
|
3868
|
+
config: config,
|
|
3869
|
+
permissions: permissions,
|
|
3870
|
+
isOpen: isNewRolePaneOpen,
|
|
3871
|
+
onClose: function onClose() {
|
|
3872
|
+
return setIsNewRolePaneOpen(false);
|
|
3873
|
+
}
|
|
3874
|
+
})]
|
|
3875
|
+
});
|
|
3778
3876
|
};
|
|
3779
3877
|
var index$1 = withTitle(withReactQuery(Roles), i18next.t("neetoTeamMembers.common.role", PLURAL));
|
|
3780
3878
|
|
|
@@ -4319,7 +4417,7 @@ var callBound$1 = function callBoundIntrinsic(name, allowMissing) {
|
|
|
4319
4417
|
return intrinsic;
|
|
4320
4418
|
};
|
|
4321
4419
|
|
|
4322
|
-
var util_inspect = require$$0.inspect;
|
|
4420
|
+
var util_inspect = require$$0$1.inspect;
|
|
4323
4421
|
|
|
4324
4422
|
var hasMap = typeof Map === 'function' && Map.prototype;
|
|
4325
4423
|
var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null;
|
|
@@ -5869,14 +5967,14 @@ var teamsApi = {
|
|
|
5869
5967
|
|
|
5870
5968
|
var _excluded$2 = ["onSuccess"],
|
|
5871
5969
|
_excluded2$1 = ["onSuccess"];
|
|
5872
|
-
function ownKeys$
|
|
5873
|
-
function _objectSpread$
|
|
5970
|
+
function ownKeys$a(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; }
|
|
5971
|
+
function _objectSpread$a(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$a(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$a(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5874
5972
|
var useFetchMembers = function useFetchMembers() {
|
|
5875
5973
|
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
5876
5974
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
5877
5975
|
return useQuery([QUERY_KEYS.TEAMS, params], function () {
|
|
5878
5976
|
return teamsApi.fetch(params);
|
|
5879
|
-
}, _objectSpread$
|
|
5977
|
+
}, _objectSpread$a(_objectSpread$a({
|
|
5880
5978
|
select: identity,
|
|
5881
5979
|
keepPreviousData: true
|
|
5882
5980
|
}, options), {}, {
|
|
@@ -5885,7 +5983,7 @@ var useFetchMembers = function useFetchMembers() {
|
|
|
5885
5983
|
};
|
|
5886
5984
|
var useFetchMembersCountsPerCategory = function useFetchMembersCountsPerCategory() {
|
|
5887
5985
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
5888
|
-
return useQuery([QUERY_KEYS.TEAMS], teamsApi.fetchCountsPerCategory, _objectSpread$
|
|
5986
|
+
return useQuery([QUERY_KEYS.TEAMS], teamsApi.fetchCountsPerCategory, _objectSpread$a(_objectSpread$a({
|
|
5889
5987
|
select: identity,
|
|
5890
5988
|
keepPreviousData: true
|
|
5891
5989
|
}, options), {}, {
|
|
@@ -5903,7 +6001,7 @@ var useUpdateMember = function useUpdateMember(_ref) {
|
|
|
5903
6001
|
var id = _ref2.id,
|
|
5904
6002
|
payload = _ref2.payload;
|
|
5905
6003
|
return teamsApi.update(id, payload);
|
|
5906
|
-
}, _objectSpread$
|
|
6004
|
+
}, _objectSpread$a({
|
|
5907
6005
|
keysToInvalidate: [QUERY_KEYS.TEAMS, QUERY_KEYS.TEAMS_DEPENDENCIES],
|
|
5908
6006
|
onSuccess: function onSuccess() {
|
|
5909
6007
|
_onSuccess === null || _onSuccess === void 0 || _onSuccess();
|
|
@@ -5913,7 +6011,7 @@ var useUpdateMember = function useUpdateMember(_ref) {
|
|
|
5913
6011
|
var useBulkUpdateMembers = function useBulkUpdateMembers(_ref3) {
|
|
5914
6012
|
var _onSuccess2 = _ref3.onSuccess,
|
|
5915
6013
|
options = _objectWithoutProperties(_ref3, _excluded2$1);
|
|
5916
|
-
return useMutationWithInvalidation(teamsApi.bulkUpdate, _objectSpread$
|
|
6014
|
+
return useMutationWithInvalidation(teamsApi.bulkUpdate, _objectSpread$a({
|
|
5917
6015
|
keysToInvalidate: [QUERY_KEYS.TEAMS, QUERY_KEYS.TEAMS_DEPENDENCIES],
|
|
5918
6016
|
onSuccess: function onSuccess() {
|
|
5919
6017
|
_onSuccess2 === null || _onSuccess2 === void 0 || _onSuccess2();
|
|
@@ -5931,7 +6029,7 @@ var useFetchFilterOptions = function useFetchFilterOptions(_ref4) {
|
|
|
5931
6029
|
options = _ref4$options === void 0 ? {} : _ref4$options;
|
|
5932
6030
|
return useQuery([QUERY_KEYS.TEAMS_DEPENDENCIES, params], function () {
|
|
5933
6031
|
return teamsApi.fetchFilterOptions(params);
|
|
5934
|
-
}, _objectSpread$
|
|
6032
|
+
}, _objectSpread$a(_objectSpread$a({
|
|
5935
6033
|
select: identity
|
|
5936
6034
|
}, options), {}, {
|
|
5937
6035
|
refetchOnWindowFocus: false
|
|
@@ -5987,8 +6085,8 @@ var DEFAULT_SELECTED_ROWS = {
|
|
|
5987
6085
|
};
|
|
5988
6086
|
var TEAM_MEMBERS_HIDDEN_COLUMNS = "TEAM_MEMBERS_TABLE_HIDDEN_COLUMNS";
|
|
5989
6087
|
|
|
5990
|
-
function ownKeys$
|
|
5991
|
-
function _objectSpread$
|
|
6088
|
+
function ownKeys$9(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; }
|
|
6089
|
+
function _objectSpread$9(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$9(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$9(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5992
6090
|
var MenuItem$2 = Dropdown.MenuItem;
|
|
5993
6091
|
var renderNameColumn = function renderNameColumn(_ref) {
|
|
5994
6092
|
var config = _ref.config,
|
|
@@ -6000,36 +6098,39 @@ var renderNameColumn = function renderNameColumn(_ref) {
|
|
|
6000
6098
|
name = tableData.displayName,
|
|
6001
6099
|
imageUrl = tableData.profileImageUrl,
|
|
6002
6100
|
subscriptionPlan = tableData.subscriptionPlan;
|
|
6003
|
-
return /*#__PURE__*/
|
|
6004
|
-
className: "ntm-members-table__wrapper"
|
|
6005
|
-
|
|
6006
|
-
|
|
6007
|
-
|
|
6008
|
-
|
|
6009
|
-
|
|
6010
|
-
|
|
6011
|
-
|
|
6012
|
-
|
|
6013
|
-
|
|
6014
|
-
|
|
6015
|
-
|
|
6016
|
-
|
|
6017
|
-
|
|
6018
|
-
|
|
6019
|
-
|
|
6020
|
-
|
|
6021
|
-
|
|
6022
|
-
|
|
6023
|
-
|
|
6024
|
-
|
|
6025
|
-
|
|
6026
|
-
|
|
6027
|
-
|
|
6028
|
-
|
|
6029
|
-
|
|
6030
|
-
|
|
6031
|
-
|
|
6032
|
-
|
|
6101
|
+
return /*#__PURE__*/jsxs("div", {
|
|
6102
|
+
className: "ntm-members-table__wrapper",
|
|
6103
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
6104
|
+
className: "ntm-members-table__column",
|
|
6105
|
+
children: [/*#__PURE__*/jsx(Avatar, {
|
|
6106
|
+
size: "medium",
|
|
6107
|
+
user: {
|
|
6108
|
+
name: name,
|
|
6109
|
+
imageUrl: imageUrl
|
|
6110
|
+
}
|
|
6111
|
+
}), /*#__PURE__*/jsx(Typography, {
|
|
6112
|
+
"data-cy": "ntm-member-name-".concat(hyphenize(name)),
|
|
6113
|
+
style: "body2",
|
|
6114
|
+
children: name
|
|
6115
|
+
}), displayStatusTag && /*#__PURE__*/jsx(Tag, {
|
|
6116
|
+
"data-cy": "ntm-member-status-tag",
|
|
6117
|
+
style: active ? "primary" : "secondary",
|
|
6118
|
+
type: "outline",
|
|
6119
|
+
label: active ? i18next.t(MEMBER_FILTER.ACTIVE.label) : i18next.t(MEMBER_FILTER.DEACTIVATED.label)
|
|
6120
|
+
}), subscriptionPlan === SUBSCRIPTION_PLANS.PRO && /*#__PURE__*/jsx(Tag, {
|
|
6121
|
+
className: "neeto-ui-text-transform-uppercase",
|
|
6122
|
+
"data-cy": "ntm-member-subscription-plan-tag",
|
|
6123
|
+
label: i18next.t("neetoTeamMembers.common.pro"),
|
|
6124
|
+
style: "info",
|
|
6125
|
+
type: "outline"
|
|
6126
|
+
})]
|
|
6127
|
+
}), renderDropdownButton({
|
|
6128
|
+
config: config,
|
|
6129
|
+
handleUpdateRole: handleUpdateRole,
|
|
6130
|
+
handleUpdateStatus: handleUpdateStatus,
|
|
6131
|
+
tableData: tableData
|
|
6132
|
+
})]
|
|
6133
|
+
});
|
|
6033
6134
|
};
|
|
6034
6135
|
var renderDropdownButton = function renderDropdownButton(_ref2) {
|
|
6035
6136
|
var _config$table, _config$table$dropdow;
|
|
@@ -6037,7 +6138,7 @@ var renderDropdownButton = function renderDropdownButton(_ref2) {
|
|
|
6037
6138
|
handleUpdateRole = _ref2.handleUpdateRole,
|
|
6038
6139
|
handleUpdateStatus = _ref2.handleUpdateStatus,
|
|
6039
6140
|
tableData = _ref2.tableData;
|
|
6040
|
-
return /*#__PURE__*/
|
|
6141
|
+
return /*#__PURE__*/jsx(MoreDropdown, {
|
|
6041
6142
|
dropdownProps: {
|
|
6042
6143
|
appendTo: function appendTo() {
|
|
6043
6144
|
return document.body;
|
|
@@ -6054,26 +6155,33 @@ var renderDropdownButton = function renderDropdownButton(_ref2) {
|
|
|
6054
6155
|
position: "top"
|
|
6055
6156
|
}
|
|
6056
6157
|
},
|
|
6057
|
-
menuTopChildren: /*#__PURE__*/
|
|
6058
|
-
|
|
6059
|
-
|
|
6060
|
-
|
|
6061
|
-
|
|
6062
|
-
|
|
6063
|
-
|
|
6064
|
-
|
|
6065
|
-
|
|
6066
|
-
|
|
6067
|
-
|
|
6068
|
-
|
|
6069
|
-
|
|
6070
|
-
|
|
6071
|
-
|
|
6072
|
-
|
|
6073
|
-
|
|
6074
|
-
|
|
6075
|
-
|
|
6076
|
-
|
|
6158
|
+
menuTopChildren: /*#__PURE__*/jsxs(Fragment, {
|
|
6159
|
+
children: [/*#__PURE__*/jsx(Tooltip, {
|
|
6160
|
+
disabled: tableData.active,
|
|
6161
|
+
position: "top",
|
|
6162
|
+
content: i18next.t("neetoTeamMembers.tooltips.activateUserToEdit", SINGULAR),
|
|
6163
|
+
children: /*#__PURE__*/jsx("span", {
|
|
6164
|
+
children: /*#__PURE__*/jsx(MenuItem$2.Button, {
|
|
6165
|
+
className: "ntm-dropdown__button",
|
|
6166
|
+
"data-cy": "ntm-edit-member-button",
|
|
6167
|
+
isDisabled: not(tableData.active),
|
|
6168
|
+
size: "small",
|
|
6169
|
+
onClick: function onClick() {
|
|
6170
|
+
return tableData.active && handleUpdateRole(tableData);
|
|
6171
|
+
},
|
|
6172
|
+
children: i18next.t("neetoTeamMembers.common.edit")
|
|
6173
|
+
})
|
|
6174
|
+
})
|
|
6175
|
+
}), config === null || config === void 0 || (_config$table = config.table) === null || _config$table === void 0 || (_config$table$dropdow = _config$table.dropdownProps) === null || _config$table$dropdow === void 0 ? void 0 : _config$table$dropdow.call(_config$table, tableData), /*#__PURE__*/jsx(MenuItem$2.Button, {
|
|
6176
|
+
className: "ntm-dropdown__button",
|
|
6177
|
+
"data-cy": "ntm-deactivate-member-button",
|
|
6178
|
+
size: "small",
|
|
6179
|
+
onClick: function onClick() {
|
|
6180
|
+
return handleUpdateStatus(tableData);
|
|
6181
|
+
},
|
|
6182
|
+
children: tableData.active ? i18next.t("neetoTeamMembers.common.deactivate") : i18next.t("neetoTeamMembers.common.activate")
|
|
6183
|
+
})]
|
|
6184
|
+
})
|
|
6077
6185
|
});
|
|
6078
6186
|
};
|
|
6079
6187
|
var getDefaultAlertTitle = function getDefaultAlertTitle(_ref3) {
|
|
@@ -6086,8 +6194,8 @@ var getDefaultAlertTitle = function getDefaultAlertTitle(_ref3) {
|
|
|
6086
6194
|
};
|
|
6087
6195
|
var getDefaultAlertMessage = function getDefaultAlertMessage(_ref4) {
|
|
6088
6196
|
var member = _ref4.member;
|
|
6089
|
-
return /*#__PURE__*/
|
|
6090
|
-
values: _objectSpread$
|
|
6197
|
+
return /*#__PURE__*/jsx(Trans, {
|
|
6198
|
+
values: _objectSpread$9(_objectSpread$9({}, SINGULAR), {}, {
|
|
6091
6199
|
person: member === null || member === void 0 ? void 0 : member.displayName
|
|
6092
6200
|
}),
|
|
6093
6201
|
i18nKey: member !== null && member !== void 0 && member.active ? "neetoTeamMembers.alerts.messages.deactivateMember" : "neetoTeamMembers.alerts.messages.activateMember"
|
|
@@ -6323,8 +6431,8 @@ var generateNoDataContent = function generateNoDataContent(_ref13) {
|
|
|
6323
6431
|
};
|
|
6324
6432
|
};
|
|
6325
6433
|
|
|
6326
|
-
function ownKeys$
|
|
6327
|
-
function _objectSpread$
|
|
6434
|
+
function ownKeys$8(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; }
|
|
6435
|
+
function _objectSpread$8(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$8(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$8(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6328
6436
|
var useFilters = function useFilters(_ref) {
|
|
6329
6437
|
var _config$filterColumns, _config$defaultFilter;
|
|
6330
6438
|
var config = _ref.config;
|
|
@@ -6344,7 +6452,7 @@ var useFilters = function useFilters(_ref) {
|
|
|
6344
6452
|
emailSearchTerm = _useState2[0],
|
|
6345
6453
|
setEmailSearchTerm = _useState2[1];
|
|
6346
6454
|
var defaultNeetoFilters = buildFiltersFromURL([].concat(_toConsumableArray((_config$filterColumns = config === null || config === void 0 ? void 0 : config.filterColumns) !== null && _config$filterColumns !== void 0 ? _config$filterColumns : defaultNeetoFiltersColumns()), [searchKeywordProps]));
|
|
6347
|
-
var _useState3 = useState(_objectSpread$
|
|
6455
|
+
var _useState3 = useState(_objectSpread$8(_objectSpread$8(_objectSpread$8({}, DEFAULT_FILTER_VALUES), config === null || config === void 0 ? void 0 : config.defaultFilterValues), {}, {
|
|
6348
6456
|
neetoFilters: defaultNeetoFilters,
|
|
6349
6457
|
category: getValidCategory(filter === null || filter === void 0 ? void 0 : filter.toUpperCase(), config === null || config === void 0 || (_config$defaultFilter = config.defaultFilterValues) === null || _config$defaultFilter === void 0 ? void 0 : _config$defaultFilter.category)
|
|
6350
6458
|
})),
|
|
@@ -6394,8 +6502,8 @@ var useFilters = function useFilters(_ref) {
|
|
|
6394
6502
|
};
|
|
6395
6503
|
};
|
|
6396
6504
|
|
|
6397
|
-
function ownKeys$
|
|
6398
|
-
function _objectSpread$
|
|
6505
|
+
function ownKeys$7(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; }
|
|
6506
|
+
function _objectSpread$7(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$7(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$7(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6399
6507
|
var useTeams = function useTeams(_ref) {
|
|
6400
6508
|
var config = _ref.config,
|
|
6401
6509
|
filters = _ref.filters,
|
|
@@ -6474,7 +6582,7 @@ var useTeams = function useTeams(_ref) {
|
|
|
6474
6582
|
subscriptionPlans: pluck("subscriptionPlan", rowData),
|
|
6475
6583
|
keys: keys
|
|
6476
6584
|
};
|
|
6477
|
-
setSelectedRows(_objectSpread$
|
|
6585
|
+
setSelectedRows(_objectSpread$7({}, rows));
|
|
6478
6586
|
config === null || config === void 0 || (_config$table = config.table) === null || _config$table === void 0 || (_config$table$onRowSe = _config$table.onRowSelect) === null || _config$table$onRowSe === void 0 || _config$table$onRowSe.call(_config$table, {
|
|
6479
6587
|
rows: rows,
|
|
6480
6588
|
resetSelectedRows: resetSelectedRows,
|
|
@@ -6498,24 +6606,11 @@ var useTeams = function useTeams(_ref) {
|
|
|
6498
6606
|
};
|
|
6499
6607
|
};
|
|
6500
6608
|
|
|
6501
|
-
function _extends() {
|
|
6502
|
-
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
6503
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
6504
|
-
var source = arguments[i];
|
|
6505
|
-
for (var key in source) {
|
|
6506
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
6507
|
-
target[key] = source[key];
|
|
6508
|
-
}
|
|
6509
|
-
}
|
|
6510
|
-
}
|
|
6511
|
-
return target;
|
|
6512
|
-
};
|
|
6513
|
-
return _extends.apply(this, arguments);
|
|
6514
|
-
}
|
|
6515
|
-
|
|
6516
6609
|
var FIXED_COLUMNS = ["name", "actions"];
|
|
6517
6610
|
var MANAGE_ROLES_BUTTON_LABEL = t$1("neetoTeamMembers.labels.manageRole", PLURAL);
|
|
6518
6611
|
|
|
6612
|
+
function ownKeys$6(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; }
|
|
6613
|
+
function _objectSpread$6(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$6(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$6(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6519
6614
|
var Header$2 = function Header(_ref) {
|
|
6520
6615
|
var isCreatePermissionGranted = _ref.isCreatePermissionGranted,
|
|
6521
6616
|
otherActionBlock = _ref.otherActionBlock,
|
|
@@ -6526,22 +6621,27 @@ var Header$2 = function Header(_ref) {
|
|
|
6526
6621
|
t = _useTranslation.t;
|
|
6527
6622
|
var isRolesButtonVisible = !!rolesButtonProps;
|
|
6528
6623
|
var isOtherActionBlockVisible = !!otherActionBlock;
|
|
6529
|
-
return /*#__PURE__*/
|
|
6530
|
-
|
|
6531
|
-
|
|
6532
|
-
|
|
6533
|
-
|
|
6534
|
-
|
|
6535
|
-
|
|
6536
|
-
|
|
6537
|
-
|
|
6538
|
-
|
|
6539
|
-
|
|
6540
|
-
|
|
6541
|
-
|
|
6542
|
-
|
|
6543
|
-
|
|
6544
|
-
|
|
6624
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
6625
|
+
children: [isOtherActionBlockVisible && otherActionBlock(), isRolesButtonVisible ? /*#__PURE__*/jsx(Button, _objectSpread$6({
|
|
6626
|
+
"data-cy": "ntm-manage-roles-button",
|
|
6627
|
+
label: MANAGE_ROLES_BUTTON_LABEL,
|
|
6628
|
+
style: "secondary"
|
|
6629
|
+
}, rolesButtonProps)) : null, /*#__PURE__*/jsx(Tooltip, {
|
|
6630
|
+
content: t("neetoTeamMembers.tooltips.noPermissionToAddMember"),
|
|
6631
|
+
disabled: isCreatePermissionGranted,
|
|
6632
|
+
position: "bottom",
|
|
6633
|
+
children: /*#__PURE__*/jsx("span", {
|
|
6634
|
+
children: /*#__PURE__*/jsx(Button, {
|
|
6635
|
+
"data-cy": "ntm-add-member-button",
|
|
6636
|
+
disabled: !isCreatePermissionGranted,
|
|
6637
|
+
label: t("neetoTeamMembers.common.addNew_", {
|
|
6638
|
+
what: taxonomies.member.singular
|
|
6639
|
+
}),
|
|
6640
|
+
onClick: onClick
|
|
6641
|
+
})
|
|
6642
|
+
})
|
|
6643
|
+
})]
|
|
6644
|
+
});
|
|
6545
6645
|
};
|
|
6546
6646
|
var HeaderActionBlock = /*#__PURE__*/memo(Header$2);
|
|
6547
6647
|
|
|
@@ -6607,58 +6707,68 @@ var RolesDropdown = function RolesDropdown(_ref) {
|
|
|
6607
6707
|
event.stopPropagation();
|
|
6608
6708
|
setIsDropdownOpen(!isDropdownOpen);
|
|
6609
6709
|
};
|
|
6610
|
-
return /*#__PURE__*/
|
|
6710
|
+
return /*#__PURE__*/jsx(Tooltip, {
|
|
6611
6711
|
disabled: isUpdatingAllowed,
|
|
6612
6712
|
position: "top",
|
|
6613
6713
|
content: t("neetoTeamMembers.tooltips.activateUserToEdit", {
|
|
6614
6714
|
count: selectedMembersCount
|
|
6615
|
-
})
|
|
6616
|
-
|
|
6617
|
-
|
|
6618
|
-
|
|
6619
|
-
|
|
6620
|
-
|
|
6621
|
-
|
|
6622
|
-
|
|
6623
|
-
|
|
6624
|
-
|
|
6625
|
-
|
|
6626
|
-
|
|
6715
|
+
}),
|
|
6716
|
+
children: /*#__PURE__*/jsx("span", {
|
|
6717
|
+
children: /*#__PURE__*/jsx(Dropdown, {
|
|
6718
|
+
buttonStyle: "secondary",
|
|
6719
|
+
closeOnSelect: false,
|
|
6720
|
+
"data-cy": "ntm-members-roles-update-dropdown-button",
|
|
6721
|
+
disabled: !isUpdatingAllowed,
|
|
6722
|
+
isOpen: isUpdatingAllowed && isDropdownOpen,
|
|
6723
|
+
position: "auto-end",
|
|
6724
|
+
customTarget: /*#__PURE__*/jsx(MenuItem$1.Button, {
|
|
6725
|
+
disabled: !isUpdatingAllowed,
|
|
6726
|
+
suffix: /*#__PURE__*/jsx(Right$1, {
|
|
6727
|
+
size: 16
|
|
6728
|
+
}),
|
|
6729
|
+
children: t("neetoTeamMembers.buttons.changeRole")
|
|
6730
|
+
}),
|
|
6731
|
+
onClick: handleClick,
|
|
6732
|
+
onClose: handleOnClose,
|
|
6733
|
+
children: /*#__PURE__*/jsxs(Menu$2, {
|
|
6734
|
+
children: [isSearchable && /*#__PURE__*/jsx("div", {
|
|
6735
|
+
className: "neeto-ui-px-3 neeto-ui-py-2",
|
|
6736
|
+
onClick: function onClick(event) {
|
|
6737
|
+
event.stopPropagation();
|
|
6738
|
+
},
|
|
6739
|
+
children: /*#__PURE__*/jsx(Input$1, {
|
|
6740
|
+
"data-cy": "ntm-members-roles-search-input",
|
|
6741
|
+
prefix: /*#__PURE__*/jsx(Search, {}),
|
|
6742
|
+
type: "search",
|
|
6743
|
+
value: searchTerm,
|
|
6744
|
+
placeholder: t("neetoTeamMembers.placeholders.searchRole", PLURAL),
|
|
6745
|
+
onChange: handleSearch
|
|
6746
|
+
})
|
|
6747
|
+
}), isNotEmpty(filteredRoles) ? filteredRoles.map(function (_ref3) {
|
|
6748
|
+
var id = _ref3.id,
|
|
6749
|
+
name = _ref3.name;
|
|
6750
|
+
return /*#__PURE__*/jsx(MenuItem$1.Button, {
|
|
6751
|
+
onClick: function onClick() {
|
|
6752
|
+
return handleSelectRole(name);
|
|
6753
|
+
},
|
|
6754
|
+
children: name
|
|
6755
|
+
}, id);
|
|
6756
|
+
}) : /*#__PURE__*/jsx("div", {
|
|
6757
|
+
className: "neeto-ui-flex neeto-ui-justify-center neeto-ui-p-1",
|
|
6758
|
+
children: /*#__PURE__*/jsx(Typography, {
|
|
6759
|
+
className: "neeto-ui-text-gray-700",
|
|
6760
|
+
style: "body2",
|
|
6761
|
+
children: t("neetoTeamMembers.helpers.noRolesFound")
|
|
6762
|
+
})
|
|
6763
|
+
})]
|
|
6764
|
+
})
|
|
6627
6765
|
})
|
|
6628
|
-
}
|
|
6629
|
-
|
|
6630
|
-
onClose: handleOnClose
|
|
6631
|
-
}, /*#__PURE__*/React.createElement(Menu$2, null, isSearchable && /*#__PURE__*/React.createElement("div", {
|
|
6632
|
-
className: "neeto-ui-px-3 neeto-ui-py-2",
|
|
6633
|
-
onClick: function onClick(event) {
|
|
6634
|
-
event.stopPropagation();
|
|
6635
|
-
}
|
|
6636
|
-
}, /*#__PURE__*/React.createElement(Input$1, {
|
|
6637
|
-
"data-cy": "ntm-members-roles-search-input",
|
|
6638
|
-
prefix: /*#__PURE__*/React.createElement(Search, null),
|
|
6639
|
-
type: "search",
|
|
6640
|
-
value: searchTerm,
|
|
6641
|
-
placeholder: t("neetoTeamMembers.placeholders.searchRole", PLURAL),
|
|
6642
|
-
onChange: handleSearch
|
|
6643
|
-
})), isNotEmpty(filteredRoles) ? filteredRoles.map(function (_ref3) {
|
|
6644
|
-
var id = _ref3.id,
|
|
6645
|
-
name = _ref3.name;
|
|
6646
|
-
return /*#__PURE__*/React.createElement(MenuItem$1.Button, {
|
|
6647
|
-
key: id,
|
|
6648
|
-
onClick: function onClick() {
|
|
6649
|
-
return handleSelectRole(name);
|
|
6650
|
-
}
|
|
6651
|
-
}, name);
|
|
6652
|
-
}) : /*#__PURE__*/React.createElement("div", {
|
|
6653
|
-
className: "neeto-ui-flex neeto-ui-justify-center neeto-ui-p-1"
|
|
6654
|
-
}, /*#__PURE__*/React.createElement(Typography, {
|
|
6655
|
-
className: "neeto-ui-text-gray-700",
|
|
6656
|
-
style: "body2"
|
|
6657
|
-
}, t("neetoTeamMembers.helpers.noRolesFound")))))));
|
|
6766
|
+
})
|
|
6767
|
+
});
|
|
6658
6768
|
};
|
|
6659
6769
|
|
|
6660
|
-
function ownKeys$
|
|
6661
|
-
function _objectSpread$
|
|
6770
|
+
function ownKeys$5(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; }
|
|
6771
|
+
function _objectSpread$5(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$5(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$5(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6662
6772
|
var Menu$1 = Dropdown.Menu,
|
|
6663
6773
|
MenuItem = Dropdown.MenuItem;
|
|
6664
6774
|
var Left = function Left(_ref) {
|
|
@@ -6765,64 +6875,74 @@ var Left = function Left(_ref) {
|
|
|
6765
6875
|
}
|
|
6766
6876
|
return type === "deactivate" ? t("neetoTeamMembers.buttons.deactivate") : t("neetoTeamMembers.buttons.activate");
|
|
6767
6877
|
};
|
|
6768
|
-
return /*#__PURE__*/
|
|
6769
|
-
className: "neeto-ui-flex neeto-ui-items-center neeto-ui-gap-4"
|
|
6770
|
-
|
|
6771
|
-
|
|
6772
|
-
|
|
6773
|
-
|
|
6774
|
-
|
|
6775
|
-
|
|
6776
|
-
|
|
6777
|
-
|
|
6878
|
+
return /*#__PURE__*/jsxs("div", {
|
|
6879
|
+
className: "neeto-ui-flex neeto-ui-items-center neeto-ui-gap-4",
|
|
6880
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
6881
|
+
component: "h4",
|
|
6882
|
+
"data-cy": "ntm-filtered-members-count",
|
|
6883
|
+
style: "h4",
|
|
6884
|
+
children: /*#__PURE__*/jsx(Trans, {
|
|
6885
|
+
components: {
|
|
6886
|
+
span: /*#__PURE__*/jsx("span", {
|
|
6887
|
+
className: "neeto-ui-text-gray-600"
|
|
6888
|
+
})
|
|
6889
|
+
},
|
|
6890
|
+
values: selectedMembersCountValues,
|
|
6891
|
+
i18nKey: hasSelectedRows ? "neetoTeamMembers.helpers.selectedMembersCount" : "neetoTeamMembers.helpers.metaNameWithCount"
|
|
6778
6892
|
})
|
|
6779
|
-
},
|
|
6780
|
-
|
|
6781
|
-
|
|
6782
|
-
|
|
6783
|
-
|
|
6784
|
-
|
|
6785
|
-
|
|
6786
|
-
|
|
6787
|
-
|
|
6788
|
-
|
|
6789
|
-
|
|
6790
|
-
|
|
6791
|
-
|
|
6792
|
-
|
|
6793
|
-
|
|
6794
|
-
|
|
6795
|
-
|
|
6796
|
-
|
|
6797
|
-
|
|
6798
|
-
|
|
6799
|
-
|
|
6800
|
-
|
|
6801
|
-
|
|
6802
|
-
|
|
6803
|
-
|
|
6804
|
-
|
|
6805
|
-
|
|
6806
|
-
|
|
6807
|
-
|
|
6808
|
-
|
|
6809
|
-
|
|
6810
|
-
|
|
6811
|
-
|
|
6812
|
-
|
|
6813
|
-
|
|
6814
|
-
message: /*#__PURE__*/React.createElement(Trans, {
|
|
6815
|
-
i18nKey: selectedAlert === null || selectedAlert === void 0 ? void 0 : selectedAlert.message,
|
|
6816
|
-
values: _objectSpread$4(_objectSpread$4({}, selectedMembersCountValues), {}, {
|
|
6817
|
-
person: selectedRows.displayNames[0],
|
|
6818
|
-
role: bulkUpdateRole
|
|
6893
|
+
}), hasSelectedRows && /*#__PURE__*/jsx(Tooltip, {
|
|
6894
|
+
content: t("neetoTeamMembers.tooltips.noPermissionToEditMembers"),
|
|
6895
|
+
disabled: isUpdatePermissionGranted,
|
|
6896
|
+
position: "top",
|
|
6897
|
+
children: /*#__PURE__*/jsx("span", {
|
|
6898
|
+
children: /*#__PURE__*/jsx(Dropdown, {
|
|
6899
|
+
buttonStyle: "secondary",
|
|
6900
|
+
"data-cy": "ntm-members-take-action-dropdown-button",
|
|
6901
|
+
disabled: !isUpdatePermissionGranted,
|
|
6902
|
+
label: t("neetoTeamMembers.common.takeAction"),
|
|
6903
|
+
children: /*#__PURE__*/jsxs(Menu$1, {
|
|
6904
|
+
children: [getDeactivatedButtonVisible(selectedRows, config) && /*#__PURE__*/jsx(MenuItem.Button, {
|
|
6905
|
+
"data-cy": "ntm-deactivate-members-button",
|
|
6906
|
+
disabled: !isUpdatePermissionGranted,
|
|
6907
|
+
onClick: function onClick() {
|
|
6908
|
+
return setAlertType("deactivate");
|
|
6909
|
+
},
|
|
6910
|
+
children: t("neetoTeamMembers.common.deactivate")
|
|
6911
|
+
}), getActivateButtonVisible(selectedRows, config) && /*#__PURE__*/jsx(MenuItem.Button, {
|
|
6912
|
+
"data-cy": "ntm-activate-members-button",
|
|
6913
|
+
disabled: !isUpdatePermissionGranted,
|
|
6914
|
+
onClick: function onClick() {
|
|
6915
|
+
return setAlertType("activate");
|
|
6916
|
+
},
|
|
6917
|
+
children: t("neetoTeamMembers.common.activate")
|
|
6918
|
+
}), !(config !== null && config !== void 0 && (_config$hiddenBulkAct = config.hiddenBulkActions) !== null && _config$hiddenBulkAct !== void 0 && _config$hiddenBulkAct.includes("role")) && /*#__PURE__*/jsx(RolesDropdown, {
|
|
6919
|
+
roles: roles,
|
|
6920
|
+
setAlertType: setAlertType,
|
|
6921
|
+
setBulkUpdateRole: setBulkUpdateRole,
|
|
6922
|
+
disabled: hasDeactivateMembers,
|
|
6923
|
+
hasUpdatePermission: isUpdatePermissionGranted,
|
|
6924
|
+
selectedMembersCount: selectedMembersCountValues === null || selectedMembersCountValues === void 0 ? void 0 : selectedMembersCountValues.count
|
|
6925
|
+
}), config === null || config === void 0 || (_config$otherBulkActi = config.otherBulkActions) === null || _config$otherBulkActi === void 0 ? void 0 : _config$otherBulkActi.call(config, resetSelectedRows, selectedRows)]
|
|
6926
|
+
})
|
|
6927
|
+
})
|
|
6819
6928
|
})
|
|
6820
|
-
}),
|
|
6821
|
-
|
|
6822
|
-
|
|
6823
|
-
|
|
6824
|
-
|
|
6825
|
-
|
|
6929
|
+
}), /*#__PURE__*/jsx(Alert, {
|
|
6930
|
+
isOpen: selectedAlert,
|
|
6931
|
+
submitButtonLabel: getButtonLabel(selectedAlert === null || selectedAlert === void 0 ? void 0 : selectedAlert.type),
|
|
6932
|
+
title: selectedAlert === null || selectedAlert === void 0 ? void 0 : selectedAlert.title,
|
|
6933
|
+
message: /*#__PURE__*/jsx(Trans, {
|
|
6934
|
+
i18nKey: selectedAlert === null || selectedAlert === void 0 ? void 0 : selectedAlert.message,
|
|
6935
|
+
values: _objectSpread$5(_objectSpread$5({}, selectedMembersCountValues), {}, {
|
|
6936
|
+
person: selectedRows.displayNames[0],
|
|
6937
|
+
role: bulkUpdateRole
|
|
6938
|
+
})
|
|
6939
|
+
}),
|
|
6940
|
+
onClose: function onClose() {
|
|
6941
|
+
return setAlertType("");
|
|
6942
|
+
},
|
|
6943
|
+
onSubmit: handleAlertClose
|
|
6944
|
+
})]
|
|
6945
|
+
});
|
|
6826
6946
|
};
|
|
6827
6947
|
var Right = withT(function (_ref3) {
|
|
6828
6948
|
var t = _ref3.t,
|
|
@@ -6832,7 +6952,7 @@ var Right = withT(function (_ref3) {
|
|
|
6832
6952
|
setIsFiltersPaneOpen = _ref3.setIsFiltersPaneOpen,
|
|
6833
6953
|
isFiltersPaneOpen = _ref3.isFiltersPaneOpen,
|
|
6834
6954
|
searchKeywordProps = _ref3.searchKeywordProps;
|
|
6835
|
-
return /*#__PURE__*/
|
|
6955
|
+
return /*#__PURE__*/jsx(SubHeaderMolecule.RightBlock, {
|
|
6836
6956
|
columnsButtonProps: {
|
|
6837
6957
|
columnData: columns,
|
|
6838
6958
|
fixedColumns: FIXED_COLUMNS,
|
|
@@ -6856,18 +6976,18 @@ var SubHeader = {
|
|
|
6856
6976
|
Right: Right
|
|
6857
6977
|
};
|
|
6858
6978
|
|
|
6859
|
-
function ownKeys$
|
|
6860
|
-
function _objectSpread$
|
|
6979
|
+
function ownKeys$4(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; }
|
|
6980
|
+
function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6861
6981
|
var Header = function Header(_ref) {
|
|
6862
6982
|
var _config$header, _config$header2;
|
|
6863
6983
|
var config = _ref.config,
|
|
6864
6984
|
setIsOpen = _ref.setIsOpen,
|
|
6865
6985
|
searchProps = _ref.searchProps,
|
|
6866
6986
|
filterCategory = _ref.filterCategory;
|
|
6867
|
-
return /*#__PURE__*/
|
|
6987
|
+
return /*#__PURE__*/jsx(NeetoHeader, _objectSpread$4({
|
|
6868
6988
|
searchProps: searchProps,
|
|
6869
6989
|
title: renderHeaderTitle(MEMBER_FILTER[filterCategory].value),
|
|
6870
|
-
actionBlock: /*#__PURE__*/
|
|
6990
|
+
actionBlock: /*#__PURE__*/jsx(HeaderActionBlock, {
|
|
6871
6991
|
isCreatePermissionGranted: config.permissions.create,
|
|
6872
6992
|
otherActionBlock: (_config$header = config.header) === null || _config$header === void 0 ? void 0 : _config$header.otherActionBlock,
|
|
6873
6993
|
rolesButtonProps: config.rolesButtonProps,
|
|
@@ -6877,7 +6997,7 @@ var Header = function Header(_ref) {
|
|
|
6877
6997
|
}),
|
|
6878
6998
|
menuBarToggle: function menuBarToggle() {
|
|
6879
6999
|
return setIsOpen(function (state) {
|
|
6880
|
-
return _objectSpread$
|
|
7000
|
+
return _objectSpread$4(_objectSpread$4({}, state), {}, {
|
|
6881
7001
|
menuBar: !state.menuBar
|
|
6882
7002
|
});
|
|
6883
7003
|
});
|
|
@@ -6886,126 +7006,29 @@ var Header = function Header(_ref) {
|
|
|
6886
7006
|
};
|
|
6887
7007
|
var Header$1 = /*#__PURE__*/memo(Header);
|
|
6888
7008
|
|
|
6889
|
-
var AppList = function AppList(_ref) {
|
|
6890
|
-
var globalRoles = _ref.globalRoles,
|
|
6891
|
-
savedStateRef = _ref.savedStateRef;
|
|
6892
|
-
var _useTranslation = useTranslation(),
|
|
6893
|
-
t = _useTranslation.t;
|
|
6894
|
-
var _useState = useState(savedStateRef.current.isAppListEnabled),
|
|
6895
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
6896
|
-
isAppListEnabled = _useState2[0],
|
|
6897
|
-
setIsAppListEnabled = _useState2[1];
|
|
6898
|
-
var _useFormikContext = useFormikContext(),
|
|
6899
|
-
_useFormikContext$val = _useFormikContext.values,
|
|
6900
|
-
_useFormikContext$val2 = _useFormikContext$val.emails,
|
|
6901
|
-
emails = _useFormikContext$val2 === void 0 ? [] : _useFormikContext$val2,
|
|
6902
|
-
_useFormikContext$val3 = _useFormikContext$val.appRoles,
|
|
6903
|
-
appRoles = _useFormikContext$val3 === void 0 ? [] : _useFormikContext$val3,
|
|
6904
|
-
setFieldValue = _useFormikContext.setFieldValue;
|
|
6905
|
-
var selectedEmail = pluck("value", emails);
|
|
6906
|
-
useEffect(function () {
|
|
6907
|
-
if (savedStateRef.current.isAppListEnabled !== isAppListEnabled) {
|
|
6908
|
-
appRoles === null || appRoles === void 0 || appRoles.forEach(function (appRole, index) {
|
|
6909
|
-
var _globalProps$appName;
|
|
6910
|
-
if ((appRole === null || appRole === void 0 ? void 0 : appRole.appName) === ((_globalProps$appName = globalProps.appName) === null || _globalProps$appName === void 0 ? void 0 : _globalProps$appName.substring(5))) {
|
|
6911
|
-
setFieldValue("appRoles[".concat(index, "].isEnabled"), true);
|
|
6912
|
-
return;
|
|
6913
|
-
}
|
|
6914
|
-
setFieldValue("appRoles[".concat(index, "].isEnabled"), isAppListEnabled);
|
|
6915
|
-
});
|
|
6916
|
-
}
|
|
6917
|
-
savedStateRef.current.isAppListEnabled = isAppListEnabled;
|
|
6918
|
-
}, [isAppListEnabled]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
6919
|
-
|
|
6920
|
-
var buildRoleOptions = function buildRoleOptions(roles) {
|
|
6921
|
-
return roles.map(function (role) {
|
|
6922
|
-
return toLabelAndValue(role.name);
|
|
6923
|
-
});
|
|
6924
|
-
};
|
|
6925
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
6926
|
-
className: "neeto-ui-flex neeto-ui-flex-col neeto-ui-gap-6"
|
|
6927
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
6928
|
-
className: "neeto-ui-w-full"
|
|
6929
|
-
}, /*#__PURE__*/React.createElement(Checkbox, {
|
|
6930
|
-
checked: isAppListEnabled,
|
|
6931
|
-
className: "ntm-manage-members__checkbox-align-start",
|
|
6932
|
-
"data-cy": "ntm-manage-members-app-list-checkbox",
|
|
6933
|
-
label: /*#__PURE__*/React.createElement(Typography, {
|
|
6934
|
-
component: "span",
|
|
6935
|
-
lineHeight: "relaxed",
|
|
6936
|
-
style: "body2"
|
|
6937
|
-
}, /*#__PURE__*/React.createElement(Trans, {
|
|
6938
|
-
i18nKey: "neetoTeamMembers.helpers.addMembersToNeetoProducts",
|
|
6939
|
-
values: {
|
|
6940
|
-
emails: selectedEmail
|
|
6941
|
-
}
|
|
6942
|
-
})),
|
|
6943
|
-
onChange: function onChange() {
|
|
6944
|
-
return setIsAppListEnabled(not);
|
|
6945
|
-
}
|
|
6946
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
6947
|
-
className: "neeto-ui-w-full"
|
|
6948
|
-
}, appRoles.map(function (_ref2, index) {
|
|
6949
|
-
var _globalProps$appName2;
|
|
6950
|
-
var appName = _ref2.appName,
|
|
6951
|
-
isEnabled = _ref2.isEnabled;
|
|
6952
|
-
var isCurrentApp = appName === ((_globalProps$appName2 = globalProps.appName) === null || _globalProps$appName2 === void 0 ? void 0 : _globalProps$appName2.substring(5));
|
|
6953
|
-
var isAppRoleSelectionChecked = isCurrentApp || isEnabled;
|
|
6954
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
6955
|
-
className: "ntm-manage-members__app-roles",
|
|
6956
|
-
key: appName
|
|
6957
|
-
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
6958
|
-
content: t("neetoTeamMembers.tooltips.hostAppIsRequired"),
|
|
6959
|
-
disabled: !isCurrentApp,
|
|
6960
|
-
position: "left"
|
|
6961
|
-
}, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(Switch, {
|
|
6962
|
-
checked: isAppRoleSelectionChecked,
|
|
6963
|
-
disabled: isCurrentApp,
|
|
6964
|
-
name: "appsRoles[".concat(index, "].isEnabled"),
|
|
6965
|
-
label: t("neetoTeamMembers.labels.neeto_", {
|
|
6966
|
-
product: appName
|
|
6967
|
-
}),
|
|
6968
|
-
onChange: function onChange(_ref3) {
|
|
6969
|
-
var target = _ref3.target;
|
|
6970
|
-
setFieldValue("appRoles[".concat(index, "].isEnabled"), target.checked);
|
|
6971
|
-
}
|
|
6972
|
-
}))), /*#__PURE__*/React.createElement(Tooltip, {
|
|
6973
|
-
content: t("neetoTeamMembers.tooltips.goBackToChangeRole"),
|
|
6974
|
-
disabled: !isCurrentApp,
|
|
6975
|
-
position: "top"
|
|
6976
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
6977
|
-
className: "ntm-manage-members-app-roles__select-wrapper"
|
|
6978
|
-
}, /*#__PURE__*/React.createElement(Select, {
|
|
6979
|
-
isDisabled: isCurrentApp || !isEnabled,
|
|
6980
|
-
name: "appRoles[".concat(index, "].activeRole"),
|
|
6981
|
-
options: buildRoleOptions(globalRoles[appName]),
|
|
6982
|
-
size: "small",
|
|
6983
|
-
strategy: "fixed",
|
|
6984
|
-
onChange: function onChange(_ref4) {
|
|
6985
|
-
var value = _ref4.value;
|
|
6986
|
-
setFieldValue("appRoles[".concat(index, "].activeRole"), value);
|
|
6987
|
-
}
|
|
6988
|
-
}))));
|
|
6989
|
-
})));
|
|
6990
|
-
};
|
|
6991
|
-
|
|
6992
7009
|
var _excluded$1 = ["className", "children"],
|
|
6993
7010
|
_excluded2 = ["className", "children"];
|
|
7011
|
+
function ownKeys$3(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; }
|
|
7012
|
+
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6994
7013
|
var PageWrapper = function PageWrapper(_ref) {
|
|
6995
7014
|
var className = _ref.className,
|
|
6996
7015
|
children = _ref.children,
|
|
6997
7016
|
otherProps = _objectWithoutProperties(_ref, _excluded$1);
|
|
6998
|
-
return /*#__PURE__*/
|
|
7017
|
+
return /*#__PURE__*/jsx("div", _objectSpread$3(_objectSpread$3({
|
|
6999
7018
|
className: className
|
|
7000
|
-
}, otherProps),
|
|
7019
|
+
}, otherProps), {}, {
|
|
7020
|
+
children: children
|
|
7021
|
+
}));
|
|
7001
7022
|
};
|
|
7002
7023
|
var Page = function Page(_ref2) {
|
|
7003
7024
|
var className = _ref2.className,
|
|
7004
7025
|
children = _ref2.children,
|
|
7005
7026
|
otherProps = _objectWithoutProperties(_ref2, _excluded2);
|
|
7006
|
-
return /*#__PURE__*/
|
|
7027
|
+
return /*#__PURE__*/jsx("div", _objectSpread$3(_objectSpread$3({
|
|
7007
7028
|
className: className
|
|
7008
|
-
}, otherProps),
|
|
7029
|
+
}, otherProps), {}, {
|
|
7030
|
+
children: children
|
|
7031
|
+
}));
|
|
7009
7032
|
};
|
|
7010
7033
|
Page.Header = PageWrapper;
|
|
7011
7034
|
Page.Body = PageWrapper;
|
|
@@ -7052,6 +7075,7 @@ var FORM_PAGES = {
|
|
|
7052
7075
|
};
|
|
7053
7076
|
var EMAIL_REGEX = new RegExp("^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,}$", "i");
|
|
7054
7077
|
|
|
7078
|
+
var _globalProps$organiza;
|
|
7055
7079
|
var _excluded = ["appRoles", "emails", "firstName", "lastName", "role"];
|
|
7056
7080
|
function ownKeys$2(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; }
|
|
7057
7081
|
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -7159,13 +7183,13 @@ var buildValidationSchema = function buildValidationSchema(_ref4) {
|
|
|
7159
7183
|
return yup.object().shape(_objectSpread$2(_objectSpread$2(_objectSpread$2(_objectSpread$2({}, NAME_INPUT_VALIDATION_SCHEMA), ROLES_RADIO_GROUP_VALIDATION_SCHEMA), APP_ROLES_SCHEMA), {}, {
|
|
7160
7184
|
emails: yup.array().min(1, t$1("neetoTeamMembers.validations.minOneEmail")).test("are-all-emails-valid", t$1("neetoTeamMembers.validations.validEmail"), function (emails) {
|
|
7161
7185
|
return emails.every(prop("valid"));
|
|
7162
|
-
}).test("is-emails-length-within-available-members-capacity", /*#__PURE__*/
|
|
7186
|
+
}).test("is-emails-length-within-available-members-capacity", /*#__PURE__*/jsx(Trans, {
|
|
7163
7187
|
i18nKey: "neetoTeamMembers.validations.memberLimitExceeded",
|
|
7164
7188
|
values: {
|
|
7165
7189
|
limit: memberLimit
|
|
7166
7190
|
},
|
|
7167
7191
|
components: {
|
|
7168
|
-
emailTo: /*#__PURE__*/
|
|
7192
|
+
emailTo: /*#__PURE__*/jsx(Button, {
|
|
7169
7193
|
href: "mailto:support@neeto.com",
|
|
7170
7194
|
style: "link"
|
|
7171
7195
|
})
|
|
@@ -7175,6 +7199,136 @@ var buildValidationSchema = function buildValidationSchema(_ref4) {
|
|
|
7175
7199
|
}).nullable()
|
|
7176
7200
|
}));
|
|
7177
7201
|
};
|
|
7202
|
+
var neetoAuthManageProductUrl = "".concat((_globalProps$organiza = globalProps.organization) === null || _globalProps$organiza === void 0 ? void 0 : _globalProps$organiza.authAppUrl, "/settings/general/products");
|
|
7203
|
+
|
|
7204
|
+
var AppList = function AppList(_ref) {
|
|
7205
|
+
var globalRoles = _ref.globalRoles,
|
|
7206
|
+
savedStateRef = _ref.savedStateRef;
|
|
7207
|
+
var _useTranslation = useTranslation(),
|
|
7208
|
+
t = _useTranslation.t;
|
|
7209
|
+
var _useState = useState(savedStateRef.current.isAppListEnabled),
|
|
7210
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
7211
|
+
isAppListEnabled = _useState2[0],
|
|
7212
|
+
setIsAppListEnabled = _useState2[1];
|
|
7213
|
+
var _useFetchNeetoApps = useFetchNeetoApps(),
|
|
7214
|
+
_useFetchNeetoApps$da = _useFetchNeetoApps.data,
|
|
7215
|
+
_useFetchNeetoApps$da2 = _useFetchNeetoApps$da === void 0 ? {} : _useFetchNeetoApps$da,
|
|
7216
|
+
isOwner = _useFetchNeetoApps$da2.isOwner,
|
|
7217
|
+
neetoApps = _useFetchNeetoApps$da2.neetoApps;
|
|
7218
|
+
var _useFormikContext = useFormikContext(),
|
|
7219
|
+
_useFormikContext$val = _useFormikContext.values,
|
|
7220
|
+
_useFormikContext$val2 = _useFormikContext$val.emails,
|
|
7221
|
+
emails = _useFormikContext$val2 === void 0 ? [] : _useFormikContext$val2,
|
|
7222
|
+
_useFormikContext$val3 = _useFormikContext$val.appRoles,
|
|
7223
|
+
appRoles = _useFormikContext$val3 === void 0 ? [] : _useFormikContext$val3,
|
|
7224
|
+
setFieldValue = _useFormikContext.setFieldValue;
|
|
7225
|
+
var selectedEmail = pluck("value", emails);
|
|
7226
|
+
var isManageProductsLinkEnabled = isOwner && (neetoApps === null || neetoApps === void 0 ? void 0 : neetoApps.length) >= 3;
|
|
7227
|
+
useEffect(function () {
|
|
7228
|
+
if (savedStateRef.current.isAppListEnabled !== isAppListEnabled) {
|
|
7229
|
+
appRoles === null || appRoles === void 0 || appRoles.forEach(function (appRole, index) {
|
|
7230
|
+
var _globalProps$appName;
|
|
7231
|
+
if ((appRole === null || appRole === void 0 ? void 0 : appRole.appName) === ((_globalProps$appName = globalProps.appName) === null || _globalProps$appName === void 0 ? void 0 : _globalProps$appName.substring(5))) {
|
|
7232
|
+
setFieldValue("appRoles[".concat(index, "].isEnabled"), true);
|
|
7233
|
+
return;
|
|
7234
|
+
}
|
|
7235
|
+
setFieldValue("appRoles[".concat(index, "].isEnabled"), isAppListEnabled);
|
|
7236
|
+
});
|
|
7237
|
+
}
|
|
7238
|
+
savedStateRef.current.isAppListEnabled = isAppListEnabled;
|
|
7239
|
+
}, [isAppListEnabled]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
7240
|
+
|
|
7241
|
+
var buildRoleOptions = function buildRoleOptions(roles) {
|
|
7242
|
+
return roles.map(function (role) {
|
|
7243
|
+
return toLabelAndValue(role.name);
|
|
7244
|
+
});
|
|
7245
|
+
};
|
|
7246
|
+
return /*#__PURE__*/jsxs("div", {
|
|
7247
|
+
className: "neeto-ui-flex neeto-ui-flex-col neeto-ui-gap-6",
|
|
7248
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
7249
|
+
className: "neeto-ui-w-full space-y-3",
|
|
7250
|
+
children: [/*#__PURE__*/jsx(Checkbox, {
|
|
7251
|
+
checked: isAppListEnabled,
|
|
7252
|
+
className: "ntm-manage-members__checkbox-align-start",
|
|
7253
|
+
"data-cy": "ntm-manage-members-app-list-checkbox",
|
|
7254
|
+
label: /*#__PURE__*/jsx(Typography, {
|
|
7255
|
+
component: "span",
|
|
7256
|
+
lineHeight: "relaxed",
|
|
7257
|
+
style: "body2",
|
|
7258
|
+
children: /*#__PURE__*/jsx(Trans, {
|
|
7259
|
+
i18nKey: "neetoTeamMembers.helpers.addMembersToNeetoProducts",
|
|
7260
|
+
values: {
|
|
7261
|
+
emails: selectedEmail
|
|
7262
|
+
}
|
|
7263
|
+
})
|
|
7264
|
+
}),
|
|
7265
|
+
onChange: function onChange() {
|
|
7266
|
+
return setIsAppListEnabled(not);
|
|
7267
|
+
}
|
|
7268
|
+
}), isManageProductsLinkEnabled && /*#__PURE__*/jsx(Typography, {
|
|
7269
|
+
style: "body2",
|
|
7270
|
+
children: /*#__PURE__*/jsx(Trans, {
|
|
7271
|
+
i18nKey: "neetoTeamMembers.helpers.manageProducts",
|
|
7272
|
+
components: {
|
|
7273
|
+
button: /*#__PURE__*/jsx(Button, {
|
|
7274
|
+
href: neetoAuthManageProductUrl,
|
|
7275
|
+
style: "link"
|
|
7276
|
+
})
|
|
7277
|
+
}
|
|
7278
|
+
})
|
|
7279
|
+
})]
|
|
7280
|
+
}), /*#__PURE__*/jsx("div", {
|
|
7281
|
+
className: "neeto-ui-w-full",
|
|
7282
|
+
children: appRoles.map(function (_ref2, index) {
|
|
7283
|
+
var _globalProps$appName2;
|
|
7284
|
+
var appName = _ref2.appName,
|
|
7285
|
+
isEnabled = _ref2.isEnabled;
|
|
7286
|
+
var isCurrentApp = appName === ((_globalProps$appName2 = globalProps.appName) === null || _globalProps$appName2 === void 0 ? void 0 : _globalProps$appName2.substring(5));
|
|
7287
|
+
var isAppRoleSelectionChecked = isCurrentApp || isEnabled;
|
|
7288
|
+
return /*#__PURE__*/jsxs("div", {
|
|
7289
|
+
className: "ntm-manage-members__app-roles",
|
|
7290
|
+
children: [/*#__PURE__*/jsx(Tooltip, {
|
|
7291
|
+
content: t("neetoTeamMembers.tooltips.hostAppIsRequired"),
|
|
7292
|
+
disabled: !isCurrentApp,
|
|
7293
|
+
position: "left",
|
|
7294
|
+
children: /*#__PURE__*/jsx("span", {
|
|
7295
|
+
children: /*#__PURE__*/jsx(Switch, {
|
|
7296
|
+
checked: isAppRoleSelectionChecked,
|
|
7297
|
+
disabled: isCurrentApp,
|
|
7298
|
+
name: "appsRoles[".concat(index, "].isEnabled"),
|
|
7299
|
+
label: t("neetoTeamMembers.labels.neeto_", {
|
|
7300
|
+
product: appName
|
|
7301
|
+
}),
|
|
7302
|
+
onChange: function onChange(_ref3) {
|
|
7303
|
+
var target = _ref3.target;
|
|
7304
|
+
setFieldValue("appRoles[".concat(index, "].isEnabled"), target.checked);
|
|
7305
|
+
}
|
|
7306
|
+
})
|
|
7307
|
+
})
|
|
7308
|
+
}), /*#__PURE__*/jsx(Tooltip, {
|
|
7309
|
+
content: t("neetoTeamMembers.tooltips.goBackToChangeRole"),
|
|
7310
|
+
disabled: !isCurrentApp,
|
|
7311
|
+
position: "top",
|
|
7312
|
+
children: /*#__PURE__*/jsx("span", {
|
|
7313
|
+
className: "ntm-manage-members-app-roles__select-wrapper",
|
|
7314
|
+
children: /*#__PURE__*/jsx(Select, {
|
|
7315
|
+
isDisabled: isCurrentApp || !isEnabled,
|
|
7316
|
+
name: "appRoles[".concat(index, "].activeRole"),
|
|
7317
|
+
options: buildRoleOptions(globalRoles[appName]),
|
|
7318
|
+
size: "small",
|
|
7319
|
+
strategy: "fixed",
|
|
7320
|
+
onChange: function onChange(_ref4) {
|
|
7321
|
+
var value = _ref4.value;
|
|
7322
|
+
setFieldValue("appRoles[".concat(index, "].activeRole"), value);
|
|
7323
|
+
}
|
|
7324
|
+
})
|
|
7325
|
+
})
|
|
7326
|
+
})]
|
|
7327
|
+
}, appName);
|
|
7328
|
+
})
|
|
7329
|
+
})]
|
|
7330
|
+
});
|
|
7331
|
+
};
|
|
7178
7332
|
|
|
7179
7333
|
var Confirmation = function Confirmation() {
|
|
7180
7334
|
var _globalProps$organiza;
|
|
@@ -7189,51 +7343,72 @@ var Confirmation = function Confirmation() {
|
|
|
7189
7343
|
var activeAppRoles = filterBy({
|
|
7190
7344
|
isEnabled: true
|
|
7191
7345
|
}, appRoles);
|
|
7192
|
-
return activeAppRoles.length > 1 ? /*#__PURE__*/
|
|
7193
|
-
className: "neeto-ui-flex neeto-ui-flex-col neeto-ui-gap-6"
|
|
7194
|
-
|
|
7195
|
-
|
|
7196
|
-
|
|
7197
|
-
|
|
7198
|
-
|
|
7199
|
-
|
|
7200
|
-
|
|
7201
|
-
|
|
7202
|
-
|
|
7203
|
-
|
|
7204
|
-
|
|
7205
|
-
|
|
7206
|
-
|
|
7207
|
-
|
|
7208
|
-
|
|
7209
|
-
|
|
7210
|
-
|
|
7211
|
-
|
|
7212
|
-
|
|
7213
|
-
|
|
7214
|
-
|
|
7215
|
-
|
|
7216
|
-
|
|
7217
|
-
|
|
7218
|
-
|
|
7219
|
-
|
|
7220
|
-
|
|
7221
|
-
|
|
7222
|
-
|
|
7223
|
-
|
|
7224
|
-
|
|
7225
|
-
|
|
7346
|
+
return activeAppRoles.length > 1 ? /*#__PURE__*/jsxs("div", {
|
|
7347
|
+
className: "neeto-ui-flex neeto-ui-flex-col neeto-ui-gap-6",
|
|
7348
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
7349
|
+
className: "neeto-ui-w-full",
|
|
7350
|
+
children: /*#__PURE__*/jsx(Typography, {
|
|
7351
|
+
component: "span",
|
|
7352
|
+
lineHeight: "relaxed",
|
|
7353
|
+
style: "body2",
|
|
7354
|
+
children: /*#__PURE__*/jsx(Trans, {
|
|
7355
|
+
i18nKey: "neetoTeamMembers.helpers.multipleProductInvitation",
|
|
7356
|
+
values: {
|
|
7357
|
+
count: selectedEmail.length,
|
|
7358
|
+
emails: selectedEmail,
|
|
7359
|
+
orgName: (_globalProps$organiza = globalProps.organization) === null || _globalProps$organiza === void 0 ? void 0 : _globalProps$organiza.name
|
|
7360
|
+
}
|
|
7361
|
+
})
|
|
7362
|
+
})
|
|
7363
|
+
}), /*#__PURE__*/jsxs("table", {
|
|
7364
|
+
className: "neeto-ui-w-full ntm-product-roles-table",
|
|
7365
|
+
children: [/*#__PURE__*/jsx("thead", {
|
|
7366
|
+
children: /*#__PURE__*/jsxs("tr", {
|
|
7367
|
+
children: [/*#__PURE__*/jsx("th", {
|
|
7368
|
+
children: t("neetoTeamMembers.common.productName")
|
|
7369
|
+
}), /*#__PURE__*/jsx("th", {
|
|
7370
|
+
children: t("neetoTeamMembers.common.role", SINGULAR)
|
|
7371
|
+
})]
|
|
7372
|
+
})
|
|
7373
|
+
}), /*#__PURE__*/jsx("tbody", {
|
|
7374
|
+
children: activeAppRoles.map(function (_ref) {
|
|
7375
|
+
var appName = _ref.appName,
|
|
7376
|
+
activeRole = _ref.activeRole;
|
|
7377
|
+
return /*#__PURE__*/jsxs("tr", {
|
|
7378
|
+
children: [/*#__PURE__*/jsx("td", {
|
|
7379
|
+
children: /*#__PURE__*/jsx(Typography, {
|
|
7380
|
+
component: "span",
|
|
7381
|
+
lineHeight: "relaxed",
|
|
7382
|
+
style: "body2",
|
|
7383
|
+
children: t("neetoTeamMembers.labels.neeto_", {
|
|
7384
|
+
product: appName
|
|
7385
|
+
})
|
|
7386
|
+
})
|
|
7387
|
+
}), /*#__PURE__*/jsx("td", {
|
|
7388
|
+
children: /*#__PURE__*/jsx(Typography, {
|
|
7389
|
+
component: "span",
|
|
7390
|
+
lineHeight: "relaxed",
|
|
7391
|
+
style: "body2",
|
|
7392
|
+
children: activeRole
|
|
7393
|
+
})
|
|
7394
|
+
})]
|
|
7395
|
+
}, appName);
|
|
7396
|
+
})
|
|
7397
|
+
})]
|
|
7398
|
+
})]
|
|
7399
|
+
}) : /*#__PURE__*/jsx(Typography, {
|
|
7226
7400
|
component: "span",
|
|
7227
7401
|
lineHeight: "relaxed",
|
|
7228
|
-
style: "body2"
|
|
7229
|
-
|
|
7230
|
-
|
|
7231
|
-
|
|
7232
|
-
|
|
7233
|
-
|
|
7234
|
-
|
|
7402
|
+
style: "body2",
|
|
7403
|
+
children: /*#__PURE__*/jsx(Trans, {
|
|
7404
|
+
i18nKey: "neetoTeamMembers.helpers.singleProductInvitation",
|
|
7405
|
+
values: getSingleInvitationTranslationProps({
|
|
7406
|
+
activeAppRoles: activeAppRoles,
|
|
7407
|
+
role: role,
|
|
7408
|
+
selectedEmail: selectedEmail
|
|
7409
|
+
})
|
|
7235
7410
|
})
|
|
7236
|
-
})
|
|
7411
|
+
});
|
|
7237
7412
|
};
|
|
7238
7413
|
|
|
7239
7414
|
var MultipleEmailInput = function MultipleEmailInput(_ref) {
|
|
@@ -7256,50 +7431,54 @@ var MultipleEmailInput = function MultipleEmailInput(_ref) {
|
|
|
7256
7431
|
}];
|
|
7257
7432
|
setFieldValue("emails", emailList);
|
|
7258
7433
|
};
|
|
7259
|
-
return /*#__PURE__*/
|
|
7260
|
-
className: "neeto-ui-w-full"
|
|
7261
|
-
|
|
7262
|
-
|
|
7263
|
-
|
|
7264
|
-
|
|
7265
|
-
|
|
7266
|
-
|
|
7267
|
-
|
|
7268
|
-
|
|
7269
|
-
|
|
7270
|
-
|
|
7271
|
-
|
|
7272
|
-
|
|
7273
|
-
|
|
7274
|
-
|
|
7275
|
-
|
|
7276
|
-
|
|
7277
|
-
|
|
7278
|
-
|
|
7279
|
-
|
|
7280
|
-
|
|
7281
|
-
|
|
7282
|
-
|
|
7283
|
-
|
|
7284
|
-
|
|
7434
|
+
return /*#__PURE__*/jsx("div", {
|
|
7435
|
+
className: "neeto-ui-w-full",
|
|
7436
|
+
children: selectedMember ? /*#__PURE__*/jsx(Input, {
|
|
7437
|
+
"data-cy": "ntm-manage-member-email-input",
|
|
7438
|
+
name: "emails",
|
|
7439
|
+
size: "medium",
|
|
7440
|
+
type: "email",
|
|
7441
|
+
value: (_head = head(emails)) === null || _head === void 0 ? void 0 : _head.value,
|
|
7442
|
+
label: /*#__PURE__*/jsx("span", {
|
|
7443
|
+
className: "neeto-ui-w-full neeto-ui-flex neeto-ui-justify-between",
|
|
7444
|
+
children: /*#__PURE__*/jsx(Typography, {
|
|
7445
|
+
component: "span",
|
|
7446
|
+
style: "body2",
|
|
7447
|
+
children: t("neetoTeamMembers.common.email", SINGULAR)
|
|
7448
|
+
})
|
|
7449
|
+
}),
|
|
7450
|
+
onChange: handleInputChange
|
|
7451
|
+
}) : /*#__PURE__*/jsx(MultiEmailInput, {
|
|
7452
|
+
required: true,
|
|
7453
|
+
counter: COUNTER_PROPS,
|
|
7454
|
+
"data-cy": "ntm-manage-member-email-input",
|
|
7455
|
+
filterInvalidEmails: FILTER_INVALID_EMAILS,
|
|
7456
|
+
helpText: t("neetoTeamMembers.helpers.enterMultipleEmails"),
|
|
7457
|
+
label: t("neetoTeamMembers.common.email", PLURAL),
|
|
7458
|
+
name: "emails",
|
|
7459
|
+
placeholder: t("neetoTeamMembers.placeholders.email"),
|
|
7460
|
+
ref: innerRef
|
|
7461
|
+
})
|
|
7462
|
+
});
|
|
7285
7463
|
};
|
|
7286
7464
|
|
|
7287
7465
|
var NameInputs = function NameInputs(_ref) {
|
|
7288
7466
|
var innerRef = _ref.innerRef;
|
|
7289
7467
|
var _useTranslation = useTranslation(),
|
|
7290
7468
|
t = _useTranslation.t;
|
|
7291
|
-
return /*#__PURE__*/
|
|
7292
|
-
className: "neeto-ui-flex neeto-ui-w-full neeto-ui-gap-4"
|
|
7293
|
-
|
|
7294
|
-
|
|
7295
|
-
|
|
7296
|
-
|
|
7297
|
-
|
|
7298
|
-
|
|
7299
|
-
|
|
7300
|
-
|
|
7301
|
-
|
|
7302
|
-
|
|
7469
|
+
return /*#__PURE__*/jsxs("div", {
|
|
7470
|
+
className: "neeto-ui-flex neeto-ui-w-full neeto-ui-gap-4",
|
|
7471
|
+
children: [/*#__PURE__*/jsx(Input, {
|
|
7472
|
+
"data-cy": "ntm-edit-member-first-name-text-field",
|
|
7473
|
+
label: t("neetoTeamMembers.labels.firstName"),
|
|
7474
|
+
name: "firstName",
|
|
7475
|
+
ref: innerRef
|
|
7476
|
+
}), /*#__PURE__*/jsx(Input, {
|
|
7477
|
+
"data-cy": "ntm-edit-member-last-name-text-field",
|
|
7478
|
+
label: t("neetoTeamMembers.labels.lastName"),
|
|
7479
|
+
name: "lastName"
|
|
7480
|
+
})]
|
|
7481
|
+
});
|
|
7303
7482
|
};
|
|
7304
7483
|
|
|
7305
7484
|
var RolesRadioGroup = function RolesRadioGroup(_ref) {
|
|
@@ -7335,7 +7514,7 @@ var RolesRadioGroup = function RolesRadioGroup(_ref) {
|
|
|
7335
7514
|
}
|
|
7336
7515
|
});
|
|
7337
7516
|
};
|
|
7338
|
-
return /*#__PURE__*/
|
|
7517
|
+
return /*#__PURE__*/jsx(Radio$1, {
|
|
7339
7518
|
stacked: true,
|
|
7340
7519
|
className: "ntm-members-radio-group flex-grow-0",
|
|
7341
7520
|
"data-cy": "ntm-manage-member-roles-group",
|
|
@@ -7343,37 +7522,40 @@ var RolesRadioGroup = function RolesRadioGroup(_ref) {
|
|
|
7343
7522
|
className: "neeto-ui-radio__label w-full"
|
|
7344
7523
|
},
|
|
7345
7524
|
name: "role",
|
|
7346
|
-
label: /*#__PURE__*/
|
|
7347
|
-
className: "flex w-full items-center justify-between"
|
|
7348
|
-
|
|
7349
|
-
|
|
7350
|
-
|
|
7351
|
-
|
|
7352
|
-
|
|
7353
|
-
|
|
7354
|
-
|
|
7525
|
+
label: /*#__PURE__*/jsxs("span", {
|
|
7526
|
+
className: "flex w-full items-center justify-between",
|
|
7527
|
+
children: [/*#__PURE__*/jsxs(Label, {
|
|
7528
|
+
required: true,
|
|
7529
|
+
children: [" ", t("neetoTeamMembers.common.role", SINGULAR)]
|
|
7530
|
+
}), /*#__PURE__*/jsx(Button, {
|
|
7531
|
+
label: t("neetoTeamMembers.labels.manageRole", PLURAL),
|
|
7532
|
+
style: "link",
|
|
7533
|
+
to: config.pathToRolesPage
|
|
7534
|
+
})]
|
|
7535
|
+
}),
|
|
7355
7536
|
onChange: function onChange(_ref3) {
|
|
7356
7537
|
var value = _ref3.target.value;
|
|
7357
7538
|
setFieldValue("role", value);
|
|
7358
7539
|
!isEdit && setDefaultSelection(value);
|
|
7359
|
-
}
|
|
7360
|
-
|
|
7361
|
-
|
|
7362
|
-
|
|
7363
|
-
|
|
7364
|
-
|
|
7365
|
-
|
|
7366
|
-
|
|
7367
|
-
|
|
7368
|
-
|
|
7369
|
-
|
|
7370
|
-
|
|
7371
|
-
|
|
7372
|
-
|
|
7373
|
-
|
|
7374
|
-
|
|
7375
|
-
|
|
7376
|
-
|
|
7540
|
+
},
|
|
7541
|
+
children: roles.map(function (_ref4) {
|
|
7542
|
+
var id = _ref4.id,
|
|
7543
|
+
name = _ref4.name;
|
|
7544
|
+
return /*#__PURE__*/jsx("label", {
|
|
7545
|
+
className: "ntm-members-form-radio-item__wrapper",
|
|
7546
|
+
htmlFor: slugify(name),
|
|
7547
|
+
children: /*#__PURE__*/jsx(Radio$1.Item, {
|
|
7548
|
+
className: "ntm-members-form-radio-item__label",
|
|
7549
|
+
"data-cy": "ntm-manage-member-roles-button",
|
|
7550
|
+
defaultChecked: identical(name, role),
|
|
7551
|
+
id: slugify(name),
|
|
7552
|
+
label: name,
|
|
7553
|
+
name: "role",
|
|
7554
|
+
value: name
|
|
7555
|
+
})
|
|
7556
|
+
}, id);
|
|
7557
|
+
})
|
|
7558
|
+
});
|
|
7377
7559
|
};
|
|
7378
7560
|
|
|
7379
7561
|
var SubscriptionPlan = function SubscriptionPlan(_ref) {
|
|
@@ -7386,29 +7568,32 @@ var SubscriptionPlan = function SubscriptionPlan(_ref) {
|
|
|
7386
7568
|
var handleChange = function handleChange(event) {
|
|
7387
7569
|
return setFieldValue("subscriptionPlan", event.target.checked ? SUBSCRIPTION_PLANS.PRO : SUBSCRIPTION_PLANS.FREE);
|
|
7388
7570
|
};
|
|
7389
|
-
return /*#__PURE__*/
|
|
7390
|
-
className: "flex flex-col space-y-4"
|
|
7391
|
-
|
|
7392
|
-
|
|
7393
|
-
|
|
7394
|
-
|
|
7395
|
-
|
|
7396
|
-
|
|
7397
|
-
|
|
7398
|
-
|
|
7399
|
-
|
|
7400
|
-
|
|
7401
|
-
|
|
7402
|
-
|
|
7403
|
-
|
|
7404
|
-
|
|
7405
|
-
|
|
7406
|
-
|
|
7407
|
-
|
|
7408
|
-
|
|
7571
|
+
return /*#__PURE__*/jsxs("div", {
|
|
7572
|
+
className: "flex flex-col space-y-4",
|
|
7573
|
+
children: [/*#__PURE__*/jsx(Checkbox$1, {
|
|
7574
|
+
label: /*#__PURE__*/jsx(Trans, {
|
|
7575
|
+
i18nKey: "neetoTeamMembers.labels.upgradeToProPlan"
|
|
7576
|
+
}),
|
|
7577
|
+
name: "isSubscriptionProPlan",
|
|
7578
|
+
onChange: handleChange
|
|
7579
|
+
}), isProPlan && /*#__PURE__*/jsx(Callout, {
|
|
7580
|
+
icon: Warning,
|
|
7581
|
+
style: "warning",
|
|
7582
|
+
children: /*#__PURE__*/jsx(Typography, {
|
|
7583
|
+
style: "body2",
|
|
7584
|
+
weight: "normal",
|
|
7585
|
+
children: /*#__PURE__*/jsx(Trans, {
|
|
7586
|
+
i18nKey: "neetoTeamMembers.helpers.subscriptionWarning",
|
|
7587
|
+
values: {
|
|
7588
|
+
amount: currencyFormat.withSymbol(subscription === null || subscription === void 0 || (_subscription$plan = subscription.plan) === null || _subscription$plan === void 0 ? void 0 : _subscription$plan.amount, subscription === null || subscription === void 0 || (_subscription$plan2 = subscription.plan) === null || _subscription$plan2 === void 0 || (_subscription$plan2 = _subscription$plan2.currency) === null || _subscription$plan2 === void 0 ? void 0 : _subscription$plan2.toUpperCase(), {
|
|
7589
|
+
maximumFractionDigits: 2,
|
|
7590
|
+
minimumFractionDigits: 0
|
|
7591
|
+
})
|
|
7592
|
+
}
|
|
7593
|
+
})
|
|
7409
7594
|
})
|
|
7410
|
-
}
|
|
7411
|
-
})
|
|
7595
|
+
})]
|
|
7596
|
+
});
|
|
7412
7597
|
};
|
|
7413
7598
|
|
|
7414
7599
|
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; }
|
|
@@ -7584,112 +7769,123 @@ var ManageMember = function ManageMember(_ref) {
|
|
|
7584
7769
|
var _config$additionalFie;
|
|
7585
7770
|
switch (page) {
|
|
7586
7771
|
case FORM_PAGES.MAIN:
|
|
7587
|
-
return /*#__PURE__*/
|
|
7588
|
-
|
|
7589
|
-
|
|
7590
|
-
|
|
7591
|
-
|
|
7592
|
-
|
|
7593
|
-
|
|
7594
|
-
|
|
7595
|
-
|
|
7596
|
-
|
|
7597
|
-
|
|
7598
|
-
|
|
7599
|
-
|
|
7600
|
-
|
|
7601
|
-
|
|
7602
|
-
|
|
7772
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
7773
|
+
children: [selectedMember && /*#__PURE__*/jsx(NameInputs, {
|
|
7774
|
+
innerRef: inputReference
|
|
7775
|
+
}), /*#__PURE__*/jsx(MultipleEmailInput, {
|
|
7776
|
+
emails: emails,
|
|
7777
|
+
selectedMember: selectedMember,
|
|
7778
|
+
innerRef: inputReference
|
|
7779
|
+
}), isSubscriptionVisible && /*#__PURE__*/jsx(SubscriptionPlan, {
|
|
7780
|
+
handleClose: handleClose,
|
|
7781
|
+
subscription: config.subscription
|
|
7782
|
+
}), /*#__PURE__*/jsx(RolesRadioGroup, {
|
|
7783
|
+
config: config,
|
|
7784
|
+
globalRoles: globalRoles,
|
|
7785
|
+
role: role,
|
|
7786
|
+
isEdit: !!selectedMember,
|
|
7787
|
+
roles: filteredRoles
|
|
7788
|
+
}), (_config$additionalFie = config.additionalFields) === null || _config$additionalFie === void 0 ? void 0 : _config$additionalFie.component]
|
|
7789
|
+
});
|
|
7603
7790
|
case FORM_PAGES.APP_LIST:
|
|
7604
|
-
return /*#__PURE__*/
|
|
7791
|
+
return /*#__PURE__*/jsx(AppList, {
|
|
7605
7792
|
globalRoles: globalRoles,
|
|
7606
7793
|
savedStateRef: appListSavedStateReference
|
|
7607
7794
|
});
|
|
7608
7795
|
case FORM_PAGES.CONFIRMATION:
|
|
7609
|
-
return /*#__PURE__*/
|
|
7796
|
+
return /*#__PURE__*/jsx(Confirmation, {});
|
|
7610
7797
|
default:
|
|
7611
7798
|
return null;
|
|
7612
7799
|
}
|
|
7613
7800
|
};
|
|
7614
|
-
return /*#__PURE__*/
|
|
7801
|
+
return /*#__PURE__*/jsxs(Component, {
|
|
7615
7802
|
className: manageMemberComponentConfig.className,
|
|
7616
7803
|
"data-cy": "ntm-manage-members-pane-wrapper",
|
|
7617
7804
|
initialFocusRef: manageMemberComponentConfig.initialFocusRef,
|
|
7618
7805
|
isOpen: manageMemberComponentConfig.isOpen,
|
|
7619
7806
|
onClose: function onClose() {
|
|
7620
7807
|
return handleClose(false);
|
|
7621
|
-
}
|
|
7622
|
-
}, /*#__PURE__*/React.createElement(Component.Header, _extends({}, manageMemberComponentConfig.headerProps, {
|
|
7623
|
-
className: classnames([{
|
|
7624
|
-
"ntm-manage-members__header": currentPage !== FORM_PAGES.MAIN
|
|
7625
|
-
}, (_manageMemberComponen = manageMemberComponentConfig.headerProps) === null || _manageMemberComponen === void 0 ? void 0 : _manageMemberComponen.className])
|
|
7626
|
-
}), currentPage !== FORM_PAGES.MAIN && /*#__PURE__*/React.createElement(Button, {
|
|
7627
|
-
"aria-label": "Back",
|
|
7628
|
-
icon: LeftArrow,
|
|
7629
|
-
size: "medium",
|
|
7630
|
-
style: "text",
|
|
7631
|
-
tooltipProps: {
|
|
7632
|
-
content: t("neetoTeamMembers.buttons.back"),
|
|
7633
|
-
position: "bottom"
|
|
7634
7808
|
},
|
|
7635
|
-
|
|
7636
|
-
|
|
7637
|
-
|
|
7638
|
-
|
|
7639
|
-
|
|
7640
|
-
|
|
7641
|
-
|
|
7642
|
-
|
|
7643
|
-
|
|
7644
|
-
|
|
7645
|
-
|
|
7646
|
-
|
|
7647
|
-
|
|
7648
|
-
|
|
7649
|
-
|
|
7650
|
-
|
|
7651
|
-
|
|
7652
|
-
|
|
7653
|
-
|
|
7654
|
-
|
|
7655
|
-
|
|
7656
|
-
|
|
7657
|
-
|
|
7658
|
-
|
|
7659
|
-
|
|
7660
|
-
|
|
7661
|
-
|
|
7662
|
-
|
|
7663
|
-
|
|
7664
|
-
|
|
7665
|
-
|
|
7666
|
-
|
|
7667
|
-
|
|
7668
|
-
|
|
7669
|
-
|
|
7670
|
-
|
|
7671
|
-
|
|
7672
|
-
|
|
7673
|
-
|
|
7674
|
-
|
|
7675
|
-
|
|
7676
|
-
|
|
7677
|
-
|
|
7678
|
-
|
|
7679
|
-
|
|
7680
|
-
|
|
7681
|
-
|
|
7682
|
-
|
|
7683
|
-
|
|
7684
|
-
|
|
7685
|
-
|
|
7686
|
-
|
|
7687
|
-
|
|
7688
|
-
|
|
7689
|
-
|
|
7809
|
+
children: [/*#__PURE__*/jsxs(Component.Header, _objectSpread$1(_objectSpread$1({}, manageMemberComponentConfig.headerProps), {}, {
|
|
7810
|
+
className: classnames([{
|
|
7811
|
+
"ntm-manage-members__header": currentPage !== FORM_PAGES.MAIN
|
|
7812
|
+
}, (_manageMemberComponen = manageMemberComponentConfig.headerProps) === null || _manageMemberComponen === void 0 ? void 0 : _manageMemberComponen.className]),
|
|
7813
|
+
children: [currentPage !== FORM_PAGES.MAIN && /*#__PURE__*/jsx(Button, {
|
|
7814
|
+
"aria-label": "Back",
|
|
7815
|
+
icon: LeftArrow,
|
|
7816
|
+
size: "medium",
|
|
7817
|
+
style: "text",
|
|
7818
|
+
tooltipProps: {
|
|
7819
|
+
content: t("neetoTeamMembers.buttons.back"),
|
|
7820
|
+
position: "bottom"
|
|
7821
|
+
},
|
|
7822
|
+
onClick: handleBackButton
|
|
7823
|
+
}), /*#__PURE__*/jsx(Typography, {
|
|
7824
|
+
className: "ntm-members-form__header",
|
|
7825
|
+
"data-cy": "ntm-manage-members-pane-header",
|
|
7826
|
+
style: "h2",
|
|
7827
|
+
weight: "semibold",
|
|
7828
|
+
children: getTitle()
|
|
7829
|
+
})]
|
|
7830
|
+
})), /*#__PURE__*/jsx(Form, {
|
|
7831
|
+
ref: formReference,
|
|
7832
|
+
formikProps: {
|
|
7833
|
+
enableReinitialize: true,
|
|
7834
|
+
initialValues: renderInitialValues({
|
|
7835
|
+
additionalFieldsInitialValues: (_config$additionalFie2 = config.additionalFields) === null || _config$additionalFie2 === void 0 ? void 0 : _config$additionalFie2.initialValues,
|
|
7836
|
+
globalRoles: globalRoles,
|
|
7837
|
+
roles: filteredRoles,
|
|
7838
|
+
selectedMember: selectedMember
|
|
7839
|
+
}),
|
|
7840
|
+
onSubmit: handleOnSubmit,
|
|
7841
|
+
validationSchema: buildValidationSchema(_objectSpread$1({
|
|
7842
|
+
selectedMember: selectedMember
|
|
7843
|
+
}, team))
|
|
7844
|
+
},
|
|
7845
|
+
children: function children(_ref5) {
|
|
7846
|
+
var _manageMemberComponen2, _manageMemberComponen3;
|
|
7847
|
+
var values = _ref5.values,
|
|
7848
|
+
dirty = _ref5.dirty;
|
|
7849
|
+
var emails = values.emails,
|
|
7850
|
+
role = values.role;
|
|
7851
|
+
formikValues.current = values;
|
|
7852
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
7853
|
+
children: [/*#__PURE__*/jsx(ScrollToErrorField, {
|
|
7854
|
+
formRef: formReference
|
|
7855
|
+
}), /*#__PURE__*/jsxs(Component.Body, _objectSpread$1(_objectSpread$1({}, manageMemberComponentConfig.bodyProps), {}, {
|
|
7856
|
+
className: classnames(["ntm-members-form__body", (_manageMemberComponen2 = manageMemberComponentConfig.bodyProps) === null || _manageMemberComponen2 === void 0 ? void 0 : _manageMemberComponen2.className]),
|
|
7857
|
+
children: [isCreationStatusPollingEnabled && /*#__PURE__*/jsx(Callout, {
|
|
7858
|
+
className: "w-full",
|
|
7859
|
+
icon: Info,
|
|
7860
|
+
style: "info",
|
|
7861
|
+
children: t("neetoTeamMembers.helpers.memberCreationStatus", {
|
|
7862
|
+
count: emails.length,
|
|
7863
|
+
totalCount: progress === null || progress === void 0 ? void 0 : progress.totalCount,
|
|
7864
|
+
completedCount: progress === null || progress === void 0 ? void 0 : progress.completedCount
|
|
7865
|
+
})
|
|
7866
|
+
}), renderFormPage(currentPage, emails, role)]
|
|
7867
|
+
})), /*#__PURE__*/jsxs(Component.Footer, _objectSpread$1(_objectSpread$1({}, manageMemberComponentConfig.footerProps), {}, {
|
|
7868
|
+
className: classnames(["ntm-members-form__footer", (_manageMemberComponen3 = manageMemberComponentConfig.footerProps) === null || _manageMemberComponen3 === void 0 ? void 0 : _manageMemberComponen3.className]),
|
|
7869
|
+
children: [/*#__PURE__*/jsx(Button, {
|
|
7870
|
+
loading: isSubmitting || isCreationStatusPollingEnabled,
|
|
7871
|
+
style: "primary",
|
|
7872
|
+
type: "submit",
|
|
7873
|
+
"data-cy": isLastPage ? "ntm-manage-member-submit-button" : "ntm-manage-member-continue-button",
|
|
7874
|
+
disabled: !dirty || isSubmitting || isCreationStatusPollingEnabled,
|
|
7875
|
+
label: isLastPage ? t("neetoTeamMembers.buttons.saveChanges") : t("neetoTeamMembers.buttons.continue")
|
|
7876
|
+
}), /*#__PURE__*/jsx(Button, {
|
|
7877
|
+
"data-cy": "ntm-manage-member-cancel-button",
|
|
7878
|
+
label: t("neetoTeamMembers.buttons.cancel"),
|
|
7879
|
+
style: "text",
|
|
7880
|
+
onClick: function onClick() {
|
|
7881
|
+
return handleClose(false);
|
|
7882
|
+
}
|
|
7883
|
+
})]
|
|
7884
|
+
}))]
|
|
7885
|
+
});
|
|
7690
7886
|
}
|
|
7691
|
-
})
|
|
7692
|
-
})
|
|
7887
|
+
})]
|
|
7888
|
+
});
|
|
7693
7889
|
};
|
|
7694
7890
|
|
|
7695
7891
|
var Menu = function Menu(_ref) {
|
|
@@ -7700,22 +7896,22 @@ var Menu = function Menu(_ref) {
|
|
|
7700
7896
|
var _useTranslation = useTranslation(),
|
|
7701
7897
|
t = _useTranslation.t;
|
|
7702
7898
|
var memberFilterKeys = keys(MEMBER_FILTER);
|
|
7703
|
-
return /*#__PURE__*/
|
|
7899
|
+
return /*#__PURE__*/jsx(MenuBar, {
|
|
7704
7900
|
"data-cy": "ntm-members-menubar-heading",
|
|
7705
7901
|
showMenu: isMenuOpen,
|
|
7706
|
-
title: taxonomies.member.plural
|
|
7707
|
-
|
|
7708
|
-
|
|
7709
|
-
|
|
7710
|
-
|
|
7711
|
-
|
|
7712
|
-
|
|
7713
|
-
|
|
7714
|
-
|
|
7715
|
-
|
|
7716
|
-
}
|
|
7717
|
-
})
|
|
7718
|
-
})
|
|
7902
|
+
title: taxonomies.member.plural,
|
|
7903
|
+
children: memberFilterKeys.map(function (filter) {
|
|
7904
|
+
return /*#__PURE__*/jsx(MenuBar.Block, {
|
|
7905
|
+
count: getPerCategoryCount(filterCounts, filter),
|
|
7906
|
+
"data-cy": "ntm-members-menubar-".concat(slugify(filter), "-block"),
|
|
7907
|
+
label: t(MEMBER_FILTER[filter].label),
|
|
7908
|
+
active: memberFilterKeys.includes(memberFilter) && identical(filter, memberFilter),
|
|
7909
|
+
onClick: function onClick() {
|
|
7910
|
+
return handleMemberFilterChange(filter);
|
|
7911
|
+
}
|
|
7912
|
+
}, filter);
|
|
7913
|
+
})
|
|
7914
|
+
});
|
|
7719
7915
|
};
|
|
7720
7916
|
|
|
7721
7917
|
function ownKeys(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; }
|
|
@@ -7843,91 +8039,98 @@ var TeamMembers = function TeamMembers(_ref) {
|
|
|
7843
8039
|
noDataTitle = _generateNoDataConten.noDataTitle,
|
|
7844
8040
|
noDataButtonProps = _generateNoDataConten.noDataButtonProps;
|
|
7845
8041
|
if (isRolesLoading || isMembersLoading) {
|
|
7846
|
-
return /*#__PURE__*/
|
|
7847
|
-
className: "ntm-members-page-loader"
|
|
7848
|
-
|
|
8042
|
+
return /*#__PURE__*/jsx("div", {
|
|
8043
|
+
className: "ntm-members-page-loader",
|
|
8044
|
+
children: /*#__PURE__*/jsx(PageLoader, {})
|
|
8045
|
+
});
|
|
7849
8046
|
}
|
|
7850
|
-
return /*#__PURE__*/
|
|
7851
|
-
className: "ntm-members"
|
|
7852
|
-
|
|
7853
|
-
|
|
7854
|
-
|
|
7855
|
-
|
|
7856
|
-
|
|
7857
|
-
|
|
7858
|
-
|
|
7859
|
-
|
|
7860
|
-
|
|
7861
|
-
|
|
7862
|
-
|
|
7863
|
-
|
|
7864
|
-
|
|
7865
|
-
|
|
7866
|
-
|
|
7867
|
-
|
|
7868
|
-
|
|
7869
|
-
|
|
7870
|
-
|
|
7871
|
-
|
|
7872
|
-
|
|
7873
|
-
|
|
7874
|
-
|
|
7875
|
-
|
|
7876
|
-
|
|
7877
|
-
|
|
7878
|
-
|
|
8047
|
+
return /*#__PURE__*/jsx("div", {
|
|
8048
|
+
className: "ntm-members",
|
|
8049
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
8050
|
+
className: "ntm-members-wrapper",
|
|
8051
|
+
children: [/*#__PURE__*/jsx(Menu, {
|
|
8052
|
+
handleMemberFilterChange: handleMemberFilterChange,
|
|
8053
|
+
filterCounts: team === null || team === void 0 ? void 0 : team.perCategoryCount,
|
|
8054
|
+
isMenuOpen: isOpen.menuBar,
|
|
8055
|
+
memberFilter: filters.category
|
|
8056
|
+
}), /*#__PURE__*/jsxs(Container, {
|
|
8057
|
+
children: [/*#__PURE__*/jsx(Header$1, {
|
|
8058
|
+
config: config,
|
|
8059
|
+
setIsOpen: setIsOpen,
|
|
8060
|
+
filterCategory: filters.category,
|
|
8061
|
+
searchProps: hasMembers ? searchProps : null
|
|
8062
|
+
}), /*#__PURE__*/jsx(SubHeaderMolecule, {
|
|
8063
|
+
leftActionBlock: /*#__PURE__*/jsx(SubHeader.Left, {
|
|
8064
|
+
config: config,
|
|
8065
|
+
selectedRows: selectedRows,
|
|
8066
|
+
setSelectedRows: setSelectedRows,
|
|
8067
|
+
filteredCount: team === null || team === void 0 ? void 0 : team.membersCount,
|
|
8068
|
+
roles: filteredRoles
|
|
8069
|
+
}),
|
|
8070
|
+
rightActionBlock: hasMembers && /*#__PURE__*/jsx(SubHeader.Right, {
|
|
8071
|
+
columns: columns,
|
|
8072
|
+
filterColumns: filterColumns,
|
|
8073
|
+
handleNeetoFilterChange: handleNeetoFilterChange,
|
|
8074
|
+
isFiltersPaneOpen: isFiltersPaneOpen,
|
|
8075
|
+
searchKeywordProps: searchKeywordProps,
|
|
8076
|
+
setIsFiltersPaneOpen: setIsFiltersPaneOpen
|
|
8077
|
+
})
|
|
8078
|
+
}), /*#__PURE__*/jsx(Bar, {
|
|
8079
|
+
columns: filterColumns,
|
|
8080
|
+
keyword: searchKeywordProps,
|
|
8081
|
+
setIsPaneOpen: setIsFiltersPaneOpen,
|
|
8082
|
+
onChange: handleNeetoFilterChange
|
|
8083
|
+
}), /*#__PURE__*/jsx(TableWrapper, {
|
|
8084
|
+
hasPagination: (team === null || team === void 0 ? void 0 : team.membersCount) > filters.pageSize,
|
|
8085
|
+
children: (team === null || team === void 0 ? void 0 : team.membersCount) !== 0 ? /*#__PURE__*/jsx(Table$1, {
|
|
8086
|
+
fixedHeight: true,
|
|
8087
|
+
allowRowClick: false,
|
|
8088
|
+
columnData: getVisibleColumnData(columns),
|
|
8089
|
+
currentPageNumber: parseInt(filters.page, DEFAULT_RADIX),
|
|
8090
|
+
"data-cy": "ntm-members-table",
|
|
8091
|
+
loading: isMembersFetching,
|
|
8092
|
+
paginationProps: renderPaginationProps(filters.pageSize),
|
|
8093
|
+
rowData: team === null || team === void 0 ? void 0 : team.members,
|
|
8094
|
+
rowSelection: {
|
|
8095
|
+
columnWidth: "2%"
|
|
8096
|
+
},
|
|
8097
|
+
selectedRowKeys: selectedRows.keys,
|
|
8098
|
+
totalCount: team === null || team === void 0 ? void 0 : team.membersCount,
|
|
8099
|
+
handlePageChange: handlePageChange(setFilters, filters.category, history),
|
|
8100
|
+
onChange: handleTableChange,
|
|
8101
|
+
onColumnHide: function onColumnHide(_ref2) {
|
|
8102
|
+
var dataIndex = _ref2.dataIndex;
|
|
8103
|
+
return hideColumn(dataIndex);
|
|
8104
|
+
},
|
|
8105
|
+
onRowSelect: handleRowSelect
|
|
8106
|
+
}) : /*#__PURE__*/jsx("div", {
|
|
8107
|
+
className: "flex h-full w-full items-center justify-center",
|
|
8108
|
+
children: /*#__PURE__*/jsx(NoData, {
|
|
8109
|
+
primaryButtonProps: noDataButtonProps,
|
|
8110
|
+
title: noDataTitle
|
|
8111
|
+
})
|
|
8112
|
+
})
|
|
8113
|
+
})]
|
|
8114
|
+
}), /*#__PURE__*/jsx(ManageMember, {
|
|
8115
|
+
config: config,
|
|
8116
|
+
selectedMember: selectedMember,
|
|
8117
|
+
componentConfig: {
|
|
8118
|
+
isOpen: isOpen.manageMember
|
|
8119
|
+
},
|
|
8120
|
+
roles: filteredRoles,
|
|
8121
|
+
onComplete: handlePaneClose
|
|
8122
|
+
}), /*#__PURE__*/jsx(Alert, {
|
|
8123
|
+
cancelButtonLabel: t("neetoTeamMembers.buttons.cancel"),
|
|
8124
|
+
isOpen: isOpen.alert,
|
|
8125
|
+
isSubmitting: isUpdatingMember,
|
|
8126
|
+
message: renderUpdateAlert("message", updateMemberAlertProps),
|
|
8127
|
+
title: renderUpdateAlert("title", updateMemberAlertProps),
|
|
8128
|
+
submitButtonLabel: selectedMember !== null && selectedMember !== void 0 && selectedMember.active ? t("neetoTeamMembers.buttons.deactivate") : t("neetoTeamMembers.buttons.activate"),
|
|
8129
|
+
onClose: handleAlertClose,
|
|
8130
|
+
onSubmit: handleUpdateMember
|
|
8131
|
+
})]
|
|
7879
8132
|
})
|
|
7880
|
-
})
|
|
7881
|
-
columns: filterColumns,
|
|
7882
|
-
keyword: searchKeywordProps,
|
|
7883
|
-
setIsPaneOpen: setIsFiltersPaneOpen,
|
|
7884
|
-
onChange: handleNeetoFilterChange
|
|
7885
|
-
}), /*#__PURE__*/React.createElement(TableWrapper, {
|
|
7886
|
-
hasPagination: (team === null || team === void 0 ? void 0 : team.membersCount) > filters.pageSize
|
|
7887
|
-
}, (team === null || team === void 0 ? void 0 : team.membersCount) !== 0 ? /*#__PURE__*/React.createElement(Table$1, {
|
|
7888
|
-
fixedHeight: true,
|
|
7889
|
-
allowRowClick: false,
|
|
7890
|
-
columnData: getVisibleColumnData(columns),
|
|
7891
|
-
currentPageNumber: parseInt(filters.page, DEFAULT_RADIX),
|
|
7892
|
-
"data-cy": "ntm-members-table",
|
|
7893
|
-
loading: isMembersFetching,
|
|
7894
|
-
paginationProps: renderPaginationProps(filters.pageSize),
|
|
7895
|
-
rowData: team === null || team === void 0 ? void 0 : team.members,
|
|
7896
|
-
rowSelection: {
|
|
7897
|
-
columnWidth: "2%"
|
|
7898
|
-
},
|
|
7899
|
-
selectedRowKeys: selectedRows.keys,
|
|
7900
|
-
totalCount: team === null || team === void 0 ? void 0 : team.membersCount,
|
|
7901
|
-
handlePageChange: handlePageChange(setFilters, filters.category, history),
|
|
7902
|
-
onChange: handleTableChange,
|
|
7903
|
-
onColumnHide: function onColumnHide(_ref2) {
|
|
7904
|
-
var dataIndex = _ref2.dataIndex;
|
|
7905
|
-
return hideColumn(dataIndex);
|
|
7906
|
-
},
|
|
7907
|
-
onRowSelect: handleRowSelect
|
|
7908
|
-
}) : /*#__PURE__*/React.createElement("div", {
|
|
7909
|
-
className: "flex h-full w-full items-center justify-center"
|
|
7910
|
-
}, /*#__PURE__*/React.createElement(NoData, {
|
|
7911
|
-
primaryButtonProps: noDataButtonProps,
|
|
7912
|
-
title: noDataTitle
|
|
7913
|
-
})))), /*#__PURE__*/React.createElement(ManageMember, {
|
|
7914
|
-
config: config,
|
|
7915
|
-
selectedMember: selectedMember,
|
|
7916
|
-
componentConfig: {
|
|
7917
|
-
isOpen: isOpen.manageMember
|
|
7918
|
-
},
|
|
7919
|
-
roles: filteredRoles,
|
|
7920
|
-
onComplete: handlePaneClose
|
|
7921
|
-
}), /*#__PURE__*/React.createElement(Alert, {
|
|
7922
|
-
cancelButtonLabel: t("neetoTeamMembers.buttons.cancel"),
|
|
7923
|
-
isOpen: isOpen.alert,
|
|
7924
|
-
isSubmitting: isUpdatingMember,
|
|
7925
|
-
message: renderUpdateAlert("message", updateMemberAlertProps),
|
|
7926
|
-
title: renderUpdateAlert("title", updateMemberAlertProps),
|
|
7927
|
-
submitButtonLabel: selectedMember !== null && selectedMember !== void 0 && selectedMember.active ? t("neetoTeamMembers.buttons.deactivate") : t("neetoTeamMembers.buttons.activate"),
|
|
7928
|
-
onClose: handleAlertClose,
|
|
7929
|
-
onSubmit: handleUpdateMember
|
|
7930
|
-
})));
|
|
8133
|
+
});
|
|
7931
8134
|
};
|
|
7932
8135
|
var index = withTitle(withReactQuery(TeamMembers), taxonomies.member.plural);
|
|
7933
8136
|
|