@esri/solutions-components 0.8.23 → 0.8.25

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.
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
@@ -351,6 +351,10 @@ const CreateFeature = class {
351
351
  this.drawComplete = index.createEvent(this, "drawComplete", 7);
352
352
  this.editingAttachment = index.createEvent(this, "editingAttachment", 7);
353
353
  this.progressStatus = index.createEvent(this, "progressStatus", 7);
354
+ /**
355
+ * boolean: Flag to maintain form submission using submit button
356
+ */
357
+ this._isSubmitBtnClicked = false;
354
358
  this.mapView = undefined;
355
359
  this.selectedLayerId = undefined;
356
360
  this.customizeSubmit = false;
@@ -390,6 +394,7 @@ const CreateFeature = class {
390
394
  */
391
395
  async submit() {
392
396
  if (this._editor) {
397
+ this._isSubmitBtnClicked = true;
393
398
  this._editor.viewModel.featureFormViewModel.submit();
394
399
  }
395
400
  }
@@ -416,7 +421,7 @@ const CreateFeature = class {
416
421
  */
417
422
  render() {
418
423
  const showSearchWidget = this.showSearchWidget ? '' : 'display-none';
419
- return (index.h(index.Fragment, { key: '66e42055c22a93c6d34440b65ac950a388639b9a' }, index.h("div", { key: 'fc4bf1fc039e4d914e416a394f0671712d116482', id: "feature-form" }), index.h("div", { key: 'aadd529366b2b85e60fdffc306cf41f37c2a6709', class: `search-widget ${showSearchWidget}`, id: "search-widget-ref" })));
424
+ return (index.h(index.Fragment, { key: 'd11a16053bc5eb86a09fd3bc35c9a89cee6dd064' }, index.h("div", { key: '0320bb0ca9fc069306151078c66fbee11060fcab', id: "feature-form" }), index.h("div", { key: '8aaa13e87213a880382ca408d324beb79ba7a500', class: `search-widget ${showSearchWidget}`, id: "search-widget-ref" })));
420
425
  }
421
426
  //--------------------------------------------------------------------------
422
427
  //
@@ -662,11 +667,13 @@ const CreateFeature = class {
662
667
  var _a;
663
668
  //return if any attribute is invalid , focus will be shifted to the invalid attribute in feature form
664
669
  if (evt.invalid.length) {
670
+ this._isSubmitBtnClicked = false;
665
671
  return;
666
672
  }
667
673
  //Submit only when valid attributes
668
674
  //emit success or fail based on the result
669
- if (evt.valid.length) {
675
+ if (evt.valid.length && this._isSubmitBtnClicked) {
676
+ this._isSubmitBtnClicked = false;
670
677
  try {
671
678
  await this._editor.activeWorkflow.commit();
672
679
  //throw errors if any failures
@@ -701,6 +708,10 @@ const CreateRelatedFeature = class {
701
708
  this.success = index.createEvent(this, "success", 7);
702
709
  this.fail = index.createEvent(this, "fail", 7);
703
710
  this.isActionPending = index.createEvent(this, "isActionPending", 7);
711
+ /**
712
+ * boolean: Flag to maintain form submission using submit button
713
+ */
714
+ this._isSubmitBtnClicked = false;
704
715
  this.mapView = undefined;
705
716
  this.table = undefined;
706
717
  this.selectedFeature = undefined;
@@ -737,6 +748,7 @@ const CreateRelatedFeature = class {
737
748
  */
738
749
  async submit() {
739
750
  if (this._editor) {
751
+ this._isSubmitBtnClicked = true;
740
752
  this._editor.viewModel.featureFormViewModel.submit();
741
753
  }
742
754
  }
@@ -774,7 +786,7 @@ const CreateRelatedFeature = class {
774
786
  this.reactiveUtils = reactiveUtils;
775
787
  }
776
788
  render() {
777
- return (index.h(index.Host, { key: '9807b7dcad1f8305756e6098f1e64ef8caffcbac' }));
789
+ return (index.h(index.Host, { key: '8c32e05707b6e5501759caaef5d89f8da40640e4' }));
778
790
  }
779
791
  /**
780
792
  * StencilJS: Called once just after the component is fully loaded and the first render() occurs.
@@ -904,11 +916,13 @@ const CreateRelatedFeature = class {
904
916
  var _a;
905
917
  //return if any attribute is invalid , focus will be shifted to the invalid attribute in feature form
906
918
  if (evt.invalid.length) {
919
+ this._isSubmitBtnClicked = false;
907
920
  return;
908
921
  }
909
922
  //Submit only when valid attributes
910
923
  //emit success or fail based on the result
911
- if (evt.valid.length) {
924
+ if (evt.valid.length && this._isSubmitBtnClicked) {
925
+ this._isSubmitBtnClicked = false;
912
926
  try {
913
927
  await this._editor.activeWorkflow.commit();
914
928
  //throw errors if any failures
@@ -934,14 +948,15 @@ const CreateRelatedFeature = class {
934
948
  };
935
949
  CreateRelatedFeature.style = CreateRelatedFeatureStyle0;
936
950
 
937
- 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}";
951
+ 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}";
938
952
  const FeatureDetailsStyle0 = featureDetailsCss;
939
953
 
940
954
  const FeatureDetails = class {
941
955
  constructor(hostRef) {
942
956
  index.registerInstance(this, hostRef);
943
957
  this.loadingStatus = index.createEvent(this, "loadingStatus", 7);
944
- this.featureSelect = index.createEvent(this, "featureSelect", 7);
958
+ this.commentSelect = index.createEvent(this, "commentSelect", 7);
959
+ this.featureSelectionChange = index.createEvent(this, "featureSelectionChange", 7);
945
960
  /**
946
961
  * string[]: Valid field types for like and dislike
947
962
  */
@@ -949,6 +964,7 @@ const FeatureDetails = class {
949
964
  this.mapView = undefined;
950
965
  this.graphics = undefined;
951
966
  this.reportingOptions = undefined;
967
+ this.layerItemsHash = undefined;
952
968
  this._likeFieldAvailable = false;
953
969
  this._likeCount = 0;
954
970
  this._disLikeCount = 0;
@@ -957,6 +973,7 @@ const FeatureDetails = class {
957
973
  this._isLikeBtnClicked = false;
958
974
  this._isDislikeBtnClicked = false;
959
975
  this._relatedFeaturesOIDs = undefined;
976
+ this._updating = false;
960
977
  }
961
978
  //--------------------------------------------------------------------------
962
979
  //
@@ -1028,12 +1045,12 @@ const FeatureDetails = class {
1028
1045
  var _a, _b, _c, _d, _e;
1029
1046
  //When related features found show comments list of only those features else comments list will be empty
1030
1047
  const commentsListWhereClause = ((_a = this._relatedFeaturesOIDs) === null || _a === void 0 ? void 0 : _a.length) > 0 ? `objectId in(${this._relatedFeaturesOIDs})` : '1=0';
1031
- return (index.h("calcite-panel", { key: 'b8d1cc9d4d9040665be3c892f5738a179ab64eaf', "full-height": true }, index.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) &&
1032
- index.h("div", { key: '2d405f3f722eb4fe0de4212ec4ff3e4b8588db40', class: "buttons-container" }, this._commentsAvailable &&
1033
- index.h("div", { key: '9454b0cb93e665de20fafb4ca75e1a6d3198a03a', class: "comment-btn" }, index.h("span", { key: '8c682aa73f9c28b9db5266cfb5ad970f15535241' }, this._relatedFeaturesOIDs.length), index.h("calcite-icon", { key: 'd920e63f8d1d447afa732bd336f6a09e18ccbd2a', icon: "speech-bubble", scale: 's' })), this._likeFieldAvailable &&
1034
- index.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 &&
1035
- index.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 &&
1036
- index.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 })));
1048
+ return (index.h("calcite-panel", { key: '8d7069fec0df2a6217c175df6171376b4412c548', "full-height": true }, index.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) &&
1049
+ index.h("div", { key: '8c84e82708fab0d6091050672b26e6fa2de59345', class: "buttons-container" }, this._commentsAvailable &&
1050
+ index.h("div", { key: '22edb3f17ef6a2bdef67e5e94492966986d452b7', class: "comment-btn" }, index.h("span", { key: '03b7eb0aff4358aac3020b3d6d52a2d47b308a41' }, this._relatedFeaturesOIDs.length), index.h("calcite-icon", { key: '5225e156b45a15db0055a28ed21bc3511dedc706', icon: "speech-bubble", scale: 's' })), this._likeFieldAvailable &&
1051
+ index.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 &&
1052
+ index.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 &&
1053
+ index.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 })));
1037
1054
  }
1038
1055
  /**
1039
1056
  * Load esri javascript api modules
@@ -1070,7 +1087,8 @@ const FeatureDetails = class {
1070
1087
  async processComments() {
1071
1088
  var _a;
1072
1089
  const selectedLayer = this._selectedGraphic.layer;
1073
- const commentsConfigured = this.reportingOptions[selectedLayer.id].comment && ((_a = selectedLayer.relationships) === null || _a === void 0 ? void 0 : _a.length) > 0;
1090
+ const commentsConfigured = this.reportingOptions && this.reportingOptions[selectedLayer.id] &&
1091
+ this.reportingOptions[selectedLayer.id].comment && ((_a = selectedLayer.relationships) === null || _a === void 0 ? void 0 : _a.length) > 0;
1074
1092
  if (commentsConfigured) {
1075
1093
  //Get comments table id from map
1076
1094
  const relatedTableIdFromRelnship = selectedLayer.relationships[0].relatedTableId;
@@ -1135,7 +1153,7 @@ const FeatureDetails = class {
1135
1153
  }
1136
1154
  //Check if selected layer have the configured like and dislike field and it is of integer types
1137
1155
  selectedLayer.fields.forEach((eachField) => {
1138
- if (this._validFieldTypes.indexOf(eachField.type) > -1) {
1156
+ if (this._validFieldTypes.indexOf(eachField.type) > -1 && this.layerItemsHash[selectedLayer.id].supportsUpdate) {
1139
1157
  if (eachField.name === likeField && this.reportingOptions[selectedLayer.id].like) {
1140
1158
  likeFieldAvailable = true;
1141
1159
  }
@@ -1170,12 +1188,12 @@ const FeatureDetails = class {
1170
1188
  //Check if selected layer have the configured like and dislike fields
1171
1189
  //also, get the current value for like and dislike field from the attributes
1172
1190
  selectedLayer.fields.forEach((eachField) => {
1173
- if (this._validFieldTypes.indexOf(eachField.type) > -1) {
1174
- if (eachField.name === this._likeField && this.reportingOptions[this._selectedGraphic.layer.id].like) {
1191
+ if (this._validFieldTypes.indexOf(eachField.type) > -1 && this.layerItemsHash[selectedLayer.id].supportsUpdate) {
1192
+ if (eachField.name === this._likeField && this.reportingOptions[selectedLayer.id].like) {
1175
1193
  this._likeFieldAvailable = true;
1176
1194
  this._likeCount = this._selectedGraphic.attributes[eachField.name];
1177
1195
  }
1178
- else if (eachField.name === this._dislikeField && this.reportingOptions[this._selectedGraphic.layer.id].dislike) {
1196
+ else if (eachField.name === this._dislikeField && this.reportingOptions[selectedLayer.id].dislike) {
1179
1197
  this._dislikeFieldAvailable = true;
1180
1198
  this._disLikeCount = this._selectedGraphic.attributes[eachField.name];
1181
1199
  }
@@ -1189,7 +1207,6 @@ const FeatureDetails = class {
1189
1207
  * @protected
1190
1208
  */
1191
1209
  onLikeButtonClick() {
1192
- this.loadingStatus.emit(true);
1193
1210
  if (this._isDislikeBtnClicked && this.reportingOptions[this._selectedGraphic.layer.id].dislike) {
1194
1211
  this.onDislikeButtonClick();
1195
1212
  }
@@ -1207,7 +1224,6 @@ const FeatureDetails = class {
1207
1224
  * @protected
1208
1225
  */
1209
1226
  onDislikeButtonClick() {
1210
- this.loadingStatus.emit(true);
1211
1227
  if (this._isLikeBtnClicked && this.reportingOptions[this._selectedGraphic.layer.id].like) {
1212
1228
  this.onLikeButtonClick();
1213
1229
  }
@@ -1229,6 +1245,7 @@ const FeatureDetails = class {
1229
1245
  async updateFeaturesLikeDislikeField(fieldName, buttonClicked) {
1230
1246
  const attributesToUpdate = {};
1231
1247
  const selectedLayer = this._selectedGraphic.layer;
1248
+ this._updating = true;
1232
1249
  //Increment the value if button is clicked or else decrement it
1233
1250
  const selectFeatureAttr = this._selectedGraphic;
1234
1251
  if (buttonClicked) {
@@ -1252,9 +1269,9 @@ const FeatureDetails = class {
1252
1269
  }
1253
1270
  //store the like dislike value for the current selected graphic in local storage
1254
1271
  this.setInLocalStorage();
1255
- this.loadingStatus.emit(false);
1272
+ this._updating = false;
1256
1273
  }, (err) => {
1257
- this.loadingStatus.emit(false);
1274
+ this._updating = false;
1258
1275
  console.log(err);
1259
1276
  });
1260
1277
  }
@@ -1366,9 +1383,9 @@ const LayerList = class {
1366
1383
  * Renders the component.
1367
1384
  */
1368
1385
  render() {
1369
- return (index.h(index.Fragment, { key: 'c73bf36c13fed8120273d8a5321dd60fe4d4b5f4' }, this._isLoading && index.h("calcite-loader", { key: 'e748d9cc7d1855d3a2da34702ba853d35d1a2cde', label: "", scale: "m" }), !this._isLoading && this.mapView && this._noLayersToDisplay &&
1370
- index.h("calcite-notice", { key: '4a06b7694fd91456ee5cdc51d33e4ac633d416b2', class: "error-msg", icon: "layers-reference", kind: "danger", open: true }, index.h("div", { key: '63b09f02312aba71826957c5b2c04a7750bdfca1', slot: "title" }, this._translations.error), index.h("div", { key: '5a19dfe527a6c66a5477a4c6a14f4686cde73bb3', slot: "message" }, this._translations.noLayerToDisplayErrorMsg)), !this._isLoading && this.mapView &&
1371
- index.h("calcite-list", { key: 'e8a6170a55f4ba6ea35a1397690c3e365b814886', "selection-appearance": "border", "selection-mode": "none" }, this.renderLayerList())));
1386
+ return (index.h(index.Fragment, { key: '9366302a704c1dbdd7a65aef5c43d0ad84a44b23' }, this._isLoading && index.h("calcite-loader", { key: '69974a23fd42bc37ef13816efbe6d06e28cb2749', label: "", scale: "m" }), !this._isLoading && this.mapView && this._noLayersToDisplay &&
1387
+ index.h("calcite-notice", { key: 'a93abb55b4db09727b3634cb1935e482c377d662', class: "error-msg", icon: "layers-reference", kind: "danger", open: true }, index.h("div", { key: 'b9046685353b8894e6c6094cff47fab7a8e07ffa', slot: "title" }, this._translations.error), index.h("div", { key: '90a052e1d80779a09a32fdd35563a1ce21d582e0', slot: "message" }, this._translations.noLayerToDisplayErrorMsg)), !this._isLoading && this.mapView &&
1388
+ index.h("calcite-list", { key: '709c1b8edd5710a2476ecef638199c2f929b4165', "selection-appearance": "border", "selection-mode": "none" }, this.renderLayerList())));
1372
1389
  }
1373
1390
  //--------------------------------------------------------------------------
1374
1391
  //
@@ -1396,10 +1413,7 @@ const LayerList = class {
1396
1413
  const allMapLayers = await mapViewUtils.getAllLayers(this.mapView);
1397
1414
  // eslint-disable-next-line @typescript-eslint/no-misused-promises
1398
1415
  allMapLayers.forEach(async (eachLayer) => {
1399
- var _a, _b;
1400
- //TODO: checking editable condition could be configurable
1401
- 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)) {
1402
- this._layerItemsHash[eachLayer.id].supportsAdd = true;
1416
+ if ((eachLayer === null || eachLayer === void 0 ? void 0 : eachLayer.type) === "feature") {
1403
1417
  if (this.showFeatureCount) {
1404
1418
  const q = eachLayer.createQuery();
1405
1419
  const result = eachLayer.queryFeatureCount(q);
@@ -1432,7 +1446,7 @@ const LayerList = class {
1432
1446
  this.layersListLoaded.emit(this._mapLayerIds);
1433
1447
  }
1434
1448
  /**
1435
- * Returns the ids of all OR configured layers that needs to be shown in the list
1449
+ * Returns the ids of configured layers that needs to be shown in the list
1436
1450
  * @param hash each layer item details
1437
1451
  * @returns array of layer ids
1438
1452
  */
@@ -1440,11 +1454,7 @@ const LayerList = class {
1440
1454
  var _a;
1441
1455
  const configuredLayers = ((_a = this.layers) === null || _a === void 0 ? void 0 : _a.length) > 0 ? this.layers : [];
1442
1456
  return Object.keys(hash).reduce((prev, cur) => {
1443
- let showLayer = true;
1444
- if ((configuredLayers === null || configuredLayers === void 0 ? void 0 : configuredLayers.length) > 0) {
1445
- showLayer = configuredLayers.indexOf(cur) > -1;
1446
- }
1447
- if (showLayer) {
1457
+ if (configuredLayers.indexOf(cur) > -1) {
1448
1458
  prev.push(cur);
1449
1459
  }
1450
1460
  return prev;
@@ -85,7 +85,7 @@ const CardManager = class {
85
85
  var _a, _b;
86
86
  const featuresClass = ((_a = this._graphics) === null || _a === void 0 ? void 0 : _a.length) > 0 ? "" : "display-none";
87
87
  const messageClass = ((_b = this._graphics) === null || _b === void 0 ? void 0 : _b.length) > 0 ? "display-none" : "";
88
- return (index.h(index.Host, { key: 'c4b71cefeb5eec1e1312104c519dfb9ef1398d71' }, index.h("div", { key: '6c1539db40060f9295c8aa72af29eac5f9c67d8d', class: "overflow-auto height-full" }, index.h("calcite-shell", { key: '2a4f7b47e01e3f27528dbce5fe236187a0f57dab', class: "position-relative " + featuresClass }, index.h("div", { key: '4b226239c5b80210aa3d42d422bbc50a66bdcf59' }, index.h("info-card", { key: '55561c22c8685c3ba3daa25c51053fa47d553ba9', graphics: this._graphics, isLoading: this._cardLoading, isMobile: this.isMobile, mapView: this.mapView }))), index.h("calcite-shell", { key: '8f9156bf9c08920e7731f50daeecb031e9135281', class: "position-relative " + messageClass }, index.h("div", { key: '0529f9a60349337716ba53f10551b08a34c48209', class: "padding-1" }, index.h("calcite-notice", { key: '812047f7628598fa6b20e3df00355efee584bb71', icon: "table", open: true }, index.h("div", { key: 'd7c1b7ab03de1fb30e8e84a6d331d43e69a9946e', slot: "message" }, this._translations.selectFeaturesToStart)))))));
88
+ return (index.h(index.Host, { key: '343554e5408de156f1973f6d1e3daa8f1ba90675' }, index.h("div", { key: '1852562a795002314236052351cab7c29d36854e', class: "overflow-auto height-full" }, index.h("calcite-shell", { key: '684f013e4397bc50743526357384f782a88a5cd3', class: "position-relative " + featuresClass }, index.h("div", { key: 'db6d9f4be5448b5596b22f2a4f49c6baefa88466' }, index.h("info-card", { key: 'be5cec81cae7ca00a5b57c8d9590541f78b67fbd', graphics: this._graphics, isLoading: this._cardLoading, isMobile: this.isMobile, mapView: this.mapView }))), index.h("calcite-shell", { key: 'df34e0ae6978298130970c60d21203f52fa32e4b', class: "position-relative " + messageClass }, index.h("div", { key: '9525a95dd21745e211ebf888da44eca6a6c17721', class: "padding-1" }, index.h("calcite-notice", { key: 'ade0e0a2f09bbe7b7bda6fdb2ce65ba81121e633', icon: "table", open: true }, index.h("div", { key: 'd6fce2d657e23738720e004177c510c3273017f4', slot: "message" }, this._translations.selectFeaturesToStart)))))));
89
89
  }
90
90
  //--------------------------------------------------------------------------
91
91
  //
@@ -199,7 +199,7 @@ const CrowdsourceManager = class {
199
199
  render() {
200
200
  // only avoid border when we have a header color that is not white
201
201
  const borderClass = this.popupHeaderColor && this.popupHeaderColor !== "#FFFFFF" ? "border-width-0" : "";
202
- return (index.h(index.Host, { key: 'adf6957871aa364f3c0d65f949eb94587f065780' }, index.h("calcite-shell", { key: 'cbe60dd48a1ffb16ca5bf4d7bf7ee96272fed7a5', class: "position-relative" }, index.h("calcite-panel", { key: '19e98d7bd25c939f3d8860d68c61a5168730eb00', class: `width-full height-full ${borderClass}` }, this._getBody(this._layoutMode, this._panelOpen, this._hideTable)), this._getFooter())));
202
+ return (index.h(index.Host, { key: '0f06df71cc424887b8dc4b4929670d94b6548085' }, index.h("calcite-shell", { key: 'c81a570fb771650de6193e45ffbebd03544eaf2e', class: "position-relative" }, index.h("calcite-panel", { key: '5e67c2bf9ed0df0080629989f93e89a145349abc', class: `width-full height-full ${borderClass}` }, this._getBody(this._layoutMode, this._panelOpen, this._hideTable)), this._getFooter())));
203
203
  }
204
204
  /**
205
205
  * Called after each render
@@ -85,18 +85,6 @@ const CrowdsourceReporter = class {
85
85
  await this.setMapView();
86
86
  });
87
87
  }
88
- /**
89
- * On Feature details change update the Layer title and the current selected layer id
90
- * @param evt Event hold the details of current feature graphic in the info-card
91
- */
92
- async selectionChanged(evt) {
93
- void this.updatingFeatureDetails(true);
94
- await this.setCurrentFeature(evt.detail.selectedFeature[0]);
95
- void this.highlightOnMap(evt.detail.selectedFeature[0]);
96
- this._selectedFeatureIndex = evt.detail.selectedFeatureIndex;
97
- //update the feature details to reflect the like, dislike and comment values
98
- await this._featureDetails.refresh(evt.detail.selectedFeature[0]);
99
- }
100
88
  //--------------------------------------------------------------------------
101
89
  //
102
90
  // Functions (lifecycle)
@@ -113,9 +101,9 @@ const CrowdsourceReporter = class {
113
101
  await this._initModules();
114
102
  await this._getTranslations();
115
103
  await ((_a = this.mapView) === null || _a === void 0 ? void 0 : _a.when(async () => {
116
- //set configured reporting layers array
104
+ //set configured layers array which are enabled for data collection
117
105
  this._layers = this.reportingOptions ? Object.keys(this.reportingOptions).filter((layerId) => {
118
- return this.reportingOptions[layerId].reporting;
106
+ return this.reportingOptions[layerId].visible;
119
107
  }) : [];
120
108
  await this.setMapView();
121
109
  }));
@@ -125,7 +113,7 @@ const CrowdsourceReporter = class {
125
113
  */
126
114
  render() {
127
115
  const themeClass = this.theme === "dark" ? "calcite-mode-dark" : "calcite-mode-light";
128
- return (index.h(index.Host, { key: '530bb7e6dacde9109246733345157c95c1a50dcb' }, this._reportSubmitted && index.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" }, index.h("div", { key: '3251fcd334b449292d3597af996eb7eea08dd00e', slot: "message" }, this.reportSubmittedMessage ? this.reportSubmittedMessage : this._translations.submitMsg)), this._featureCreationFailedErrorMsg && index.h("calcite-alert", { key: '0d0553df8133b8d20cc0f2d66a8462334117b5cf', "auto-close": true, class: themeClass, icon: "x-octagon", kind: "danger", label: "", onCalciteAlertClose: () => { this._featureCreationFailedErrorMsg = ""; }, open: true, placement: "top" }, index.h("div", { key: '81658d0eab5392cbddbcf42ccb0b79b0cebc22dd', slot: "title" }, this._translations.error), index.h("div", { key: 'e4a00bef08ca9121425fd4f3b8ac7bfffa70d371', slot: "message" }, this._featureCreationFailedErrorMsg)), this._commentSubmitted && index.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" }, index.h("div", { key: 'b9b01d82faded409059563840a4bc0ce3ef1faf7', slot: "message" }, this._translations.commentSubmittedMsg)), this._addingCommentFailed && index.h("calcite-alert", { key: '3754d8a1d5d91ac3bf3b1bddc16f078170e61a80', "auto-close": true, class: themeClass, icon: "x-octagon", kind: "danger", label: "", onCalciteAlertClose: () => { this._addingCommentFailed = false; }, open: true, placement: "top" }, index.h("div", { key: '977b632702e8dc176bd9a9c930c1492539689576', slot: "title" }, this._translations.error), index.h("div", { key: '45fa0ba61f3831a743b0cc7ae4aa10854b1a9ff5', slot: "message" }, this._translations.addingCommentFailedMsg)), index.h("div", { key: '57be499cc8fb87ca20c6efa65fbbe9cc47269906' }, index.h("calcite-shell", { key: '2ce48b4cdd0dc0dd52995cd7b32f476b14ddd49d', "content-behind": true }, this._getReporter())), this.filterModal()));
116
+ return (index.h(index.Host, { key: '497227745f29c2afc434349e86da19b088b1eb78' }, this._reportSubmitted && index.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" }, index.h("div", { key: '1f98f71fa79cf64e65fecfbceec3862714702609', slot: "message" }, this.reportSubmittedMessage ? this.reportSubmittedMessage : this._translations.submitMsg)), this._featureCreationFailedErrorMsg && index.h("calcite-alert", { key: '381d3b5a3f5115782634833ad53b4494e888ea97', "auto-close": true, class: themeClass, icon: "x-octagon", kind: "danger", label: "", onCalciteAlertClose: () => { this._featureCreationFailedErrorMsg = ""; }, open: true, placement: "top" }, index.h("div", { key: '34371959d1272e4bc465e5f5a432d450a156c20b', slot: "title" }, this._translations.error), index.h("div", { key: '09a55e3325edde43f660a2db1621a4ffd373e09f', slot: "message" }, this._featureCreationFailedErrorMsg)), this._commentSubmitted && index.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" }, index.h("div", { key: '91b9dcc26cf1f66a116a287a94e8df5c3d2f37bf', slot: "message" }, this._translations.commentSubmittedMsg)), this._addingCommentFailed && index.h("calcite-alert", { key: '758f1d465d4301fade8fd93a682bfe4b359be2ca', "auto-close": true, class: themeClass, icon: "x-octagon", kind: "danger", label: "", onCalciteAlertClose: () => { this._addingCommentFailed = false; }, open: true, placement: "top" }, index.h("div", { key: '982424caf90e309701c62c75065d7e7e15d327b4', slot: "title" }, this._translations.error), index.h("div", { key: '1c93f9f8e1b958ccf8553560c36a32273f16a3a6', slot: "message" }, this._translations.addingCommentFailedMsg)), index.h("div", { key: '612254cf38da92cf88b90ace8136a2e0859afcae' }, index.h("calcite-shell", { key: 'bb56100b4dfc355b93d580deee929aad7cfb3f7f', "content-behind": true }, this._getReporter())), this.filterModal()));
129
117
  }
130
118
  //--------------------------------------------------------------------------
131
119
  //
@@ -160,6 +148,14 @@ const CrowdsourceReporter = class {
160
148
  layer.set('visible', !layerId || (layer.id === layerId));
161
149
  });
162
150
  }
151
+ /**
152
+ * Returns the layers configuration
153
+ * @param layerId string layerId of the selected layer
154
+ * @returns Configuration for the layerId
155
+ */
156
+ _getLayersConfig(layerId) {
157
+ return this.reportingOptions && this.reportingOptions[layerId] ? this.reportingOptions[layerId] : null;
158
+ }
163
159
  /**
164
160
  * Get the reporter app functionality
165
161
  * @protected
@@ -283,7 +279,10 @@ const CrowdsourceReporter = class {
283
279
  * @protected
284
280
  */
285
281
  getChooseCategoryFlowItem() {
286
- return (index.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(), index.h("calcite-panel", { "full-height": true, "full-width": true }, index.h("div", { class: "progress-bar" }, index.h("calcite-progress", { type: "determinate", value: this._updatedProgressBarStatus })), index.h("calcite-notice", { class: "notice-msg", icon: "lightbulb", kind: "success", open: true }, index.h("div", { slot: "message" }, this._translations.chooseCategoryMsg)), index.h("layer-list", { class: "height-full", layers: this._layers, mapView: this.mapView, onLayerSelect: this.navigateToCreateFeature.bind(this), showFeatureCount: false, showNextIcon: false }))));
282
+ const onlyReportingLayers = this.reportingOptions ? Object.keys(this.reportingOptions).filter((layerId) => {
283
+ return this.reportingOptions[layerId].visible && this.reportingOptions[layerId].reporting && this._layerItemsHash[layerId] && this._layerItemsHash[layerId].supportsAdd;
284
+ }) : [];
285
+ return (index.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(), index.h("calcite-panel", { "full-height": true, "full-width": true }, index.h("div", { class: "progress-bar" }, index.h("calcite-progress", { type: "determinate", value: this._updatedProgressBarStatus })), index.h("calcite-notice", { class: "notice-msg", icon: "lightbulb", kind: "success", open: true }, index.h("div", { slot: "message" }, this._translations.chooseCategoryMsg)), index.h("layer-list", { class: "height-full", layers: onlyReportingLayers, mapView: this.mapView, onLayerSelect: this.navigateToCreateFeature.bind(this), showFeatureCount: false, showNextIcon: false }))));
287
286
  }
288
287
  /**
289
288
  * Get Feature create form of the selected feature layer
@@ -442,16 +441,22 @@ const CrowdsourceReporter = class {
442
441
  const layersListed = evt.detail;
443
442
  //consider only the layers listed in the layer-list component
444
443
  const allMapLayers = await mapViewUtils.getAllLayers(this.mapView);
444
+ const reportingEnabledLayerIds = [];
445
445
  this._validLayers = [];
446
446
  allMapLayers.forEach((eachLayer) => {
447
+ var _a;
447
448
  if (layersListed.includes(eachLayer.id)) {
448
449
  this._validLayers.push(eachLayer);
450
+ //create list of reporting enabled layers
451
+ if (((_a = this._getLayersConfig(eachLayer.id)) === null || _a === void 0 ? void 0 : _a.reporting) && this._layerItemsHash[eachLayer.id] && this._layerItemsHash[eachLayer.id].supportsAdd) {
452
+ reportingEnabledLayerIds.push(eachLayer.id);
453
+ }
449
454
  }
450
455
  });
451
456
  //handleMap click on layer list loaded
452
457
  this.handleMapClick();
453
- //update the has valid layer state
454
- this._hasValidLayers = layersListed.length > 0;
458
+ //When we have any reporting layer then only show the create report button on layerList
459
+ this._hasValidLayers = reportingEnabledLayerIds.length > 0;
455
460
  //navigate to the feature details if URL params found
456
461
  if (!this._urlParamsLoaded) {
457
462
  this._urlParamsLoaded = true;
@@ -479,8 +484,9 @@ const CrowdsourceReporter = class {
479
484
  backFromSelectedPanel() {
480
485
  this._updatedProgressBarStatus = 0.25;
481
486
  const updatedFlowItems = [...this._flowItems];
482
- // when coming back from comment details page don't clear the highlighted feature of map
483
- if (updatedFlowItems[updatedFlowItems.length - 1] !== 'comment-details') {
487
+ // when back from comment details or add comment page don't clear the highlighted feature of map
488
+ if (!(updatedFlowItems[updatedFlowItems.length - 1] === 'comment-details' ||
489
+ updatedFlowItems[updatedFlowItems.length - 1] === 'add-comment')) {
484
490
  this.clearHighlights();
485
491
  }
486
492
  updatedFlowItems.pop();
@@ -525,6 +531,19 @@ const CrowdsourceReporter = class {
525
531
  async updatingFeatureDetails(isLoading) {
526
532
  this._showLoadingIndicator = isLoading;
527
533
  }
534
+ /**
535
+ * On Feature details change update the Layer title and the current selected layer id
536
+ * @param evt Event hold the details of current feature graphic from the feature-details
537
+ * @protected
538
+ */
539
+ async selectionChanged(evt) {
540
+ void this.updatingFeatureDetails(true);
541
+ await this.setCurrentFeature(evt.detail.selectedFeature[0]);
542
+ void this.highlightOnMap(evt.detail.selectedFeature[0]);
543
+ this._selectedFeatureIndex = evt.detail.selectedFeatureIndex;
544
+ //update the feature details to reflect the like, dislike and comment values
545
+ await this._featureDetails.refresh(evt.detail.selectedFeature[0]);
546
+ }
528
547
  /**
529
548
  * When comment is selected from list store that and show comment details
530
549
  * @param evt Event which has details of selected feature
@@ -542,10 +561,11 @@ const CrowdsourceReporter = class {
542
561
  * @protected
543
562
  */
544
563
  getFeatureListFlowItem(layerId, layerName) {
545
- var _a;
564
+ var _a, _b;
546
565
  const layerExpressions = (_a = this.layerExpressions) === null || _a === void 0 ? void 0 : _a.filter((exp) => exp.id === this._selectedLayerId);
566
+ const canCreateReports = ((_b = this._getLayersConfig(this._selectedLayerId)) === null || _b === void 0 ? void 0 : _b.reporting) && this._layerItemsHash[this._selectedLayerId].supportsAdd;
547
567
  const showFilterIcon = (layerExpressions === null || layerExpressions === void 0 ? void 0 : layerExpressions.length) > 0;
548
- return (index.h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: layerName, loading: this._showLoadingIndicator, onCalciteFlowItemBack: this.backFromSelectedPanel.bind(this) }, this._toggleSort(), index.h("calcite-action", { icon: "sort-ascending-arrow", id: "sort-popover", slot: "header-actions-end", text: this._translations.sort, title: this._translations.sort }), showFilterIcon && index.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 &&
568
+ return (index.h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: layerName, loading: this._showLoadingIndicator, onCalciteFlowItemBack: this.backFromSelectedPanel.bind(this) }, this._toggleSort(), index.h("calcite-action", { icon: "sort-ascending-arrow", id: "sort-popover", slot: "header-actions-end", text: this._translations.sort, title: this._translations.sort }), showFilterIcon && index.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 &&
549
569
  index.h("calcite-button", { appearance: "solid", onClick: this.navigateToCreateFeature.bind(this), slot: "footer", width: "full" }, this.reportButtonText ? this.reportButtonText : this._translations.createReportButtonText), index.h("calcite-panel", { "full-height": true }, index.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 }))));
550
570
  }
551
571
  /**
@@ -553,8 +573,9 @@ const CrowdsourceReporter = class {
553
573
  * @returns Node
554
574
  */
555
575
  getFeatureDetailsFlowItem() {
556
- const showCommentBtn = this.reportingOptions[this._currentFeature.layer.id].comment && this._currentFeature.layer.relationships.length > 0;
557
- return (index.h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this._selectedLayerName, loading: this._showLoadingIndicator, onCalciteFlowItemBack: this.backFromSelectedPanel.bind(this) }, this.isMobile && this.getActionToExpandCollapsePanel(), index.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(), index.h("calcite-panel", null, index.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 &&
576
+ var _a;
577
+ const showCommentBtn = ((_a = this._getLayersConfig(this._selectedLayerId)) === null || _a === void 0 ? void 0 : _a.comment) && this._selectedLayer.relationships.length > 0;
578
+ return (index.h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this._selectedLayerName, loading: this._showLoadingIndicator, onCalciteFlowItemBack: this.backFromSelectedPanel.bind(this) }, this.isMobile && this.getActionToExpandCollapsePanel(), index.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(), index.h("calcite-panel", null, index.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 &&
558
579
  index.h("calcite-button", { appearance: "solid", onClick: () => this._flowItems = [...this._flowItems, "add-comment"], slot: "footer", width: "full" }, this._translations.comment))));
559
580
  }
560
581
  /**
@@ -592,13 +613,14 @@ const CrowdsourceReporter = class {
592
613
  * @param selectedFeature Graphic currently shown in feature details
593
614
  */
594
615
  async setCurrentFeature(selectedFeature) {
616
+ var _a;
595
617
  this._currentFeature = selectedFeature;
596
618
  if (selectedFeature && selectedFeature.layer) {
597
619
  const layer = selectedFeature.layer;
598
620
  void this.setSelectedLayer(layer.id, layer.title);
599
621
  this._currentFeatureId = selectedFeature.attributes[layer.objectIdField];
600
622
  // check if comments are configured and relationship is present then only get the related table
601
- const isCommentTablePresent = this.reportingOptions[selectedFeature.layer.id].comment && selectedFeature.layer.relationships.length > 0;
623
+ const isCommentTablePresent = ((_a = this._getLayersConfig(layer.id)) === null || _a === void 0 ? void 0 : _a.comment) && layer.relationships.length > 0;
602
624
  if (isCommentTablePresent) {
603
625
  await this.getRelatedTable();
604
626
  }
@@ -712,12 +734,12 @@ const CrowdsourceReporter = class {
712
734
  await this.setSelectedFeatures(reportingLayerGraphics);
713
735
  //if featureDetails not open then add it to the list else just reInit flowItems which will update details with newly selected features
714
736
  // eslint-disable-next-line unicorn/prefer-ternary
715
- if (this._flowItems.length && this._flowItems[this._flowItems.length - 1] !== "feature-details") {
716
- this._flowItems = [...this._flowItems, "feature-details"];
737
+ if (this._flowItems.length && this._flowItems.includes("feature-details")) {
738
+ this._flowItems = [...this._flowItems.slice(0, this._flowItems.indexOf("feature-details") + 1)];
739
+ await this.highlightOnMap(clickedGraphics[0]);
717
740
  }
718
741
  else {
719
- this._flowItems = [...this._flowItems];
720
- void this.highlightOnMap(clickedGraphics[0]);
742
+ this._flowItems = [...this._flowItems, "feature-details"];
721
743
  }
722
744
  }
723
745
  // if clicked graphic's layer is from non reporting layers then show popup on map
@@ -760,13 +782,11 @@ const CrowdsourceReporter = class {
760
782
  * @returns array of editable layer ids
761
783
  */
762
784
  reduceToConfiguredLayers(hash) {
763
- var _a;
764
- const configuredLayers = ((_a = this._layers) === null || _a === void 0 ? void 0 : _a.length) > 0 ? this._layers : [];
765
785
  return Object.keys(hash).reduce((prev, cur) => {
766
- let showLayer = hash[cur].supportsAdd;
767
- if ((configuredLayers === null || configuredLayers === void 0 ? void 0 : configuredLayers.length) > 0) {
768
- showLayer = configuredLayers.indexOf(cur) > -1 ? hash[cur].supportsAdd : false;
769
- }
786
+ var _a;
787
+ // check if reporting options exists consider the visible prop if else just check the supports Add
788
+ const showLayer = this.reportingOptions ? (_a = this._getLayersConfig(cur)) === null || _a === void 0 ? void 0 : _a.visible
789
+ : hash[cur].supportsAdd;
770
790
  if (showLayer) {
771
791
  prev.push(cur);
772
792
  }
@@ -787,18 +807,19 @@ const CrowdsourceReporter = class {
787
807
  }
788
808
  });
789
809
  this._editableLayerIds = this.reduceToConfiguredLayers(layerItemsHash);
810
+ this._layerItemsHash = layerItemsHash;
790
811
  }
791
812
  /**
792
813
  * renders feature list
793
814
  * @protected
794
815
  */
795
816
  async renderFeaturesList() {
817
+ this._flowItems = ['feature-list'];
796
818
  const evt = {
797
819
  detail: this._editableLayerIds
798
820
  };
799
821
  await this.layerListLoaded(evt);
800
822
  void this.setSelectedLayer(this._validLayers[0].id, this._validLayers[0].title);
801
- this._flowItems = ['feature-list'];
802
823
  }
803
824
  /**
804
825
  * Updates the share url for current selected feature
@@ -846,7 +867,7 @@ const CrowdsourceReporter = class {
846
867
  const featureSet = await mapViewUtils.queryFeaturesByID([Number(this.objectId)], layer, [], true, this.mapView.spatialReference);
847
868
  if (featureSet.length) {
848
869
  //update the selectedFeature
849
- this._selectedFeature = featureSet;
870
+ await this.setSelectedFeatures(featureSet);
850
871
  //if featureDetails not open then add it to the list else just reInit flowItems which will update details with newly selected features
851
872
  // eslint-disable-next-line unicorn/prefer-ternary
852
873
  if (this._flowItems.length && this._flowItems[this._flowItems.length - 1] !== "feature-details") {
@@ -855,7 +876,6 @@ const CrowdsourceReporter = class {
855
876
  else {
856
877
  this._flowItems = [...this._flowItems];
857
878
  }
858
- await this.highlightOnMap(featureSet[0]);
859
879
  }
860
880
  }
861
881
  }
@@ -18,7 +18,7 @@ require('./index-f64944ad.js');
18
18
  require('./restHelpersGet-dbaa28df.js');
19
19
  require('./interfaces-7cd0a48a.js');
20
20
 
21
- 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}";
21
+ 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}";
22
22
  const FeatureListStyle0 = featureListCss;
23
23
 
24
24
  const FeatureList = class {
@@ -35,6 +35,7 @@ const FeatureList = class {
35
35
  this.whereClause = undefined;
36
36
  this.textSize = "large";
37
37
  this.showInitialLoading = true;
38
+ this.showErrorWhenNoFeatures = true;
38
39
  this._featureItems = [];
39
40
  this._featuresCount = 0;
40
41
  this._isLoading = false;
@@ -102,9 +103,9 @@ const FeatureList = class {
102
103
  * Renders the component.
103
104
  */
104
105
  render() {
105
- return (index.h("calcite-panel", { key: '9f702c6d98cc19704e0773e36fd969817ea7262e', "full-height": true, "full-width": true }, this._isLoading && index.h("calcite-loader", { key: 'e9acf13f3444057b097d6b145c1a6e0118f150ea', label: "", scale: "m" }), this._featureItems.length === 0 && !this._isLoading &&
106
- index.h("calcite-notice", { key: '8c7fa89e2da7490b04456e51f8534c2515a02399', class: "error-msg", icon: "feature-details", kind: "info", open: true }, index.h("div", { key: '799d419e9c26b7928f15cb1cf9afa9f47cab0e94', slot: "message" }, this.noFeaturesFoundMsg ? this.noFeaturesFoundMsg : this._translations.featureErrorMsg)), index.h("calcite-list", { key: '82c60b16ab586ad57f8f98bb08814f688102b166', "selection-appearance": "border", "selection-mode": "none" }, !this._isLoading && this._featureItems.length > 0 && this._featureItems), this._featuresCount > this.pageSize &&
107
- index.h("div", { key: 'e5b789ea46c6bedfbe83f1323ffb89271c0b76ce', class: "width-full", slot: "footer" }, index.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 }))));
106
+ return (index.h("calcite-panel", { key: '6184d07592669fd8884996475b7eeb26e0604790', "full-height": true, "full-width": true }, this._isLoading && index.h("calcite-loader", { key: '282127215213a28b9cfdf484aaf5730145b6bb55', label: "", scale: "m" }), this.showErrorWhenNoFeatures && this._featureItems.length === 0 && !this._isLoading &&
107
+ index.h("calcite-notice", { key: '25fcfeb1d19a089b092050515c3d69401bc17dc8', class: "error-msg", icon: "feature-details", kind: "info", open: true }, index.h("div", { key: '2ac81a338df9d0e0f43c659a24be0c9b7b95d027', slot: "message" }, this.noFeaturesFoundMsg ? this.noFeaturesFoundMsg : this._translations.featureErrorMsg)), index.h("calcite-list", { key: '70453e8ded4f859076a5f00d8f04152cd78278d8', "selection-appearance": "border", "selection-mode": "none" }, !this._isLoading && this._featureItems.length > 0 && this._featureItems), this._featuresCount > this.pageSize &&
108
+ index.h("div", { key: 'db1003ace54cd599acefad04e94fe54248327126', class: "width-full", slot: "footer" }, index.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 }))));
108
109
  }
109
110
  //--------------------------------------------------------------------------
110
111
  //
@@ -236,7 +236,8 @@ async function handleFilter(data, info, infoIndex, filterMode, parentLegendEleme
236
236
  const [FeatureFilter, FeatureEffect] = await loadModules.loadModules(['esri/layers/support/FeatureFilter', 'esri/layers/support/FeatureEffect']);
237
237
  const { queryExpressions, fLayerView } = data;
238
238
  generateQueryExpressions(data, info, infoIndex, parentLegendElementInfo);
239
- const where = queryExpressions.join(' OR ');
239
+ const sep = queryExpressions.every(expression => expression && expression.includes('<>')) ? ' AND ' : ' OR ';
240
+ const where = queryExpressions.join(sep);
240
241
  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;
241
242
  const { type } = filterMode;
242
243
  if (type === 'filter') {