@esri/solutions-components 0.8.23 → 0.8.25

Sign up to get free protection for your applications and to get access to all the features.
Files changed (171) hide show
  1. package/dist/cjs/arcgis-login.cjs.entry.js +1 -1
  2. package/dist/cjs/basemap-gallery_7.cjs.entry.js +1 -1
  3. package/dist/cjs/buffer-tools_3.cjs.entry.js +1 -1
  4. package/dist/cjs/{calcite-avatar.cjs.entry.js → calcite-avatar_2.cjs.entry.js} +62 -0
  5. package/dist/cjs/calcite-block_5.cjs.entry.js +12 -3
  6. package/dist/cjs/calcite-dropdown-group_2.cjs.entry.js +419 -0
  7. package/dist/cjs/{calcite-dropdown_4.cjs.entry.js → calcite-dropdown_2.cjs.entry.js} +12 -435
  8. package/dist/cjs/calcite-flow_6.cjs.entry.js +44 -34
  9. package/dist/cjs/card-manager_3.cjs.entry.js +1 -1
  10. package/dist/cjs/crowdsource-manager.cjs.entry.js +1 -1
  11. package/dist/cjs/crowdsource-reporter.cjs.entry.js +58 -38
  12. package/dist/cjs/feature-list.cjs.entry.js +5 -4
  13. package/dist/cjs/{helpers-9347ad83.js → helpers-618a3f7d.js} +2 -1
  14. package/dist/cjs/instant-apps-create.cjs.entry.js +266 -0
  15. package/dist/cjs/instant-apps-export.cjs.entry.js +31 -16
  16. package/dist/cjs/instant-apps-header.cjs.entry.js +3 -2
  17. package/dist/cjs/instant-apps-interactive-legend-classic.cjs.entry.js +11 -4
  18. package/dist/cjs/instant-apps-interactive-legend-count_2.cjs.entry.js +1 -1
  19. package/dist/cjs/instant-apps-interactive-legend-group-legend-element-caption.cjs.entry.js +1 -1
  20. package/dist/cjs/instant-apps-interactive-legend-group-legend-element_5.cjs.entry.js +2 -2
  21. package/dist/cjs/instant-apps-interactive-legend.cjs.entry.js +1 -1
  22. package/dist/cjs/instant-apps-landing-page.cjs.entry.js +45 -9
  23. package/dist/cjs/instant-apps-language-switcher.cjs.entry.js +1 -1
  24. package/dist/cjs/instant-apps-language-translator.cjs.entry.js +1 -1
  25. package/dist/cjs/instant-apps-sign-in.cjs.entry.js +168 -0
  26. package/dist/cjs/{languageSwitcher-395021d6.js → languageSwitcher-b9a1485c.js} +3 -1
  27. package/dist/cjs/loader.cjs.js +1 -1
  28. package/dist/cjs/public-notification.cjs.entry.js +3 -3
  29. package/dist/cjs/resources-fa37e40f.js +26 -0
  30. package/dist/cjs/solutions-components.cjs.js +1 -1
  31. package/dist/collection/collection-manifest.json +3 -1
  32. package/dist/collection/components/arcgis-login/arcgis-login.js +1 -1
  33. package/dist/collection/components/basemap-gallery/basemap-gallery.js +1 -1
  34. package/dist/collection/components/buffer-tools/buffer-tools.js +1 -1
  35. package/dist/collection/components/card-manager/card-manager.js +1 -1
  36. package/dist/collection/components/create-feature/create-feature.js +9 -2
  37. package/dist/collection/components/create-related-feature/create-related-feature.js +9 -2
  38. package/dist/collection/components/crowdsource-manager/crowdsource-manager.js +1 -1
  39. package/dist/collection/components/crowdsource-reporter/crowdsource-reporter.js +58 -47
  40. package/dist/collection/components/feature-details/feature-details.css +4 -4
  41. package/dist/collection/components/feature-details/feature-details.js +62 -18
  42. package/dist/collection/components/feature-list/feature-list.css +2 -0
  43. package/dist/collection/components/feature-list/feature-list.js +22 -3
  44. package/dist/collection/components/layer-list/layer-list.js +6 -13
  45. package/dist/collection/components/public-notification/public-notification.js +3 -3
  46. package/dist/collection/demos/crowdsource-reporter.html +22 -15
  47. package/dist/collection/utils/interfaces.ts +1 -0
  48. package/dist/components/arcgis-login.js +1 -1
  49. package/dist/components/basemap-gallery2.js +1 -1
  50. package/dist/components/buffer-tools2.js +1 -1
  51. package/dist/components/calcite-navigation-user.js +1 -99
  52. package/dist/components/card-manager2.js +1 -1
  53. package/dist/components/create-feature2.js +9 -2
  54. package/dist/components/create-related-feature2.js +9 -2
  55. package/dist/components/crowdsource-manager.js +1 -1
  56. package/dist/components/crowdsource-reporter.js +59 -39
  57. package/dist/components/feature-details2.js +22 -17
  58. package/dist/components/feature-list2.js +6 -4
  59. package/dist/components/helpers.js +3 -2
  60. package/dist/components/instant-apps-ckeditor-wrapper2.js +1 -1
  61. package/dist/components/instant-apps-create.js +317 -0
  62. package/dist/components/instant-apps-export.js +32 -16
  63. package/dist/components/instant-apps-filter-list2.js +6 -1
  64. package/dist/components/instant-apps-header2.js +3 -2
  65. package/dist/components/instant-apps-interactive-legend-classic2.js +12 -5
  66. package/dist/components/instant-apps-interactive-legend-legend-element-caption2.js +2 -2
  67. package/dist/components/instant-apps-landing-page.js +91 -16
  68. package/dist/components/instant-apps-language-translator2.js +3 -1
  69. package/dist/components/instant-apps-sign-in.js +11 -0
  70. package/dist/components/instant-apps-sign-in2.js +243 -0
  71. package/dist/components/instant-apps-social-share2.js +8 -2
  72. package/dist/components/layer-list2.js +6 -13
  73. package/dist/{esm/calcite-navigation-user.entry.js → components/navigation-user.js} +46 -9
  74. package/dist/components/public-notification.js +3 -3
  75. package/dist/esm/arcgis-login.entry.js +1 -1
  76. package/dist/esm/basemap-gallery_7.entry.js +1 -1
  77. package/dist/esm/buffer-tools_3.entry.js +1 -1
  78. package/dist/esm/{calcite-avatar.entry.js → calcite-avatar_2.entry.js} +64 -3
  79. package/dist/esm/calcite-block_5.entry.js +12 -3
  80. package/dist/esm/calcite-color-picker-hex-input_2.entry.js +1 -1
  81. package/dist/esm/calcite-color-picker.entry.js +1 -1
  82. package/dist/esm/calcite-dropdown-group_2.entry.js +414 -0
  83. package/dist/esm/{calcite-dropdown_4.entry.js → calcite-dropdown_2.entry.js} +2 -423
  84. package/dist/esm/calcite-flow_6.entry.js +44 -34
  85. package/dist/esm/card-manager_3.entry.js +1 -1
  86. package/dist/esm/crowdsource-manager.entry.js +1 -1
  87. package/dist/esm/crowdsource-reporter.entry.js +58 -38
  88. package/dist/esm/feature-list.entry.js +5 -4
  89. package/dist/esm/{helpers-a5a81b9d.js → helpers-61b05164.js} +3 -2
  90. package/dist/esm/instant-apps-create.entry.js +262 -0
  91. package/dist/esm/instant-apps-export.entry.js +31 -16
  92. package/dist/esm/instant-apps-header.entry.js +3 -2
  93. package/dist/esm/instant-apps-interactive-legend-classic.entry.js +11 -4
  94. package/dist/esm/instant-apps-interactive-legend-count_2.entry.js +1 -1
  95. package/dist/esm/instant-apps-interactive-legend-group-legend-element-caption.entry.js +1 -1
  96. package/dist/esm/instant-apps-interactive-legend-group-legend-element_5.entry.js +2 -2
  97. package/dist/esm/instant-apps-interactive-legend.entry.js +1 -1
  98. package/dist/esm/instant-apps-landing-page.entry.js +46 -10
  99. package/dist/esm/instant-apps-language-switcher.entry.js +1 -1
  100. package/dist/esm/instant-apps-language-translator.entry.js +1 -1
  101. package/dist/esm/instant-apps-sign-in.entry.js +164 -0
  102. package/dist/esm/{languageSwitcher-a4a615e4.js → languageSwitcher-d60f03b2.js} +3 -1
  103. package/dist/esm/loader.js +1 -1
  104. package/dist/esm/public-notification.entry.js +3 -3
  105. package/dist/esm/resources-16800cce.js +24 -0
  106. package/dist/esm/solutions-components.js +1 -1
  107. package/dist/esm/{utils-6419e941.js → utils-251cb6de.js} +1 -1
  108. package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-create/instant-apps-create.css +150 -0
  109. package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-header/instant-apps-header.css +16 -9
  110. package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-landing-page/instant-apps-landing-page.css +19 -0
  111. package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-sign-in/instant-apps-sign-in.css +98 -0
  112. package/dist/solutions-components/demos/crowdsource-reporter.html +22 -15
  113. package/dist/solutions-components/{p-88495699.entry.js → p-16730f05.entry.js} +1 -1
  114. package/dist/solutions-components/p-1ae3b886.entry.js +17 -0
  115. package/dist/solutions-components/{p-63460d51.entry.js → p-1ff9eb95.entry.js} +1 -1
  116. package/dist/solutions-components/{p-8f6e0ae5.entry.js → p-26eb1225.entry.js} +1 -1
  117. package/dist/solutions-components/{p-3a2e0188.entry.js → p-2c044250.entry.js} +2 -2
  118. package/dist/solutions-components/p-314dc933.entry.js +6 -0
  119. package/dist/solutions-components/p-50741707.entry.js +6 -0
  120. package/dist/solutions-components/p-5b817c98.entry.js +6 -0
  121. package/dist/solutions-components/p-614ebce7.js +6 -0
  122. package/dist/solutions-components/p-686fa7ce.entry.js +6 -0
  123. package/dist/solutions-components/{p-df73649e.entry.js → p-77cd573b.entry.js} +1 -1
  124. package/dist/solutions-components/{p-c95dcdf7.entry.js → p-7883b885.entry.js} +3 -3
  125. package/dist/solutions-components/p-79e2e203.entry.js +6 -0
  126. package/dist/solutions-components/{p-968a6fd8.entry.js → p-7b17e929.entry.js} +1 -1
  127. package/dist/solutions-components/p-80b3eb6b.entry.js +6 -0
  128. package/dist/solutions-components/p-84913712.js +6 -0
  129. package/dist/solutions-components/p-8c500fd7.entry.js +6 -0
  130. package/dist/solutions-components/{p-fe9d6d06.js → p-9f56c02c.js} +1 -1
  131. package/dist/solutions-components/{p-667c022f.entry.js → p-af4be4ce.entry.js} +1 -1
  132. package/dist/solutions-components/p-bb2e669d.entry.js +6 -0
  133. package/dist/solutions-components/p-c2ec0dcc.entry.js +17 -0
  134. package/dist/solutions-components/p-c41997d5.js +11 -0
  135. package/dist/solutions-components/p-c512fcfb.entry.js +6 -0
  136. package/dist/solutions-components/{p-21d6360a.entry.js → p-c7f0e7a8.entry.js} +1 -1
  137. package/dist/solutions-components/{p-9c7d4343.entry.js → p-cd91c3e7.entry.js} +1 -1
  138. package/dist/solutions-components/p-ceba37d3.entry.js +11 -0
  139. package/dist/solutions-components/{p-09b769b7.entry.js → p-d8a15e32.entry.js} +1 -1
  140. package/dist/solutions-components/p-d8da6406.entry.js +6 -0
  141. package/dist/solutions-components/p-da6b3c8a.entry.js +6 -0
  142. package/dist/solutions-components/{p-60f1055e.entry.js → p-e2400b0d.entry.js} +1 -1
  143. package/dist/solutions-components/p-f35cc7ae.entry.js +6 -0
  144. package/dist/solutions-components/solutions-components.esm.js +1 -1
  145. package/dist/solutions-components/utils/interfaces.ts +1 -0
  146. package/dist/types/components/create-feature/create-feature.d.ts +4 -0
  147. package/dist/types/components/create-related-feature/create-related-feature.d.ts +4 -0
  148. package/dist/types/components/crowdsource-reporter/crowdsource-reporter.d.ts +18 -7
  149. package/dist/types/components/feature-details/feature-details.d.ts +17 -1
  150. package/dist/types/components/feature-list/feature-list.d.ts +4 -0
  151. package/dist/types/components/layer-list/layer-list.d.ts +1 -1
  152. package/dist/types/components.d.ts +25 -2
  153. package/dist/types/preact.d.ts +7 -2
  154. package/dist/types/utils/interfaces.d.ts +1 -0
  155. package/package.json +2 -2
  156. package/dist/cjs/calcite-navigation-user.cjs.entry.js +0 -73
  157. package/dist/solutions-components/p-08a1e120.js +0 -6
  158. package/dist/solutions-components/p-3283660c.entry.js +0 -6
  159. package/dist/solutions-components/p-33647277.entry.js +0 -6
  160. package/dist/solutions-components/p-3af0764f.entry.js +0 -6
  161. package/dist/solutions-components/p-41d288c0.entry.js +0 -6
  162. package/dist/solutions-components/p-599dcc29.js +0 -6
  163. package/dist/solutions-components/p-64b4b579.entry.js +0 -11
  164. package/dist/solutions-components/p-64da5bb8.entry.js +0 -17
  165. package/dist/solutions-components/p-ab96dd27.entry.js +0 -6
  166. package/dist/solutions-components/p-bb0c7be3.entry.js +0 -17
  167. package/dist/solutions-components/p-bb8e3add.entry.js +0 -11
  168. package/dist/solutions-components/p-c36bb8ca.entry.js +0 -6
  169. package/dist/solutions-components/p-cbe166fc.entry.js +0 -6
  170. package/dist/solutions-components/p-eab95aa4.entry.js +0 -6
  171. package/dist/solutions-components/p-f6a1673c.entry.js +0 -6
@@ -347,6 +347,10 @@ const CreateFeature = class {
347
347
  this.drawComplete = createEvent(this, "drawComplete", 7);
348
348
  this.editingAttachment = createEvent(this, "editingAttachment", 7);
349
349
  this.progressStatus = createEvent(this, "progressStatus", 7);
350
+ /**
351
+ * boolean: Flag to maintain form submission using submit button
352
+ */
353
+ this._isSubmitBtnClicked = false;
350
354
  this.mapView = undefined;
351
355
  this.selectedLayerId = undefined;
352
356
  this.customizeSubmit = false;
@@ -386,6 +390,7 @@ const CreateFeature = class {
386
390
  */
387
391
  async submit() {
388
392
  if (this._editor) {
393
+ this._isSubmitBtnClicked = true;
389
394
  this._editor.viewModel.featureFormViewModel.submit();
390
395
  }
391
396
  }
@@ -412,7 +417,7 @@ const CreateFeature = class {
412
417
  */
413
418
  render() {
414
419
  const showSearchWidget = this.showSearchWidget ? '' : 'display-none';
415
- return (h(Fragment, { key: '66e42055c22a93c6d34440b65ac950a388639b9a' }, h("div", { key: 'fc4bf1fc039e4d914e416a394f0671712d116482', id: "feature-form" }), h("div", { key: 'aadd529366b2b85e60fdffc306cf41f37c2a6709', class: `search-widget ${showSearchWidget}`, id: "search-widget-ref" })));
420
+ return (h(Fragment, { key: 'd11a16053bc5eb86a09fd3bc35c9a89cee6dd064' }, h("div", { key: '0320bb0ca9fc069306151078c66fbee11060fcab', id: "feature-form" }), h("div", { key: '8aaa13e87213a880382ca408d324beb79ba7a500', class: `search-widget ${showSearchWidget}`, id: "search-widget-ref" })));
416
421
  }
417
422
  //--------------------------------------------------------------------------
418
423
  //
@@ -658,11 +663,13 @@ const CreateFeature = class {
658
663
  var _a;
659
664
  //return if any attribute is invalid , focus will be shifted to the invalid attribute in feature form
660
665
  if (evt.invalid.length) {
666
+ this._isSubmitBtnClicked = false;
661
667
  return;
662
668
  }
663
669
  //Submit only when valid attributes
664
670
  //emit success or fail based on the result
665
- if (evt.valid.length) {
671
+ if (evt.valid.length && this._isSubmitBtnClicked) {
672
+ this._isSubmitBtnClicked = false;
666
673
  try {
667
674
  await this._editor.activeWorkflow.commit();
668
675
  //throw errors if any failures
@@ -697,6 +704,10 @@ const CreateRelatedFeature = class {
697
704
  this.success = createEvent(this, "success", 7);
698
705
  this.fail = createEvent(this, "fail", 7);
699
706
  this.isActionPending = createEvent(this, "isActionPending", 7);
707
+ /**
708
+ * boolean: Flag to maintain form submission using submit button
709
+ */
710
+ this._isSubmitBtnClicked = false;
700
711
  this.mapView = undefined;
701
712
  this.table = undefined;
702
713
  this.selectedFeature = undefined;
@@ -733,6 +744,7 @@ const CreateRelatedFeature = class {
733
744
  */
734
745
  async submit() {
735
746
  if (this._editor) {
747
+ this._isSubmitBtnClicked = true;
736
748
  this._editor.viewModel.featureFormViewModel.submit();
737
749
  }
738
750
  }
@@ -770,7 +782,7 @@ const CreateRelatedFeature = class {
770
782
  this.reactiveUtils = reactiveUtils;
771
783
  }
772
784
  render() {
773
- return (h(Host, { key: '9807b7dcad1f8305756e6098f1e64ef8caffcbac' }));
785
+ return (h(Host, { key: '8c32e05707b6e5501759caaef5d89f8da40640e4' }));
774
786
  }
775
787
  /**
776
788
  * StencilJS: Called once just after the component is fully loaded and the first render() occurs.
@@ -900,11 +912,13 @@ const CreateRelatedFeature = class {
900
912
  var _a;
901
913
  //return if any attribute is invalid , focus will be shifted to the invalid attribute in feature form
902
914
  if (evt.invalid.length) {
915
+ this._isSubmitBtnClicked = false;
903
916
  return;
904
917
  }
905
918
  //Submit only when valid attributes
906
919
  //emit success or fail based on the result
907
- if (evt.valid.length) {
920
+ if (evt.valid.length && this._isSubmitBtnClicked) {
921
+ this._isSubmitBtnClicked = false;
908
922
  try {
909
923
  await this._editor.activeWorkflow.commit();
910
924
  //throw errors if any failures
@@ -930,14 +944,15 @@ const CreateRelatedFeature = class {
930
944
  };
931
945
  CreateRelatedFeature.style = CreateRelatedFeatureStyle0;
932
946
 
933
- const featureDetailsCss = ":host{display:block}.buttons-container{align-items:center;display:flex;padding:10px;color:var(--calcite-color-text-1) !important;background-color:var(--calcite-color-foreground-1) !important;border-block-start:1px solid var(--calcite-color-border-3);border-block-end:1px solid var(--calcite-color-border-3)}.comment-btn{display:flex;gap:5px;font-size:var(--calcite-font-size--2);align-items:center;padding:0 0.5rem}";
947
+ const featureDetailsCss = ":host{display:block}.buttons-container{align-items:center;display:flex;padding:4px;color:var(--calcite-color-text-1) !important;background-color:var(--calcite-color-foreground-1) !important;border-block-start:1px solid var(--calcite-color-border-3);border-block-end:1px solid var(--calcite-color-border-3)}.comment-btn{display:flex;gap:10px;font-size:var(--calcite-font-size--1);align-items:center;padding:7px 0.75rem}";
934
948
  const FeatureDetailsStyle0 = featureDetailsCss;
935
949
 
936
950
  const FeatureDetails = class {
937
951
  constructor(hostRef) {
938
952
  registerInstance(this, hostRef);
939
953
  this.loadingStatus = createEvent(this, "loadingStatus", 7);
940
- this.featureSelect = createEvent(this, "featureSelect", 7);
954
+ this.commentSelect = createEvent(this, "commentSelect", 7);
955
+ this.featureSelectionChange = createEvent(this, "featureSelectionChange", 7);
941
956
  /**
942
957
  * string[]: Valid field types for like and dislike
943
958
  */
@@ -945,6 +960,7 @@ const FeatureDetails = class {
945
960
  this.mapView = undefined;
946
961
  this.graphics = undefined;
947
962
  this.reportingOptions = undefined;
963
+ this.layerItemsHash = undefined;
948
964
  this._likeFieldAvailable = false;
949
965
  this._likeCount = 0;
950
966
  this._disLikeCount = 0;
@@ -953,6 +969,7 @@ const FeatureDetails = class {
953
969
  this._isLikeBtnClicked = false;
954
970
  this._isDislikeBtnClicked = false;
955
971
  this._relatedFeaturesOIDs = undefined;
972
+ this._updating = false;
956
973
  }
957
974
  //--------------------------------------------------------------------------
958
975
  //
@@ -1024,12 +1041,12 @@ const FeatureDetails = class {
1024
1041
  var _a, _b, _c, _d, _e;
1025
1042
  //When related features found show comments list of only those features else comments list will be empty
1026
1043
  const commentsListWhereClause = ((_a = this._relatedFeaturesOIDs) === null || _a === void 0 ? void 0 : _a.length) > 0 ? `objectId in(${this._relatedFeaturesOIDs})` : '1=0';
1027
- return (h("calcite-panel", { key: 'b8d1cc9d4d9040665be3c892f5738a179ab64eaf', "full-height": true }, h("info-card", { key: 'a4c7771bdf84f85b88bd6bf2544e2a1a985fdbbe', allowEditing: false, graphics: this.graphics, highlightEnabled: false, isLoading: false, isMobile: false, mapView: this.mapView, paginationEnabled: false, position: "relative", ref: el => this._infoCard = el }), (this._likeFieldAvailable || this._dislikeFieldAvailable || this._commentsAvailable) &&
1028
- h("div", { key: '2d405f3f722eb4fe0de4212ec4ff3e4b8588db40', class: "buttons-container" }, this._commentsAvailable &&
1029
- h("div", { key: '9454b0cb93e665de20fafb4ca75e1a6d3198a03a', class: "comment-btn" }, h("span", { key: '8c682aa73f9c28b9db5266cfb5ad970f15535241' }, this._relatedFeaturesOIDs.length), h("calcite-icon", { key: 'd920e63f8d1d447afa732bd336f6a09e18ccbd2a', icon: "speech-bubble", scale: 's' })), this._likeFieldAvailable &&
1030
- h("calcite-button", { key: '6b68adcc0b24b1e8d71148182339fa1b6d7922a1', appearance: "transparent", iconEnd: "thumbs-up", kind: this._isLikeBtnClicked ? "brand" : "neutral", onClick: this.onLikeButtonClick.bind(this), scale: 's' }, (_c = (_b = this._likeCount) !== null && _b !== void 0 ? _b : this._selectedGraphic.attributes[this._likeField]) !== null && _c !== void 0 ? _c : 0), this._dislikeFieldAvailable &&
1031
- h("calcite-button", { key: '7c365fdaf5a3de12745e4a7b7a79dc8ec5e37cc0', appearance: "transparent", iconEnd: "thumbs-down", kind: this._isDislikeBtnClicked ? "brand" : "neutral", onClick: this.onDislikeButtonClick.bind(this), scale: 's' }, (_e = (_d = this._disLikeCount) !== null && _d !== void 0 ? _d : this._selectedGraphic.attributes[this._dislikeField]) !== null && _e !== void 0 ? _e : 0)), this.relatedTableId && this._commentsAvailable &&
1032
- h("feature-list", { key: '7b2b92b001dcdeb51d7ae1c1b39dc263f5ed1934', class: "height-full", mapView: this.mapView, pageSize: 5, ref: el => this._commentsList = el, selectedLayerId: this.relatedTableId, showInitialLoading: false, textSize: "small", whereClause: commentsListWhereClause })));
1044
+ return (h("calcite-panel", { key: '8d7069fec0df2a6217c175df6171376b4412c548', "full-height": true }, h("info-card", { key: '3713b783371bcb36a9b844196033326941d833f5', allowEditing: false, graphics: this.graphics, highlightEnabled: false, isLoading: false, isMobile: false, mapView: this.mapView, onSelectionChanged: (e) => { this.featureSelectionChange.emit(e.detail); }, paginationEnabled: false, position: "relative", ref: el => this._infoCard = el }), (this._likeFieldAvailable || this._dislikeFieldAvailable || this._commentsAvailable) &&
1045
+ h("div", { key: '8c84e82708fab0d6091050672b26e6fa2de59345', class: "buttons-container" }, this._commentsAvailable &&
1046
+ h("div", { key: '22edb3f17ef6a2bdef67e5e94492966986d452b7', class: "comment-btn" }, h("span", { key: '03b7eb0aff4358aac3020b3d6d52a2d47b308a41' }, this._relatedFeaturesOIDs.length), h("calcite-icon", { key: '5225e156b45a15db0055a28ed21bc3511dedc706', icon: "speech-bubble", scale: 's' })), this._likeFieldAvailable &&
1047
+ h("calcite-button", { key: '1a291524d46c6f826813c87f781e7d6bcf5bc097', appearance: "transparent", iconEnd: "thumbs-up", kind: this._isLikeBtnClicked ? "brand" : "neutral", loading: this._updating, onClick: this.onLikeButtonClick.bind(this), scale: 'm' }, (_c = (_b = this._likeCount) !== null && _b !== void 0 ? _b : this._selectedGraphic.attributes[this._likeField]) !== null && _c !== void 0 ? _c : 0), this._dislikeFieldAvailable &&
1048
+ h("calcite-button", { key: 'da6bee2189565c1eb70564b340e742494bac35c9', appearance: "transparent", iconEnd: "thumbs-down", kind: this._isDislikeBtnClicked ? "brand" : "neutral", loading: this._updating, onClick: this.onDislikeButtonClick.bind(this), scale: 'm' }, (_e = (_d = this._disLikeCount) !== null && _d !== void 0 ? _d : this._selectedGraphic.attributes[this._dislikeField]) !== null && _e !== void 0 ? _e : 0)), this.relatedTableId && this._commentsAvailable &&
1049
+ h("feature-list", { key: 'fd6faa9f3404a2dfadb102ca7c578ffb47207729', class: "height-full", mapView: this.mapView, onFeatureSelect: (e) => { this.commentSelect.emit(e.detail); }, pageSize: 5, ref: el => this._commentsList = el, selectedLayerId: this.relatedTableId, showErrorWhenNoFeatures: false, showInitialLoading: false, textSize: "small", whereClause: commentsListWhereClause })));
1033
1050
  }
1034
1051
  /**
1035
1052
  * Load esri javascript api modules
@@ -1066,7 +1083,8 @@ const FeatureDetails = class {
1066
1083
  async processComments() {
1067
1084
  var _a;
1068
1085
  const selectedLayer = this._selectedGraphic.layer;
1069
- const commentsConfigured = this.reportingOptions[selectedLayer.id].comment && ((_a = selectedLayer.relationships) === null || _a === void 0 ? void 0 : _a.length) > 0;
1086
+ const commentsConfigured = this.reportingOptions && this.reportingOptions[selectedLayer.id] &&
1087
+ this.reportingOptions[selectedLayer.id].comment && ((_a = selectedLayer.relationships) === null || _a === void 0 ? void 0 : _a.length) > 0;
1070
1088
  if (commentsConfigured) {
1071
1089
  //Get comments table id from map
1072
1090
  const relatedTableIdFromRelnship = selectedLayer.relationships[0].relatedTableId;
@@ -1131,7 +1149,7 @@ const FeatureDetails = class {
1131
1149
  }
1132
1150
  //Check if selected layer have the configured like and dislike field and it is of integer types
1133
1151
  selectedLayer.fields.forEach((eachField) => {
1134
- if (this._validFieldTypes.indexOf(eachField.type) > -1) {
1152
+ if (this._validFieldTypes.indexOf(eachField.type) > -1 && this.layerItemsHash[selectedLayer.id].supportsUpdate) {
1135
1153
  if (eachField.name === likeField && this.reportingOptions[selectedLayer.id].like) {
1136
1154
  likeFieldAvailable = true;
1137
1155
  }
@@ -1166,12 +1184,12 @@ const FeatureDetails = class {
1166
1184
  //Check if selected layer have the configured like and dislike fields
1167
1185
  //also, get the current value for like and dislike field from the attributes
1168
1186
  selectedLayer.fields.forEach((eachField) => {
1169
- if (this._validFieldTypes.indexOf(eachField.type) > -1) {
1170
- if (eachField.name === this._likeField && this.reportingOptions[this._selectedGraphic.layer.id].like) {
1187
+ if (this._validFieldTypes.indexOf(eachField.type) > -1 && this.layerItemsHash[selectedLayer.id].supportsUpdate) {
1188
+ if (eachField.name === this._likeField && this.reportingOptions[selectedLayer.id].like) {
1171
1189
  this._likeFieldAvailable = true;
1172
1190
  this._likeCount = this._selectedGraphic.attributes[eachField.name];
1173
1191
  }
1174
- else if (eachField.name === this._dislikeField && this.reportingOptions[this._selectedGraphic.layer.id].dislike) {
1192
+ else if (eachField.name === this._dislikeField && this.reportingOptions[selectedLayer.id].dislike) {
1175
1193
  this._dislikeFieldAvailable = true;
1176
1194
  this._disLikeCount = this._selectedGraphic.attributes[eachField.name];
1177
1195
  }
@@ -1185,7 +1203,6 @@ const FeatureDetails = class {
1185
1203
  * @protected
1186
1204
  */
1187
1205
  onLikeButtonClick() {
1188
- this.loadingStatus.emit(true);
1189
1206
  if (this._isDislikeBtnClicked && this.reportingOptions[this._selectedGraphic.layer.id].dislike) {
1190
1207
  this.onDislikeButtonClick();
1191
1208
  }
@@ -1203,7 +1220,6 @@ const FeatureDetails = class {
1203
1220
  * @protected
1204
1221
  */
1205
1222
  onDislikeButtonClick() {
1206
- this.loadingStatus.emit(true);
1207
1223
  if (this._isLikeBtnClicked && this.reportingOptions[this._selectedGraphic.layer.id].like) {
1208
1224
  this.onLikeButtonClick();
1209
1225
  }
@@ -1225,6 +1241,7 @@ const FeatureDetails = class {
1225
1241
  async updateFeaturesLikeDislikeField(fieldName, buttonClicked) {
1226
1242
  const attributesToUpdate = {};
1227
1243
  const selectedLayer = this._selectedGraphic.layer;
1244
+ this._updating = true;
1228
1245
  //Increment the value if button is clicked or else decrement it
1229
1246
  const selectFeatureAttr = this._selectedGraphic;
1230
1247
  if (buttonClicked) {
@@ -1248,9 +1265,9 @@ const FeatureDetails = class {
1248
1265
  }
1249
1266
  //store the like dislike value for the current selected graphic in local storage
1250
1267
  this.setInLocalStorage();
1251
- this.loadingStatus.emit(false);
1268
+ this._updating = false;
1252
1269
  }, (err) => {
1253
- this.loadingStatus.emit(false);
1270
+ this._updating = false;
1254
1271
  console.log(err);
1255
1272
  });
1256
1273
  }
@@ -1362,9 +1379,9 @@ const LayerList = class {
1362
1379
  * Renders the component.
1363
1380
  */
1364
1381
  render() {
1365
- return (h(Fragment, { key: 'c73bf36c13fed8120273d8a5321dd60fe4d4b5f4' }, this._isLoading && h("calcite-loader", { key: 'e748d9cc7d1855d3a2da34702ba853d35d1a2cde', label: "", scale: "m" }), !this._isLoading && this.mapView && this._noLayersToDisplay &&
1366
- h("calcite-notice", { key: '4a06b7694fd91456ee5cdc51d33e4ac633d416b2', class: "error-msg", icon: "layers-reference", kind: "danger", open: true }, h("div", { key: '63b09f02312aba71826957c5b2c04a7750bdfca1', slot: "title" }, this._translations.error), h("div", { key: '5a19dfe527a6c66a5477a4c6a14f4686cde73bb3', slot: "message" }, this._translations.noLayerToDisplayErrorMsg)), !this._isLoading && this.mapView &&
1367
- h("calcite-list", { key: 'e8a6170a55f4ba6ea35a1397690c3e365b814886', "selection-appearance": "border", "selection-mode": "none" }, this.renderLayerList())));
1382
+ return (h(Fragment, { key: '9366302a704c1dbdd7a65aef5c43d0ad84a44b23' }, this._isLoading && h("calcite-loader", { key: '69974a23fd42bc37ef13816efbe6d06e28cb2749', label: "", scale: "m" }), !this._isLoading && this.mapView && this._noLayersToDisplay &&
1383
+ h("calcite-notice", { key: 'a93abb55b4db09727b3634cb1935e482c377d662', class: "error-msg", icon: "layers-reference", kind: "danger", open: true }, h("div", { key: 'b9046685353b8894e6c6094cff47fab7a8e07ffa', slot: "title" }, this._translations.error), h("div", { key: '90a052e1d80779a09a32fdd35563a1ce21d582e0', slot: "message" }, this._translations.noLayerToDisplayErrorMsg)), !this._isLoading && this.mapView &&
1384
+ h("calcite-list", { key: '709c1b8edd5710a2476ecef638199c2f929b4165', "selection-appearance": "border", "selection-mode": "none" }, this.renderLayerList())));
1368
1385
  }
1369
1386
  //--------------------------------------------------------------------------
1370
1387
  //
@@ -1392,10 +1409,7 @@ const LayerList = class {
1392
1409
  const allMapLayers = await getAllLayers(this.mapView);
1393
1410
  // eslint-disable-next-line @typescript-eslint/no-misused-promises
1394
1411
  allMapLayers.forEach(async (eachLayer) => {
1395
- var _a, _b;
1396
- //TODO: checking editable condition could be configurable
1397
- if ((eachLayer === null || eachLayer === void 0 ? void 0 : eachLayer.type) === "feature" && (eachLayer === null || eachLayer === void 0 ? void 0 : eachLayer.editingEnabled) && ((_b = (_a = eachLayer === null || eachLayer === void 0 ? void 0 : eachLayer.capabilities) === null || _a === void 0 ? void 0 : _a.operations) === null || _b === void 0 ? void 0 : _b.supportsAdd)) {
1398
- this._layerItemsHash[eachLayer.id].supportsAdd = true;
1412
+ if ((eachLayer === null || eachLayer === void 0 ? void 0 : eachLayer.type) === "feature") {
1399
1413
  if (this.showFeatureCount) {
1400
1414
  const q = eachLayer.createQuery();
1401
1415
  const result = eachLayer.queryFeatureCount(q);
@@ -1428,7 +1442,7 @@ const LayerList = class {
1428
1442
  this.layersListLoaded.emit(this._mapLayerIds);
1429
1443
  }
1430
1444
  /**
1431
- * Returns the ids of all OR configured layers that needs to be shown in the list
1445
+ * Returns the ids of configured layers that needs to be shown in the list
1432
1446
  * @param hash each layer item details
1433
1447
  * @returns array of layer ids
1434
1448
  */
@@ -1436,11 +1450,7 @@ const LayerList = class {
1436
1450
  var _a;
1437
1451
  const configuredLayers = ((_a = this.layers) === null || _a === void 0 ? void 0 : _a.length) > 0 ? this.layers : [];
1438
1452
  return Object.keys(hash).reduce((prev, cur) => {
1439
- let showLayer = true;
1440
- if ((configuredLayers === null || configuredLayers === void 0 ? void 0 : configuredLayers.length) > 0) {
1441
- showLayer = configuredLayers.indexOf(cur) > -1;
1442
- }
1443
- if (showLayer) {
1453
+ if (configuredLayers.indexOf(cur) > -1) {
1444
1454
  prev.push(cur);
1445
1455
  }
1446
1456
  return prev;
@@ -81,7 +81,7 @@ const CardManager = class {
81
81
  var _a, _b;
82
82
  const featuresClass = ((_a = this._graphics) === null || _a === void 0 ? void 0 : _a.length) > 0 ? "" : "display-none";
83
83
  const messageClass = ((_b = this._graphics) === null || _b === void 0 ? void 0 : _b.length) > 0 ? "display-none" : "";
84
- return (h(Host, { key: 'c4b71cefeb5eec1e1312104c519dfb9ef1398d71' }, h("div", { key: '6c1539db40060f9295c8aa72af29eac5f9c67d8d', class: "overflow-auto height-full" }, h("calcite-shell", { key: '2a4f7b47e01e3f27528dbce5fe236187a0f57dab', class: "position-relative " + featuresClass }, h("div", { key: '4b226239c5b80210aa3d42d422bbc50a66bdcf59' }, h("info-card", { key: '55561c22c8685c3ba3daa25c51053fa47d553ba9', graphics: this._graphics, isLoading: this._cardLoading, isMobile: this.isMobile, mapView: this.mapView }))), h("calcite-shell", { key: '8f9156bf9c08920e7731f50daeecb031e9135281', class: "position-relative " + messageClass }, h("div", { key: '0529f9a60349337716ba53f10551b08a34c48209', class: "padding-1" }, h("calcite-notice", { key: '812047f7628598fa6b20e3df00355efee584bb71', icon: "table", open: true }, h("div", { key: 'd7c1b7ab03de1fb30e8e84a6d331d43e69a9946e', slot: "message" }, this._translations.selectFeaturesToStart)))))));
84
+ return (h(Host, { key: '343554e5408de156f1973f6d1e3daa8f1ba90675' }, h("div", { key: '1852562a795002314236052351cab7c29d36854e', class: "overflow-auto height-full" }, h("calcite-shell", { key: '684f013e4397bc50743526357384f782a88a5cd3', class: "position-relative " + featuresClass }, h("div", { key: 'db6d9f4be5448b5596b22f2a4f49c6baefa88466' }, h("info-card", { key: 'be5cec81cae7ca00a5b57c8d9590541f78b67fbd', graphics: this._graphics, isLoading: this._cardLoading, isMobile: this.isMobile, mapView: this.mapView }))), h("calcite-shell", { key: 'df34e0ae6978298130970c60d21203f52fa32e4b', class: "position-relative " + messageClass }, h("div", { key: '9525a95dd21745e211ebf888da44eca6a6c17721', class: "padding-1" }, h("calcite-notice", { key: 'ade0e0a2f09bbe7b7bda6fdb2ce65ba81121e633', icon: "table", open: true }, h("div", { key: 'd6fce2d657e23738720e004177c510c3273017f4', slot: "message" }, this._translations.selectFeaturesToStart)))))));
85
85
  }
86
86
  //--------------------------------------------------------------------------
87
87
  //
@@ -195,7 +195,7 @@ const CrowdsourceManager = class {
195
195
  render() {
196
196
  // only avoid border when we have a header color that is not white
197
197
  const borderClass = this.popupHeaderColor && this.popupHeaderColor !== "#FFFFFF" ? "border-width-0" : "";
198
- return (h(Host, { key: 'adf6957871aa364f3c0d65f949eb94587f065780' }, h("calcite-shell", { key: 'cbe60dd48a1ffb16ca5bf4d7bf7ee96272fed7a5', class: "position-relative" }, h("calcite-panel", { key: '19e98d7bd25c939f3d8860d68c61a5168730eb00', class: `width-full height-full ${borderClass}` }, this._getBody(this._layoutMode, this._panelOpen, this._hideTable)), this._getFooter())));
198
+ return (h(Host, { key: '0f06df71cc424887b8dc4b4929670d94b6548085' }, h("calcite-shell", { key: 'c81a570fb771650de6193e45ffbebd03544eaf2e', class: "position-relative" }, h("calcite-panel", { key: '5e67c2bf9ed0df0080629989f93e89a145349abc', class: `width-full height-full ${borderClass}` }, this._getBody(this._layoutMode, this._panelOpen, this._hideTable)), this._getFooter())));
199
199
  }
200
200
  /**
201
201
  * Called after each render
@@ -81,18 +81,6 @@ const CrowdsourceReporter = class {
81
81
  await this.setMapView();
82
82
  });
83
83
  }
84
- /**
85
- * On Feature details change update the Layer title and the current selected layer id
86
- * @param evt Event hold the details of current feature graphic in the info-card
87
- */
88
- async selectionChanged(evt) {
89
- void this.updatingFeatureDetails(true);
90
- await this.setCurrentFeature(evt.detail.selectedFeature[0]);
91
- void this.highlightOnMap(evt.detail.selectedFeature[0]);
92
- this._selectedFeatureIndex = evt.detail.selectedFeatureIndex;
93
- //update the feature details to reflect the like, dislike and comment values
94
- await this._featureDetails.refresh(evt.detail.selectedFeature[0]);
95
- }
96
84
  //--------------------------------------------------------------------------
97
85
  //
98
86
  // Functions (lifecycle)
@@ -109,9 +97,9 @@ const CrowdsourceReporter = class {
109
97
  await this._initModules();
110
98
  await this._getTranslations();
111
99
  await ((_a = this.mapView) === null || _a === void 0 ? void 0 : _a.when(async () => {
112
- //set configured reporting layers array
100
+ //set configured layers array which are enabled for data collection
113
101
  this._layers = this.reportingOptions ? Object.keys(this.reportingOptions).filter((layerId) => {
114
- return this.reportingOptions[layerId].reporting;
102
+ return this.reportingOptions[layerId].visible;
115
103
  }) : [];
116
104
  await this.setMapView();
117
105
  }));
@@ -121,7 +109,7 @@ const CrowdsourceReporter = class {
121
109
  */
122
110
  render() {
123
111
  const themeClass = this.theme === "dark" ? "calcite-mode-dark" : "calcite-mode-light";
124
- return (h(Host, { key: '530bb7e6dacde9109246733345157c95c1a50dcb' }, this._reportSubmitted && h("calcite-alert", { key: '52abbe347eb4adaf526a3194cb4d389326323d19', "auto-close": true, class: themeClass + " report-submitted-msg", icon: "check-circle", kind: "success", label: "", onCalciteAlertClose: () => { this._reportSubmitted = false; }, open: true, placement: "top" }, h("div", { key: '3251fcd334b449292d3597af996eb7eea08dd00e', slot: "message" }, this.reportSubmittedMessage ? this.reportSubmittedMessage : this._translations.submitMsg)), this._featureCreationFailedErrorMsg && h("calcite-alert", { key: '0d0553df8133b8d20cc0f2d66a8462334117b5cf', "auto-close": true, class: themeClass, icon: "x-octagon", kind: "danger", label: "", onCalciteAlertClose: () => { this._featureCreationFailedErrorMsg = ""; }, open: true, placement: "top" }, h("div", { key: '81658d0eab5392cbddbcf42ccb0b79b0cebc22dd', slot: "title" }, this._translations.error), h("div", { key: 'e4a00bef08ca9121425fd4f3b8ac7bfffa70d371', slot: "message" }, this._featureCreationFailedErrorMsg)), this._commentSubmitted && h("calcite-alert", { key: '97a200eebe63b3f6fb7515fa07c617d40f94815f', "auto-close": true, class: 'report-submitted ' + themeClass, icon: "check-circle", kind: "success", label: "", onCalciteAlertClose: () => { this._commentSubmitted = false; }, open: true, placement: "top" }, h("div", { key: 'b9b01d82faded409059563840a4bc0ce3ef1faf7', slot: "message" }, this._translations.commentSubmittedMsg)), this._addingCommentFailed && h("calcite-alert", { key: '3754d8a1d5d91ac3bf3b1bddc16f078170e61a80', "auto-close": true, class: themeClass, icon: "x-octagon", kind: "danger", label: "", onCalciteAlertClose: () => { this._addingCommentFailed = false; }, open: true, placement: "top" }, h("div", { key: '977b632702e8dc176bd9a9c930c1492539689576', slot: "title" }, this._translations.error), h("div", { key: '45fa0ba61f3831a743b0cc7ae4aa10854b1a9ff5', slot: "message" }, this._translations.addingCommentFailedMsg)), h("div", { key: '57be499cc8fb87ca20c6efa65fbbe9cc47269906' }, h("calcite-shell", { key: '2ce48b4cdd0dc0dd52995cd7b32f476b14ddd49d', "content-behind": true }, this._getReporter())), this.filterModal()));
112
+ return (h(Host, { key: '497227745f29c2afc434349e86da19b088b1eb78' }, this._reportSubmitted && h("calcite-alert", { key: 'd22cceb7124073ad390cd53d97214a2983e97ea0', "auto-close": true, class: themeClass + " report-submitted-msg", icon: "check-circle", kind: "success", label: "", onCalciteAlertClose: () => { this._reportSubmitted = false; }, open: true, placement: "top" }, h("div", { key: '1f98f71fa79cf64e65fecfbceec3862714702609', slot: "message" }, this.reportSubmittedMessage ? this.reportSubmittedMessage : this._translations.submitMsg)), this._featureCreationFailedErrorMsg && h("calcite-alert", { key: '381d3b5a3f5115782634833ad53b4494e888ea97', "auto-close": true, class: themeClass, icon: "x-octagon", kind: "danger", label: "", onCalciteAlertClose: () => { this._featureCreationFailedErrorMsg = ""; }, open: true, placement: "top" }, h("div", { key: '34371959d1272e4bc465e5f5a432d450a156c20b', slot: "title" }, this._translations.error), h("div", { key: '09a55e3325edde43f660a2db1621a4ffd373e09f', slot: "message" }, this._featureCreationFailedErrorMsg)), this._commentSubmitted && h("calcite-alert", { key: '33d79a67575c9a2b14e602e60b702ca82025e20f', "auto-close": true, class: 'report-submitted ' + themeClass, icon: "check-circle", kind: "success", label: "", onCalciteAlertClose: () => { this._commentSubmitted = false; }, open: true, placement: "top" }, h("div", { key: '91b9dcc26cf1f66a116a287a94e8df5c3d2f37bf', slot: "message" }, this._translations.commentSubmittedMsg)), this._addingCommentFailed && h("calcite-alert", { key: '758f1d465d4301fade8fd93a682bfe4b359be2ca', "auto-close": true, class: themeClass, icon: "x-octagon", kind: "danger", label: "", onCalciteAlertClose: () => { this._addingCommentFailed = false; }, open: true, placement: "top" }, h("div", { key: '982424caf90e309701c62c75065d7e7e15d327b4', slot: "title" }, this._translations.error), h("div", { key: '1c93f9f8e1b958ccf8553560c36a32273f16a3a6', slot: "message" }, this._translations.addingCommentFailedMsg)), h("div", { key: '612254cf38da92cf88b90ace8136a2e0859afcae' }, h("calcite-shell", { key: 'bb56100b4dfc355b93d580deee929aad7cfb3f7f', "content-behind": true }, this._getReporter())), this.filterModal()));
125
113
  }
126
114
  //--------------------------------------------------------------------------
127
115
  //
@@ -156,6 +144,14 @@ const CrowdsourceReporter = class {
156
144
  layer.set('visible', !layerId || (layer.id === layerId));
157
145
  });
158
146
  }
147
+ /**
148
+ * Returns the layers configuration
149
+ * @param layerId string layerId of the selected layer
150
+ * @returns Configuration for the layerId
151
+ */
152
+ _getLayersConfig(layerId) {
153
+ return this.reportingOptions && this.reportingOptions[layerId] ? this.reportingOptions[layerId] : null;
154
+ }
159
155
  /**
160
156
  * Get the reporter app functionality
161
157
  * @protected
@@ -279,7 +275,10 @@ const CrowdsourceReporter = class {
279
275
  * @protected
280
276
  */
281
277
  getChooseCategoryFlowItem() {
282
- return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this.reportButtonText ? this.reportButtonText : this._translations.createReportButtonText, onCalciteFlowItemBack: this.backFromSelectedPanel.bind(this) }, this.isMobile && this.getActionToExpandCollapsePanel(), h("calcite-panel", { "full-height": true, "full-width": true }, h("div", { class: "progress-bar" }, h("calcite-progress", { type: "determinate", value: this._updatedProgressBarStatus })), h("calcite-notice", { class: "notice-msg", icon: "lightbulb", kind: "success", open: true }, h("div", { slot: "message" }, this._translations.chooseCategoryMsg)), h("layer-list", { class: "height-full", layers: this._layers, mapView: this.mapView, onLayerSelect: this.navigateToCreateFeature.bind(this), showFeatureCount: false, showNextIcon: false }))));
278
+ const onlyReportingLayers = this.reportingOptions ? Object.keys(this.reportingOptions).filter((layerId) => {
279
+ return this.reportingOptions[layerId].visible && this.reportingOptions[layerId].reporting && this._layerItemsHash[layerId] && this._layerItemsHash[layerId].supportsAdd;
280
+ }) : [];
281
+ return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this.reportButtonText ? this.reportButtonText : this._translations.createReportButtonText, onCalciteFlowItemBack: this.backFromSelectedPanel.bind(this) }, this.isMobile && this.getActionToExpandCollapsePanel(), h("calcite-panel", { "full-height": true, "full-width": true }, h("div", { class: "progress-bar" }, h("calcite-progress", { type: "determinate", value: this._updatedProgressBarStatus })), h("calcite-notice", { class: "notice-msg", icon: "lightbulb", kind: "success", open: true }, h("div", { slot: "message" }, this._translations.chooseCategoryMsg)), h("layer-list", { class: "height-full", layers: onlyReportingLayers, mapView: this.mapView, onLayerSelect: this.navigateToCreateFeature.bind(this), showFeatureCount: false, showNextIcon: false }))));
283
282
  }
284
283
  /**
285
284
  * Get Feature create form of the selected feature layer
@@ -438,16 +437,22 @@ const CrowdsourceReporter = class {
438
437
  const layersListed = evt.detail;
439
438
  //consider only the layers listed in the layer-list component
440
439
  const allMapLayers = await getAllLayers(this.mapView);
440
+ const reportingEnabledLayerIds = [];
441
441
  this._validLayers = [];
442
442
  allMapLayers.forEach((eachLayer) => {
443
+ var _a;
443
444
  if (layersListed.includes(eachLayer.id)) {
444
445
  this._validLayers.push(eachLayer);
446
+ //create list of reporting enabled layers
447
+ if (((_a = this._getLayersConfig(eachLayer.id)) === null || _a === void 0 ? void 0 : _a.reporting) && this._layerItemsHash[eachLayer.id] && this._layerItemsHash[eachLayer.id].supportsAdd) {
448
+ reportingEnabledLayerIds.push(eachLayer.id);
449
+ }
445
450
  }
446
451
  });
447
452
  //handleMap click on layer list loaded
448
453
  this.handleMapClick();
449
- //update the has valid layer state
450
- this._hasValidLayers = layersListed.length > 0;
454
+ //When we have any reporting layer then only show the create report button on layerList
455
+ this._hasValidLayers = reportingEnabledLayerIds.length > 0;
451
456
  //navigate to the feature details if URL params found
452
457
  if (!this._urlParamsLoaded) {
453
458
  this._urlParamsLoaded = true;
@@ -475,8 +480,9 @@ const CrowdsourceReporter = class {
475
480
  backFromSelectedPanel() {
476
481
  this._updatedProgressBarStatus = 0.25;
477
482
  const updatedFlowItems = [...this._flowItems];
478
- // when coming back from comment details page don't clear the highlighted feature of map
479
- if (updatedFlowItems[updatedFlowItems.length - 1] !== 'comment-details') {
483
+ // when back from comment details or add comment page don't clear the highlighted feature of map
484
+ if (!(updatedFlowItems[updatedFlowItems.length - 1] === 'comment-details' ||
485
+ updatedFlowItems[updatedFlowItems.length - 1] === 'add-comment')) {
480
486
  this.clearHighlights();
481
487
  }
482
488
  updatedFlowItems.pop();
@@ -521,6 +527,19 @@ const CrowdsourceReporter = class {
521
527
  async updatingFeatureDetails(isLoading) {
522
528
  this._showLoadingIndicator = isLoading;
523
529
  }
530
+ /**
531
+ * On Feature details change update the Layer title and the current selected layer id
532
+ * @param evt Event hold the details of current feature graphic from the feature-details
533
+ * @protected
534
+ */
535
+ async selectionChanged(evt) {
536
+ void this.updatingFeatureDetails(true);
537
+ await this.setCurrentFeature(evt.detail.selectedFeature[0]);
538
+ void this.highlightOnMap(evt.detail.selectedFeature[0]);
539
+ this._selectedFeatureIndex = evt.detail.selectedFeatureIndex;
540
+ //update the feature details to reflect the like, dislike and comment values
541
+ await this._featureDetails.refresh(evt.detail.selectedFeature[0]);
542
+ }
524
543
  /**
525
544
  * When comment is selected from list store that and show comment details
526
545
  * @param evt Event which has details of selected feature
@@ -538,10 +557,11 @@ const CrowdsourceReporter = class {
538
557
  * @protected
539
558
  */
540
559
  getFeatureListFlowItem(layerId, layerName) {
541
- var _a;
560
+ var _a, _b;
542
561
  const layerExpressions = (_a = this.layerExpressions) === null || _a === void 0 ? void 0 : _a.filter((exp) => exp.id === this._selectedLayerId);
562
+ const canCreateReports = ((_b = this._getLayersConfig(this._selectedLayerId)) === null || _b === void 0 ? void 0 : _b.reporting) && this._layerItemsHash[this._selectedLayerId].supportsAdd;
543
563
  const showFilterIcon = (layerExpressions === null || layerExpressions === void 0 ? void 0 : layerExpressions.length) > 0;
544
- return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: layerName, loading: this._showLoadingIndicator, onCalciteFlowItemBack: this.backFromSelectedPanel.bind(this) }, this._toggleSort(), h("calcite-action", { icon: "sort-ascending-arrow", id: "sort-popover", slot: "header-actions-end", text: this._translations.sort, title: this._translations.sort }), showFilterIcon && h("calcite-action", { icon: "filter", indicator: this._filterActive, onClick: this._toggleFilter.bind(this), slot: "header-actions-end", text: this._translations.filter, title: this._translations.filter }), this.isMobile && this.getActionToExpandCollapsePanel(), this.enableNewReports &&
564
+ return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: layerName, loading: this._showLoadingIndicator, onCalciteFlowItemBack: this.backFromSelectedPanel.bind(this) }, this._toggleSort(), h("calcite-action", { icon: "sort-ascending-arrow", id: "sort-popover", slot: "header-actions-end", text: this._translations.sort, title: this._translations.sort }), showFilterIcon && h("calcite-action", { icon: "filter", indicator: this._filterActive, onClick: this._toggleFilter.bind(this), slot: "header-actions-end", text: this._translations.filter, title: this._translations.filter }), this.isMobile && this.getActionToExpandCollapsePanel(), this.enableNewReports && canCreateReports &&
545
565
  h("calcite-button", { appearance: "solid", onClick: this.navigateToCreateFeature.bind(this), slot: "footer", width: "full" }, this.reportButtonText ? this.reportButtonText : this._translations.createReportButtonText), h("calcite-panel", { "full-height": true }, h("feature-list", { class: "height-full", highlightOnHover: true, mapView: this.mapView, noFeaturesFoundMsg: this._translations.featureErrorMsg, onFeatureSelect: this.onFeatureSelectFromList.bind(this), pageSize: 30, ref: el => this._featureList = el, selectedLayerId: layerId, sortingInfo: this._updatedSorting }))));
546
566
  }
547
567
  /**
@@ -549,8 +569,9 @@ const CrowdsourceReporter = class {
549
569
  * @returns Node
550
570
  */
551
571
  getFeatureDetailsFlowItem() {
552
- const showCommentBtn = this.reportingOptions[this._currentFeature.layer.id].comment && this._currentFeature.layer.relationships.length > 0;
553
- return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this._selectedLayerName, loading: this._showLoadingIndicator, onCalciteFlowItemBack: this.backFromSelectedPanel.bind(this) }, this.isMobile && this.getActionToExpandCollapsePanel(), h("instant-apps-social-share", { autoUpdateShareUrl: false, embed: false, popoverButtonIconScale: "s", ref: el => this._shareNode = el, scale: "m", shareButtonColor: "neutral", shareButtonType: "action", slot: "header-actions-end", socialMedia: true, view: this.mapView }), this._selectedFeature.length > 1 && this.getFeaturesPagination(), h("calcite-panel", null, h("feature-details", { class: 'full-height', graphics: this._selectedFeature, mapView: this.mapView, onFeatureSelect: this.onCommentSelectFromList.bind(this), onLoadingStatus: (evt) => void this.updatingFeatureDetails(evt.detail), ref: el => this._featureDetails = el, reportingOptions: this.reportingOptions }), showCommentBtn &&
572
+ var _a;
573
+ const showCommentBtn = ((_a = this._getLayersConfig(this._selectedLayerId)) === null || _a === void 0 ? void 0 : _a.comment) && this._selectedLayer.relationships.length > 0;
574
+ return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this._selectedLayerName, loading: this._showLoadingIndicator, onCalciteFlowItemBack: this.backFromSelectedPanel.bind(this) }, this.isMobile && this.getActionToExpandCollapsePanel(), h("instant-apps-social-share", { autoUpdateShareUrl: false, embed: false, popoverButtonIconScale: "s", ref: el => this._shareNode = el, removePopoverOffset: true, scale: "s", shareButtonColor: "neutral", shareButtonType: "action", slot: "header-actions-end", socialMedia: true, view: this.mapView }), this._selectedFeature.length > 1 && this.getFeaturesPagination(), h("calcite-panel", null, h("feature-details", { class: 'full-height', graphics: this._selectedFeature, layerItemsHash: this._layerItemsHash, mapView: this.mapView, onCommentSelect: this.onCommentSelectFromList.bind(this), onFeatureSelectionChange: this.selectionChanged.bind(this), onLoadingStatus: (evt) => void this.updatingFeatureDetails(evt.detail), ref: el => this._featureDetails = el, reportingOptions: this.reportingOptions }), showCommentBtn &&
554
575
  h("calcite-button", { appearance: "solid", onClick: () => this._flowItems = [...this._flowItems, "add-comment"], slot: "footer", width: "full" }, this._translations.comment))));
555
576
  }
556
577
  /**
@@ -588,13 +609,14 @@ const CrowdsourceReporter = class {
588
609
  * @param selectedFeature Graphic currently shown in feature details
589
610
  */
590
611
  async setCurrentFeature(selectedFeature) {
612
+ var _a;
591
613
  this._currentFeature = selectedFeature;
592
614
  if (selectedFeature && selectedFeature.layer) {
593
615
  const layer = selectedFeature.layer;
594
616
  void this.setSelectedLayer(layer.id, layer.title);
595
617
  this._currentFeatureId = selectedFeature.attributes[layer.objectIdField];
596
618
  // check if comments are configured and relationship is present then only get the related table
597
- const isCommentTablePresent = this.reportingOptions[selectedFeature.layer.id].comment && selectedFeature.layer.relationships.length > 0;
619
+ const isCommentTablePresent = ((_a = this._getLayersConfig(layer.id)) === null || _a === void 0 ? void 0 : _a.comment) && layer.relationships.length > 0;
598
620
  if (isCommentTablePresent) {
599
621
  await this.getRelatedTable();
600
622
  }
@@ -708,12 +730,12 @@ const CrowdsourceReporter = class {
708
730
  await this.setSelectedFeatures(reportingLayerGraphics);
709
731
  //if featureDetails not open then add it to the list else just reInit flowItems which will update details with newly selected features
710
732
  // eslint-disable-next-line unicorn/prefer-ternary
711
- if (this._flowItems.length && this._flowItems[this._flowItems.length - 1] !== "feature-details") {
712
- this._flowItems = [...this._flowItems, "feature-details"];
733
+ if (this._flowItems.length && this._flowItems.includes("feature-details")) {
734
+ this._flowItems = [...this._flowItems.slice(0, this._flowItems.indexOf("feature-details") + 1)];
735
+ await this.highlightOnMap(clickedGraphics[0]);
713
736
  }
714
737
  else {
715
- this._flowItems = [...this._flowItems];
716
- void this.highlightOnMap(clickedGraphics[0]);
738
+ this._flowItems = [...this._flowItems, "feature-details"];
717
739
  }
718
740
  }
719
741
  // if clicked graphic's layer is from non reporting layers then show popup on map
@@ -756,13 +778,11 @@ const CrowdsourceReporter = class {
756
778
  * @returns array of editable layer ids
757
779
  */
758
780
  reduceToConfiguredLayers(hash) {
759
- var _a;
760
- const configuredLayers = ((_a = this._layers) === null || _a === void 0 ? void 0 : _a.length) > 0 ? this._layers : [];
761
781
  return Object.keys(hash).reduce((prev, cur) => {
762
- let showLayer = hash[cur].supportsAdd;
763
- if ((configuredLayers === null || configuredLayers === void 0 ? void 0 : configuredLayers.length) > 0) {
764
- showLayer = configuredLayers.indexOf(cur) > -1 ? hash[cur].supportsAdd : false;
765
- }
782
+ var _a;
783
+ // check if reporting options exists consider the visible prop if else just check the supports Add
784
+ const showLayer = this.reportingOptions ? (_a = this._getLayersConfig(cur)) === null || _a === void 0 ? void 0 : _a.visible
785
+ : hash[cur].supportsAdd;
766
786
  if (showLayer) {
767
787
  prev.push(cur);
768
788
  }
@@ -783,18 +803,19 @@ const CrowdsourceReporter = class {
783
803
  }
784
804
  });
785
805
  this._editableLayerIds = this.reduceToConfiguredLayers(layerItemsHash);
806
+ this._layerItemsHash = layerItemsHash;
786
807
  }
787
808
  /**
788
809
  * renders feature list
789
810
  * @protected
790
811
  */
791
812
  async renderFeaturesList() {
813
+ this._flowItems = ['feature-list'];
792
814
  const evt = {
793
815
  detail: this._editableLayerIds
794
816
  };
795
817
  await this.layerListLoaded(evt);
796
818
  void this.setSelectedLayer(this._validLayers[0].id, this._validLayers[0].title);
797
- this._flowItems = ['feature-list'];
798
819
  }
799
820
  /**
800
821
  * Updates the share url for current selected feature
@@ -842,7 +863,7 @@ const CrowdsourceReporter = class {
842
863
  const featureSet = await queryFeaturesByID([Number(this.objectId)], layer, [], true, this.mapView.spatialReference);
843
864
  if (featureSet.length) {
844
865
  //update the selectedFeature
845
- this._selectedFeature = featureSet;
866
+ await this.setSelectedFeatures(featureSet);
846
867
  //if featureDetails not open then add it to the list else just reInit flowItems which will update details with newly selected features
847
868
  // eslint-disable-next-line unicorn/prefer-ternary
848
869
  if (this._flowItems.length && this._flowItems[this._flowItems.length - 1] !== "feature-details") {
@@ -851,7 +872,6 @@ const CrowdsourceReporter = class {
851
872
  else {
852
873
  this._flowItems = [...this._flowItems];
853
874
  }
854
- await this.highlightOnMap(featureSet[0]);
855
875
  }
856
876
  }
857
877
  }
@@ -14,7 +14,7 @@ import './index-a1e91462.js';
14
14
  import './restHelpersGet-1bd54274.js';
15
15
  import './interfaces-586e863c.js';
16
16
 
17
- const featureListCss = ":host{display:block}.width-full{width:100%}.pagination{display:flex;justify-content:center}.error-msg{padding:10px;width:calc(100% - 20px)}.feature-list-popup-title{font-weight:500;padding:10px 12px}.feature-list-popup-title-small{font-size:small;padding:10px 12px}";
17
+ const featureListCss = ":host{display:block}.width-full{width:100%}.pagination{display:flex;justify-content:center}.error-msg{padding:10px;width:calc(100% - 20px)}.feature-list-popup-title{font-weight:500;padding:10px 12px;white-space:pre-line}.feature-list-popup-title-small{font-size:small;padding:10px 12px;white-space:pre-line}";
18
18
  const FeatureListStyle0 = featureListCss;
19
19
 
20
20
  const FeatureList = class {
@@ -31,6 +31,7 @@ const FeatureList = class {
31
31
  this.whereClause = undefined;
32
32
  this.textSize = "large";
33
33
  this.showInitialLoading = true;
34
+ this.showErrorWhenNoFeatures = true;
34
35
  this._featureItems = [];
35
36
  this._featuresCount = 0;
36
37
  this._isLoading = false;
@@ -98,9 +99,9 @@ const FeatureList = class {
98
99
  * Renders the component.
99
100
  */
100
101
  render() {
101
- return (h("calcite-panel", { key: '9f702c6d98cc19704e0773e36fd969817ea7262e', "full-height": true, "full-width": true }, this._isLoading && h("calcite-loader", { key: 'e9acf13f3444057b097d6b145c1a6e0118f150ea', label: "", scale: "m" }), this._featureItems.length === 0 && !this._isLoading &&
102
- h("calcite-notice", { key: '8c7fa89e2da7490b04456e51f8534c2515a02399', class: "error-msg", icon: "feature-details", kind: "info", open: true }, h("div", { key: '799d419e9c26b7928f15cb1cf9afa9f47cab0e94', slot: "message" }, this.noFeaturesFoundMsg ? this.noFeaturesFoundMsg : this._translations.featureErrorMsg)), h("calcite-list", { key: '82c60b16ab586ad57f8f98bb08814f688102b166', "selection-appearance": "border", "selection-mode": "none" }, !this._isLoading && this._featureItems.length > 0 && this._featureItems), this._featuresCount > this.pageSize &&
103
- h("div", { key: 'e5b789ea46c6bedfbe83f1323ffb89271c0b76ce', class: "width-full", slot: "footer" }, h("calcite-pagination", { key: '4d30b5364fc4742f278157c5f2c21e75d4ecb0b8', class: "pagination", "full-width": true, onCalcitePaginationChange: this.pageChanged.bind(this), "page-size": this.pageSize, ref: el => this._pagination = el, "start-item": "1", "total-items": this._featuresCount }))));
102
+ return (h("calcite-panel", { key: '6184d07592669fd8884996475b7eeb26e0604790', "full-height": true, "full-width": true }, this._isLoading && h("calcite-loader", { key: '282127215213a28b9cfdf484aaf5730145b6bb55', label: "", scale: "m" }), this.showErrorWhenNoFeatures && this._featureItems.length === 0 && !this._isLoading &&
103
+ h("calcite-notice", { key: '25fcfeb1d19a089b092050515c3d69401bc17dc8', class: "error-msg", icon: "feature-details", kind: "info", open: true }, h("div", { key: '2ac81a338df9d0e0f43c659a24be0c9b7b95d027', slot: "message" }, this.noFeaturesFoundMsg ? this.noFeaturesFoundMsg : this._translations.featureErrorMsg)), h("calcite-list", { key: '70453e8ded4f859076a5f00d8f04152cd78278d8', "selection-appearance": "border", "selection-mode": "none" }, !this._isLoading && this._featureItems.length > 0 && this._featureItems), this._featuresCount > this.pageSize &&
104
+ h("div", { key: 'db1003ace54cd599acefad04e94fe54248327126', class: "width-full", slot: "footer" }, h("calcite-pagination", { key: '67764a051381b0e7ef26dbd16dc9226d7e152c20', class: "pagination", "full-width": true, onCalcitePaginationChange: this.pageChanged.bind(this), "page-size": this.pageSize, ref: el => this._pagination = el, "start-item": "1", "total-items": this._featuresCount }))));
104
105
  }
105
106
  //--------------------------------------------------------------------------
106
107
  //
@@ -234,7 +234,8 @@ async function handleFilter(data, info, infoIndex, filterMode, parentLegendEleme
234
234
  const [FeatureFilter, FeatureEffect] = await loadModules(['esri/layers/support/FeatureFilter', 'esri/layers/support/FeatureEffect']);
235
235
  const { queryExpressions, fLayerView } = data;
236
236
  generateQueryExpressions(data, info, infoIndex, parentLegendElementInfo);
237
- const where = queryExpressions.join(' OR ');
237
+ const sep = queryExpressions.every(expression => expression && expression.includes('<>')) ? ' AND ' : ' OR ';
238
+ const where = queryExpressions.join(sep);
238
239
  const timeExtent = (_b = (_a = fLayerView === null || fLayerView === void 0 ? void 0 : fLayerView.filter) === null || _a === void 0 ? void 0 : _a.timeExtent) !== null && _b !== void 0 ? _b : null;
239
240
  const { type } = filterMode;
240
241
  if (type === 'filter') {
@@ -877,4 +878,4 @@ function getExistingFilter(fLayerView) {
877
878
  return (fLayerView === null || fLayerView === void 0 ? void 0 : fLayerView.filter) || ((_a = fLayerView === null || fLayerView === void 0 ? void 0 : fLayerView.featureEffect) === null || _a === void 0 ? void 0 : _a.filter);
878
879
  }
879
880
 
880
- export { generateData as a, getParentLegendElementInfoData as b, getCategoryData as c, checkNoneSelected as d, handleFeatureCount as e, createInteractiveLegendDataForLayer as f, getTheme as g, handleFilterChange as h, interactiveLegendState as i, handleFilter as j, getIntLegendLayerData as k, checkNestedUniqueSymbolLegendElement as l, checkRelationshipRamp as m, showAllNestedUniqueSymbol as n, showAll as o, getMergedEffect as p, getCategoriesArray as q, checkNestedUniqueSymbol as r, store as s, calculateTotalFeatureCountForNestedSymbols as t, updateStore as u, validateInteractivity as v, calculateTotalCount as w, getNestedInfoData as x, zoomTo as z };
881
+ export { getParentLegendElementInfoData as a, getCategoryData as b, checkNoneSelected as c, handleFeatureCount as d, generateData as e, createInteractiveLegendDataForLayer as f, getTheme as g, handleFilterChange as h, interactiveLegendState as i, handleFilter as j, getIntLegendLayerData as k, checkNestedUniqueSymbolLegendElement as l, checkRelationshipRamp as m, showAllNestedUniqueSymbol as n, showAll as o, getMergedEffect as p, getCategoriesArray as q, checkNestedUniqueSymbol as r, store as s, calculateTotalFeatureCountForNestedSymbols as t, updateStore as u, validateInteractivity as v, calculateTotalCount as w, getNestedInfoData as x, zoomTo as z };