@plusscommunities/pluss-maintenance-web-feedback 1.1.37-beta.5 → 1.1.37-beta.6

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
@@ -810,25 +810,11 @@ class JobList extends React.Component {
810
810
  }
811
811
  return params;
812
812
  });
813
- /**
814
- * Minimum number of items to auto-fill before stopping background fetch.
815
- * Because DynamoDB pages are unfiltered and the backend filters after
816
- * query, a single page may yield very few matching results. We keep
817
- * fetching in the background until we have this many items to display.
818
- */
819
- _defineProperty__default["default"](this, "MIN_PAGE_SIZE", 20);
820
813
  /**
821
814
  * Monotonically increasing ID used to ignore stale fetch results.
822
815
  * When a filter changes, fetchJobs() increments this counter. Any
823
- * in-flight fetch or autoFillPages loop checks the counter before
824
- * applying results — if it doesn't match, the results are discarded.
825
- *
826
- * Alternative: AbortController would actually cancel the HTTP request
827
- * (axios supports it via the `signal` config option). That would save
828
- * bandwidth and server load but requires threading `signal` through
829
- * authedFunction → getJobs2 → fetchPage (3 layers). The fetchId
830
- * approach is simpler and sufficient — stale requests still complete
831
- * in the background but their results are ignored.
816
+ * in-flight fetch checks the counter before applying results —
817
+ * if it doesn't match, the results are discarded.
832
818
  */
833
819
  _defineProperty__default["default"](this, "_fetchId", 0);
834
820
  /**
@@ -844,9 +830,6 @@ class JobList extends React.Component {
844
830
  });
845
831
  /**
846
832
  * Fetch the first page and render immediately.
847
- * If fewer than MIN_PAGE_SIZE items returned and there's more data,
848
- * kicks off a background loop that keeps fetching and appending
849
- * so results appear progressively.
850
833
  */
851
834
  _defineProperty__default["default"](this, "fetchJobs", async () => {
852
835
  const fetchId = ++this._fetchId;
@@ -856,8 +839,7 @@ class JobList extends React.Component {
856
839
  }, async () => {
857
840
  try {
858
841
  const res = await this.fetchPage(null);
859
- if (this._fetchId !== fetchId) return; // stale fetch
860
-
842
+ if (this._fetchId !== fetchId) return;
861
843
  const items = res.data.Items || [];
862
844
  const lastKey = res.data.LastKey || null;
863
845
  this.setState({
@@ -868,13 +850,8 @@ class JobList extends React.Component {
868
850
  });
869
851
  this.props.jobsLoaded(items);
870
852
  this.setRequesters(items);
871
-
872
- // Auto-fill in background if first page was sparse
873
- if (lastKey && items.length < this.MIN_PAGE_SIZE) {
874
- this.autoFillPages(items, lastKey, fetchId);
875
- }
876
853
  } catch (error) {
877
- if (this._fetchId !== fetchId) return; // stale fetch
854
+ if (this._fetchId !== fetchId) return;
878
855
  console.error('fetchJobs', error);
879
856
  this.setState({
880
857
  loading: false
@@ -882,52 +859,8 @@ class JobList extends React.Component {
882
859
  }
883
860
  });
884
861
  });
885
- /**
886
- * Background loop: keep fetching pages and appending results
887
- * until we have MIN_PAGE_SIZE items or run out of data.
888
- * Each page is rendered as it arrives so the user sees
889
- * results appearing progressively.
890
- */
891
- _defineProperty__default["default"](this, "autoFillPages", async (existingJobs, startKey, fetchId) => {
892
- this.setState({
893
- loadingMore: true
894
- });
895
- let currentJobs = existingJobs;
896
- let currentLastKey = startKey;
897
- try {
898
- while (currentLastKey && currentJobs.length < this.MIN_PAGE_SIZE) {
899
- const res = await this.fetchPage(currentLastKey);
900
- if (this._fetchId !== fetchId) return; // stale fetch
901
-
902
- const items = res.data.Items || [];
903
- currentLastKey = res.data.LastKey || null;
904
- currentJobs = [...currentJobs, ...items];
905
-
906
- // Append to UI immediately after each page arrives
907
- this.setState({
908
- jobs: currentJobs,
909
- lastKey: currentLastKey,
910
- hasMore: !!currentLastKey
911
- });
912
- if (items.length > 0) {
913
- this.props.jobsLoaded(items);
914
- this.setRequesters(currentJobs);
915
- }
916
- }
917
- } catch (error) {
918
- if (this._fetchId !== fetchId) return; // stale fetch
919
- console.error('autoFillPages', error);
920
- } finally {
921
- if (this._fetchId === fetchId) {
922
- this.setState({
923
- loadingMore: false
924
- });
925
- }
926
- }
927
- });
928
862
  /**
929
863
  * Load the next batch of jobs when the user clicks "Load More".
930
- * Fetches one page and also auto-fills in background if sparse.
931
864
  */
932
865
  _defineProperty__default["default"](this, "loadMore", async () => {
933
866
  const fetchId = ++this._fetchId;
@@ -940,30 +873,21 @@ class JobList extends React.Component {
940
873
  }, async () => {
941
874
  try {
942
875
  const res = await this.fetchPage(lastKey);
943
- if (this._fetchId !== fetchId) return; // stale fetch
944
-
876
+ if (this._fetchId !== fetchId) return;
945
877
  const items = res.data.Items || [];
946
878
  const newLastKey = res.data.LastKey || null;
947
879
  const updatedJobs = [...jobs, ...items];
948
880
  this.setState({
949
881
  jobs: updatedJobs,
950
882
  lastKey: newLastKey,
951
- hasMore: !!newLastKey
883
+ hasMore: !!newLastKey,
884
+ loadingMore: false
952
885
  });
953
886
  if (items.length > 0) {
954
887
  this.props.jobsLoaded(items);
955
888
  }
956
-
957
- // Auto-fill in background if this page was sparse
958
- if (newLastKey && items.length < this.MIN_PAGE_SIZE) {
959
- this.autoFillPages(updatedJobs, newLastKey, fetchId);
960
- } else {
961
- this.setState({
962
- loadingMore: false
963
- });
964
- }
965
889
  } catch (error) {
966
- if (this._fetchId !== fetchId) return; // stale fetch
890
+ if (this._fetchId !== fetchId) return;
967
891
  console.error('loadMore', error);
968
892
  this.setState({
969
893
  loadingMore: false
@@ -1795,16 +1719,24 @@ class JobList extends React.Component {
1795
1719
  }, "Loading more results\u2026"));
1796
1720
  }
1797
1721
  return /*#__PURE__*/React__default["default"].createElement("div", {
1798
- className: "flex flex-center-row",
1799
1722
  style: {
1800
- padding: '16px 0'
1723
+ margin: '24px 0 40px 0',
1724
+ position: 'relative',
1725
+ top: -16
1801
1726
  }
1802
1727
  }, /*#__PURE__*/React__default["default"].createElement(Components$7.Button, {
1803
- inline: true,
1804
- buttonType: "tertiary",
1728
+ buttonType: "primary",
1805
1729
  onClick: this.loadMore,
1806
- isActive: true
1807
- }, "Load More"));
1730
+ isActive: true,
1731
+ style: {
1732
+ width: '100%'
1733
+ }
1734
+ }, "Load More Results", /*#__PURE__*/React__default["default"].createElement(FontAwesome__default["default"], {
1735
+ name: "plus",
1736
+ style: {
1737
+ marginLeft: 8
1738
+ }
1739
+ })));
1808
1740
  }
1809
1741
  renderContent() {
1810
1742
  const {
package/dist/index.esm.js CHANGED
@@ -779,25 +779,11 @@ class JobList extends Component {
779
779
  }
780
780
  return params;
781
781
  });
782
- /**
783
- * Minimum number of items to auto-fill before stopping background fetch.
784
- * Because DynamoDB pages are unfiltered and the backend filters after
785
- * query, a single page may yield very few matching results. We keep
786
- * fetching in the background until we have this many items to display.
787
- */
788
- _defineProperty(this, "MIN_PAGE_SIZE", 20);
789
782
  /**
790
783
  * Monotonically increasing ID used to ignore stale fetch results.
791
784
  * When a filter changes, fetchJobs() increments this counter. Any
792
- * in-flight fetch or autoFillPages loop checks the counter before
793
- * applying results — if it doesn't match, the results are discarded.
794
- *
795
- * Alternative: AbortController would actually cancel the HTTP request
796
- * (axios supports it via the `signal` config option). That would save
797
- * bandwidth and server load but requires threading `signal` through
798
- * authedFunction → getJobs2 → fetchPage (3 layers). The fetchId
799
- * approach is simpler and sufficient — stale requests still complete
800
- * in the background but their results are ignored.
785
+ * in-flight fetch checks the counter before applying results —
786
+ * if it doesn't match, the results are discarded.
801
787
  */
802
788
  _defineProperty(this, "_fetchId", 0);
803
789
  /**
@@ -813,9 +799,6 @@ class JobList extends Component {
813
799
  });
814
800
  /**
815
801
  * Fetch the first page and render immediately.
816
- * If fewer than MIN_PAGE_SIZE items returned and there's more data,
817
- * kicks off a background loop that keeps fetching and appending
818
- * so results appear progressively.
819
802
  */
820
803
  _defineProperty(this, "fetchJobs", async () => {
821
804
  const fetchId = ++this._fetchId;
@@ -825,8 +808,7 @@ class JobList extends Component {
825
808
  }, async () => {
826
809
  try {
827
810
  const res = await this.fetchPage(null);
828
- if (this._fetchId !== fetchId) return; // stale fetch
829
-
811
+ if (this._fetchId !== fetchId) return;
830
812
  const items = res.data.Items || [];
831
813
  const lastKey = res.data.LastKey || null;
832
814
  this.setState({
@@ -837,13 +819,8 @@ class JobList extends Component {
837
819
  });
838
820
  this.props.jobsLoaded(items);
839
821
  this.setRequesters(items);
840
-
841
- // Auto-fill in background if first page was sparse
842
- if (lastKey && items.length < this.MIN_PAGE_SIZE) {
843
- this.autoFillPages(items, lastKey, fetchId);
844
- }
845
822
  } catch (error) {
846
- if (this._fetchId !== fetchId) return; // stale fetch
823
+ if (this._fetchId !== fetchId) return;
847
824
  console.error('fetchJobs', error);
848
825
  this.setState({
849
826
  loading: false
@@ -851,52 +828,8 @@ class JobList extends Component {
851
828
  }
852
829
  });
853
830
  });
854
- /**
855
- * Background loop: keep fetching pages and appending results
856
- * until we have MIN_PAGE_SIZE items or run out of data.
857
- * Each page is rendered as it arrives so the user sees
858
- * results appearing progressively.
859
- */
860
- _defineProperty(this, "autoFillPages", async (existingJobs, startKey, fetchId) => {
861
- this.setState({
862
- loadingMore: true
863
- });
864
- let currentJobs = existingJobs;
865
- let currentLastKey = startKey;
866
- try {
867
- while (currentLastKey && currentJobs.length < this.MIN_PAGE_SIZE) {
868
- const res = await this.fetchPage(currentLastKey);
869
- if (this._fetchId !== fetchId) return; // stale fetch
870
-
871
- const items = res.data.Items || [];
872
- currentLastKey = res.data.LastKey || null;
873
- currentJobs = [...currentJobs, ...items];
874
-
875
- // Append to UI immediately after each page arrives
876
- this.setState({
877
- jobs: currentJobs,
878
- lastKey: currentLastKey,
879
- hasMore: !!currentLastKey
880
- });
881
- if (items.length > 0) {
882
- this.props.jobsLoaded(items);
883
- this.setRequesters(currentJobs);
884
- }
885
- }
886
- } catch (error) {
887
- if (this._fetchId !== fetchId) return; // stale fetch
888
- console.error('autoFillPages', error);
889
- } finally {
890
- if (this._fetchId === fetchId) {
891
- this.setState({
892
- loadingMore: false
893
- });
894
- }
895
- }
896
- });
897
831
  /**
898
832
  * Load the next batch of jobs when the user clicks "Load More".
899
- * Fetches one page and also auto-fills in background if sparse.
900
833
  */
901
834
  _defineProperty(this, "loadMore", async () => {
902
835
  const fetchId = ++this._fetchId;
@@ -909,30 +842,21 @@ class JobList extends Component {
909
842
  }, async () => {
910
843
  try {
911
844
  const res = await this.fetchPage(lastKey);
912
- if (this._fetchId !== fetchId) return; // stale fetch
913
-
845
+ if (this._fetchId !== fetchId) return;
914
846
  const items = res.data.Items || [];
915
847
  const newLastKey = res.data.LastKey || null;
916
848
  const updatedJobs = [...jobs, ...items];
917
849
  this.setState({
918
850
  jobs: updatedJobs,
919
851
  lastKey: newLastKey,
920
- hasMore: !!newLastKey
852
+ hasMore: !!newLastKey,
853
+ loadingMore: false
921
854
  });
922
855
  if (items.length > 0) {
923
856
  this.props.jobsLoaded(items);
924
857
  }
925
-
926
- // Auto-fill in background if this page was sparse
927
- if (newLastKey && items.length < this.MIN_PAGE_SIZE) {
928
- this.autoFillPages(updatedJobs, newLastKey, fetchId);
929
- } else {
930
- this.setState({
931
- loadingMore: false
932
- });
933
- }
934
858
  } catch (error) {
935
- if (this._fetchId !== fetchId) return; // stale fetch
859
+ if (this._fetchId !== fetchId) return;
936
860
  console.error('loadMore', error);
937
861
  this.setState({
938
862
  loadingMore: false
@@ -1764,16 +1688,24 @@ class JobList extends Component {
1764
1688
  }, "Loading more results\u2026"));
1765
1689
  }
1766
1690
  return /*#__PURE__*/React.createElement("div", {
1767
- className: "flex flex-center-row",
1768
1691
  style: {
1769
- padding: '16px 0'
1692
+ margin: '24px 0 40px 0',
1693
+ position: 'relative',
1694
+ top: -16
1770
1695
  }
1771
1696
  }, /*#__PURE__*/React.createElement(Components$7.Button, {
1772
- inline: true,
1773
- buttonType: "tertiary",
1697
+ buttonType: "primary",
1774
1698
  onClick: this.loadMore,
1775
- isActive: true
1776
- }, "Load More"));
1699
+ isActive: true,
1700
+ style: {
1701
+ width: '100%'
1702
+ }
1703
+ }, "Load More Results", /*#__PURE__*/React.createElement(FontAwesome, {
1704
+ name: "plus",
1705
+ style: {
1706
+ marginLeft: 8
1707
+ }
1708
+ })));
1777
1709
  }
1778
1710
  renderContent() {
1779
1711
  const {
package/dist/index.umd.js CHANGED
@@ -799,25 +799,11 @@
799
799
  }
800
800
  return params;
801
801
  });
802
- /**
803
- * Minimum number of items to auto-fill before stopping background fetch.
804
- * Because DynamoDB pages are unfiltered and the backend filters after
805
- * query, a single page may yield very few matching results. We keep
806
- * fetching in the background until we have this many items to display.
807
- */
808
- _defineProperty__default["default"](this, "MIN_PAGE_SIZE", 20);
809
802
  /**
810
803
  * Monotonically increasing ID used to ignore stale fetch results.
811
804
  * When a filter changes, fetchJobs() increments this counter. Any
812
- * in-flight fetch or autoFillPages loop checks the counter before
813
- * applying results — if it doesn't match, the results are discarded.
814
- *
815
- * Alternative: AbortController would actually cancel the HTTP request
816
- * (axios supports it via the `signal` config option). That would save
817
- * bandwidth and server load but requires threading `signal` through
818
- * authedFunction → getJobs2 → fetchPage (3 layers). The fetchId
819
- * approach is simpler and sufficient — stale requests still complete
820
- * in the background but their results are ignored.
805
+ * in-flight fetch checks the counter before applying results —
806
+ * if it doesn't match, the results are discarded.
821
807
  */
822
808
  _defineProperty__default["default"](this, "_fetchId", 0);
823
809
  /**
@@ -833,9 +819,6 @@
833
819
  });
834
820
  /**
835
821
  * Fetch the first page and render immediately.
836
- * If fewer than MIN_PAGE_SIZE items returned and there's more data,
837
- * kicks off a background loop that keeps fetching and appending
838
- * so results appear progressively.
839
822
  */
840
823
  _defineProperty__default["default"](this, "fetchJobs", async () => {
841
824
  const fetchId = ++this._fetchId;
@@ -845,8 +828,7 @@
845
828
  }, async () => {
846
829
  try {
847
830
  const res = await this.fetchPage(null);
848
- if (this._fetchId !== fetchId) return; // stale fetch
849
-
831
+ if (this._fetchId !== fetchId) return;
850
832
  const items = res.data.Items || [];
851
833
  const lastKey = res.data.LastKey || null;
852
834
  this.setState({
@@ -857,13 +839,8 @@
857
839
  });
858
840
  this.props.jobsLoaded(items);
859
841
  this.setRequesters(items);
860
-
861
- // Auto-fill in background if first page was sparse
862
- if (lastKey && items.length < this.MIN_PAGE_SIZE) {
863
- this.autoFillPages(items, lastKey, fetchId);
864
- }
865
842
  } catch (error) {
866
- if (this._fetchId !== fetchId) return; // stale fetch
843
+ if (this._fetchId !== fetchId) return;
867
844
  console.error('fetchJobs', error);
868
845
  this.setState({
869
846
  loading: false
@@ -871,52 +848,8 @@
871
848
  }
872
849
  });
873
850
  });
874
- /**
875
- * Background loop: keep fetching pages and appending results
876
- * until we have MIN_PAGE_SIZE items or run out of data.
877
- * Each page is rendered as it arrives so the user sees
878
- * results appearing progressively.
879
- */
880
- _defineProperty__default["default"](this, "autoFillPages", async (existingJobs, startKey, fetchId) => {
881
- this.setState({
882
- loadingMore: true
883
- });
884
- let currentJobs = existingJobs;
885
- let currentLastKey = startKey;
886
- try {
887
- while (currentLastKey && currentJobs.length < this.MIN_PAGE_SIZE) {
888
- const res = await this.fetchPage(currentLastKey);
889
- if (this._fetchId !== fetchId) return; // stale fetch
890
-
891
- const items = res.data.Items || [];
892
- currentLastKey = res.data.LastKey || null;
893
- currentJobs = [...currentJobs, ...items];
894
-
895
- // Append to UI immediately after each page arrives
896
- this.setState({
897
- jobs: currentJobs,
898
- lastKey: currentLastKey,
899
- hasMore: !!currentLastKey
900
- });
901
- if (items.length > 0) {
902
- this.props.jobsLoaded(items);
903
- this.setRequesters(currentJobs);
904
- }
905
- }
906
- } catch (error) {
907
- if (this._fetchId !== fetchId) return; // stale fetch
908
- console.error('autoFillPages', error);
909
- } finally {
910
- if (this._fetchId === fetchId) {
911
- this.setState({
912
- loadingMore: false
913
- });
914
- }
915
- }
916
- });
917
851
  /**
918
852
  * Load the next batch of jobs when the user clicks "Load More".
919
- * Fetches one page and also auto-fills in background if sparse.
920
853
  */
921
854
  _defineProperty__default["default"](this, "loadMore", async () => {
922
855
  const fetchId = ++this._fetchId;
@@ -929,30 +862,21 @@
929
862
  }, async () => {
930
863
  try {
931
864
  const res = await this.fetchPage(lastKey);
932
- if (this._fetchId !== fetchId) return; // stale fetch
933
-
865
+ if (this._fetchId !== fetchId) return;
934
866
  const items = res.data.Items || [];
935
867
  const newLastKey = res.data.LastKey || null;
936
868
  const updatedJobs = [...jobs, ...items];
937
869
  this.setState({
938
870
  jobs: updatedJobs,
939
871
  lastKey: newLastKey,
940
- hasMore: !!newLastKey
872
+ hasMore: !!newLastKey,
873
+ loadingMore: false
941
874
  });
942
875
  if (items.length > 0) {
943
876
  this.props.jobsLoaded(items);
944
877
  }
945
-
946
- // Auto-fill in background if this page was sparse
947
- if (newLastKey && items.length < this.MIN_PAGE_SIZE) {
948
- this.autoFillPages(updatedJobs, newLastKey, fetchId);
949
- } else {
950
- this.setState({
951
- loadingMore: false
952
- });
953
- }
954
878
  } catch (error) {
955
- if (this._fetchId !== fetchId) return; // stale fetch
879
+ if (this._fetchId !== fetchId) return;
956
880
  console.error('loadMore', error);
957
881
  this.setState({
958
882
  loadingMore: false
@@ -1784,16 +1708,24 @@
1784
1708
  }, "Loading more results\u2026"));
1785
1709
  }
1786
1710
  return /*#__PURE__*/React__default["default"].createElement("div", {
1787
- className: "flex flex-center-row",
1788
1711
  style: {
1789
- padding: '16px 0'
1712
+ margin: '24px 0 40px 0',
1713
+ position: 'relative',
1714
+ top: -16
1790
1715
  }
1791
1716
  }, /*#__PURE__*/React__default["default"].createElement(Components$7.Button, {
1792
- inline: true,
1793
- buttonType: "tertiary",
1717
+ buttonType: "primary",
1794
1718
  onClick: this.loadMore,
1795
- isActive: true
1796
- }, "Load More"));
1719
+ isActive: true,
1720
+ style: {
1721
+ width: '100%'
1722
+ }
1723
+ }, "Load More Results", /*#__PURE__*/React__default["default"].createElement(FontAwesome__default["default"], {
1724
+ name: "plus",
1725
+ style: {
1726
+ marginLeft: 8
1727
+ }
1728
+ })));
1797
1729
  }
1798
1730
  renderContent() {
1799
1731
  const {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plusscommunities/pluss-maintenance-web-feedback",
3
- "version": "1.1.37-beta.5",
3
+ "version": "1.1.37-beta.6",
4
4
  "description": "Extension package to enable maintenance on Pluss Communities Platform",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -17,9 +17,9 @@
17
17
  "upload:p": "npm run patch && npm run upload",
18
18
  "copy:add": "run(){ ext=${1:-default}; test -f src/values.config.$ext.js || cp src/values.config.default.js src/values.config.$ext.js; }; run",
19
19
  "copy:get": "echo $npm_package_name",
20
- "copy:set": "run(){ target='\\@plusscommunities\\/pluss-maintenance-web'; ext=${1:-default}; [ $ext == 'default' ] && replace=$target || replace=$target'-'$ext; echo 'Setting target to '$replace; test -f src/values.config.$ext.js && cp -f src/values.config.$ext.js src/values.config.js; sed -i'' -e 's/'$target'.*\"/'$replace'\"/g' package.json; }; run",
20
+ "copy:set": "run(){ target='\\@plusscommunities\\/pluss-maintenance-web'; ext=${1:-default}; [ $ext == 'default' ] && replace=$target || replace=$target'-'$ext; echo 'Setting target to '$replace; test -f src/values.config.$ext.js && cp -f src/values.config.$ext.js src/values.config.js; sed -i '' -e 's/'$target'.*\"/'$replace'\"/g' package.json; }; run",
21
21
  "copy:betaupload": "for file in `ls ./src/values.config.*.js`; do dup=`echo $file | sed 's/.*values\\.config\\.\\(.*\\)\\.js/\\1/'`; npm run copy:set $dup; npm run betaupload; done; npm run copy:set;",
22
- "copy:upload": "for file in `ls ./src/values.config.*.js`; do dup=`echo $file | sed 's/.*values\\.config\\.\\(.*\\)\\.js/\\1/'`; npm run copy:set $dup; npm run upload; done; npm run copy:set;"
22
+ "copy:upload": "npm run patch; for file in `ls ./src/values.config.*.js`; do dup=`echo $file | sed 's/.*values\\.config\\.\\(.*\\)\\.js/\\1/'`; npm run copy:set $dup; npm run upload; done; npm run copy:set;"
23
23
  },
24
24
  "author": "Phillip Suh",
25
25
  "license": "ISC",