@bigbinary/neeto-fields-frontend 1.3.4 → 1.3.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/dist/index.cjs.js CHANGED
@@ -6542,17 +6542,9 @@ var useFetchFields = function useFetchFields(_ref, options) {
6542
6542
  }, options));
6543
6543
  };
6544
6544
  var useCreateField = function useCreateField(options) {
6545
- var queryClient = reactQuery.useQueryClient();
6546
- return reactQuery.useMutation(fieldsApi.create, _objectSpread$9(_objectSpread$9({}, options), {}, {
6547
- onSuccess: function onSuccess() {
6548
- var _options$onSuccess;
6549
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
6550
- args[_key] = arguments[_key];
6551
- }
6552
- options === null || options === void 0 ? void 0 : (_options$onSuccess = options.onSuccess) === null || _options$onSuccess === void 0 ? void 0 : _options$onSuccess.call.apply(_options$onSuccess, [options].concat(args));
6553
- queryClient.invalidateQueries(FIELDS);
6554
- }
6555
- }));
6545
+ return reactUtils.useMutationWithInvalidation(fieldsApi.create, _objectSpread$9({
6546
+ keysToInvalidate: [FIELDS]
6547
+ }, options));
6556
6548
  };
6557
6549
  var useShowField = function useShowField(_ref2, options) {
6558
6550
  var fieldId = _ref2.fieldId,
@@ -6576,37 +6568,18 @@ var useFetchDependencies = function useFetchDependencies(_ref3, options) {
6576
6568
  }, options);
6577
6569
  };
6578
6570
  var useUpdateField = function useUpdateField(options) {
6579
- var queryClient = reactQuery.useQueryClient();
6580
- return reactQuery.useMutation(fieldsApi.update, _objectSpread$9(_objectSpread$9({}, options), {}, {
6581
- onSuccess: function onSuccess() {
6582
- var _options$onSuccess2;
6583
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
6584
- args[_key2] = arguments[_key2];
6585
- }
6586
- options === null || options === void 0 ? void 0 : (_options$onSuccess2 = options.onSuccess) === null || _options$onSuccess2 === void 0 ? void 0 : _options$onSuccess2.call.apply(_options$onSuccess2, [options].concat(args));
6587
- queryClient.invalidateQueries(FIELDS);
6588
- }
6589
- }));
6571
+ return reactUtils.useMutationWithInvalidation(fieldsApi.update, _objectSpread$9({
6572
+ keysToInvalidate: [FIELDS]
6573
+ }, options));
6590
6574
  };
6591
6575
  var useDestroyField = function useDestroyField(options) {
6592
- var queryClient = reactQuery.useQueryClient();
6593
- return reactQuery.useMutation(fieldsApi.destroy, _objectSpread$9(_objectSpread$9({}, options), {}, {
6594
- onSuccess: function onSuccess() {
6595
- var _options$onSuccess3;
6596
- for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
6597
- args[_key3] = arguments[_key3];
6598
- }
6599
- options === null || options === void 0 ? void 0 : (_options$onSuccess3 = options.onSuccess) === null || _options$onSuccess3 === void 0 ? void 0 : _options$onSuccess3.call.apply(_options$onSuccess3, [options].concat(args));
6600
- queryClient.invalidateQueries(FIELDS);
6601
- }
6602
- }));
6576
+ return reactUtils.useMutationWithInvalidation(fieldsApi.destroy, _objectSpread$9({
6577
+ keysToInvalidate: [FIELDS]
6578
+ }, options));
6603
6579
  };
6604
6580
  var useReorderFields = function useReorderFields() {
6605
- var queryClient = reactQuery.useQueryClient();
6606
- return reactQuery.useMutation(fieldsApi.reorder, {
6607
- onSuccess: function onSuccess() {
6608
- queryClient.invalidateQueries(FIELDS);
6609
- }
6581
+ return reactUtils.useMutationWithInvalidation(fieldsApi.reorder, {
6582
+ keysToInvalidate: [FIELDS]
6610
6583
  });
6611
6584
  };
6612
6585
 
@@ -8001,7 +7974,7 @@ var useFieldsDashboard = function useFieldsDashboard(_ref) {
8001
7974
  }, [menuItems, resource]);
8002
7975
  React.useEffect(function () {
8003
7976
  handleURLWithDefaultValues();
8004
- }, [isConfigsLoading, resources]);
7977
+ }, [isConfigsLoading, resources, resource, state]);
8005
7978
  React.useEffect(function () {
8006
7979
  setPageProps({
8007
7980
  pageIndex: constants.DEFAULT_PAGE_INDEX,
@@ -8178,11 +8151,9 @@ var Header = function Header(_ref) {
8178
8151
  actionBlockProps = _objectWithoutProperties(_ref, _excluded);
8179
8152
  return /*#__PURE__*/React__default["default"].createElement(NeetoUIHeader__default["default"], {
8180
8153
  size: "small",
8154
+ breadcrumbs: breadcrumbs,
8181
8155
  searchProps: searchProps,
8182
8156
  actionBlock: /*#__PURE__*/React__default["default"].createElement(ActionBlock, actionBlockProps),
8183
- breadcrumbs: [].concat(_toConsumableArray(breadcrumbs), [{
8184
- text: pure.truncate(title, 50)
8185
- }]),
8186
8157
  title: /*#__PURE__*/React__default["default"].createElement(TitleWithHelpLink, {
8187
8158
  helpUrl: helpDocUrl,
8188
8159
  title: title
@@ -12741,40 +12712,19 @@ var fieldValuesApi = {
12741
12712
  function ownKeys$2(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
12742
12713
  function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$2(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$2(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
12743
12714
  var useCreateFieldValue = function useCreateFieldValue(options) {
12744
- var queryClient = reactQuery.useQueryClient();
12745
- return reactQuery.useMutation(fieldValuesApi.create, _objectSpread$2(_objectSpread$2({}, options), {}, {
12746
- onSuccess: function onSuccess() {
12747
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
12748
- args[_key] = arguments[_key];
12749
- }
12750
- options === null || options === void 0 ? void 0 : options.onSuccess.apply(options, args);
12751
- queryClient.invalidateQueries([QUERY_KEYS.FIELD_VALUES]);
12752
- }
12753
- }));
12715
+ return reactUtils.useMutationWithInvalidation(fieldValuesApi.create, _objectSpread$2({
12716
+ keysToInvalidate: [[QUERY_KEYS.FIELD_VALUES]]
12717
+ }, options));
12754
12718
  };
12755
12719
  var useUpdateFieldValue = function useUpdateFieldValue(options) {
12756
- var queryClient = reactQuery.useQueryClient();
12757
- return reactQuery.useMutation(fieldValuesApi.update, _objectSpread$2(_objectSpread$2({}, options), {}, {
12758
- onSuccess: function onSuccess() {
12759
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
12760
- args[_key2] = arguments[_key2];
12761
- }
12762
- options === null || options === void 0 ? void 0 : options.onSuccess.apply(options, args);
12763
- queryClient.invalidateQueries([QUERY_KEYS.FIELD_VALUES]);
12764
- }
12765
- }));
12720
+ return reactUtils.useMutationWithInvalidation(fieldValuesApi.update, _objectSpread$2({
12721
+ keysToInvalidate: [[QUERY_KEYS.FIELD_VALUES]]
12722
+ }, options));
12766
12723
  };
12767
12724
  var useDeleteFieldValue = function useDeleteFieldValue(options) {
12768
- var queryClient = reactQuery.useQueryClient();
12769
- return reactQuery.useMutation(fieldValuesApi.destroy, _objectSpread$2(_objectSpread$2({}, options), {}, {
12770
- onSuccess: function onSuccess() {
12771
- for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
12772
- args[_key3] = arguments[_key3];
12773
- }
12774
- options === null || options === void 0 ? void 0 : options.onSuccess.apply(options, args);
12775
- queryClient.invalidateQueries([QUERY_KEYS.FIELD_VALUES]);
12776
- }
12777
- }));
12725
+ return reactUtils.useMutationWithInvalidation(fieldValuesApi.destroy, _objectSpread$2({
12726
+ keysToInvalidate: [[QUERY_KEYS.FIELD_VALUES]]
12727
+ }, options));
12778
12728
  };
12779
12729
 
12780
12730
  const useNavPrompt = ({