@esri/solutions-components 0.8.8 → 0.8.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (114) hide show
  1. package/dist/assets/t9n/crowdsource-reporter/resources.json +3 -1
  2. package/dist/assets/t9n/crowdsource-reporter/resources_en.json +3 -1
  3. package/dist/cjs/{calcite-action-menu_2.cjs.entry.js → calcite-action-menu_3.cjs.entry.js} +114 -7
  4. package/dist/cjs/calcite-alert_4.cjs.entry.js +46 -5
  5. package/dist/cjs/{calcite-input-date-picker_3.cjs.entry.js → calcite-block_5.cjs.entry.js} +691 -13
  6. package/dist/cjs/{calcite-combobox_5.cjs.entry.js → calcite-combobox_3.cjs.entry.js} +876 -844
  7. package/dist/cjs/calcite-dropdown_4.cjs.entry.js +1023 -0
  8. package/dist/cjs/{calcite-flow_5.cjs.entry.js → calcite-flow_6.cjs.entry.js} +327 -2
  9. package/dist/cjs/card-manager_3.cjs.entry.js +5 -5
  10. package/dist/cjs/crowdsource-manager.cjs.entry.js +1 -1
  11. package/dist/cjs/crowdsource-reporter.cjs.entry.js +122 -21
  12. package/dist/cjs/{downloadUtils-8b05d7cc.js → downloadUtils-dc349b1a.js} +2 -2
  13. package/dist/cjs/{index.es-e7587227.js → index.es-1830a1e6.js} +2 -2
  14. package/dist/cjs/loader.cjs.js +1 -1
  15. package/dist/cjs/map-select-tools_3.cjs.entry.js +8 -8
  16. package/dist/cjs/{mapViewUtils-3e0fa457.js → mapViewUtils-9dc05308.js} +11 -5
  17. package/dist/cjs/public-notification.cjs.entry.js +2 -2
  18. package/dist/cjs/solutions-components.cjs.js +1 -1
  19. package/dist/collection/collection-manifest.json +1 -0
  20. package/dist/collection/components/create-feature/create-feature.js +18 -0
  21. package/dist/collection/components/crowdsource-reporter/crowdsource-reporter.css +16 -0
  22. package/dist/collection/components/crowdsource-reporter/crowdsource-reporter.js +155 -35
  23. package/dist/collection/components/feature-details/feature-details.css +18 -0
  24. package/dist/collection/components/feature-details/feature-details.js +500 -0
  25. package/dist/collection/components/feature-details/test/feature-details.e2e.js +14 -0
  26. package/dist/collection/components/feature-details/test/feature-details.spec.js +22 -0
  27. package/dist/collection/components/feature-list/feature-list.js +14 -1
  28. package/dist/collection/components/info-card/info-card.css +15 -5
  29. package/dist/collection/components/info-card/info-card.js +178 -5
  30. package/dist/collection/components/layer-table/layer-table.js +2 -2
  31. package/dist/collection/components/map-card/map-card.js +1 -1
  32. package/dist/collection/components/map-select-tools/map-select-tools.js +5 -5
  33. package/dist/collection/components/refine-selection/refine-selection.js +1 -1
  34. package/dist/collection/demos/crowdsource-reporter.html +115 -1
  35. package/dist/collection/utils/mapViewUtils.js +11 -5
  36. package/dist/collection/utils/mapViewUtils.ts +13 -5
  37. package/dist/components/create-feature2.js +4 -0
  38. package/dist/components/crowdsource-reporter.js +270 -81
  39. package/dist/components/feature-details.d.ts +11 -0
  40. package/dist/components/feature-details.js +11 -0
  41. package/dist/components/feature-details2.js +449 -0
  42. package/dist/components/feature-list2.js +14 -1
  43. package/dist/components/info-card2.js +53 -5
  44. package/dist/components/layer-table2.js +2 -2
  45. package/dist/components/map-card2.js +1 -1
  46. package/dist/components/map-select-tools2.js +5 -5
  47. package/dist/components/mapViewUtils.js +11 -5
  48. package/dist/components/refine-selection2.js +1 -1
  49. package/dist/esm/{calcite-action-menu_2.entry.js → calcite-action-menu_3.entry.js} +118 -12
  50. package/dist/esm/calcite-alert_4.entry.js +46 -5
  51. package/dist/esm/{calcite-input-date-picker_3.entry.js → calcite-block_5.entry.js} +688 -12
  52. package/dist/esm/{calcite-combobox_5.entry.js → calcite-combobox_3.entry.js} +878 -844
  53. package/dist/esm/calcite-date-picker-day_3.entry.js +1 -1
  54. package/dist/esm/calcite-dropdown_4.entry.js +1016 -0
  55. package/dist/esm/{calcite-flow_5.entry.js → calcite-flow_6.entry.js} +327 -3
  56. package/dist/esm/card-manager_3.entry.js +5 -5
  57. package/dist/esm/crowdsource-manager.entry.js +1 -1
  58. package/dist/esm/crowdsource-reporter.entry.js +122 -21
  59. package/dist/esm/{date-5630530d.js → date-0c026a8b.js} +1 -1
  60. package/dist/esm/{downloadUtils-0c1e4d7b.js → downloadUtils-df4f21f6.js} +2 -2
  61. package/dist/esm/{index.es-286e3cfa.js → index.es-904fb846.js} +2 -2
  62. package/dist/esm/loader.js +1 -1
  63. package/dist/esm/map-select-tools_3.entry.js +8 -8
  64. package/dist/esm/{mapViewUtils-253178f1.js → mapViewUtils-2ec19fb0.js} +11 -5
  65. package/dist/esm/public-notification.entry.js +2 -2
  66. package/dist/esm/solutions-components.js +1 -1
  67. package/dist/solutions-components/demos/crowdsource-reporter.html +115 -1
  68. package/dist/solutions-components/{p-813fd8a4.entry.js → p-29f518fd.entry.js} +2 -2
  69. package/dist/solutions-components/{p-13ca3b00.entry.js → p-452fd697.entry.js} +1 -1
  70. package/dist/solutions-components/p-511b1c91.entry.js +23 -0
  71. package/dist/solutions-components/p-577efb16.js +36 -0
  72. package/dist/solutions-components/{p-94de9279.js → p-5817d78c.js} +1 -1
  73. package/dist/solutions-components/p-602cd811.entry.js +17 -0
  74. package/dist/solutions-components/{p-15f9624a.entry.js → p-6557b703.entry.js} +1 -1
  75. package/dist/solutions-components/p-7269c49b.entry.js +6 -0
  76. package/dist/solutions-components/p-760bd17e.entry.js +6 -0
  77. package/dist/solutions-components/p-95fea07a.entry.js +17 -0
  78. package/dist/solutions-components/{p-212b02e7.js → p-ae4d86e8.js} +1 -1
  79. package/dist/solutions-components/{p-038fcd93.entry.js → p-c273ab7a.entry.js} +1 -1
  80. package/dist/solutions-components/p-d742b915.entry.js +29 -0
  81. package/dist/solutions-components/p-dfad61a8.entry.js +24 -0
  82. package/dist/solutions-components/{p-331b5d1e.js → p-fca434c8.js} +2 -2
  83. package/dist/solutions-components/p-fd82a00f.entry.js +6 -0
  84. package/dist/solutions-components/solutions-components.esm.js +1 -1
  85. package/dist/solutions-components/utils/mapViewUtils.ts +13 -5
  86. package/dist/types/components/create-feature/create-feature.d.ts +4 -4
  87. package/dist/types/components/crowdsource-reporter/crowdsource-reporter.d.ts +91 -10
  88. package/dist/types/components/feature-details/feature-details.d.ts +151 -0
  89. package/dist/types/components/feature-list/feature-list.d.ts +6 -0
  90. package/dist/types/components/info-card/info-card.d.ts +33 -1
  91. package/dist/types/components.d.ts +129 -12
  92. package/dist/types/preact.d.ts +6 -1
  93. package/dist/types/utils/mapViewUtils.d.ts +5 -3
  94. package/package.json +1 -1
  95. package/dist/cjs/calcite-block_2.cjs.entry.js +0 -652
  96. package/dist/cjs/calcite-graph_2.cjs.entry.js +0 -1055
  97. package/dist/cjs/calcite-scrim.cjs.entry.js +0 -125
  98. package/dist/cjs/utils-7bc7f595.js +0 -64
  99. package/dist/esm/calcite-block_2.entry.js +0 -647
  100. package/dist/esm/calcite-graph_2.entry.js +0 -1050
  101. package/dist/esm/calcite-scrim.entry.js +0 -121
  102. package/dist/esm/utils-9fb4104a.js +0 -61
  103. package/dist/solutions-components/p-04c37d69.entry.js +0 -17
  104. package/dist/solutions-components/p-0b92e4b1.entry.js +0 -11
  105. package/dist/solutions-components/p-238d3b5f.entry.js +0 -6
  106. package/dist/solutions-components/p-3af79063.js +0 -36
  107. package/dist/solutions-components/p-80b11ec1.entry.js +0 -17
  108. package/dist/solutions-components/p-a3a11749.entry.js +0 -6
  109. package/dist/solutions-components/p-aec06ce4.entry.js +0 -18
  110. package/dist/solutions-components/p-bfdf89c2.js +0 -11
  111. package/dist/solutions-components/p-c4ff3b52.entry.js +0 -17
  112. package/dist/solutions-components/p-ced067bd.entry.js +0 -17
  113. package/dist/solutions-components/p-d136eab0.entry.js +0 -23
  114. package/dist/solutions-components/p-e0446d5b.entry.js +0 -6
@@ -13,6 +13,7 @@
13
13
  "components/delete-button/delete-button.js",
14
14
  "components/edit-card/edit-card.js",
15
15
  "components/feature-comments/feature-comments.js",
16
+ "components/feature-details/feature-details.js",
16
17
  "components/feature-form-flow-item/feature-form-flow-item.js",
17
18
  "components/feature-list/feature-list.js",
18
19
  "components/features-flow-item/features-flow-item.js",
@@ -167,6 +167,7 @@ export class CreateFeature {
167
167
  //Add handle to watch featureTemplatesViewModel ready state and then start the creation
168
168
  const handle = this.reactiveUtils.watch(() => this._editor.viewModel.featureTemplatesViewModel.state, (state) => {
169
169
  if (state === 'ready') {
170
+ this.progressStatus.emit(0.5);
170
171
  void this.startCreate();
171
172
  }
172
173
  });
@@ -190,6 +191,7 @@ export class CreateFeature {
190
191
  //once the feature template is selected handle the event for formSubmit and sketch complete
191
192
  //also, hide the headers and footer in the editor as we will be showing our own submit and cancel button
192
193
  this._editor.viewModel.featureTemplatesViewModel.on('select', () => {
194
+ this.progressStatus.emit(0.75);
193
195
  setTimeout(() => {
194
196
  //on form submit
195
197
  this._editor.viewModel.featureFormViewModel.on('submit', this.submitted.bind(this));
@@ -197,6 +199,7 @@ export class CreateFeature {
197
199
  this._editor.viewModel.sketchViewModel.on("create", (evt) => {
198
200
  if (evt.state === "complete") {
199
201
  this.showSearchWidget = false;
202
+ this.progressStatus.emit(1);
200
203
  this.drawComplete.emit();
201
204
  }
202
205
  });
@@ -516,6 +519,21 @@ export class CreateFeature {
516
519
  "resolved": "boolean",
517
520
  "references": {}
518
521
  }
522
+ }, {
523
+ "method": "progressStatus",
524
+ "name": "progressStatus",
525
+ "bubbles": true,
526
+ "cancelable": true,
527
+ "composed": true,
528
+ "docs": {
529
+ "tags": [],
530
+ "text": "Emitted on demand when editor panel changes"
531
+ },
532
+ "complexType": {
533
+ "original": "number",
534
+ "resolved": "number",
535
+ "references": {}
536
+ }
519
537
  }];
520
538
  }
521
539
  static get methods() {
@@ -49,6 +49,10 @@
49
49
  width: calc(100% - 20px);
50
50
  }
51
51
 
52
+ .progress-bar {
53
+ padding: 12px;
54
+ }
55
+
52
56
  .footer-top-button {
53
57
  padding-bottom: 7px;
54
58
  }
@@ -57,6 +61,18 @@
57
61
  height: 35px;
58
62
  }
59
63
 
64
+ .feature-pagination {
65
+ align-items: center;
66
+ margin: 5% 124%;
67
+ display: flex;
68
+ }
69
+
70
+ .pagination-count {
71
+ width: 32px;
72
+ color: var(--calcite-color-brand);
73
+ border-bottom: 1px solid var(--calcite-color-brand);
74
+ }
75
+
60
76
  .report-submitted-msg {
61
77
  position: absolute;
62
78
  z-index: 1000;
@@ -34,7 +34,6 @@ export class CrowdsourceReporter {
34
34
  this.enableComments = undefined;
35
35
  this.enableLogin = undefined;
36
36
  this.enableNewReports = undefined;
37
- this.layers = undefined;
38
37
  this.loginTitle = undefined;
39
38
  this.mapView = undefined;
40
39
  this.layerId = undefined;
@@ -54,6 +53,7 @@ export class CrowdsourceReporter {
54
53
  this.theme = "light";
55
54
  this.enableZoom = true;
56
55
  this.zoomToScale = undefined;
56
+ this.layerExpressions = undefined;
57
57
  this._mapInfo = undefined;
58
58
  this._flowItems = [];
59
59
  this._sidePanelCollapsed = false;
@@ -62,7 +62,11 @@ export class CrowdsourceReporter {
62
62
  this._selectedLayerName = undefined;
63
63
  this._reportSubmitted = false;
64
64
  this._showSubmitCancelButton = false;
65
+ this._loadingFeatureDetails = undefined;
65
66
  this._featureCreationFailedErrorMsg = undefined;
67
+ this._updatedProgressBarStatus = 0.25;
68
+ this._filterOpen = false;
69
+ this._filterActive = false;
66
70
  }
67
71
  //--------------------------------------------------------------------------
68
72
  //
@@ -83,6 +87,18 @@ export class CrowdsourceReporter {
83
87
  await this.setMapView();
84
88
  });
85
89
  }
90
+ /**
91
+ * On Feature details change update the Layer title and the current selected layer id
92
+ * @param evt Event hold the details of current feature graphic in the info-card
93
+ */
94
+ async selectionChanged(evt) {
95
+ void this.updatingFeatureDetails(true);
96
+ this.setCurrentFeature(evt.detail.selectedFeature[0]);
97
+ void this.highlightOnMap(evt.detail.selectedFeature[0]);
98
+ this.selectedFeatureIndex = evt.detail.selectedFeatureIndex;
99
+ //update the feature details to reflect the like dislike values
100
+ await this._featureDetails.refresh(evt.detail.selectedFeature[0]);
101
+ }
86
102
  //--------------------------------------------------------------------------
87
103
  //
88
104
  // Functions (lifecycle)
@@ -99,6 +115,10 @@ export class CrowdsourceReporter {
99
115
  await this._initModules();
100
116
  await this._getTranslations();
101
117
  await ((_a = this.mapView) === null || _a === void 0 ? void 0 : _a.when(async () => {
118
+ //set configured reporting layers array
119
+ this.layers = this.reportingOptions ? Object.keys(this.reportingOptions).filter((layerId) => {
120
+ return this.reportingOptions[layerId].reporting;
121
+ }) : [];
102
122
  await this.setMapView();
103
123
  }));
104
124
  }
@@ -107,7 +127,7 @@ export class CrowdsourceReporter {
107
127
  */
108
128
  render() {
109
129
  const themeClass = this.theme === "dark" ? "calcite-mode-dark" : "calcite-mode-light";
110
- return (h(Host, null, this._reportSubmitted && h("calcite-alert", { "auto-close": true, class: themeClass + " report-submitted-msg", icon: "check-circle", kind: "success", label: "", onCalciteAlertClose: () => { this._reportSubmitted = false; }, open: true, placement: "top" }, h("div", { slot: "message" }, this.reportSubmittedMessage ? this.reportSubmittedMessage : this._translations.submitMsg)), this._featureCreationFailedErrorMsg && h("calcite-alert", { "auto-close": true, class: themeClass, icon: "x-octagon", kind: "danger", label: "", onCalciteAlertClose: () => { this._featureCreationFailedErrorMsg = ""; }, open: true, placement: "top" }, h("div", { slot: "title" }, this._translations.error), h("div", { slot: "message" }, this._featureCreationFailedErrorMsg)), h("div", null, h("calcite-shell", { "content-behind": true }, this._getReporter()))));
130
+ return (h(Host, null, this._reportSubmitted && h("calcite-alert", { "auto-close": true, class: themeClass + " report-submitted-msg", icon: "check-circle", kind: "success", label: "", onCalciteAlertClose: () => { this._reportSubmitted = false; }, open: true, placement: "top" }, h("div", { slot: "message" }, this.reportSubmittedMessage ? this.reportSubmittedMessage : this._translations.submitMsg)), this._featureCreationFailedErrorMsg && h("calcite-alert", { "auto-close": true, class: themeClass, icon: "x-octagon", kind: "danger", label: "", onCalciteAlertClose: () => { this._featureCreationFailedErrorMsg = ""; }, open: true, placement: "top" }, h("div", { slot: "title" }, this._translations.error), h("div", { slot: "message" }, this._featureCreationFailedErrorMsg)), h("div", null, h("calcite-shell", { "content-behind": true }, this._getReporter())), this.filterModal()));
111
131
  }
112
132
  //--------------------------------------------------------------------------
113
133
  //
@@ -171,6 +191,54 @@ export class CrowdsourceReporter {
171
191
  ? h("calcite-flow", null, (renderLists === null || renderLists === void 0 ? void 0 : renderLists.length) > 0 && renderLists)
172
192
  : h("calcite-loader", { label: "", scale: "m" })));
173
193
  }
194
+ /**
195
+ * Show filter component in modal
196
+ * @returns node to interact with any configured filters for the current layer
197
+ */
198
+ filterModal() {
199
+ var _a, _b;
200
+ //get layer expression for current selected layer
201
+ const currentLayersExpressions = this.layerExpressions ? this.layerExpressions.filter((exp) => exp.id === this._selectedLayerId) : [];
202
+ return (currentLayersExpressions.length > 0 &&
203
+ h("calcite-modal", { "aria-labelledby": "modal-title", class: "modal", kind: "brand", onCalciteModalClose: () => void this._closeFilter(), open: this._filterOpen, widthScale: "s" }, h("div", { class: "display-flex align-center", id: "modal-title", slot: "header" }, (_b = (_a = this._translations) === null || _a === void 0 ? void 0 : _a.filterLayerTitle) === null || _b === void 0 ? void 0 : _b.replace("{{title}}", this._selectedLayerName)), h("div", { slot: "content" }, h("instant-apps-filter-list", { autoUpdateUrl: false, closeBtn: true, closeBtnOnClick: async () => this._closeFilter(), comboboxOverlayPositioning: "fixed", layerExpressions: currentLayersExpressions, onFilterListReset: () => this._handleFilterListReset(), onFilterUpdate: () => this._handleFilterUpdate(), ref: (el) => this._filterList = el, view: this.mapView, zoomBtn: false }))));
204
+ }
205
+ /**
206
+ * Close the filter modal
207
+ * @protected
208
+ */
209
+ _closeFilter() {
210
+ if (this._filterOpen) {
211
+ this._filterOpen = false;
212
+ }
213
+ }
214
+ /**
215
+ * When true the filter modal will be displayed
216
+ * @protected
217
+ */
218
+ _toggleFilter() {
219
+ this._filterOpen = !this._filterOpen;
220
+ }
221
+ /**
222
+ * Reset the filter active prop
223
+ * @protected
224
+ */
225
+ _handleFilterListReset() {
226
+ //on reset filter list reset the filter active state
227
+ this._filterActive = false;
228
+ //reset the features list to reflect the applied filters
229
+ void this._featureList.refresh();
230
+ }
231
+ /**
232
+ * Check if the layers definitionExpression has been modified
233
+ * @protected
234
+ */
235
+ _handleFilterUpdate() {
236
+ //if filter are applied the url params will be generated
237
+ //set the filter active state based on the length of applied filters
238
+ this._filterActive = this._filterList.urlParams.getAll('filter').length > 0;
239
+ //reset the features list to reflect the applied filters
240
+ void this._featureList.refresh();
241
+ }
174
242
  /**
175
243
  * Get the feature layer list
176
244
  * @returns the layer list items
@@ -187,7 +255,7 @@ export class CrowdsourceReporter {
187
255
  * @protected
188
256
  */
189
257
  getChooseCategoryFlowItem() {
190
- 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("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, noLayerErrorMsg: this._noLayerToDisplayErrorMsg, onLayerSelect: this.navigateToCreateFeature.bind(this), showFeatureCount: false, showNextIcon: false }))));
258
+ 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, noLayerErrorMsg: this._noLayerToDisplayErrorMsg, onLayerSelect: this.navigateToCreateFeature.bind(this), showFeatureCount: false, showNextIcon: false }))));
191
259
  }
192
260
  /**
193
261
  * Get Feature create form of the selected feature layer
@@ -195,7 +263,15 @@ export class CrowdsourceReporter {
195
263
  * @protected
196
264
  */
197
265
  getFeatureCreateFlowItem() {
198
- return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this._selectedLayerName, onCalciteFlowItemBack: this.backFromCreateFeaturePanel.bind(this) }, this.isMobile && this.getActionToExpandCollapsePanel(), this._showSubmitCancelButton && h("div", { class: "width-full", slot: "footer" }, h("calcite-button", { appearance: "solid", class: "footer-top-button footer-button", onClick: this.onSubmitButtonClick.bind(this), width: "full" }, this._translations.submit), h("calcite-button", { appearance: "outline", class: "footer-button", onClick: this.backFromCreateFeaturePanel.bind(this), width: "full" }, this._translations.cancel)), h("calcite-panel", { "full-height": true, "full-width": true }, h("calcite-notice", { class: "notice-msg", icon: "lightbulb", kind: "success", open: true }, h("div", { slot: "message" }, this._translations.featureEditFormInfoMsg)), h("create-feature", { customizeSubmit: true, mapView: this.mapView, onDrawComplete: this.onDrawComplete.bind(this), onEditingAttachment: this.showSubmitCancelButton.bind(this), onFail: this.createFeatureFailed.bind(this), onSuccess: this.onReportSubmitted.bind(this), ref: el => this._createFeature = el, searchConfiguration: this.searchConfiguration, selectedLayerId: this._selectedLayerId }))));
266
+ return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this._selectedLayerName, onCalciteFlowItemBack: this.backFromCreateFeaturePanel.bind(this) }, this.isMobile && this.getActionToExpandCollapsePanel(), this._showSubmitCancelButton && h("div", { class: "width-full", slot: "footer" }, h("calcite-button", { appearance: "solid", class: "footer-top-button footer-button", onClick: this.onSubmitButtonClick.bind(this), width: "full" }, this._translations.submit), h("calcite-button", { appearance: "outline", class: "footer-button", onClick: this.backFromCreateFeaturePanel.bind(this), width: "full" }, this._translations.cancel)), 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.featureEditFormInfoMsg)), h("create-feature", { customizeSubmit: true, mapView: this.mapView, onDrawComplete: this.onDrawComplete.bind(this), onEditingAttachment: this.showSubmitCancelButton.bind(this), onFail: this.createFeatureFailed.bind(this), onProgressStatus: this.updatedProgressStatus.bind(this), onSuccess: this.onReportSubmitted.bind(this), ref: el => this._createFeature = el, searchConfiguration: this.searchConfiguration, selectedLayerId: this._selectedLayerId }))));
267
+ }
268
+ /**
269
+ * Update the progress bar status when editor panel changes
270
+ * @param evt Event which has progress bar status
271
+ * @protected
272
+ */
273
+ updatedProgressStatus(evt) {
274
+ this._updatedProgressBarStatus = evt.detail;
199
275
  }
200
276
  /**
201
277
  * When drawing of incident location completed on map show the submit and cancel button
@@ -217,7 +293,7 @@ export class CrowdsourceReporter {
217
293
  */
218
294
  onSubmitButtonClick() {
219
295
  if (this._createFeature) {
220
- this._createFeature.submit();
296
+ void this._createFeature.submit();
221
297
  }
222
298
  }
223
299
  /**
@@ -226,7 +302,7 @@ export class CrowdsourceReporter {
226
302
  */
227
303
  backFromCreateFeaturePanel() {
228
304
  if (this._createFeature) {
229
- this._createFeature.close();
305
+ void this._createFeature.close();
230
306
  }
231
307
  this.backFromSelectedPanel();
232
308
  }
@@ -253,10 +329,10 @@ export class CrowdsourceReporter {
253
329
  */
254
330
  async navigateToHomePage() {
255
331
  if (this._createFeature) {
256
- this._createFeature.close();
332
+ void this._createFeature.close();
257
333
  }
258
334
  if (this._layerList) {
259
- this._layerList.refresh();
335
+ void this._layerList.refresh();
260
336
  }
261
337
  this.setSelectedFeatures([]);
262
338
  if (this._editableLayerIds.length === 1) {
@@ -324,6 +400,7 @@ export class CrowdsourceReporter {
324
400
  * @protected
325
401
  */
326
402
  backFromSelectedPanel() {
403
+ this._updatedProgressBarStatus = 0.25;
327
404
  const updatedFlowItems = [...this._flowItems];
328
405
  updatedFlowItems.pop();
329
406
  this.clearHighlights();
@@ -350,6 +427,13 @@ export class CrowdsourceReporter {
350
427
  this.setSelectedFeatures([evt.detail]);
351
428
  this._flowItems = [...this._flowItems, "feature-details"];
352
429
  }
430
+ /**
431
+ * Show loading indicator while updating the feature details component
432
+ * @param isLoading is feature detail component loading
433
+ */
434
+ async updatingFeatureDetails(isLoading) {
435
+ this._loadingFeatureDetails = isLoading;
436
+ }
353
437
  /**
354
438
  * Get feature list of the selected feature layer
355
439
  * @param layerId Layer id
@@ -358,7 +442,10 @@ export class CrowdsourceReporter {
358
442
  * @protected
359
443
  */
360
444
  getFeatureListFlowItem(layerId, layerName) {
361
- return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: layerName, onCalciteFlowItemBack: this.backFromSelectedPanel.bind(this) }, this.isMobile && this.getActionToExpandCollapsePanel(), this.enableNewReports &&
445
+ var _a;
446
+ const layerExpressions = (_a = this.layerExpressions) === null || _a === void 0 ? void 0 : _a.filter((exp) => exp.id === this._selectedLayerId);
447
+ const showFilterIcon = layerExpressions.length > 0;
448
+ return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: layerName, onCalciteFlowItemBack: this.backFromSelectedPanel.bind(this) }, showFilterIcon && h("calcite-action", { icon: "filter", indicator: this._filterActive, onClick: this._toggleFilter.bind(this), slot: this.isMobile ? "header-menu-actions" : "header-actions-end", text: this._translations.filter, "text-enabled": this.isMobile }), this.isMobile && this.getActionToExpandCollapsePanel(), this.enableNewReports &&
362
449
  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 }))));
363
450
  }
364
451
  /**
@@ -366,7 +453,15 @@ export class CrowdsourceReporter {
366
453
  * @returns Node
367
454
  */
368
455
  getFeatureDetailsFlowItem() {
369
- return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this._selectedLayerName, 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 }), h("calcite-panel", { "full-height": true }, h("info-card", { allowEditing: false, graphics: this._selectedFeature, highlightEnabled: false, isLoading: false, isMobile: false, mapView: this.mapView, onSelectionChanged: this.featureDetailsChanged.bind(this), zoomAndScrollToSelected: true }))));
456
+ return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this._selectedLayerName, loading: this._loadingFeatureDetails, 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 }), h("calcite-panel", null, this._selectedFeature.length > 1 && this.getFeaturesPagination(), h("feature-details", { class: 'full-height', graphics: this._selectedFeature, mapView: this.mapView, onLoadingStatus: (evt) => { void this.updatingFeatureDetails(evt.detail); }, ref: el => this._featureDetails = el, reportingOptions: this.reportingOptions }))));
457
+ }
458
+ /**
459
+ * Returns the pagination for the multiple features
460
+ * Create pagination to avoid the overlap of like, dislike and comment section
461
+ * @returns Node
462
+ */
463
+ getFeaturesPagination() {
464
+ return (h("div", { class: "feature-pagination", slot: "header-actions-start" }, h("div", null, h("calcite-button", { appearance: 'transparent', disabled: false, iconStart: "chevron-left", id: "solutions-back", onClick: () => void this._featureDetails.back(), scale: "s", width: "full" }), h("calcite-tooltip", { label: "", placement: "top", "reference-element": "solutions-back" }, h("span", null, this._translations.back))), h("calcite-button", { appearance: 'transparent', class: 'pagination-action', onClick: () => void this._featureDetails.toggleListView(), scale: "s" }, h("span", { class: "pagination-count" }, this._getCount())), h("div", null, h("calcite-button", { appearance: "transparent", disabled: false, iconStart: "chevron-right", id: "solutions-next", onClick: () => void this._featureDetails.next(), scale: "s", width: "full" }), h("calcite-tooltip", { placement: "top", "reference-element": "solutions-next" }, h("span", null, this._translations.next)))));
370
465
  }
371
466
  /**
372
467
  * Sets the selected features and updates the first feature as the current selected feature
@@ -394,14 +489,6 @@ export class CrowdsourceReporter {
394
489
  }
395
490
  this._updateShareURL();
396
491
  }
397
- /**
398
- * On Feature details change update the Layer title and the current selected layer id
399
- * @param evt Event hold the details of current feature graphic in the info-card
400
- */
401
- featureDetailsChanged(evt) {
402
- this.setCurrentFeature(evt.detail[0]);
403
- void this.highlightOnMap(evt.detail[0]);
404
- }
405
492
  /**
406
493
  * Highlights the feature on map
407
494
  * @param selectedFeature Graphic currently shown in feature details
@@ -414,8 +501,9 @@ export class CrowdsourceReporter {
414
501
  const selectedLayerView = await getFeatureLayerView(this.mapView, selectedFeature.layer.id);
415
502
  // remove previous highlight options (if any) to highlight the feature by default color
416
503
  selectedLayerView.highlightOptions = null;
417
- this._highlightHandle = await highlightFeatures([selectedFeature.getObjectId()], selectedLayerView, this.mapView, true);
504
+ this._highlightHandle = await highlightFeatures([selectedFeature.getObjectId()], selectedLayerView, this.mapView, true, this.zoomToScale);
418
505
  }
506
+ void this.updatingFeatureDetails(false);
419
507
  }
420
508
  /**
421
509
  * Clears the highlight
@@ -521,6 +609,19 @@ export class CrowdsourceReporter {
521
609
  }
522
610
  }
523
611
  }
612
+ /**
613
+ * Get the current index of total string
614
+ *
615
+ * @returns the index of total string
616
+ * @protected
617
+ */
618
+ _getCount() {
619
+ const index = (this.selectedFeatureIndex + 1).toString();
620
+ const total = this._selectedFeature.length.toString();
621
+ return this._translations.indexOfTotal
622
+ .replace("{{index}}", index)
623
+ .replace("{{total}}", total);
624
+ }
524
625
  /**
525
626
  * Fetches the component's translations
526
627
  * @returns Promise when complete
@@ -769,21 +870,6 @@ export class CrowdsourceReporter {
769
870
  "attribute": "enable-new-reports",
770
871
  "reflect": false
771
872
  },
772
- "layers": {
773
- "type": "unknown",
774
- "mutable": false,
775
- "complexType": {
776
- "original": "string[]",
777
- "resolved": "string[]",
778
- "references": {}
779
- },
780
- "required": false,
781
- "optional": false,
782
- "docs": {
783
- "tags": [],
784
- "text": "string[]: list of layer ids"
785
- }
786
- },
787
873
  "loginTitle": {
788
874
  "type": "string",
789
875
  "mutable": false,
@@ -1133,6 +1219,27 @@ export class CrowdsourceReporter {
1133
1219
  },
1134
1220
  "attribute": "zoom-to-scale",
1135
1221
  "reflect": false
1222
+ },
1223
+ "layerExpressions": {
1224
+ "type": "unknown",
1225
+ "mutable": false,
1226
+ "complexType": {
1227
+ "original": "ILayerExpression[]",
1228
+ "resolved": "ILayerExpression[]",
1229
+ "references": {
1230
+ "ILayerExpression": {
1231
+ "location": "import",
1232
+ "path": "../../utils/interfaces",
1233
+ "id": "src/utils/interfaces.ts::ILayerExpression"
1234
+ }
1235
+ }
1236
+ },
1237
+ "required": false,
1238
+ "optional": false,
1239
+ "docs": {
1240
+ "tags": [],
1241
+ "text": "ILayerExpression[]: Array of layer expressions for layers (filter configuration)"
1242
+ }
1136
1243
  }
1137
1244
  };
1138
1245
  }
@@ -1146,7 +1253,11 @@ export class CrowdsourceReporter {
1146
1253
  "_selectedLayerName": {},
1147
1254
  "_reportSubmitted": {},
1148
1255
  "_showSubmitCancelButton": {},
1149
- "_featureCreationFailedErrorMsg": {}
1256
+ "_loadingFeatureDetails": {},
1257
+ "_featureCreationFailedErrorMsg": {},
1258
+ "_updatedProgressBarStatus": {},
1259
+ "_filterOpen": {},
1260
+ "_filterActive": {}
1150
1261
  };
1151
1262
  }
1152
1263
  static get events() {
@@ -1177,4 +1288,13 @@ export class CrowdsourceReporter {
1177
1288
  "methodName": "mapViewWatchHandler"
1178
1289
  }];
1179
1290
  }
1291
+ static get listeners() {
1292
+ return [{
1293
+ "name": "selectionChanged",
1294
+ "method": "selectionChanged",
1295
+ "target": "window",
1296
+ "capture": false,
1297
+ "passive": false
1298
+ }];
1299
+ }
1180
1300
  }
@@ -0,0 +1,18 @@
1
+ :host {
2
+ display: block;
3
+ }
4
+
5
+ .buttons{
6
+ align-items: center;
7
+ background-color: white;
8
+ display: flex;
9
+ padding: 10px 0 10px 15px;
10
+ border-block-start: 1px solid var(--calcite-color-border-3);
11
+ border-block-end: 1px solid var(--calcite-color-border-3);
12
+ }
13
+
14
+ .comment-btn{
15
+ display: flex;
16
+ gap: 5px;
17
+ width: 35px;
18
+ }