@esri/solutions-components 0.10.12 → 0.10.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/calcite-alert_4.cjs.entry.js +1 -1
- package/dist/cjs/calcite-flow_6.cjs.entry.js +103 -7
- package/dist/cjs/crowdsource-reporter.cjs.entry.js +173 -43
- package/dist/cjs/feature-list.cjs.entry.js +110 -17
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{popupUtils-92e52dbf.js → popupUtils-47bd97e7.js} +1 -1
- package/dist/cjs/solutions-components.cjs.js +1 -1
- package/dist/collection/assets/t9n/crowdsource-reporter/resources.json +3 -1
- package/dist/collection/assets/t9n/crowdsource-reporter/resources_en.json +3 -1
- package/dist/collection/assets/t9n/feature-list/resources.json +3 -1
- package/dist/collection/assets/t9n/feature-list/resources_en.json +3 -1
- package/dist/collection/components/create-feature/create-feature.js +145 -2
- package/dist/collection/components/crowdsource-reporter/crowdsource-reporter.js +227 -43
- package/dist/collection/components/feature-list/feature-list.css +16 -1
- package/dist/collection/components/feature-list/feature-list.js +165 -15
- package/dist/collection/components/layer-list/layer-list.js +35 -6
- package/dist/collection/demos/crowdsource-reporter.html +2 -0
- package/dist/collection/utils/popupUtils.js +1 -1
- package/dist/collection/utils/popupUtils.ts +1 -1
- package/dist/components/create-feature2.js +91 -3
- package/dist/components/crowdsource-reporter.js +178 -45
- package/dist/components/feature-list2.js +152 -50
- package/dist/components/layer-list2.js +18 -6
- package/dist/components/popupUtils.js +1 -1
- package/dist/esm/calcite-alert_4.entry.js +1 -1
- package/dist/esm/calcite-flow_6.entry.js +104 -8
- package/dist/esm/crowdsource-reporter.entry.js +173 -43
- package/dist/esm/feature-list.entry.js +110 -17
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{popupUtils-00c655fb.js → popupUtils-349a26e6.js} +1 -1
- package/dist/esm/solutions-components.js +1 -1
- package/dist/solutions-components/assets/t9n/crowdsource-reporter/resources.json +3 -1
- package/dist/solutions-components/assets/t9n/crowdsource-reporter/resources_en.json +3 -1
- package/dist/solutions-components/assets/t9n/feature-list/resources.json +3 -1
- package/dist/solutions-components/assets/t9n/feature-list/resources_en.json +3 -1
- package/dist/solutions-components/demos/crowdsource-reporter.html +2 -0
- package/dist/solutions-components/p-40e305b4.entry.js +17 -0
- package/dist/solutions-components/p-4d44410b.entry.js +6 -0
- package/dist/solutions-components/{p-900fee65.js → p-5a473f0d.js} +1 -1
- package/dist/solutions-components/p-9b83e593.entry.js +6 -0
- package/dist/solutions-components/{p-cde8d6e5.entry.js → p-f6bc95b3.entry.js} +1 -1
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/dist/solutions-components/utils/popupUtils.ts +1 -1
- package/dist/types/components/create-feature/create-feature.d.ts +34 -0
- package/dist/types/components/crowdsource-reporter/crowdsource-reporter.d.ts +80 -21
- package/dist/types/components/feature-list/feature-list.d.ts +49 -7
- package/dist/types/components/layer-list/layer-list.d.ts +4 -0
- package/dist/types/components.d.ts +77 -0
- package/package.json +1 -1
- package/dist/solutions-components/p-064e43e0.entry.js +0 -6
- package/dist/solutions-components/p-2d1afda0.entry.js +0 -17
- package/dist/solutions-components/p-c9260b4c.entry.js +0 -6
@@ -90,11 +90,13 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
|
|
90
90
|
this.searchConfiguration = undefined;
|
91
91
|
this.showComments = undefined;
|
92
92
|
this.showUserImageInCommentsList = false;
|
93
|
+
this.showFeatureSymbol = false;
|
94
|
+
this.showMyReportsOnly = false;
|
93
95
|
this.theme = "light";
|
94
96
|
this.zoomToScale = undefined;
|
97
|
+
this.floorLevel = undefined;
|
95
98
|
this._featureCreationFailedErrorMsg = undefined;
|
96
99
|
this._filterActive = false;
|
97
|
-
this._filterOpen = false;
|
98
100
|
this._flowItems = [];
|
99
101
|
this._hasValidLayers = false;
|
100
102
|
this._loadingFeatureDetails = undefined;
|
@@ -189,6 +191,11 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
|
|
189
191
|
* esri/core/reactiveUtils: https://developers.arcgis.com/javascript/latest/api-reference/esri-core-reactiveUtils.html
|
190
192
|
*/
|
191
193
|
reactiveUtils;
|
194
|
+
/**
|
195
|
+
* "esri/layers/support/FeatureFilter": https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureFilter.html
|
196
|
+
* Esri FeatureFilter
|
197
|
+
*/
|
198
|
+
FeatureFilter;
|
192
199
|
/**
|
193
200
|
* __esri.Graphic: The selected feature
|
194
201
|
*/
|
@@ -225,6 +232,22 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
|
|
225
232
|
* boolean: when true allow panel to show in full height
|
226
233
|
*/
|
227
234
|
_showFullPanel;
|
235
|
+
/**
|
236
|
+
* string: The current floor expression
|
237
|
+
*/
|
238
|
+
_floorExpression;
|
239
|
+
/**
|
240
|
+
* _esri.Element: form elements of the selected layer
|
241
|
+
*/
|
242
|
+
_formElements = [];
|
243
|
+
/**
|
244
|
+
* string[]: URL params set by using filters.
|
245
|
+
*/
|
246
|
+
_filterUrlParams;
|
247
|
+
/**
|
248
|
+
* FilterInitState: filter's init state
|
249
|
+
*/
|
250
|
+
_filterInitState;
|
228
251
|
//--------------------------------------------------------------------------
|
229
252
|
//
|
230
253
|
// Watch handlers
|
@@ -244,6 +267,30 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
|
|
244
267
|
await this.setMapView();
|
245
268
|
});
|
246
269
|
}
|
270
|
+
/**
|
271
|
+
* Called each time the floorLevel prop is changed.
|
272
|
+
*/
|
273
|
+
async floorLevelWatchHandler() {
|
274
|
+
if (this._editableLayerIds) {
|
275
|
+
// updates all layer's defination expression when floorLevel is changed
|
276
|
+
// then refresh the components to update features
|
277
|
+
for (const layerId of this._editableLayerIds) {
|
278
|
+
const layer = await getLayerOrTable(this.mapView, layerId);
|
279
|
+
if (layer.floorInfo?.floorField) {
|
280
|
+
this._updateFloorDefinitionExpression(layer);
|
281
|
+
}
|
282
|
+
}
|
283
|
+
}
|
284
|
+
if (this._layerList) {
|
285
|
+
await this._layerList.refresh();
|
286
|
+
}
|
287
|
+
if (this._featureList) {
|
288
|
+
void this._featureList.refresh();
|
289
|
+
}
|
290
|
+
if (this._createFeature) {
|
291
|
+
void this._createFeature.refresh(this.floorLevel);
|
292
|
+
}
|
293
|
+
}
|
247
294
|
//--------------------------------------------------------------------------
|
248
295
|
//
|
249
296
|
// Methods (public)
|
@@ -285,7 +332,7 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
|
|
285
332
|
*/
|
286
333
|
render() {
|
287
334
|
const themeClass = this.theme === "dark" ? "calcite-mode-dark" : "calcite-mode-light";
|
288
|
-
return (h(Host, { key: '
|
335
|
+
return (h(Host, { key: '57ea463ae2d3eac3a23e63ed8702f5fde3743e09' }, this._reportSubmitted && h("calcite-alert", { key: '4082ad71fa4d6c3a01ec0ac6477e81b3d3bc40e1', "auto-close": true, class: themeClass + " report-submitted-msg", icon: "check-circle", kind: "success", label: "", onCalciteAlertClose: () => { this._reportSubmitted = false; }, open: true, placement: "top" }, h("div", { key: '9e042989b10a7d68347b7f34b9f31957ede3ca37', slot: "message" }, this.reportSubmittedMessage ? this.reportSubmittedMessage : this._translations.submitMsg)), this._featureCreationFailedErrorMsg && h("calcite-alert", { key: '573dc6a472b00191a1822c95ba0ee2192c486612', "auto-close": true, class: themeClass, icon: "x-octagon", kind: "danger", label: "", onCalciteAlertClose: () => { this._featureCreationFailedErrorMsg = ""; }, open: true, placement: "top" }, h("div", { key: 'f3799e01a09ccbeec651762833783d3200729f1b', slot: "title" }, this._translations.error), h("div", { key: 'cd80f9a2c8df9a4c7b5b517a9e98ce4622e230c2', slot: "message" }, this._featureCreationFailedErrorMsg)), this._commentSubmitted && h("calcite-alert", { key: '1137ce7794f36419d20a5b5d2d1f390e72713155', "auto-close": true, class: 'report-submitted ' + themeClass, icon: "check-circle", kind: "success", label: "", onCalciteAlertClose: () => { this._commentSubmitted = false; }, open: true, placement: "top" }, h("div", { key: '24a0604c3be1cab965c48ab46435c349a7d67f65', slot: "message" }, this._translations.commentSubmittedMsg)), this._addingCommentFailed && h("calcite-alert", { key: '86112e4c449e1061fa436822670dc93cb3bfe949', "auto-close": true, class: themeClass, icon: "x-octagon", kind: "danger", label: "", onCalciteAlertClose: () => { this._addingCommentFailed = false; }, open: true, placement: "top" }, h("div", { key: '94be8a14c1bf22127f8018dfe3a92304870ce70d', slot: "title" }, this._translations.error), h("div", { key: '6b30463e2ee941834fcad93e4cbe32e5a65d592d', slot: "message" }, this._translations.addingCommentFailedMsg)), h("div", { key: '9b928eab61af6ed84a0059dbc04c633c131f879b' }, h("calcite-shell", { key: 'e07ac5d7d6d8e8c8fd0001586448ab13733e2ed5', "content-behind": true }, this._getReporter()))));
|
289
336
|
}
|
290
337
|
//--------------------------------------------------------------------------
|
291
338
|
//
|
@@ -300,10 +347,12 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
|
|
300
347
|
* @protected
|
301
348
|
*/
|
302
349
|
async _initModules() {
|
303
|
-
const [reactiveUtils] = await loadModules([
|
304
|
-
"esri/core/reactiveUtils"
|
350
|
+
const [reactiveUtils, FeatureFilter] = await loadModules([
|
351
|
+
"esri/core/reactiveUtils",
|
352
|
+
"esri/layers/support/FeatureFilter"
|
305
353
|
]);
|
306
354
|
this.reactiveUtils = reactiveUtils;
|
355
|
+
this.FeatureFilter = FeatureFilter;
|
307
356
|
}
|
308
357
|
/**
|
309
358
|
* Set the selected layer id and layer name
|
@@ -342,6 +391,10 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
|
|
342
391
|
case "feature-list":
|
343
392
|
renderLists.push(this.getFeatureListFlowItem(this._selectedLayerId, this._selectedLayerName));
|
344
393
|
break;
|
394
|
+
case "filter-panel":
|
395
|
+
renderLists.push(this.getFilterPanel());
|
396
|
+
void this._restoreFilters();
|
397
|
+
break;
|
345
398
|
case "feature-details":
|
346
399
|
renderLists.push(this.getFeatureDetailsFlowItem());
|
347
400
|
break;
|
@@ -364,32 +417,6 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
|
|
364
417
|
? h("calcite-flow", null, renderLists?.length > 0 && renderLists)
|
365
418
|
: h("calcite-loader", { label: "", scale: "m" })));
|
366
419
|
}
|
367
|
-
/**
|
368
|
-
* Show filter component in modal
|
369
|
-
* @returns node to interact with any configured filters for the current layer
|
370
|
-
*/
|
371
|
-
filterModal() {
|
372
|
-
//get layer expression for current selected layer
|
373
|
-
const currentLayersExpressions = this.layerExpressions ? this.layerExpressions.filter((exp) => exp.id === this._selectedLayerId) : [];
|
374
|
-
return (currentLayersExpressions.length > 0 &&
|
375
|
-
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" }, this._translations?.filterLayerTitle?.replace("{{title}}", this._selectedLayerName)), h("div", { slot: "content" }, h("instant-apps-filter-list", { autoUpdateUrl: false, closeBtn: true, closeBtnOnClick: () => void this._closeFilter(), comboboxOverlayPositioning: "fixed", layerExpressions: currentLayersExpressions, onFilterListReset: () => this._handleFilterListReset(), onFilterUpdate: () => this._handleFilterUpdate(), ref: (el) => this._filterList = el, view: this.mapView, zoomBtn: false }))));
|
376
|
-
}
|
377
|
-
/**
|
378
|
-
* Close the filter modal
|
379
|
-
* @protected
|
380
|
-
*/
|
381
|
-
_closeFilter() {
|
382
|
-
if (this._filterOpen) {
|
383
|
-
this._filterOpen = false;
|
384
|
-
}
|
385
|
-
}
|
386
|
-
/**
|
387
|
-
* When true the filter modal will be displayed
|
388
|
-
* @protected
|
389
|
-
*/
|
390
|
-
_toggleFilter() {
|
391
|
-
this._filterOpen = !this._filterOpen;
|
392
|
-
}
|
393
420
|
/**
|
394
421
|
* On sort option click update the sort field and sort order
|
395
422
|
* @param sortField sort field
|
@@ -414,14 +441,27 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
|
|
414
441
|
h(Fragment, null, h("calcite-list-item", { label: this._translations.sortHighestVoted, onCalciteListItemSelect: () => { void this.sortOptionClick(this.reportingOptions[this._selectedLayerId].likeField, "desc", "sortHighestVoted"); }, selected: this._updatedSortOption === "sortHighestVoted", value: "sortHighestVoted" }), h("calcite-list-item", { label: this._translations.sortLowestVoted, onCalciteListItemSelect: () => { void this.sortOptionClick(this.reportingOptions[this._selectedLayerId].likeField, "asc", "sortLowestVoted"); }, selected: this._updatedSortOption === "sortLowestVoted", value: "sortLowestVoted" })))));
|
415
442
|
}
|
416
443
|
/**
|
417
|
-
*
|
444
|
+
* Restores the applied filters
|
445
|
+
* @protected
|
446
|
+
*/
|
447
|
+
_restoreFilters() {
|
448
|
+
// call the restore function when instant-apps-filter-list is ready
|
449
|
+
setTimeout(() => {
|
450
|
+
const canRestoreFilter = this._filterList && this._filterUrlParams && this._filterInitState;
|
451
|
+
if (canRestoreFilter) {
|
452
|
+
void this._filterList.restoreFilters(this._filterUrlParams[0], this._filterInitState);
|
453
|
+
}
|
454
|
+
}, 200);
|
455
|
+
}
|
456
|
+
/**
|
457
|
+
* Reset the filter
|
418
458
|
* @protected
|
419
459
|
*/
|
420
|
-
_handleFilterListReset() {
|
421
|
-
//on reset filter list reset the filter
|
460
|
+
async _handleFilterListReset() {
|
461
|
+
//on reset filter list reset the filter states
|
422
462
|
this._filterActive = false;
|
423
|
-
|
424
|
-
|
463
|
+
this._filterUrlParams = null;
|
464
|
+
this._filterInitState = null;
|
425
465
|
}
|
426
466
|
/**
|
427
467
|
* Check if the layers definitionExpression has been modified and update the feature list depending on the applied filters
|
@@ -431,8 +471,7 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
|
|
431
471
|
//if filter are applied the url params will be generated
|
432
472
|
//set the filter active state based on the length of applied filters
|
433
473
|
this._filterActive = this._filterList.urlParams.getAll('filter').length > 0;
|
434
|
-
|
435
|
-
void this._featureList.refresh();
|
474
|
+
this._filterUrlParams = this._filterList.urlParams.getAll('filter');
|
436
475
|
}
|
437
476
|
/**
|
438
477
|
* Get the feature layer list
|
@@ -441,7 +480,7 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
|
|
441
480
|
*/
|
442
481
|
getLayerListFlowItem() {
|
443
482
|
return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this.reportsHeader }, this.isMobile && this.getActionToExpandCollapsePanel(), this._hasValidLayers && this.enableNewReports &&
|
444
|
-
h("calcite-button", { appearance: "solid", onClick: this.navigateToChooseCategory.bind(this), slot: "footer", width: "full" }, this.reportButtonText ? this.reportButtonText : this._translations.createReportButtonText), h("calcite-panel", { "full-height": true, "full-width": true }, h("layer-list", { class: "height-full", layers: this._editableLayerIds?.length > 0 ? this._editableLayerIds : this._layers, mapView: this.mapView, onLayerSelect: this.displayFeaturesList.bind(this), onLayersListLoaded: this.layerListLoaded.bind(this), ref: el => this._layerList = el, showFeatureCount: true, showNextIcon: true }))));
|
483
|
+
h("calcite-button", { appearance: "solid", onClick: this.navigateToChooseCategory.bind(this), slot: "footer", width: "full" }, this.reportButtonText ? this.reportButtonText : this._translations.createReportButtonText), h("calcite-panel", { "full-height": true, "full-width": true }, h("layer-list", { applyLayerViewFilter: this.showMyReportsOnly, class: "height-full", layers: this._editableLayerIds?.length > 0 ? this._editableLayerIds : this._layers, mapView: this.mapView, onLayerSelect: this.displayFeaturesList.bind(this), onLayersListLoaded: this.layerListLoaded.bind(this), ref: el => this._layerList = el, showFeatureCount: true, showNextIcon: true }))));
|
445
484
|
}
|
446
485
|
/**
|
447
486
|
* Get the layer list for creating a report
|
@@ -460,7 +499,7 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
|
|
460
499
|
* @protected
|
461
500
|
*/
|
462
501
|
getFeatureCreateFlowItem() {
|
463
|
-
return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this._selectedLayerName, onCalciteFlowItemBack: this.backFromCreateFeaturePanel.bind(this) }, this._showSubmitCancelButton && h("div", { class: "width-full", slot: "footer" }, h("calcite-button", { appearance: "solid", class: "footer-top-button footer-button", onClick: this.onCreateFeatureSubmitButtonClick.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, isMobile: this.isMobile, mapView: this.mapView, onDrawComplete: this.onFormReady.bind(this), onEditingAttachment: this.showSubmitCancelButton.bind(this), onFail: this.createFeatureFailed.bind(this), onModeChanged: this.backFromCreateFeaturePanel.bind(this), onProgressStatus: this.updatedProgressStatus.bind(this), onSuccess: this.onReportSubmitted.bind(this), ref: el => this._createFeature = el, searchConfiguration: this.searchConfiguration, selectedLayerId: this._selectedLayerId }))));
|
502
|
+
return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this._selectedLayerName, onCalciteFlowItemBack: this.backFromCreateFeaturePanel.bind(this) }, this._showSubmitCancelButton && h("div", { class: "width-full", slot: "footer" }, h("calcite-button", { appearance: "solid", class: "footer-top-button footer-button", onClick: this.onCreateFeatureSubmitButtonClick.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, floorLevel: this.floorLevel, formElements: this._formElements.find(elm => elm.id === this._selectedLayerId), isMobile: this.isMobile, mapView: this.mapView, onDrawComplete: this.onFormReady.bind(this), onEditingAttachment: this.showSubmitCancelButton.bind(this), onFail: this.createFeatureFailed.bind(this), onModeChanged: this.backFromCreateFeaturePanel.bind(this), onProgressStatus: this.updatedProgressStatus.bind(this), onSuccess: this.onReportSubmitted.bind(this), ref: el => this._createFeature = el, searchConfiguration: this.searchConfiguration, selectedLayerId: this._selectedLayerId }))));
|
464
503
|
}
|
465
504
|
/**
|
466
505
|
* Update the progress bar status when editor panel changes
|
@@ -597,8 +636,10 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
|
|
597
636
|
*/
|
598
637
|
async navigateToCreateFeature(evt) {
|
599
638
|
if (evt.detail.layerId && evt.detail.layerName) {
|
600
|
-
|
639
|
+
await this.setSelectedLayer(evt.detail.layerId, evt.detail.layerName);
|
601
640
|
}
|
641
|
+
// get the form template elements to pass in create-feature to create a LEVELID field in feature-form
|
642
|
+
this._getFormElements();
|
602
643
|
this._showSubmitCancelButton = false;
|
603
644
|
this.updatePanelState(false, true);
|
604
645
|
this._flowItems = [...this._flowItems, "feature-create"];
|
@@ -655,6 +696,15 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
|
|
655
696
|
void this.setSelectedLayer(evt.detail.layerId, evt.detail.layerName);
|
656
697
|
this._flowItems = [...this._flowItems, "feature-list"];
|
657
698
|
}
|
699
|
+
/**
|
700
|
+
* On back from filter panel get the filter's init state
|
701
|
+
* @protected
|
702
|
+
*/
|
703
|
+
async backFromFilterPanel() {
|
704
|
+
this._filterInitState = await this._filterList.getFilterInitState();
|
705
|
+
void this._featureList.refresh();
|
706
|
+
this.backFromSelectedPanel();
|
707
|
+
}
|
658
708
|
/**
|
659
709
|
* On back from selected panel navigate to the previous panel
|
660
710
|
* @protected
|
@@ -672,6 +722,10 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
|
|
672
722
|
(updatedFlowItems[0] === 'feature-list' || updatedFlowItems[updatedFlowItems.length - 2] === 'feature-list'))) {
|
673
723
|
this.updatePanelState(this._sidePanelCollapsed, false);
|
674
724
|
}
|
725
|
+
// Coming back from feature details refresh the feature list to update the like count
|
726
|
+
if (this.reportingOptions && this.reportingOptions[this._selectedLayerId]?.like && updatedFlowItems[updatedFlowItems.length - 1] === 'feature-details') {
|
727
|
+
void this._featureList.refresh();
|
728
|
+
}
|
675
729
|
updatedFlowItems.pop();
|
676
730
|
//Back to layer list, and return as the flowItems will be reset in navigateToHomePage
|
677
731
|
if (updatedFlowItems.length === 1 && updatedFlowItems[0] === 'layer-list') {
|
@@ -759,8 +813,19 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
|
|
759
813
|
const layerExpressions = this.layerExpressions?.filter((exp) => exp.id === this._selectedLayerId);
|
760
814
|
const canCreateReports = this._getLayersConfig(this._selectedLayerId)?.reporting && this._layerItemsHash[this._selectedLayerId].supportsAdd;
|
761
815
|
const showFilterIcon = layerExpressions?.length > 0;
|
762
|
-
return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: layerName, loading: this._showLoadingIndicator, onCalciteFlowItemBack: this.backFromSelectedPanel.bind(this) }, this._toggleSort(), h("calcite-action", { icon: "sort-ascending-arrow", id: "sort-popover", slot: "header-actions-end", text: this._translations.sort, title: this._translations.sort }), showFilterIcon && h("calcite-action", { icon: "filter", indicator: this._filterActive, onClick: this.
|
763
|
-
h("calcite-button", { appearance: "solid", onClick: this.navigateToCreateFeature.bind(this), slot: "footer", width: "full" }, this.reportButtonText ? this.reportButtonText : this._translations.createReportButtonText), h("calcite-panel", { "full-height": true }, h("feature-list", { class: "height-full", highlightOnHover: true, mapView: this.mapView, noFeaturesFoundMsg: this._translations.featureErrorMsg, onFeatureSelect: this.onFeatureSelectFromList.bind(this), pageSize: 30, ref: el => this._featureList = el, selectedLayerId: layerId, sortingInfo: this._updatedSorting }))));
|
816
|
+
return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: layerName, loading: this._showLoadingIndicator, onCalciteFlowItemBack: this.backFromSelectedPanel.bind(this) }, this._toggleSort(), h("calcite-action", { icon: "sort-ascending-arrow", id: "sort-popover", slot: "header-actions-end", text: this._translations.sort, title: this._translations.sort }), showFilterIcon && h("calcite-action", { icon: "filter", indicator: this._filterActive, onClick: () => { this._flowItems = [...this._flowItems, "filter-panel"]; }, slot: "header-actions-end", text: this._translations.filter, title: this._translations.filter }), this.isMobile && this.getActionToExpandCollapsePanel(), this.enableNewReports && canCreateReports &&
|
817
|
+
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", { applyLayerViewFilter: this.showMyReportsOnly, class: "height-full", highlightOnHover: true, mapView: this.mapView, noFeaturesFoundMsg: this._translations.featureErrorMsg, onFeatureSelect: this.onFeatureSelectFromList.bind(this), pageSize: 30, ref: el => this._featureList = el, reportingOptions: this.reportingOptions, selectedLayerId: layerId, showFeatureSymbol: this.showFeatureSymbol, sortingInfo: this._updatedSorting }))));
|
818
|
+
}
|
819
|
+
/**
|
820
|
+
* Get Filter page for apllying filter
|
821
|
+
* @param layerId Layer id
|
822
|
+
* @param layerName Layer name
|
823
|
+
* @returns feature list node
|
824
|
+
* @protected
|
825
|
+
*/
|
826
|
+
getFilterPanel() {
|
827
|
+
const currentLayersExpressions = this.layerExpressions ? this.layerExpressions.filter((exp) => exp.id === this._selectedLayerId) : [];
|
828
|
+
return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this._translations?.filterLayerTitle?.replace("{{title}}", this._selectedLayerName), loading: this._showLoadingIndicator, onCalciteFlowItemBack: this.backFromFilterPanel.bind(this) }, this.isMobile && this.getActionToExpandCollapsePanel(), h("div", { class: "width-full", slot: "footer" }, h("div", { class: "width-full", slot: "footer" }, h("calcite-button", { appearance: "solid", class: "footer-top-button footer-button", onClick: () => { void this._filterList?.forceReset(); }, width: "full" }, this._translations.resetFilter), h("calcite-button", { appearance: "outline", class: "footer-button", onClick: this.backFromFilterPanel.bind(this), width: "full" }, this._translations.close))), h("calcite-panel", { "full-height": true }, h("instant-apps-filter-list", { autoUpdateUrl: false, closeBtnOnClick: () => undefined, comboboxOverlayPositioning: "fixed", layerExpressions: currentLayersExpressions, onFilterListReset: () => this._handleFilterListReset(), onFilterUpdate: () => this._handleFilterUpdate(), ref: (el) => this._filterList = el, resetFiltersOnDisconnect: false, view: this.mapView, zoomBtn: false }))));
|
764
829
|
}
|
765
830
|
/**
|
766
831
|
* Returns the calcite-flow item for feature details
|
@@ -864,6 +929,8 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
|
|
864
929
|
*/
|
865
930
|
async setMapView() {
|
866
931
|
await this.getLayersToShowInList();
|
932
|
+
// filter/update the feature(s) if any filter/condition is already applied
|
933
|
+
await this._updateFeatures();
|
867
934
|
// if only one valid layer is present then directly render features list
|
868
935
|
if (this._editableLayerIds?.length === 1) {
|
869
936
|
await this.renderFeaturesList();
|
@@ -965,6 +1032,39 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
|
|
965
1032
|
const messages = await getLocaleComponentStrings(this.el);
|
966
1033
|
this._translations = messages[0];
|
967
1034
|
}
|
1035
|
+
/**
|
1036
|
+
* Applies a definition expression when floor field and level are available
|
1037
|
+
*
|
1038
|
+
* @returns boolean
|
1039
|
+
* @protected
|
1040
|
+
*/
|
1041
|
+
_updateFloorDefinitionExpression(layer) {
|
1042
|
+
const floorField = layer.floorInfo.floorField;
|
1043
|
+
// update the layer defination expression
|
1044
|
+
const floorExp = `${floorField} = '${this.floorLevel}'`;
|
1045
|
+
const defExp = layer.definitionExpression;
|
1046
|
+
layer.definitionExpression = defExp?.indexOf(this._floorExpression) > -1 ?
|
1047
|
+
defExp.replace(this._floorExpression, floorExp) : floorExp;
|
1048
|
+
this._floorExpression = floorExp;
|
1049
|
+
}
|
1050
|
+
/**
|
1051
|
+
* Gets the form template elements
|
1052
|
+
* @protected
|
1053
|
+
*/
|
1054
|
+
_getFormElements() {
|
1055
|
+
const layer = this._selectedLayer;
|
1056
|
+
const floorField = layer?.floorInfo?.floorField;
|
1057
|
+
if (floorField && this.floorLevel && layer?.formTemplate) {
|
1058
|
+
const formElement = this._formElements.find((elm) => elm.id === layer.id);
|
1059
|
+
if (this._formElements.length === 0 || !formElement) {
|
1060
|
+
this._formElements.push({
|
1061
|
+
id: layer.id,
|
1062
|
+
orgElements: layer.formTemplate.elements,
|
1063
|
+
orgExpressionInfos: layer.formTemplate.expressionInfos
|
1064
|
+
});
|
1065
|
+
}
|
1066
|
+
}
|
1067
|
+
}
|
968
1068
|
/**
|
969
1069
|
* Returns the ids of all OR configured layers that support edits with the update capability
|
970
1070
|
* @param hash each layer item details
|
@@ -982,6 +1082,35 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
|
|
982
1082
|
return prev;
|
983
1083
|
}, []);
|
984
1084
|
}
|
1085
|
+
/**
|
1086
|
+
* updates the features for layer/feature list
|
1087
|
+
* @protected
|
1088
|
+
*/
|
1089
|
+
async _updateFeatures() {
|
1090
|
+
for (const eachLayerId of this._editableLayerIds) {
|
1091
|
+
const featureLayerView = await getFeatureLayerView(this.mapView, eachLayerId);
|
1092
|
+
// In case of show my features add filter for Featurelayerview
|
1093
|
+
await this._showMyFeaturesOnly(featureLayerView);
|
1094
|
+
const floorField = featureLayerView.layer?.floorInfo?.floorField;
|
1095
|
+
if (floorField && this.floorLevel) {
|
1096
|
+
// Update the layer's defination as per selected floor level from map for all editable layers
|
1097
|
+
this._updateFloorDefinitionExpression(featureLayerView.layer);
|
1098
|
+
}
|
1099
|
+
}
|
1100
|
+
}
|
1101
|
+
/**
|
1102
|
+
* Show only loggedIn user's features
|
1103
|
+
* @protected
|
1104
|
+
*/
|
1105
|
+
async _showMyFeaturesOnly(featureLayerView) {
|
1106
|
+
const loggedInUserName = this.mapView.map.portalItem.portal?.credential?.userId;
|
1107
|
+
if (loggedInUserName) {
|
1108
|
+
const creatorField = featureLayerView.layer.editFieldsInfo?.creatorField.toLowerCase();
|
1109
|
+
featureLayerView.filter = this.showMyReportsOnly && creatorField ? new this.FeatureFilter({
|
1110
|
+
where: creatorField + "='" + loggedInUserName + "'"
|
1111
|
+
}) : null;
|
1112
|
+
}
|
1113
|
+
}
|
985
1114
|
/**
|
986
1115
|
* Creates the list of layers to be listed in layer list
|
987
1116
|
* @protected
|
@@ -1069,7 +1198,8 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
|
|
1069
1198
|
}
|
1070
1199
|
static get watchers() { return {
|
1071
1200
|
"isMobile": ["isMobileWatchHandler"],
|
1072
|
-
"mapView": ["mapViewWatchHandler"]
|
1201
|
+
"mapView": ["mapViewWatchHandler"],
|
1202
|
+
"floorLevel": ["floorLevelWatchHandler"]
|
1073
1203
|
}; }
|
1074
1204
|
static get style() { return CrowdsourceReporterStyle0; }
|
1075
1205
|
}, [0, "crowdsource-reporter", {
|
@@ -1099,11 +1229,13 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
|
|
1099
1229
|
"searchConfiguration": [16],
|
1100
1230
|
"showComments": [4, "show-comments"],
|
1101
1231
|
"showUserImageInCommentsList": [4, "show-user-image-in-comments-list"],
|
1232
|
+
"showFeatureSymbol": [4, "show-feature-symbol"],
|
1233
|
+
"showMyReportsOnly": [4, "show-my-reports-only"],
|
1102
1234
|
"theme": [1],
|
1103
1235
|
"zoomToScale": [2, "zoom-to-scale"],
|
1236
|
+
"floorLevel": [1, "floor-level"],
|
1104
1237
|
"_featureCreationFailedErrorMsg": [32],
|
1105
1238
|
"_filterActive": [32],
|
1106
|
-
"_filterOpen": [32],
|
1107
1239
|
"_flowItems": [32],
|
1108
1240
|
"_hasValidLayers": [32],
|
1109
1241
|
"_loadingFeatureDetails": [32],
|
@@ -1121,7 +1253,8 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
|
|
1121
1253
|
"_addingCommentFailed": [32]
|
1122
1254
|
}, undefined, {
|
1123
1255
|
"isMobile": ["isMobileWatchHandler"],
|
1124
|
-
"mapView": ["mapViewWatchHandler"]
|
1256
|
+
"mapView": ["mapViewWatchHandler"],
|
1257
|
+
"floorLevel": ["floorLevelWatchHandler"]
|
1125
1258
|
}]);
|
1126
1259
|
function defineCustomElement$1() {
|
1127
1260
|
if (typeof customElements === "undefined") {
|