@bigbinary/neeto-fields-frontend 1.3.3 → 1.3.4

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
@@ -7851,7 +7851,8 @@ var useFieldsDashboard = function useFieldsDashboard(_ref) {
7851
7851
  inactiveFieldsCount = _useFetchFields$data2.inactiveFieldsCount,
7852
7852
  reorderable = _useFetchFields$data2.reorderable,
7853
7853
  isFieldsLoading = _useFetchFields.isLoading,
7854
- isFieldsFetching = _useFetchFields.isFetching;
7854
+ isFieldsFetching = _useFetchFields.isFetching,
7855
+ isFieldsFetched = _useFetchFields.isFetched;
7855
7856
  var _useDestroyField = useDestroyField({
7856
7857
  onSuccess: function onSuccess() {
7857
7858
  setIsDeleteAlertOpen(false);
@@ -7985,11 +7986,10 @@ var useFieldsDashboard = function useFieldsDashboard(_ref) {
7985
7986
  selectedMenu: resource,
7986
7987
  // resource will be ownerId if showOwnersInMenu is true, else it will be resourceType
7987
7988
  ownerId: ownerId,
7988
- isFieldsFetching: isFieldsFetching,
7989
- isFieldsLoading: isFieldsLoading,
7990
7989
  isDeleting: isDeleting,
7990
+ isFieldsFetching: isFieldsFetching,
7991
+ isFieldsFetched: isFieldsFetched,
7991
7992
  isScreenLoading: isScreenLoading,
7992
- isConfigsLoading: isConfigsLoading,
7993
7993
  isMenuBarNeeded: isMenuBarNeeded,
7994
7994
  showCountSubheader: showCountSubheader,
7995
7995
  handleDelete: handleDelete,
@@ -8045,7 +8045,8 @@ function ownKeys$3(object, enumerableOnly) { var keys = Object.keys(object); if
8045
8045
  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; }
8046
8046
  var FieldsTable = function FieldsTable(_ref) {
8047
8047
  var totalCount = _ref.totalCount,
8048
- isLoading = _ref.isLoading,
8048
+ isFetched = _ref.isFetched,
8049
+ isFetching = _ref.isFetching,
8049
8050
  rowData = _ref.rowData,
8050
8051
  columnData = _ref.columnData,
8051
8052
  setIsPaneOpen = _ref.setIsPaneOpen,
@@ -8055,10 +8056,13 @@ var FieldsTable = function FieldsTable(_ref) {
8055
8056
  setPageProps = _ref.setPageProps;
8056
8057
  var _useTranslation = useTranslation(),
8057
8058
  t = _useTranslation.t;
8058
- var showNoDataScreen = !isLoading && isEmpty(rowData);
8059
+ var showNoDataScreen = isFetched && isEmpty(rowData);
8059
8060
  title = title.toLocaleLowerCase();
8060
8061
  var pageIndex = pageProps.pageIndex,
8061
8062
  pageSize = pageProps.pageSize;
8063
+ if (!isFetched && isEmpty(rowData)) {
8064
+ return /*#__PURE__*/React.createElement(PageLoader, null);
8065
+ }
8062
8066
  return /*#__PURE__*/React.createElement(TableWrapper, null, showNoDataScreen ? /*#__PURE__*/React.createElement("div", {
8063
8067
  className: "flex h-full w-full items-center justify-center"
8064
8068
  }, /*#__PURE__*/React.createElement(NoData, _extends({}, helpDocUrl && {
@@ -8081,7 +8085,7 @@ var FieldsTable = function FieldsTable(_ref) {
8081
8085
  totalCount: totalCount,
8082
8086
  currentPageNumber: pageIndex,
8083
8087
  defaultPageSize: pageSize,
8084
- loading: isLoading,
8088
+ loading: isFetching,
8085
8089
  handlePageChange: function handlePageChange(pageIndex) {
8086
8090
  return setPageProps(_objectSpread$3(_objectSpread$3({}, pageProps), {}, {
8087
8091
  pageIndex: pageIndex
@@ -8152,15 +8156,12 @@ var Header = function Header(_ref) {
8152
8156
  };
8153
8157
 
8154
8158
  var Menubar = function Menubar(_ref) {
8155
- var isConfigsLoading = _ref.isConfigsLoading,
8156
- menuBarItems = _ref.menuBarItems,
8159
+ var menuBarItems = _ref.menuBarItems,
8157
8160
  title = _ref.title;
8158
8161
  return /*#__PURE__*/React.createElement(MenuBar, {
8159
8162
  showMenu: true,
8160
8163
  title: title
8161
- }, isConfigsLoading ? /*#__PURE__*/React.createElement("div", {
8162
- className: "flex items-center justify-center"
8163
- }, /*#__PURE__*/React.createElement(Spinner, null)) : menuBarItems);
8164
+ }, menuBarItems);
8164
8165
  };
8165
8166
 
8166
8167
  function useCombinedRefs() {
@@ -12603,10 +12604,9 @@ var FieldsDashboard = function FieldsDashboard(_ref) {
12603
12604
  selectedMenu = _useFieldsDashboard.selectedMenu,
12604
12605
  ownerId = _useFieldsDashboard.ownerId,
12605
12606
  isFieldsFetching = _useFieldsDashboard.isFieldsFetching,
12606
- isFieldsLoading = _useFieldsDashboard.isFieldsLoading,
12607
+ isFieldsFetched = _useFieldsDashboard.isFieldsFetched,
12607
12608
  isDeleting = _useFieldsDashboard.isDeleting,
12608
12609
  isScreenLoading = _useFieldsDashboard.isScreenLoading,
12609
- isConfigsLoading = _useFieldsDashboard.isConfigsLoading,
12610
12610
  isMenuBarNeeded = _useFieldsDashboard.isMenuBarNeeded,
12611
12611
  showCountSubheader = _useFieldsDashboard.showCountSubheader,
12612
12612
  handleDelete = _useFieldsDashboard.handleDelete,
@@ -12630,15 +12630,15 @@ var FieldsDashboard = function FieldsDashboard(_ref) {
12630
12630
  title: headerDisplayTitle
12631
12631
  };
12632
12632
  return /*#__PURE__*/React.createElement(React.Fragment, null, isMenuBarNeeded && /*#__PURE__*/React.createElement(Menubar, {
12633
- isConfigsLoading: isConfigsLoading,
12634
12633
  menuBarItems: menuBarItems,
12635
12634
  title: title
12636
- }), isScreenLoading && isEmpty(fields) ? /*#__PURE__*/React.createElement("div", {
12637
- className: "flex h-screen w-full flex-grow items-center justify-center"
12638
- }, /*#__PURE__*/React.createElement(PageLoader, null)) : /*#__PURE__*/React.createElement(Container, null, /*#__PURE__*/React.createElement(Header, headerProps), showStateFilter && stateFilterTabs, showCountSubheader && /*#__PURE__*/React.createElement(Subheader, {
12635
+ }), /*#__PURE__*/React.createElement(Container, null, /*#__PURE__*/React.createElement(Header, headerProps), showStateFilter && stateFilterTabs, showCountSubheader && /*#__PURE__*/React.createElement(Subheader, {
12639
12636
  count: count
12640
- }), /*#__PURE__*/React.createElement(FieldsTable, {
12641
- isLoading: isFieldsFetching || isFieldsLoading,
12637
+ }), isScreenLoading ? /*#__PURE__*/React.createElement("div", {
12638
+ className: "flex h-screen w-full flex-grow items-center justify-center"
12639
+ }, /*#__PURE__*/React.createElement(PageLoader, null)) : /*#__PURE__*/React.createElement(FieldsTable, {
12640
+ isFetched: isFieldsFetched,
12641
+ isFetching: isFieldsFetching,
12642
12642
  rowData: isEmpty(rowData) ? fields : rowData,
12643
12643
  totalCount: count,
12644
12644
  columnData: columnData,