@bigbinary/neeto-team-members-frontend 3.3.0 → 3.4.0-beta1

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/dist/index.js CHANGED
@@ -6,8 +6,8 @@ import Container from '@bigbinary/neeto-molecules/Container';
6
6
  import NeetoHeader from '@bigbinary/neeto-molecules/Header';
7
7
  import Button from '@bigbinary/neetoui/Button';
8
8
  import { useTranslation, Trans } from 'react-i18next';
9
- import { prop, pluck, mergeLeft, includes, keys, isEmpty, replace as replace$1, is, append, equals, concat, groupBy, not, map, identical, modify, __, filter as filter$1, identity, clamp, curry, isNil, toLower, assoc, trim, isNotNil, pick, move, head, reverse } from 'ramda';
10
- import { useQuery, QueryClient, QueryCache, QueryClientProvider, useMutation } from 'react-query';
9
+ import { useQuery, QueryClient, QueryCache, QueryClientProvider, keepPreviousData, useMutation } from '@tanstack/react-query';
10
+ import { prop, pluck, mergeLeft, includes, keys, isEmpty, replace as replace$1, is, append, concat, equals, groupBy, not, map, identical, modify, __, filter as filter$1, identity, clamp, curry, isNil, toLower, assoc, trim, isNotNil, pick, move, head, reverse } from 'ramda';
11
11
  import axios from 'axios';
12
12
  import i18next, { t as t$1 } from 'i18next';
13
13
  import { DEFAULT_PAGE_INDEX, DEFAULT_STALE_TIME, PLURAL, SINGULAR, DEFAULT_PAGE_SIZE as DEFAULT_PAGE_SIZE$1 } from '@bigbinary/neeto-commons-frontend/constants';
@@ -33,18 +33,21 @@ import Table$1 from '@bigbinary/neetoui/Table';
33
33
  import NoData from '@bigbinary/neetoui/NoData';
34
34
  import Tooltip from '@bigbinary/neetoui/Tooltip';
35
35
  import { useProfileImageUpload } from '@bigbinary/neeto-image-uploader-frontend';
36
- import { Delete as Delete$1, ExternalLink, Up, Down, Search, Right as Right$1, Warning, LeftArrow, Info, UserCircle } from '@bigbinary/neeto-icons';
36
+ import ExternalLink from '@bigbinary/neeto-icons/ExternalLink';
37
37
  import Callout from '@bigbinary/neetoui/Callout';
38
38
  import Label from '@bigbinary/neetoui/Label';
39
39
  import Radio from '@bigbinary/neetoui/Radio';
40
40
  import Toastr from '@bigbinary/neetoui/Toastr';
41
+ import Delete$1 from '@bigbinary/neeto-icons/Delete';
41
42
  import withImmutableActions from '@bigbinary/neeto-commons-frontend/react-utils/withImmutableActions';
42
43
  import { create as create$3 } from 'zustand';
43
44
  import { shallow } from 'zustand/shallow';
44
- import { ReactQueryDevtools } from 'react-query/devtools';
45
45
  import Checkbox from '@bigbinary/neetoui/Checkbox';
46
46
  import classnames from 'classnames';
47
+ import Search from '@bigbinary/neeto-icons/Search';
47
48
  import Input$1 from '@bigbinary/neetoui/Input';
49
+ import Down from '@bigbinary/neeto-icons/Down';
50
+ import Up from '@bigbinary/neeto-icons/Up';
48
51
  import { getQueryParams, buildUrl, hyphenize, currencyFormat, showThumbsUpToastr } from '@bigbinary/neeto-commons-frontend/utils';
49
52
  import { buildFiltersFromURL, Bar } from '@bigbinary/neeto-filters-frontend';
50
53
  import { useHiddenColumns } from '@bigbinary/neeto-molecules/Columns';
@@ -52,13 +55,18 @@ import { useHistory, matchPath } from 'react-router-dom';
52
55
  import require$$0$1 from 'util';
53
56
  import Dropdown from '@bigbinary/neetoui/Dropdown';
54
57
  import Tag from '@bigbinary/neetoui/Tag';
58
+ import Right$1 from '@bigbinary/neeto-icons/Right';
59
+ import Info from '@bigbinary/neeto-icons/Info';
60
+ import LeftArrow from '@bigbinary/neeto-icons/LeftArrow';
55
61
  import useFetchNeetoApps from '@bigbinary/neeto-commons-frontend/react-utils/useFetchNeetoApps';
56
62
  import Switch from '@bigbinary/neetoui/formik/Switch';
57
63
  import Modal from '@bigbinary/neetoui/Modal';
58
64
  import MultiEmailInput from '@bigbinary/neetoui/formik/MultiEmailInput';
59
65
  import Radio$1 from '@bigbinary/neetoui/formik/Radio';
66
+ import Warning from '@bigbinary/neeto-icons/Warning';
60
67
  import Checkbox$1 from '@bigbinary/neetoui/formik/Checkbox';
61
68
  import MenuBar from '@bigbinary/neeto-molecules/MenuBar';
69
+ import UserCircle from '@bigbinary/neeto-icons/UserCircle';
62
70
 
63
71
  function _typeof$1(o) {
64
72
  "@babel/helpers - typeof";
@@ -247,13 +255,16 @@ var useFetchGroups = function useFetchGroups(_ref) {
247
255
  pageSize = _ref.pageSize,
248
256
  _ref$searchTerm = _ref.searchTerm,
249
257
  searchTerm = _ref$searchTerm === void 0 ? "" : _ref$searchTerm;
250
- return useQuery([QUERY_KEYS.GROUPS, searchTerm, page, pageSize], function () {
251
- return groupsApi.list({
252
- searchTerm: searchTerm,
253
- page: page,
254
- pageSize: pageSize,
255
- loadDetails: true
256
- });
258
+ return useQuery({
259
+ queryKey: [QUERY_KEYS.GROUPS, searchTerm, page, pageSize],
260
+ queryFn: function queryFn() {
261
+ return groupsApi.list({
262
+ searchTerm: searchTerm,
263
+ page: page,
264
+ pageSize: pageSize,
265
+ loadDetails: true
266
+ });
267
+ }
257
268
  });
258
269
  };
259
270
  var useCreateGroup = function useCreateGroup() {
@@ -262,7 +273,7 @@ var useCreateGroup = function useCreateGroup() {
262
273
  return useMutationWithInvalidation(function (payload) {
263
274
  return groupsApi.create(payload);
264
275
  }, {
265
- keysToInvalidate: [QUERY_KEYS.GROUPS].concat(_toConsumableArray((_config$form$otherKey = config === null || config === void 0 || (_config$form = config.form) === null || _config$form === void 0 ? void 0 : _config$form.otherKeysToInvalidate) !== null && _config$form$otherKey !== void 0 ? _config$form$otherKey : []))
276
+ keysToInvalidate: [[QUERY_KEYS.GROUPS]].concat(_toConsumableArray((_config$form$otherKey = config === null || config === void 0 || (_config$form = config.form) === null || _config$form === void 0 ? void 0 : _config$form.otherKeysToInvalidate) !== null && _config$form$otherKey !== void 0 ? _config$form$otherKey : []))
266
277
  });
267
278
  };
268
279
  var useDeleteGroup = function useDeleteGroup() {
@@ -271,13 +282,15 @@ var useDeleteGroup = function useDeleteGroup() {
271
282
  return useMutationWithInvalidation(function (id) {
272
283
  return groupsApi.destroy(id);
273
284
  }, {
274
- keysToInvalidate: [QUERY_KEYS.GROUPS].concat(_toConsumableArray((_config$form$otherKey2 = config === null || config === void 0 || (_config$form2 = config.form) === null || _config$form2 === void 0 ? void 0 : _config$form2.otherKeysToInvalidate) !== null && _config$form$otherKey2 !== void 0 ? _config$form$otherKey2 : []))
285
+ keysToInvalidate: [[QUERY_KEYS.GROUPS]].concat(_toConsumableArray((_config$form$otherKey2 = config === null || config === void 0 || (_config$form2 = config.form) === null || _config$form2 === void 0 ? void 0 : _config$form2.otherKeysToInvalidate) !== null && _config$form$otherKey2 !== void 0 ? _config$form$otherKey2 : []))
275
286
  });
276
287
  };
277
288
  var useFetchGroup = function useFetchGroup(id) {
278
- return useQuery([QUERY_KEYS.GROUPS, id], function () {
279
- return groupsApi.show(id);
280
- }, {
289
+ return useQuery({
290
+ queryKey: [QUERY_KEYS.GROUPS, id],
291
+ queryFn: function queryFn() {
292
+ return groupsApi.show(id);
293
+ },
281
294
  select: prop("group"),
282
295
  enabled: !!id
283
296
  });
@@ -290,7 +303,7 @@ var useUpdateGroup = function useUpdateGroup() {
290
303
  payload = _ref2.payload;
291
304
  return groupsApi.update(id, payload);
292
305
  }, {
293
- keysToInvalidate: [QUERY_KEYS.GROUPS].concat(_toConsumableArray((_config$form$otherKey3 = config === null || config === void 0 || (_config$form3 = config.form) === null || _config$form3 === void 0 ? void 0 : _config$form3.otherKeysToInvalidate) !== null && _config$form$otherKey3 !== void 0 ? _config$form$otherKey3 : []))
306
+ keysToInvalidate: [[QUERY_KEYS.GROUPS]].concat(_toConsumableArray((_config$form$otherKey3 = config === null || config === void 0 || (_config$form3 = config.form) === null || _config$form3 === void 0 ? void 0 : _config$form3.otherKeysToInvalidate) !== null && _config$form$otherKey3 !== void 0 ? _config$form$otherKey3 : []))
294
307
  });
295
308
  };
296
309
 
@@ -309,7 +322,10 @@ var usersApi = {
309
322
  };
310
323
 
311
324
  var useFetchUsers = function useFetchUsers() {
312
- return useQuery([QUERY_KEYS.GROUP_MEMBERS], usersApi.list);
325
+ return useQuery({
326
+ queryKey: [QUERY_KEYS.USERS],
327
+ queryFn: usersApi.list
328
+ });
313
329
  };
314
330
 
315
331
  var MAXIMUM_NAME_LENGTH = 25;
@@ -474,10 +490,10 @@ var Form = function Form(_ref) {
474
490
  isLoading = _useFetchUsers.isLoading;
475
491
  var _useCreateGroup = useCreateGroup(config),
476
492
  create = _useCreateGroup.mutate,
477
- isCreating = _useCreateGroup.isLoading;
493
+ isCreating = _useCreateGroup.isPending;
478
494
  var _useUpdateGroup = useUpdateGroup(config),
479
495
  update = _useUpdateGroup.mutate,
480
- isUpdating = _useUpdateGroup.isLoading;
496
+ isUpdating = _useUpdateGroup.isPending;
481
497
  var initialValues = isEdit ? group : mergeLeft(GROUP_FORM_INITIAL_VALUES, (_config$form$initialV = config === null || config === void 0 || (_config$form = config.form) === null || _config$form === void 0 ? void 0 : _config$form.initialValues) !== null && _config$form$initialV !== void 0 ? _config$form$initialV : {});
482
498
  var validationSchema = GROUP_FORM_VALIDATION_SCHEMA.concat(config === null || config === void 0 || (_config$form2 = config.form) === null || _config$form2 === void 0 ? void 0 : _config$form2.validationSchema);
483
499
  var getUserIds = function getUserIds(members) {
@@ -1295,7 +1311,7 @@ var List = function List(_ref) {
1295
1311
  var totalCount = groups === null || groups === void 0 ? void 0 : groups.length;
1296
1312
  var _useDeleteGroup = useDeleteGroup(config),
1297
1313
  groupDelete = _useDeleteGroup.mutate,
1298
- isDeleting = _useDeleteGroup.isLoading;
1314
+ isDeleting = _useDeleteGroup.isPending;
1299
1315
  var getGroupDetail = function getGroupDetail(id) {
1300
1316
  return findById(id, groups);
1301
1317
  };
@@ -1879,9 +1895,10 @@ var profileApi = {
1879
1895
  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; }
1880
1896
  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; }
1881
1897
  var useFetchProfile = function useFetchProfile(options) {
1882
- return useQuery([QUERY_KEYS.USER_PROFILE], profileApi.fetchUserDetails, _objectSpread$j({
1883
- staleTime: DEFAULT_STALE_TIME,
1884
- refetchOnWindowFocus: true
1898
+ return useQuery(_objectSpread$j({
1899
+ queryKey: [QUERY_KEYS.USER_PROFILE],
1900
+ queryFn: profileApi.fetchUserDetails,
1901
+ staleTime: DEFAULT_STALE_TIME
1885
1902
  }, options));
1886
1903
  };
1887
1904
  var useUpdateProfileMutation = function useUpdateProfileMutation(options) {
@@ -1914,7 +1931,9 @@ var VALIDATION_ERRORS = {
1914
1931
  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; }
1915
1932
  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; }
1916
1933
  var useFetchCountries = function useFetchCountries(options) {
1917
- return useQuery([QUERY_KEYS.COUNTRIES_LIST], profileApi.fetchCountries, _objectSpread$i({
1934
+ return useQuery(_objectSpread$i({
1935
+ queryKey: [QUERY_KEYS.COUNTRIES_LIST],
1936
+ queryFn: profileApi.fetchCountries,
1918
1937
  staleTime: DEFAULT_STALE_TIME
1919
1938
  }, options));
1920
1939
  };
@@ -2168,7 +2187,7 @@ var ChangeProfile = function ChangeProfile(_ref) {
2168
2187
  handleTimeZoneChange = _useCountries$handleT === void 0 ? noop : _useCountries$handleT;
2169
2188
  var _useUpdateProfileMuta = useUpdateProfileMutation(),
2170
2189
  updateProfile = _useUpdateProfileMuta.mutate,
2171
- isUpdatingProfile = _useUpdateProfileMuta.isLoading;
2190
+ isUpdatingProfile = _useUpdateProfileMuta.isPending;
2172
2191
  var initialFormValues = {
2173
2192
  firstName: firstName,
2174
2193
  lastName: lastName,
@@ -3811,12 +3830,9 @@ function ownKeys$g(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymb
3811
3830
  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; }
3812
3831
  var withReactQuery = function withReactQuery(Component) {
3813
3832
  var QueryWrapper = function QueryWrapper(props) {
3814
- return /*#__PURE__*/jsxs(QueryClientProvider, {
3833
+ return /*#__PURE__*/jsx(QueryClientProvider, {
3815
3834
  client: queryClient,
3816
- children: [/*#__PURE__*/jsx(Component, _objectSpread$g({}, props)), /*#__PURE__*/jsx(ReactQueryDevtools, {
3817
- initialIsOpen: false,
3818
- position: "bottom-right"
3819
- })]
3835
+ children: /*#__PURE__*/jsx(Component, _objectSpread$g({}, props))
3820
3836
  });
3821
3837
  };
3822
3838
  return QueryWrapper;
@@ -3833,7 +3849,9 @@ function ownKeys$f(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymb
3833
3849
  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; }
3834
3850
  var useFetchPermissions = function useFetchPermissions() {
3835
3851
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
3836
- return useQuery(QUERY_KEYS.PERMISSIONS, permissionsApi.fetch, _objectSpread$f({
3852
+ return useQuery(_objectSpread$f({
3853
+ queryKey: [QUERY_KEYS.PERMISSIONS],
3854
+ queryFn: permissionsApi.fetch,
3837
3855
  select: function select(response) {
3838
3856
  return response === null || response === void 0 ? void 0 : response.permissions;
3839
3857
  }
@@ -3909,7 +3927,9 @@ function ownKeys$e(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymb
3909
3927
  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; }
3910
3928
  var useFetchRoles = function useFetchRoles() {
3911
3929
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
3912
- return useQuery(QUERY_KEYS.ROLES, organizationRolesApi.fetch, _objectSpread$e({
3930
+ return useQuery(_objectSpread$e({
3931
+ queryKey: [QUERY_KEYS.ROLES],
3932
+ queryFn: organizationRolesApi.fetch,
3913
3933
  select: function select(response) {
3914
3934
  return response === null || response === void 0 ? void 0 : response.organizationRoles;
3915
3935
  }
@@ -3917,15 +3937,17 @@ var useFetchRoles = function useFetchRoles() {
3917
3937
  };
3918
3938
  var useFetchGlobalRoles = function useFetchGlobalRoles() {
3919
3939
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
3920
- return useQuery(QUERY_KEYS.GLOBAL_ROLES, globalRolesApi.fetch, _objectSpread$e({}, options));
3940
+ return useQuery(_objectSpread$e({
3941
+ queryKey: [QUERY_KEYS.GLOBAL_ROLES],
3942
+ queryFn: globalRolesApi.fetch
3943
+ }, options));
3921
3944
  };
3922
3945
  var useCreateRole = function useCreateRole(_ref) {
3923
3946
  var _onSuccess = _ref.onSuccess,
3924
3947
  options = _objectWithoutProperties(_ref, _excluded$3);
3925
- return useMutation(organizationRolesApi.create, _objectSpread$e({
3948
+ return useMutationWithInvalidation(organizationRolesApi.create, _objectSpread$e({
3949
+ keysToInvalidate: [[QUERY_KEYS.TEAMS_DEPENDENCIES], [QUERY_KEYS.ROLES]],
3926
3950
  onSuccess: function onSuccess() {
3927
- queryClient.invalidateQueries(QUERY_KEYS.TEAMS_DEPENDENCIES);
3928
- queryClient.invalidateQueries(QUERY_KEYS.ROLES);
3929
3951
  _onSuccess === null || _onSuccess === void 0 || _onSuccess();
3930
3952
  }
3931
3953
  }, options));
@@ -3933,15 +3955,13 @@ var useCreateRole = function useCreateRole(_ref) {
3933
3955
  var useUpdateRole = function useUpdateRole(_ref2) {
3934
3956
  var _onSuccess2 = _ref2.onSuccess,
3935
3957
  options = _objectWithoutProperties(_ref2, _excluded2$2);
3936
- return useMutation(function (_ref3) {
3958
+ return useMutationWithInvalidation(function (_ref3) {
3937
3959
  var id = _ref3.id,
3938
3960
  payload = _ref3.payload;
3939
3961
  return organizationRolesApi.update(id, payload);
3940
3962
  }, _objectSpread$e({
3963
+ keysToInvalidate: [[QUERY_KEYS.TEAMS], [QUERY_KEYS.TEAMS_DEPENDENCIES], [QUERY_KEYS.ROLES]],
3941
3964
  onSuccess: function onSuccess() {
3942
- queryClient.invalidateQueries(QUERY_KEYS.TEAMS);
3943
- queryClient.invalidateQueries(QUERY_KEYS.TEAMS_DEPENDENCIES);
3944
- queryClient.invalidateQueries(QUERY_KEYS.ROLES);
3945
3965
  _onSuccess2 === null || _onSuccess2 === void 0 || _onSuccess2();
3946
3966
  }
3947
3967
  }, options));
@@ -3950,15 +3970,13 @@ var useDestroyRole = function useDestroyRole(_ref4) {
3950
3970
  var _ref4$onSuccess = _ref4.onSuccess,
3951
3971
  _onSuccess3 = _ref4$onSuccess === void 0 ? noop : _ref4$onSuccess,
3952
3972
  options = _objectWithoutProperties(_ref4, _excluded3);
3953
- return useMutation(function (_ref5) {
3973
+ return useMutationWithInvalidation(function (_ref5) {
3954
3974
  var id = _ref5.id,
3955
3975
  payload = _ref5.payload;
3956
3976
  return organizationRolesApi.destroy(id, payload);
3957
3977
  }, _objectSpread$e({
3978
+ keysToInvalidate: [[QUERY_KEYS.TEAMS], [QUERY_KEYS.TEAMS_DEPENDENCIES], [QUERY_KEYS.ROLES]],
3958
3979
  onSuccess: function onSuccess() {
3959
- queryClient.invalidateQueries(QUERY_KEYS.TEAMS);
3960
- queryClient.invalidateQueries(QUERY_KEYS.TEAMS_DEPENDENCIES);
3961
- queryClient.invalidateQueries(QUERY_KEYS.ROLES);
3962
3980
  _onSuccess3 === null || _onSuccess3 === void 0 || _onSuccess3();
3963
3981
  }
3964
3982
  }, options));
@@ -3966,11 +3984,9 @@ var useDestroyRole = function useDestroyRole(_ref4) {
3966
3984
  var useBulkUpdateRoles = function useBulkUpdateRoles(_ref6) {
3967
3985
  var _onSuccess4 = _ref6.onSuccess,
3968
3986
  options = _objectWithoutProperties(_ref6, _excluded4);
3969
- return useMutation(organizationRolesApi.bulkUpdate, _objectSpread$e({
3987
+ return useMutationWithInvalidation(organizationRolesApi.bulkUpdate, _objectSpread$e({
3988
+ keysToInvalidate: [[QUERY_KEYS.TEAMS], [QUERY_KEYS.TEAMS_DEPENDENCIES], [QUERY_KEYS.ROLES]],
3970
3989
  onSuccess: function onSuccess() {
3971
- queryClient.invalidateQueries(QUERY_KEYS.TEAMS);
3972
- queryClient.invalidateQueries(QUERY_KEYS.TEAMS_DEPENDENCIES);
3973
- queryClient.invalidateQueries(QUERY_KEYS.ROLES);
3974
3990
  _onSuccess4 === null || _onSuccess4 === void 0 || _onSuccess4();
3975
3991
  }
3976
3992
  }, options));
@@ -4015,7 +4031,8 @@ var Header$3 = function Header(_ref) {
4015
4031
  var config = _ref.config,
4016
4032
  handleReset = _ref.handleReset,
4017
4033
  handleSubmit = _ref.handleSubmit,
4018
- isDirty = _ref.isDirty,
4034
+ _ref$isDirty = _ref.isDirty,
4035
+ isDirty = _ref$isDirty === void 0 ? false : _ref$isDirty,
4019
4036
  setIsNewRolePaneOpen = _ref.setIsNewRolePaneOpen,
4020
4037
  roles = _ref.roles;
4021
4038
  var _useTranslation = useTranslation(),
@@ -4363,12 +4380,12 @@ var ManageRoles = function ManageRoles(_ref) {
4363
4380
  onSuccess: onClose
4364
4381
  }),
4365
4382
  createRole = _useCreateRole.mutate,
4366
- isCreatingRole = _useCreateRole.isLoading;
4383
+ isCreatingRole = _useCreateRole.isPending;
4367
4384
  var _useUpdateRole = useUpdateRole({
4368
4385
  onSuccess: onClose
4369
4386
  }),
4370
4387
  updateRole = _useUpdateRole.mutate,
4371
- isUpdatingRole = _useUpdateRole.isLoading;
4388
+ isUpdatingRole = _useUpdateRole.isPending;
4372
4389
  var isEdit = isPresent(selectedRole);
4373
4390
  var isSubmitting = isCreatingRole || isUpdatingRole;
4374
4391
  var handleSubmit = function handleSubmit(formValues) {
@@ -4724,7 +4741,7 @@ var Delete = function Delete(_ref) {
4724
4741
  onSuccess: onClose
4725
4742
  }),
4726
4743
  deleteRole = _useDestroyRole.mutate,
4727
- isDeleting = _useDestroyRole.isLoading;
4744
+ isDeleting = _useDestroyRole.isPending;
4728
4745
  var handleDelete = function handleDelete() {
4729
4746
  var _roles$find;
4730
4747
  var id = selectedRole.id;
@@ -4739,8 +4756,9 @@ var Delete = function Delete(_ref) {
4739
4756
  });
4740
4757
  };
4741
4758
  return /*#__PURE__*/jsx(Alert, {
4742
- cancelButtonLabel: t("neetoTeamMembers.buttons.cancel"),
4743
4759
  isOpen: isOpen,
4760
+ onClose: onClose,
4761
+ cancelButtonLabel: t("neetoTeamMembers.buttons.cancel"),
4744
4762
  isSubmitting: isDeleting,
4745
4763
  submitButtonLabel: t("neetoTeamMembers.buttons.delete"),
4746
4764
  title: t("neetoTeamMembers.labels.deleteRole"),
@@ -4750,7 +4768,6 @@ var Delete = function Delete(_ref) {
4750
4768
  name: selectedRole === null || selectedRole === void 0 ? void 0 : selectedRole.name
4751
4769
  }
4752
4770
  }),
4753
- onClose: onClose,
4754
4771
  onSubmit: handleDelete
4755
4772
  });
4756
4773
  };
@@ -5051,12 +5068,12 @@ var Roles = function Roles(_ref) {
5051
5068
  isNewRolePaneOpen = _useState4[0],
5052
5069
  setIsNewRolePaneOpen = _useState4[1];
5053
5070
  var _useFetchRoles = useFetchRoles({
5054
- onSuccess: setModifiedRoles,
5055
5071
  enabled: isViewPermissionGranted
5056
5072
  }),
5057
5073
  _useFetchRoles$data = _useFetchRoles.data,
5058
5074
  roles = _useFetchRoles$data === void 0 ? [] : _useFetchRoles$data,
5059
- isRolesLoading = _useFetchRoles.isLoading;
5075
+ isRolesLoading = _useFetchRoles.isLoading,
5076
+ status = _useFetchRoles.status;
5060
5077
  var _useQueryParams = useQueryParams(),
5061
5078
  _useQueryParams$searc = _useQueryParams.searchTerm,
5062
5079
  searchTerm = _useQueryParams$searc === void 0 ? "" : _useQueryParams$searc;
@@ -5069,7 +5086,6 @@ var Roles = function Roles(_ref) {
5069
5086
  enabled: isUpdatePermissionGranted
5070
5087
  }),
5071
5088
  bulkUpdate = _useBulkUpdateRoles.mutate;
5072
- var isDirty = isPresent(getModifiedPermissions(roles, modifiedRoles));
5073
5089
  var permissions = sortPermissionsBySequence(permissionData);
5074
5090
  var permissionGroups = getPermissionGroups(permissions);
5075
5091
  var filteredRoles = filter$1(function (_ref2) {
@@ -5087,6 +5103,10 @@ var Roles = function Roles(_ref) {
5087
5103
  var handleReset = function handleReset() {
5088
5104
  return setModifiedRoles(roles);
5089
5105
  };
5106
+ useEffect(function () {
5107
+ if (status !== "success") return;
5108
+ setModifiedRoles(roles);
5109
+ }, [roles, status]);
5090
5110
  if (isRolesLoading || isPermissionsLoading) {
5091
5111
  return /*#__PURE__*/jsx("div", {
5092
5112
  className: "ntm-members-page-loader",
@@ -5101,7 +5121,6 @@ var Roles = function Roles(_ref) {
5101
5121
  config: config,
5102
5122
  handleReset: handleReset,
5103
5123
  handleSubmit: handleSubmit,
5104
- isDirty: isDirty,
5105
5124
  roles: roles,
5106
5125
  setIsNewRolePaneOpen: setIsNewRolePaneOpen
5107
5126
  }), /*#__PURE__*/jsx(Table, {
@@ -7222,27 +7241,33 @@ function _objectSpread$a(e) { for (var r = 1; r < arguments.length; r++) { var t
7222
7241
  var useFetchMembers = function useFetchMembers() {
7223
7242
  var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7224
7243
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
7225
- return useQuery([QUERY_KEYS.TEAMS, params], function () {
7226
- return teamsApi.fetch(params);
7227
- }, _objectSpread$a(_objectSpread$a({
7244
+ return useQuery(_objectSpread$a(_objectSpread$a({
7245
+ queryKey: [QUERY_KEYS.TEAMS, params],
7246
+ queryFn: function queryFn() {
7247
+ return teamsApi.fetch(params);
7248
+ },
7228
7249
  select: identity,
7229
- keepPreviousData: true
7250
+ placeholderData: keepPreviousData
7230
7251
  }, options), {}, {
7231
7252
  refetchOnWindowFocus: false
7232
7253
  }));
7233
7254
  };
7234
7255
  var useFetchMembersCountsPerCategory = function useFetchMembersCountsPerCategory() {
7235
7256
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7236
- return useQuery([QUERY_KEYS.TEAMS], teamsApi.fetchCountsPerCategory, _objectSpread$a(_objectSpread$a({
7257
+ return useQuery(_objectSpread$a(_objectSpread$a({
7258
+ queryKey: [QUERY_KEYS.TEAMS],
7259
+ queryFn: teamsApi.fetchCountsPerCategory,
7237
7260
  select: identity,
7238
- keepPreviousData: true
7261
+ placeholderData: keepPreviousData
7239
7262
  }, options), {}, {
7240
7263
  refetchOnWindowFocus: false
7241
7264
  }));
7242
7265
  };
7243
7266
  var useCreateMember = function useCreateMember() {
7244
7267
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7245
- return useMutation(teamsApi.create, options);
7268
+ return useMutation(_objectSpread$a({
7269
+ mutationFn: teamsApi.create
7270
+ }, options));
7246
7271
  };
7247
7272
  var useUpdateMember = function useUpdateMember(_ref) {
7248
7273
  var _onSuccess = _ref.onSuccess,
@@ -7252,7 +7277,7 @@ var useUpdateMember = function useUpdateMember(_ref) {
7252
7277
  payload = _ref2.payload;
7253
7278
  return teamsApi.update(id, payload);
7254
7279
  }, _objectSpread$a({
7255
- keysToInvalidate: [QUERY_KEYS.TEAMS, QUERY_KEYS.TEAMS_DEPENDENCIES],
7280
+ keysToInvalidate: [[QUERY_KEYS.TEAMS], [QUERY_KEYS.TEAMS_DEPENDENCIES]],
7256
7281
  onSuccess: function onSuccess() {
7257
7282
  _onSuccess === null || _onSuccess === void 0 || _onSuccess();
7258
7283
  }
@@ -7262,33 +7287,42 @@ var useBulkUpdateMembers = function useBulkUpdateMembers(_ref3) {
7262
7287
  var _onSuccess2 = _ref3.onSuccess,
7263
7288
  options = _objectWithoutProperties(_ref3, _excluded2$1);
7264
7289
  return useMutationWithInvalidation(teamsApi.bulkUpdate, _objectSpread$a({
7265
- keysToInvalidate: [QUERY_KEYS.TEAMS, QUERY_KEYS.TEAMS_DEPENDENCIES],
7290
+ keysToInvalidate: [[QUERY_KEYS.TEAMS], [QUERY_KEYS.TEAMS_DEPENDENCIES]],
7266
7291
  onSuccess: function onSuccess() {
7267
7292
  _onSuccess2 === null || _onSuccess2 === void 0 || _onSuccess2();
7268
7293
  }
7269
7294
  }, options));
7270
7295
  };
7271
7296
  var refetchMembers = function refetchMembers() {
7272
- queryClient.invalidateQueries(QUERY_KEYS.TEAMS);
7273
- queryClient.invalidateQueries(QUERY_KEYS.TEAMS_DEPENDENCIES);
7297
+ queryClient.invalidateQueries({
7298
+ queryKey: [QUERY_KEYS.TEAMS]
7299
+ });
7300
+ queryClient.invalidateQueries({
7301
+ queryKey: [QUERY_KEYS.TEAMS_DEPENDENCIES]
7302
+ });
7274
7303
  };
7275
7304
  var useFetchFilterOptions = function useFetchFilterOptions(_ref4) {
7276
7305
  var _ref4$params = _ref4.params,
7277
7306
  params = _ref4$params === void 0 ? {} : _ref4$params,
7278
7307
  _ref4$options = _ref4.options,
7279
7308
  options = _ref4$options === void 0 ? {} : _ref4$options;
7280
- return useQuery([QUERY_KEYS.TEAMS_DEPENDENCIES, params], function () {
7281
- return teamsApi.fetchFilterOptions(params);
7282
- }, _objectSpread$a(_objectSpread$a({
7309
+ return useQuery(_objectSpread$a(_objectSpread$a({
7310
+ queryKey: [QUERY_KEYS.TEAMS_DEPENDENCIES, params],
7311
+ queryFn: function queryFn() {
7312
+ return teamsApi.fetchFilterOptions(params);
7313
+ },
7283
7314
  select: identity
7284
7315
  }, options), {}, {
7285
7316
  refetchOnWindowFocus: false
7286
7317
  }));
7287
7318
  };
7288
7319
  var useMembersCreationStatus = function useMembersCreationStatus(jobId, options) {
7289
- return useQuery([QUERY_KEYS.CREATION_STATUS, jobId], function () {
7290
- return teamsApi.creationStatus(jobId);
7291
- }, options);
7320
+ return useQuery(_objectSpread$a({
7321
+ queryKey: [QUERY_KEYS.CREATION_STATUS, jobId],
7322
+ queryFn: function queryFn() {
7323
+ return teamsApi.creationStatus(jobId);
7324
+ }
7325
+ }, options));
7292
7326
  };
7293
7327
 
7294
7328
  var _getQueryParams = getQueryParams(),
@@ -8963,7 +8997,7 @@ var ManageMember = function ManageMember(_ref) {
8963
8997
  }
8964
8998
  }),
8965
8999
  updateMember = _useUpdateMember.mutate,
8966
- isUpdatingMember = _useUpdateMember.isLoading;
9000
+ isUpdatingMember = _useUpdateMember.isPending;
8967
9001
  var hasRoleChanged = function hasRoleChanged(_ref4) {
8968
9002
  var submitted = _ref4.submitted,
8969
9003
  values = _ref4.values;
@@ -9217,7 +9251,7 @@ var TeamMembers = function TeamMembers(_ref) {
9217
9251
  }
9218
9252
  }),
9219
9253
  updateMember = _useUpdateMember.mutate,
9220
- isUpdatingMember = _useUpdateMember.isLoading;
9254
+ isUpdatingMember = _useUpdateMember.isPending;
9221
9255
  var filteredRoles = getFilteredRoles(roles, config);
9222
9256
  var _useTeams = useTeams({
9223
9257
  config: config,