@bigbinary/neeto-fields-frontend 1.3.3 → 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 +42 -92
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +45 -95
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
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
|
-
|
|
6546
|
-
|
|
6547
|
-
|
|
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
|
-
|
|
6580
|
-
|
|
6581
|
-
|
|
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
|
-
|
|
6593
|
-
|
|
6594
|
-
|
|
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
|
-
|
|
6606
|
-
|
|
6607
|
-
onSuccess: function onSuccess() {
|
|
6608
|
-
queryClient.invalidateQueries(FIELDS);
|
|
6609
|
-
}
|
|
6581
|
+
return reactUtils.useMutationWithInvalidation(fieldsApi.reorder, {
|
|
6582
|
+
keysToInvalidate: [FIELDS]
|
|
6610
6583
|
});
|
|
6611
6584
|
};
|
|
6612
6585
|
|
|
@@ -7886,7 +7859,8 @@ var useFieldsDashboard = function useFieldsDashboard(_ref) {
|
|
|
7886
7859
|
inactiveFieldsCount = _useFetchFields$data2.inactiveFieldsCount,
|
|
7887
7860
|
reorderable = _useFetchFields$data2.reorderable,
|
|
7888
7861
|
isFieldsLoading = _useFetchFields.isLoading,
|
|
7889
|
-
isFieldsFetching = _useFetchFields.isFetching
|
|
7862
|
+
isFieldsFetching = _useFetchFields.isFetching,
|
|
7863
|
+
isFieldsFetched = _useFetchFields.isFetched;
|
|
7890
7864
|
var _useDestroyField = useDestroyField({
|
|
7891
7865
|
onSuccess: function onSuccess() {
|
|
7892
7866
|
setIsDeleteAlertOpen(false);
|
|
@@ -8000,7 +7974,7 @@ var useFieldsDashboard = function useFieldsDashboard(_ref) {
|
|
|
8000
7974
|
}, [menuItems, resource]);
|
|
8001
7975
|
React.useEffect(function () {
|
|
8002
7976
|
handleURLWithDefaultValues();
|
|
8003
|
-
}, [isConfigsLoading, resources]);
|
|
7977
|
+
}, [isConfigsLoading, resources, resource, state]);
|
|
8004
7978
|
React.useEffect(function () {
|
|
8005
7979
|
setPageProps({
|
|
8006
7980
|
pageIndex: constants.DEFAULT_PAGE_INDEX,
|
|
@@ -8020,11 +7994,10 @@ var useFieldsDashboard = function useFieldsDashboard(_ref) {
|
|
|
8020
7994
|
selectedMenu: resource,
|
|
8021
7995
|
// resource will be ownerId if showOwnersInMenu is true, else it will be resourceType
|
|
8022
7996
|
ownerId: ownerId,
|
|
8023
|
-
isFieldsFetching: isFieldsFetching,
|
|
8024
|
-
isFieldsLoading: isFieldsLoading,
|
|
8025
7997
|
isDeleting: isDeleting,
|
|
7998
|
+
isFieldsFetching: isFieldsFetching,
|
|
7999
|
+
isFieldsFetched: isFieldsFetched,
|
|
8026
8000
|
isScreenLoading: isScreenLoading,
|
|
8027
|
-
isConfigsLoading: isConfigsLoading,
|
|
8028
8001
|
isMenuBarNeeded: isMenuBarNeeded,
|
|
8029
8002
|
showCountSubheader: showCountSubheader,
|
|
8030
8003
|
handleDelete: handleDelete,
|
|
@@ -8080,7 +8053,8 @@ function ownKeys$3(object, enumerableOnly) { var keys = Object.keys(object); if
|
|
|
8080
8053
|
function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$3(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$3(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8081
8054
|
var FieldsTable = function FieldsTable(_ref) {
|
|
8082
8055
|
var totalCount = _ref.totalCount,
|
|
8083
|
-
|
|
8056
|
+
isFetched = _ref.isFetched,
|
|
8057
|
+
isFetching = _ref.isFetching,
|
|
8084
8058
|
rowData = _ref.rowData,
|
|
8085
8059
|
columnData = _ref.columnData,
|
|
8086
8060
|
setIsPaneOpen = _ref.setIsPaneOpen,
|
|
@@ -8090,10 +8064,13 @@ var FieldsTable = function FieldsTable(_ref) {
|
|
|
8090
8064
|
setPageProps = _ref.setPageProps;
|
|
8091
8065
|
var _useTranslation = useTranslation(),
|
|
8092
8066
|
t = _useTranslation.t;
|
|
8093
|
-
var showNoDataScreen =
|
|
8067
|
+
var showNoDataScreen = isFetched && ramda.isEmpty(rowData);
|
|
8094
8068
|
title = title.toLocaleLowerCase();
|
|
8095
8069
|
var pageIndex = pageProps.pageIndex,
|
|
8096
8070
|
pageSize = pageProps.pageSize;
|
|
8071
|
+
if (!isFetched && ramda.isEmpty(rowData)) {
|
|
8072
|
+
return /*#__PURE__*/React__default["default"].createElement(PageLoader__default["default"], null);
|
|
8073
|
+
}
|
|
8097
8074
|
return /*#__PURE__*/React__default["default"].createElement(TableWrapper__default["default"], null, showNoDataScreen ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
8098
8075
|
className: "flex h-full w-full items-center justify-center"
|
|
8099
8076
|
}, /*#__PURE__*/React__default["default"].createElement(neetoui.NoData, _extends({}, helpDocUrl && {
|
|
@@ -8116,7 +8093,7 @@ var FieldsTable = function FieldsTable(_ref) {
|
|
|
8116
8093
|
totalCount: totalCount,
|
|
8117
8094
|
currentPageNumber: pageIndex,
|
|
8118
8095
|
defaultPageSize: pageSize,
|
|
8119
|
-
loading:
|
|
8096
|
+
loading: isFetching,
|
|
8120
8097
|
handlePageChange: function handlePageChange(pageIndex) {
|
|
8121
8098
|
return setPageProps(_objectSpread$3(_objectSpread$3({}, pageProps), {}, {
|
|
8122
8099
|
pageIndex: pageIndex
|
|
@@ -8174,11 +8151,9 @@ var Header = function Header(_ref) {
|
|
|
8174
8151
|
actionBlockProps = _objectWithoutProperties(_ref, _excluded);
|
|
8175
8152
|
return /*#__PURE__*/React__default["default"].createElement(NeetoUIHeader__default["default"], {
|
|
8176
8153
|
size: "small",
|
|
8154
|
+
breadcrumbs: breadcrumbs,
|
|
8177
8155
|
searchProps: searchProps,
|
|
8178
8156
|
actionBlock: /*#__PURE__*/React__default["default"].createElement(ActionBlock, actionBlockProps),
|
|
8179
|
-
breadcrumbs: [].concat(_toConsumableArray(breadcrumbs), [{
|
|
8180
|
-
text: pure.truncate(title, 50)
|
|
8181
|
-
}]),
|
|
8182
8157
|
title: /*#__PURE__*/React__default["default"].createElement(TitleWithHelpLink, {
|
|
8183
8158
|
helpUrl: helpDocUrl,
|
|
8184
8159
|
title: title
|
|
@@ -8187,15 +8162,12 @@ var Header = function Header(_ref) {
|
|
|
8187
8162
|
};
|
|
8188
8163
|
|
|
8189
8164
|
var Menubar = function Menubar(_ref) {
|
|
8190
|
-
var
|
|
8191
|
-
menuBarItems = _ref.menuBarItems,
|
|
8165
|
+
var menuBarItems = _ref.menuBarItems,
|
|
8192
8166
|
title = _ref.title;
|
|
8193
8167
|
return /*#__PURE__*/React__default["default"].createElement(MenuBar__default["default"], {
|
|
8194
8168
|
showMenu: true,
|
|
8195
8169
|
title: title
|
|
8196
|
-
},
|
|
8197
|
-
className: "flex items-center justify-center"
|
|
8198
|
-
}, /*#__PURE__*/React__default["default"].createElement(neetoui.Spinner, null)) : menuBarItems);
|
|
8170
|
+
}, menuBarItems);
|
|
8199
8171
|
};
|
|
8200
8172
|
|
|
8201
8173
|
function useCombinedRefs() {
|
|
@@ -12638,10 +12610,9 @@ var FieldsDashboard = function FieldsDashboard(_ref) {
|
|
|
12638
12610
|
selectedMenu = _useFieldsDashboard.selectedMenu,
|
|
12639
12611
|
ownerId = _useFieldsDashboard.ownerId,
|
|
12640
12612
|
isFieldsFetching = _useFieldsDashboard.isFieldsFetching,
|
|
12641
|
-
|
|
12613
|
+
isFieldsFetched = _useFieldsDashboard.isFieldsFetched,
|
|
12642
12614
|
isDeleting = _useFieldsDashboard.isDeleting,
|
|
12643
12615
|
isScreenLoading = _useFieldsDashboard.isScreenLoading,
|
|
12644
|
-
isConfigsLoading = _useFieldsDashboard.isConfigsLoading,
|
|
12645
12616
|
isMenuBarNeeded = _useFieldsDashboard.isMenuBarNeeded,
|
|
12646
12617
|
showCountSubheader = _useFieldsDashboard.showCountSubheader,
|
|
12647
12618
|
handleDelete = _useFieldsDashboard.handleDelete,
|
|
@@ -12665,15 +12636,15 @@ var FieldsDashboard = function FieldsDashboard(_ref) {
|
|
|
12665
12636
|
title: headerDisplayTitle
|
|
12666
12637
|
};
|
|
12667
12638
|
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, isMenuBarNeeded && /*#__PURE__*/React__default["default"].createElement(Menubar, {
|
|
12668
|
-
isConfigsLoading: isConfigsLoading,
|
|
12669
12639
|
menuBarItems: menuBarItems,
|
|
12670
12640
|
title: title
|
|
12671
|
-
}),
|
|
12672
|
-
className: "flex h-screen w-full flex-grow items-center justify-center"
|
|
12673
|
-
}, /*#__PURE__*/React__default["default"].createElement(PageLoader__default["default"], null)) : /*#__PURE__*/React__default["default"].createElement(Container__default["default"], null, /*#__PURE__*/React__default["default"].createElement(Header, headerProps), showStateFilter && stateFilterTabs, showCountSubheader && /*#__PURE__*/React__default["default"].createElement(Subheader, {
|
|
12641
|
+
}), /*#__PURE__*/React__default["default"].createElement(Container__default["default"], null, /*#__PURE__*/React__default["default"].createElement(Header, headerProps), showStateFilter && stateFilterTabs, showCountSubheader && /*#__PURE__*/React__default["default"].createElement(Subheader, {
|
|
12674
12642
|
count: count
|
|
12675
|
-
}), /*#__PURE__*/React__default["default"].createElement(
|
|
12676
|
-
|
|
12643
|
+
}), isScreenLoading ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
12644
|
+
className: "flex h-screen w-full flex-grow items-center justify-center"
|
|
12645
|
+
}, /*#__PURE__*/React__default["default"].createElement(PageLoader__default["default"], null)) : /*#__PURE__*/React__default["default"].createElement(FieldsTable, {
|
|
12646
|
+
isFetched: isFieldsFetched,
|
|
12647
|
+
isFetching: isFieldsFetching,
|
|
12677
12648
|
rowData: ramda.isEmpty(rowData) ? fields : rowData,
|
|
12678
12649
|
totalCount: count,
|
|
12679
12650
|
columnData: columnData,
|
|
@@ -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
|
-
|
|
12745
|
-
|
|
12746
|
-
|
|
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
|
-
|
|
12757
|
-
|
|
12758
|
-
|
|
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
|
-
|
|
12769
|
-
|
|
12770
|
-
|
|
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 = ({
|