@esri/solutions-components 0.10.29 → 0.10.31
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/calcite-alert_5.cjs.entry.js +33 -12
- package/dist/cjs/calcite-flow_4.cjs.entry.js +15 -17
- package/dist/cjs/card-manager_3.cjs.entry.js +0 -2
- package/dist/cjs/crowdsource-reporter.cjs.entry.js +45 -22
- package/dist/cjs/feature-list.cjs.entry.js +16 -10
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/map-select-tools_3.cjs.entry.js +4 -1
- package/dist/cjs/solutions-components.cjs.js +1 -1
- package/dist/collection/assets/t9n/create-feature/resources_ar.json +1 -1
- package/dist/collection/assets/t9n/create-feature/resources_bg.json +1 -1
- package/dist/collection/assets/t9n/create-feature/resources_bs.json +1 -1
- package/dist/collection/assets/t9n/create-feature/resources_ca.json +1 -1
- package/dist/collection/assets/t9n/create-feature/resources_cs.json +1 -1
- package/dist/collection/assets/t9n/create-feature/resources_da.json +1 -1
- package/dist/collection/assets/t9n/create-feature/resources_de.json +1 -1
- package/dist/collection/assets/t9n/create-feature/resources_el.json +1 -1
- package/dist/collection/assets/t9n/create-feature/resources_es.json +1 -1
- package/dist/collection/assets/t9n/create-feature/resources_et.json +1 -1
- package/dist/collection/assets/t9n/create-feature/resources_fi.json +1 -1
- package/dist/collection/assets/t9n/create-feature/resources_fr.json +1 -1
- package/dist/collection/assets/t9n/create-feature/resources_he.json +1 -1
- package/dist/collection/assets/t9n/create-feature/resources_hr.json +1 -1
- package/dist/collection/assets/t9n/create-feature/resources_hu.json +1 -1
- package/dist/collection/assets/t9n/create-feature/resources_id.json +1 -1
- package/dist/collection/assets/t9n/create-feature/resources_it.json +1 -1
- package/dist/collection/assets/t9n/create-feature/resources_ja.json +1 -1
- package/dist/collection/assets/t9n/create-feature/resources_ko.json +1 -1
- package/dist/collection/assets/t9n/create-feature/resources_lt.json +1 -1
- package/dist/collection/assets/t9n/create-feature/resources_lv.json +1 -1
- package/dist/collection/assets/t9n/create-feature/resources_nb.json +1 -1
- package/dist/collection/assets/t9n/create-feature/resources_nl.json +1 -1
- package/dist/collection/assets/t9n/create-feature/resources_pl.json +1 -1
- package/dist/collection/assets/t9n/create-feature/resources_pt-BR.json +2 -2
- package/dist/collection/assets/t9n/create-feature/resources_pt-PT.json +1 -1
- package/dist/collection/assets/t9n/create-feature/resources_ro.json +1 -1
- package/dist/collection/assets/t9n/create-feature/resources_ru.json +1 -1
- package/dist/collection/assets/t9n/create-feature/resources_sk.json +1 -1
- package/dist/collection/assets/t9n/create-feature/resources_sl.json +1 -1
- package/dist/collection/assets/t9n/create-feature/resources_sr.json +1 -1
- package/dist/collection/assets/t9n/create-feature/resources_sv.json +1 -1
- package/dist/collection/assets/t9n/create-feature/resources_th.json +1 -1
- package/dist/collection/assets/t9n/create-feature/resources_tr.json +1 -1
- package/dist/collection/assets/t9n/create-feature/resources_uk.json +1 -1
- package/dist/collection/assets/t9n/create-feature/resources_vi.json +1 -1
- package/dist/collection/assets/t9n/create-feature/resources_zh-CN.json +1 -1
- package/dist/collection/assets/t9n/create-feature/resources_zh-HK.json +1 -1
- package/dist/collection/assets/t9n/create-feature/resources_zh-TW.json +1 -1
- package/dist/collection/components/card-manager/card-manager.js +0 -2
- package/dist/collection/components/create-feature/create-feature.css +8 -1
- package/dist/collection/components/create-feature/create-feature.js +32 -31
- package/dist/collection/components/create-related-feature/create-related-feature.js +9 -26
- package/dist/collection/components/crowdsource-reporter/crowdsource-reporter.js +45 -23
- package/dist/collection/components/feature-details/feature-details.js +6 -8
- package/dist/collection/components/feature-list/feature-list.js +16 -10
- package/dist/collection/components/map-select-tools/map-select-tools.js +4 -1
- package/dist/components/card-manager2.js +0 -2
- package/dist/components/create-feature2.js +33 -13
- package/dist/components/create-related-feature2.js +9 -10
- package/dist/components/crowdsource-reporter.js +45 -23
- package/dist/components/feature-details2.js +6 -8
- package/dist/components/feature-list2.js +16 -10
- package/dist/components/map-select-tools2.js +4 -1
- package/dist/esm/calcite-alert_5.entry.js +33 -12
- package/dist/esm/calcite-flow_4.entry.js +15 -17
- package/dist/esm/card-manager_3.entry.js +0 -2
- package/dist/esm/crowdsource-reporter.entry.js +45 -22
- package/dist/esm/feature-list.entry.js +16 -10
- package/dist/esm/loader.js +1 -1
- package/dist/esm/map-select-tools_3.entry.js +4 -1
- package/dist/esm/solutions-components.js +1 -1
- package/dist/solutions-components/assets/t9n/create-feature/resources_ar.json +1 -1
- package/dist/solutions-components/assets/t9n/create-feature/resources_bg.json +1 -1
- package/dist/solutions-components/assets/t9n/create-feature/resources_bs.json +1 -1
- package/dist/solutions-components/assets/t9n/create-feature/resources_ca.json +1 -1
- package/dist/solutions-components/assets/t9n/create-feature/resources_cs.json +1 -1
- package/dist/solutions-components/assets/t9n/create-feature/resources_da.json +1 -1
- package/dist/solutions-components/assets/t9n/create-feature/resources_de.json +1 -1
- package/dist/solutions-components/assets/t9n/create-feature/resources_el.json +1 -1
- package/dist/solutions-components/assets/t9n/create-feature/resources_es.json +1 -1
- package/dist/solutions-components/assets/t9n/create-feature/resources_et.json +1 -1
- package/dist/solutions-components/assets/t9n/create-feature/resources_fi.json +1 -1
- package/dist/solutions-components/assets/t9n/create-feature/resources_fr.json +1 -1
- package/dist/solutions-components/assets/t9n/create-feature/resources_he.json +1 -1
- package/dist/solutions-components/assets/t9n/create-feature/resources_hr.json +1 -1
- package/dist/solutions-components/assets/t9n/create-feature/resources_hu.json +1 -1
- package/dist/solutions-components/assets/t9n/create-feature/resources_id.json +1 -1
- package/dist/solutions-components/assets/t9n/create-feature/resources_it.json +1 -1
- package/dist/solutions-components/assets/t9n/create-feature/resources_ja.json +1 -1
- package/dist/solutions-components/assets/t9n/create-feature/resources_ko.json +1 -1
- package/dist/solutions-components/assets/t9n/create-feature/resources_lt.json +1 -1
- package/dist/solutions-components/assets/t9n/create-feature/resources_lv.json +1 -1
- package/dist/solutions-components/assets/t9n/create-feature/resources_nb.json +1 -1
- package/dist/solutions-components/assets/t9n/create-feature/resources_nl.json +1 -1
- package/dist/solutions-components/assets/t9n/create-feature/resources_pl.json +1 -1
- package/dist/solutions-components/assets/t9n/create-feature/resources_pt-BR.json +2 -2
- package/dist/solutions-components/assets/t9n/create-feature/resources_pt-PT.json +1 -1
- package/dist/solutions-components/assets/t9n/create-feature/resources_ro.json +1 -1
- package/dist/solutions-components/assets/t9n/create-feature/resources_ru.json +1 -1
- package/dist/solutions-components/assets/t9n/create-feature/resources_sk.json +1 -1
- package/dist/solutions-components/assets/t9n/create-feature/resources_sl.json +1 -1
- package/dist/solutions-components/assets/t9n/create-feature/resources_sr.json +1 -1
- package/dist/solutions-components/assets/t9n/create-feature/resources_sv.json +1 -1
- package/dist/solutions-components/assets/t9n/create-feature/resources_th.json +1 -1
- package/dist/solutions-components/assets/t9n/create-feature/resources_tr.json +1 -1
- package/dist/solutions-components/assets/t9n/create-feature/resources_uk.json +1 -1
- package/dist/solutions-components/assets/t9n/create-feature/resources_vi.json +1 -1
- package/dist/solutions-components/assets/t9n/create-feature/resources_zh-CN.json +1 -1
- package/dist/solutions-components/assets/t9n/create-feature/resources_zh-HK.json +1 -1
- package/dist/solutions-components/assets/t9n/create-feature/resources_zh-TW.json +1 -1
- package/dist/solutions-components/p-0a578582.entry.js +6 -0
- package/dist/solutions-components/p-1f072e2c.entry.js +11 -0
- package/dist/solutions-components/p-cc4c013e.entry.js +6 -0
- package/dist/solutions-components/p-dd0bd439.entry.js +17 -0
- package/dist/solutions-components/p-edd88d2d.entry.js +6 -0
- package/dist/solutions-components/{p-971b67d7.entry.js → p-ff8b0603.entry.js} +1 -1
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/dist/types/components/create-feature/create-feature.d.ts +17 -5
- package/dist/types/components/create-related-feature/create-related-feature.d.ts +4 -4
- package/dist/types/components/crowdsource-reporter/crowdsource-reporter.d.ts +10 -9
- package/dist/types/components/feature-list/feature-list.d.ts +1 -2
- package/dist/types/components.d.ts +0 -9
- package/package.json +1 -1
- package/dist/solutions-components/p-24ae549d.entry.js +0 -6
- package/dist/solutions-components/p-399dc933.entry.js +0 -17
- package/dist/solutions-components/p-634f86e5.entry.js +0 -11
- package/dist/solutions-components/p-94a5d59f.entry.js +0 -6
- package/dist/solutions-components/p-988c0d5e.entry.js +0 -6
@@ -62,7 +62,6 @@ export class CrowdsourceReporter {
|
|
62
62
|
this._filterActive = false;
|
63
63
|
this._flowItems = [];
|
64
64
|
this._hasValidLayers = false;
|
65
|
-
this._loadingFeatureDetails = undefined;
|
66
65
|
this._mapInfo = undefined;
|
67
66
|
this._reportSubmitted = false;
|
68
67
|
this._selectedLayerName = undefined;
|
@@ -220,6 +219,10 @@ export class CrowdsourceReporter {
|
|
220
219
|
* FilterInitState: filter's init state
|
221
220
|
*/
|
222
221
|
_filterInitState;
|
222
|
+
/**
|
223
|
+
* string: Previous selected layer id
|
224
|
+
*/
|
225
|
+
_prevSelectedLayerId;
|
223
226
|
//--------------------------------------------------------------------------
|
224
227
|
//
|
225
228
|
// Watch handlers
|
@@ -320,7 +323,7 @@ export class CrowdsourceReporter {
|
|
320
323
|
*/
|
321
324
|
render() {
|
322
325
|
const themeClass = this.theme === "dark" ? "calcite-mode-dark" : "calcite-mode-light";
|
323
|
-
return (h(Host, { key: '
|
326
|
+
return (h(Host, { key: 'bb2f79258038360e5c0b894ce5a21dcdd41d0ce4' }, this._reportSubmitted && h("calcite-alert", { key: 'aa244cd93326c8817b851d2465c7b9c453117ad2', "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: '25d6d6bd01ee8dc260bce41ea6c43eafa609292e', slot: "message" }, this.reportSubmittedMessage ? this.reportSubmittedMessage : this._translations.submitMsg)), this._featureCreationFailedErrorMsg && h("calcite-alert", { key: '06851f2f8cabebd0e953c31bdddfdeac363a4e6e', "auto-close": true, class: themeClass, icon: "x-octagon", kind: "danger", label: "", onCalciteAlertClose: () => { this._featureCreationFailedErrorMsg = ""; }, open: true, placement: "top" }, h("div", { key: 'f0d73a00a8150a78c48cc09e8901ad7dcb438e90', slot: "title" }, this._translations.error), h("div", { key: '0747a85bbf4936a28dd85a9ea0e8b416f70ee7cf', slot: "message" }, this._featureCreationFailedErrorMsg)), this._commentSubmitted && h("calcite-alert", { key: '55017090c066ad4e12023315bde39e8c7fa67091', "auto-close": true, class: 'report-submitted ' + themeClass, icon: "check-circle", kind: "success", label: "", onCalciteAlertClose: () => { this._commentSubmitted = false; }, open: true, placement: "top" }, h("div", { key: 'cb63168c1fe507b7b93ac4f58d5283ad0d09b34b', slot: "message" }, this.commentSubmittedMessage || this._translations.commentSubmittedMsg)), this._addingCommentFailed && h("calcite-alert", { key: '36b551428b32c7d93f4d04639504bfe326bbc9c8', "auto-close": true, class: themeClass, icon: "x-octagon", kind: "danger", label: "", onCalciteAlertClose: () => { this._addingCommentFailed = false; }, open: true, placement: "top" }, h("div", { key: '2e9865c5611f4960bb622f75f386a489abcbb484', slot: "title" }, this._translations.error), h("div", { key: 'ebdf339d63369e18b1c68867cdffb9bd40f52766', slot: "message" }, this._translations.addingCommentFailedMsg)), h("div", { key: 'a08980aead377e11697e96e77aa514ed66dc9613' }, h("calcite-shell", { key: '6d96e769ece33073870f2b8f1a7ef6a44006c3f0', "content-behind": true }, this._getReporter()))));
|
324
327
|
}
|
325
328
|
//--------------------------------------------------------------------------
|
326
329
|
//
|
@@ -453,18 +456,29 @@ export class CrowdsourceReporter {
|
|
453
456
|
this._filterActive = false;
|
454
457
|
this._filterUrlParams = null;
|
455
458
|
this._filterInitState = null;
|
456
|
-
|
459
|
+
if (this._featureList) {
|
460
|
+
await this._featureList.refresh();
|
461
|
+
}
|
462
|
+
if (this._layerList) {
|
463
|
+
await this._layerList.refresh();
|
464
|
+
}
|
457
465
|
}
|
458
466
|
/**
|
459
467
|
* Check if the layers definitionExpression has been modified and update the feature list depending on the applied filters
|
460
468
|
* @protected
|
461
469
|
*/
|
462
|
-
_handleFilterUpdate() {
|
470
|
+
async _handleFilterUpdate() {
|
471
|
+
this._showLoadingIndicator = true;
|
463
472
|
//if filter are applied the url params will be generated
|
464
473
|
//set the filter active state based on the length of applied filters
|
465
474
|
this._filterActive = this._filterList.urlParams.getAll('filter').length > 0;
|
466
475
|
this._filterUrlParams = this._filterList.urlParams.getAll('filter');
|
467
|
-
|
476
|
+
this._filterInitState = await this._filterList.getFilterInitState();
|
477
|
+
await this._featureList.refresh();
|
478
|
+
if (this._layerList) {
|
479
|
+
await this._layerList.refresh();
|
480
|
+
}
|
481
|
+
this._showLoadingIndicator = false;
|
468
482
|
}
|
469
483
|
/**
|
470
484
|
* Get the feature layer list
|
@@ -531,7 +545,6 @@ export class CrowdsourceReporter {
|
|
531
545
|
*/
|
532
546
|
backFromCreateFeaturePanel() {
|
533
547
|
if (this._createFeature) {
|
534
|
-
void this._createFeature.close();
|
535
548
|
void this.updateNonVisibleLayersOnMap(false);
|
536
549
|
}
|
537
550
|
//on back form will be closed, so update the form state
|
@@ -552,7 +565,6 @@ export class CrowdsourceReporter {
|
|
552
565
|
*/
|
553
566
|
backFromCreateRelatedFeaturePanel() {
|
554
567
|
if (this._createRelatedFeature) {
|
555
|
-
void this._createRelatedFeature.close();
|
556
568
|
this._showSubmitCancelButton = false;
|
557
569
|
}
|
558
570
|
//on back form will be closed, so update the form state
|
@@ -609,9 +621,6 @@ export class CrowdsourceReporter {
|
|
609
621
|
* @protected
|
610
622
|
*/
|
611
623
|
async navigateToHomePage() {
|
612
|
-
if (this._createFeature) {
|
613
|
-
void this._createFeature.close();
|
614
|
-
}
|
615
624
|
if (this._layerList) {
|
616
625
|
void this._layerList.refresh();
|
617
626
|
}
|
@@ -633,6 +642,10 @@ export class CrowdsourceReporter {
|
|
633
642
|
if (evt.detail.layerId && evt.detail.layerName) {
|
634
643
|
await this.setSelectedLayer(evt.detail.layerId, evt.detail.layerName);
|
635
644
|
}
|
645
|
+
// reset the applied filter when switching to another layer
|
646
|
+
if (this._selectedLayerId !== this._prevSelectedLayerId && this._filterActive) {
|
647
|
+
await this.resetFilter();
|
648
|
+
}
|
636
649
|
void this.updateNonVisibleLayersOnMap(true);
|
637
650
|
// get the form template elements to pass in create-feature to create a LEVELID field in feature-form
|
638
651
|
this._getFormElements();
|
@@ -692,27 +705,33 @@ export class CrowdsourceReporter {
|
|
692
705
|
await this.loadFeatureFromURLParams();
|
693
706
|
}
|
694
707
|
}
|
695
|
-
/**
|
708
|
+
/**
|
709
|
+
* On click of layer list item show feature list
|
696
710
|
* @param evt Event which has details of selected layerId and layerName
|
697
711
|
* @protected
|
698
712
|
*/
|
699
|
-
displayFeaturesList(evt) {
|
713
|
+
async displayFeaturesList(evt) {
|
700
714
|
this._updatedSorting = {
|
701
715
|
field: '',
|
702
716
|
order: 'desc'
|
703
717
|
};
|
704
|
-
this._filterActive = false;
|
705
718
|
this._updatedSortOption = "sortNewest";
|
706
|
-
|
719
|
+
await this.setSelectedLayer(evt.detail.layerId, evt.detail.layerName);
|
707
720
|
this._flowItems = [...this._flowItems, "feature-list"];
|
721
|
+
// reset the applied filter when switching to another layer
|
722
|
+
if (this._selectedLayerId !== this._prevSelectedLayerId && this._filterActive) {
|
723
|
+
await this.resetFilter();
|
724
|
+
}
|
725
|
+
this._prevSelectedLayerId = this._selectedLayerId;
|
708
726
|
}
|
709
727
|
/**
|
710
|
-
*
|
728
|
+
* Reset's the applied filter
|
711
729
|
* @protected
|
712
730
|
*/
|
713
|
-
async
|
714
|
-
|
715
|
-
this.
|
731
|
+
async resetFilter() {
|
732
|
+
const prevLayer = await getLayerOrTable(this.mapView, this._prevSelectedLayerId);
|
733
|
+
prevLayer.definitionExpression = this._filterInitState.initDefExpressions[this._prevSelectedLayerId];
|
734
|
+
void this._handleFilterListReset();
|
716
735
|
}
|
717
736
|
/**
|
718
737
|
* On back from selected panel navigate to the previous panel
|
@@ -773,10 +792,14 @@ export class CrowdsourceReporter {
|
|
773
792
|
*/
|
774
793
|
async getRelatedTable() {
|
775
794
|
const selectedLayer = this._currentFeature.layer;
|
776
|
-
const allRelatedTableIds = selectedLayer.relationships.map(a => a.relatedTableId);
|
777
795
|
const allTables = await getAllTables(this.mapView);
|
778
|
-
|
779
|
-
|
796
|
+
selectedLayer.relationships.some((relationship) => {
|
797
|
+
const relatedTables = allTables.filter((table) => selectedLayer.url === table.url && table.layerId === relationship.relatedTableId);
|
798
|
+
if (relatedTables && relatedTables.length > 0) {
|
799
|
+
this._relatedTable = relatedTables[0];
|
800
|
+
return true;
|
801
|
+
}
|
802
|
+
});
|
780
803
|
}
|
781
804
|
/**
|
782
805
|
* Show loading indicator while updating the feature details component
|
@@ -834,7 +857,7 @@ export class CrowdsourceReporter {
|
|
834
857
|
*/
|
835
858
|
getFilterPanel() {
|
836
859
|
const currentLayersExpressions = this.layerExpressions ? this.layerExpressions.filter((exp) => exp.id === this._selectedLayerId) : [];
|
837
|
-
return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this._translations?.filterLayerTitle?.replace("{{title}}", this._selectedLayerName), loading: this._showLoadingIndicator, onCalciteFlowItemBack: this.
|
860
|
+
return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this._translations?.filterLayerTitle?.replace("{{title}}", this._selectedLayerName), loading: this._showLoadingIndicator, onCalciteFlowItemBack: this.backFromSelectedPanel.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", disabled: !this._filterActive, onClick: () => { void this._filterList?.forceReset(); }, width: "full" }, this._translations.resetFilter), h("calcite-button", { appearance: "outline", class: "footer-button", onClick: this.backFromSelectedPanel.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, resetBtn: false, resetFiltersOnDisconnect: false, view: this.mapView, zoomBtn: false }))));
|
838
861
|
}
|
839
862
|
/**
|
840
863
|
* Returns the calcite-flow item for feature details
|
@@ -1827,7 +1850,6 @@ export class CrowdsourceReporter {
|
|
1827
1850
|
"_filterActive": {},
|
1828
1851
|
"_flowItems": {},
|
1829
1852
|
"_hasValidLayers": {},
|
1830
|
-
"_loadingFeatureDetails": {},
|
1831
1853
|
"_mapInfo": {},
|
1832
1854
|
"_reportSubmitted": {},
|
1833
1855
|
"_selectedLayerName": {},
|
@@ -228,14 +228,12 @@ export class FeatureDetails {
|
|
228
228
|
const allTables = await getAllTables(this.mapView);
|
229
229
|
let relatedTable = null;
|
230
230
|
let validRelationshipId = null;
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
return true;
|
238
|
-
}
|
231
|
+
selectedLayer.relationships.some((relationship) => {
|
232
|
+
const relatedTables = allTables.filter((table) => selectedLayer.url === table.url && table.layerId === relationship.relatedTableId);
|
233
|
+
if (relatedTables && relatedTables.length > 0) {
|
234
|
+
relatedTable = relatedTables[0];
|
235
|
+
validRelationshipId = relationship.id;
|
236
|
+
return true;
|
239
237
|
}
|
240
238
|
});
|
241
239
|
this.relatedTableId = relatedTable?.id ?? '';
|
@@ -132,7 +132,7 @@ export class FeatureList {
|
|
132
132
|
* @returns Promise that resolves when the operation is complete
|
133
133
|
*/
|
134
134
|
async refresh(maintainPageState) {
|
135
|
-
if (maintainPageState) {
|
135
|
+
if (maintainPageState && this._pagination) {
|
136
136
|
const event = {
|
137
137
|
target: {
|
138
138
|
startItem: this._pagination.startItem
|
@@ -183,9 +183,9 @@ export class FeatureList {
|
|
183
183
|
* Renders the component.
|
184
184
|
*/
|
185
185
|
render() {
|
186
|
-
return (h("calcite-panel", { key: '
|
187
|
-
h("calcite-notice", { key: '
|
188
|
-
h("div", { key: '
|
186
|
+
return (h("calcite-panel", { key: 'fc2cc60231efb7fc4a05d3ade0bad6a3dd649b8e', "full-height": true, "full-width": true }, this._isLoading && h("calcite-loader", { key: '43c8176c2aaf0cc7f36a9f1ff477f53890cfcf2d', label: "", scale: "m" }), this.showErrorWhenNoFeatures && this._featureItems.length === 0 && !this._isLoading &&
|
187
|
+
h("calcite-notice", { key: 'dff1bb7207397ded8a557b61e9185ea788520441', class: "error-msg", icon: "feature-details", kind: "info", open: true }, h("div", { key: 'c1dd4e7fb8398c4317270b50eba7e6270fd7051b', slot: "message" }, this.noFeaturesFoundMsg ? this.noFeaturesFoundMsg : this._translations.featureErrorMsg)), h("calcite-list", { key: '49019c011e8667d193f566826644b0693b0fb6f9', "selection-appearance": "border", "selection-mode": "none" }, !this._isLoading && this._featureItems.length > 0 && this._featureItems), this._featuresCount > this.pageSize &&
|
188
|
+
h("div", { key: '12e767a001c4dffec7e771d12b772fb43bbf9b0f', class: "width-full", slot: "footer" }, h("calcite-pagination", { key: 'd6a8a9eac72fe7217eda926f46baedcb4e6d5859', 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 }))));
|
189
189
|
}
|
190
190
|
//--------------------------------------------------------------------------
|
191
191
|
//
|
@@ -359,10 +359,10 @@ export class FeatureList {
|
|
359
359
|
let userInfo;
|
360
360
|
let featureSymbol;
|
361
361
|
if (this.showUserImageInList) {
|
362
|
-
const creatorField = this._selectedLayer.editFieldsInfo?.creatorField
|
362
|
+
const creatorField = this._selectedLayer.editFieldsInfo?.creatorField;
|
363
363
|
// if feature's creator field is present then only we can fetch the information of user
|
364
364
|
if (creatorField) {
|
365
|
-
userInfo = await this.getUserInformation(feature
|
365
|
+
userInfo = await this.getUserInformation(feature);
|
366
366
|
}
|
367
367
|
}
|
368
368
|
if (this.showFeatureSymbol) {
|
@@ -414,21 +414,27 @@ export class FeatureList {
|
|
414
414
|
const popupTitleClass = this.textSize === 'small' ? 'feature-list-popup-title-small' : 'feature-list-popup-title';
|
415
415
|
const popupTitlePaddingClass = this.showUserImageInList || this.showFeatureSymbol ? 'feature-list-popup-title-padding-reduced' : 'feature-list-popup-title-padding';
|
416
416
|
return (h("calcite-list-item", { onCalciteListItemSelect: (e) => { void this.featureClicked(e, selectedFeature); }, onMouseLeave: () => { void this.clearHighlights(); }, onMouseOver: () => { void this.onFeatureHover(selectedFeature); }, value: oId }, this.showUserImageInList &&
|
417
|
-
h("calcite-avatar", { class: 'profile-img', "full-name": userInfo?.fullName,
|
417
|
+
h("calcite-avatar", { class: 'profile-img', "full-name": userInfo?.fullName, scale: "m", slot: "content-start", thumbnail: userInfo?.userProfileUrl, userId: userInfo?.id, username: userInfo?.fullName ? userInfo.username : undefined }), this.showFeatureSymbol &&
|
418
418
|
h("div", { class: 'feature-symbol', ref: (el) => el && el.appendChild(featureSymbol), slot: "content-start" }), h("div", { class: `${popupTitleClass} ${popupTitlePaddingClass}`, slot: "content-start" }, popupTitle), this._likeFieldAvailable &&
|
419
419
|
h("div", { class: "like-container", id: oId.concat("like"), slot: "content-end" }, h("span", null, this._abbreviatedLikeCount), h("calcite-icon", { icon: "thumbs-up", scale: 's' }), h("calcite-tooltip", { overlayPositioning: "fixed", placement: "top", "reference-element": oId.concat("like") }, formattedLikeCount)), h("calcite-icon", { flipRtl: true, icon: "chevron-right", scale: "s", slot: "content-end" })));
|
420
420
|
}
|
421
421
|
/**
|
422
422
|
*
|
423
423
|
* @param feature Each individual feature instance to be listed
|
424
|
-
* @param creatorField Feature's creator field from the layer
|
425
424
|
* @returns user information
|
426
425
|
* @protected
|
427
426
|
*/
|
428
|
-
async getUserInformation(feature
|
429
|
-
|
427
|
+
async getUserInformation(feature) {
|
428
|
+
let creatorField = this._selectedLayer.editFieldsInfo?.creatorField;
|
429
|
+
if (feature.attributes.hasOwnProperty(creatorField.toLowerCase())) {
|
430
|
+
creatorField = creatorField.toLowerCase();
|
431
|
+
}
|
432
|
+
else if (feature.attributes.hasOwnProperty(creatorField.toUpperCase())) {
|
433
|
+
creatorField = creatorField.toUpperCase();
|
434
|
+
}
|
430
435
|
//get the user information
|
431
436
|
let url = `${this.esriConfig.portalUrl}/sharing/rest/community/users/${feature.attributes[creatorField]}?f=json&returnUserLicensedItems=true`;
|
437
|
+
const userToken = this.mapView.map.portalItem.portal?.credential?.token;
|
432
438
|
if (userToken) {
|
433
439
|
url += `&token=${userToken}`;
|
434
440
|
}
|
@@ -934,7 +934,10 @@ export class MapSelectTools {
|
|
934
934
|
hasOID = g?.layer?.hasOwnProperty("objectIdField") || g.hasOwnProperty("getObjectId");
|
935
935
|
});
|
936
936
|
// OIDs are used when the addressee layer and the current "use layer features" layer are the same
|
937
|
-
const
|
937
|
+
const layerViewLayer = this.layerViews[0].layer;
|
938
|
+
const selectLayerViewLayer = this.selectLayerView.layer;
|
939
|
+
const useOIDs = hasOID && layerViewLayer.url === selectLayerViewLayer.url &&
|
940
|
+
selectLayerViewLayer.layerId === layerViewLayer.layerId;
|
938
941
|
await this._sketchGraphicsChanged({
|
939
942
|
detail: {
|
940
943
|
graphics,
|
@@ -184,7 +184,6 @@ const CardManager = /*@__PURE__*/ proxyCustomElement(class CardManager extends H
|
|
184
184
|
*/
|
185
185
|
async _backFromCreateFeature() {
|
186
186
|
if (this._createFeature) {
|
187
|
-
await this._createFeature.close();
|
188
187
|
this._showCreateFeatureComponent = false;
|
189
188
|
this.backFromCreateWorkFlow.emit();
|
190
189
|
}
|
@@ -195,7 +194,6 @@ const CardManager = /*@__PURE__*/ proxyCustomElement(class CardManager extends H
|
|
195
194
|
* @protected
|
196
195
|
*/
|
197
196
|
_featureCreated() {
|
198
|
-
void this._createFeature.close();
|
199
197
|
this._showCreateFeatureComponent = false;
|
200
198
|
this._showSubmitBtn = false;
|
201
199
|
this._isFeatureCreated = true;
|
@@ -11,7 +11,7 @@ import { d as defineCustomElement$3 } from './icon.js';
|
|
11
11
|
import { d as defineCustomElement$2 } from './loader.js';
|
12
12
|
import { d as defineCustomElement$1 } from './notice.js';
|
13
13
|
|
14
|
-
const createFeatureCss = ":host{display:block}.esri-editor__panel-toolbar{display:none !important}.esri-editor__panel-content{padding-block:0px !important}.esri-editor .esri-item-list__group__header{display:none !important}.esri-editor__panel-content__section .esri-widget__heading{display:none !important}.esri-editor .esri-item-list__filter-container--sticky{padding-block:0px !important;padding-inline:10px !important}.search-widget{width:92% !important;margin:5px 14px 20px 14px}.display-none{display:none !important}.hide-map{height:1%;visibility:hidden}.show-map{padding:10px !important;position:absolute;bottom:0;width:calc(100% - 22px)
|
14
|
+
const createFeatureCss = ":host{display:block}.esri-editor__panel-toolbar{display:none !important}.esri-editor__panel-content{padding-block:0px !important}.esri-editor .esri-item-list__group__header{display:none !important}.esri-editor__panel-content__section .esri-widget__heading{display:none !important}.esri-editor .esri-item-list__filter-container--sticky{padding-block:0px !important;padding-inline:10px !important}.search-widget{width:92% !important;margin:5px 14px 20px 14px}.display-none{display:none !important}.hide-map{height:1%;visibility:hidden}.show-map{padding:10px !important;position:absolute;bottom:0;width:calc(100% - 22px)}.notice-msg{padding:10px;width:calc(100% - 20px)}.esri-editor__panel-content{padding-block:10px !important}@media only screen and (max-width: 600px){.esri-editor__panel-content{padding-block:0 !important;min-height:0 !important}}";
|
15
15
|
const CreateFeatureStyle0 = createFeatureCss;
|
16
16
|
|
17
17
|
const CreateFeature = /*@__PURE__*/ proxyCustomElement(class CreateFeature extends HTMLElement {
|
@@ -117,6 +117,14 @@ const CreateFeature = /*@__PURE__*/ proxyCustomElement(class CreateFeature exten
|
|
117
117
|
* __esri.FeatureLayer: selected feature layer;
|
118
118
|
*/
|
119
119
|
_selectedLayer;
|
120
|
+
/**
|
121
|
+
* HTMLDivElement: refrence for search div element
|
122
|
+
*/
|
123
|
+
_searchDiv;
|
124
|
+
/**
|
125
|
+
* HTMLCalciteNoticeElement: calcite notice refrence element
|
126
|
+
*/
|
127
|
+
_calciteNotice;
|
120
128
|
//--------------------------------------------------------------------------
|
121
129
|
//
|
122
130
|
// Watch handlers
|
@@ -164,15 +172,6 @@ const CreateFeature = /*@__PURE__*/ proxyCustomElement(class CreateFeature exten
|
|
164
172
|
// Methods (public)
|
165
173
|
//
|
166
174
|
//--------------------------------------------------------------------------
|
167
|
-
/**
|
168
|
-
* Destroy the Editor widget instance
|
169
|
-
* @returns Promise that resolves when the operation is complete
|
170
|
-
*/
|
171
|
-
async close() {
|
172
|
-
if (this._editor) {
|
173
|
-
this._editor.destroy();
|
174
|
-
}
|
175
|
-
}
|
176
175
|
/**
|
177
176
|
* Submit the created feature
|
178
177
|
* @returns Promise that resolves when the operation is complete
|
@@ -240,6 +239,26 @@ const CreateFeature = /*@__PURE__*/ proxyCustomElement(class CreateFeature exten
|
|
240
239
|
async componentDidLoad() {
|
241
240
|
await this.init();
|
242
241
|
}
|
242
|
+
/**
|
243
|
+
* Called after each render
|
244
|
+
* Used to adjust the map top in case of mobile
|
245
|
+
*/
|
246
|
+
componentDidRender() {
|
247
|
+
// update the map top according to space occupied by notice msg and search
|
248
|
+
if (this.isMobile) {
|
249
|
+
// get the height of notice, search and add 80px(editor msg) height to adjust the map top
|
250
|
+
const top = this._calciteNotice.offsetHeight + this._searchDiv.offsetHeight + 80;
|
251
|
+
this._mapViewContainer.style.top = `${top}px`;
|
252
|
+
}
|
253
|
+
}
|
254
|
+
/**
|
255
|
+
* StencilJS: Called every time the component is disconnected from the DOM,
|
256
|
+
*/
|
257
|
+
disconnectedCallback() {
|
258
|
+
if (this._editor) {
|
259
|
+
this._editor.destroy();
|
260
|
+
}
|
261
|
+
}
|
243
262
|
/**
|
244
263
|
* Renders the component.
|
245
264
|
*/
|
@@ -257,7 +276,8 @@ const CreateFeature = /*@__PURE__*/ proxyCustomElement(class CreateFeature exten
|
|
257
276
|
else if (this._currentPage === 'featureForm') {
|
258
277
|
guidingMsg = this._translations.provideDetailsMsg;
|
259
278
|
}
|
260
|
-
return (h(Fragment, { key: '
|
279
|
+
return (h(Fragment, { key: '89634bf5707ea8390416d3087bfbe4e747bafcd7' }, showGuidingMsg && h("calcite-notice", { key: '4269224c2904f29060081f6cb8f383f1cf8d741d', class: "notice-msg", icon: "lightbulb", kind: "success", open: true, ref: el => this._calciteNotice = el }, h("div", { key: 'ecc3cca85c81d1cb7ab7cdc89b99e31afcb55f76', slot: "message" }, guidingMsg)), h("calcite-loader", { key: '34e492c0c469b39d4cfbcda17c4ba196ccb39eb8', class: loaderClass, label: "", scale: "s" }), h("div", { key: 'b2073ef4b6124b54038de34798cdf83337626023', class: featureFormClass, id: "feature-form" }), this.enableSearch &&
|
280
|
+
h("div", { key: 'cd13e98b6a40d5d89d271b5785f797e9bfc19900', class: `search-widget ${showSearchWidget} ${featureFormClass}`, id: "search-widget-ref", ref: el => this._searchDiv = el }), h("div", { key: '2575b2d20f7713b05a2024e77452af93eb64e147', class: `${mobileMapClass}`, ref: (el) => { this._mapViewContainer = el; } })));
|
261
281
|
}
|
262
282
|
//--------------------------------------------------------------------------
|
263
283
|
//
|
@@ -305,7 +325,8 @@ const CreateFeature = /*@__PURE__*/ proxyCustomElement(class CreateFeature exten
|
|
305
325
|
this._mapViewContainer.classList.add('hide-map');
|
306
326
|
await new this.MapView({
|
307
327
|
map: this.mapView.map,
|
308
|
-
container: this._mapViewContainer
|
328
|
+
container: this._mapViewContainer,
|
329
|
+
zoom: this.mapView.zoom
|
309
330
|
}).when((view) => {
|
310
331
|
// update the mapView and load all widgets
|
311
332
|
this._updatedMapView = view;
|
@@ -678,7 +699,6 @@ const CreateFeature = /*@__PURE__*/ proxyCustomElement(class CreateFeature exten
|
|
678
699
|
"_editorLoading": [32],
|
679
700
|
"_currentPage": [32],
|
680
701
|
"_translations": [32],
|
681
|
-
"close": [64],
|
682
702
|
"submit": [64],
|
683
703
|
"refresh": [64]
|
684
704
|
}, undefined, {
|
@@ -90,14 +90,6 @@ const CreateRelatedFeature = /*@__PURE__*/ proxyCustomElement(class CreateRelate
|
|
90
90
|
// Methods (public)
|
91
91
|
//
|
92
92
|
//--------------------------------------------------------------------------
|
93
|
-
/**
|
94
|
-
* Destroy the Editor widget instance
|
95
|
-
*/
|
96
|
-
async close() {
|
97
|
-
if (this._editor) {
|
98
|
-
this._editor.destroy();
|
99
|
-
}
|
100
|
-
}
|
101
93
|
/**
|
102
94
|
* Submit the comment
|
103
95
|
*/
|
@@ -164,7 +156,7 @@ const CreateRelatedFeature = /*@__PURE__*/ proxyCustomElement(class CreateRelate
|
|
164
156
|
}
|
165
157
|
render() {
|
166
158
|
const loaderClass = this._editorLoading ? "" : "display-none";
|
167
|
-
return (h(Fragment, { key: '
|
159
|
+
return (h(Fragment, { key: '641b4f6f51bce04b6263a1d7dc72a31839df970d' }, this.showGuidingMsg && h("calcite-notice", { key: '1a6e577bcc0632a7bc69dd411a692062a7ad176e', class: "notice-msg", icon: "lightbulb", kind: "success", open: true }, h("div", { key: '55c5836314fcca69a259be3a36e34c527edcabf3', slot: "message" }, this._translations.provideDetailsMsg)), h("calcite-loader", { key: '18c5603a4a75c67a160a71caa15e94790f66d60b', class: loaderClass, label: "", scale: "s" })));
|
168
160
|
}
|
169
161
|
/**
|
170
162
|
* StencilJS: Called once just after the component is fully loaded and the first render() occurs.
|
@@ -172,6 +164,14 @@ const CreateRelatedFeature = /*@__PURE__*/ proxyCustomElement(class CreateRelate
|
|
172
164
|
async componentDidLoad() {
|
173
165
|
await this.init();
|
174
166
|
}
|
167
|
+
/**
|
168
|
+
* StencilJS: Called every time the component is disconnected from the DOM,
|
169
|
+
*/
|
170
|
+
disconnectedCallback() {
|
171
|
+
if (this._editor) {
|
172
|
+
this._editor.destroy();
|
173
|
+
}
|
174
|
+
}
|
175
175
|
/**
|
176
176
|
* Display editor widget to create the new feature
|
177
177
|
* @protected
|
@@ -355,7 +355,6 @@ const CreateRelatedFeature = /*@__PURE__*/ proxyCustomElement(class CreateRelate
|
|
355
355
|
"showGuidingMsg": [4, "show-guiding-msg"],
|
356
356
|
"_editorLoading": [32],
|
357
357
|
"_translations": [32],
|
358
|
-
"close": [64],
|
359
358
|
"submit": [64]
|
360
359
|
}, undefined, {
|
361
360
|
"mapView": ["mapViewWatchHandler"],
|
@@ -101,7 +101,6 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
|
|
101
101
|
this._filterActive = false;
|
102
102
|
this._flowItems = [];
|
103
103
|
this._hasValidLayers = false;
|
104
|
-
this._loadingFeatureDetails = undefined;
|
105
104
|
this._mapInfo = undefined;
|
106
105
|
this._reportSubmitted = false;
|
107
106
|
this._selectedLayerName = undefined;
|
@@ -254,6 +253,10 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
|
|
254
253
|
* FilterInitState: filter's init state
|
255
254
|
*/
|
256
255
|
_filterInitState;
|
256
|
+
/**
|
257
|
+
* string: Previous selected layer id
|
258
|
+
*/
|
259
|
+
_prevSelectedLayerId;
|
257
260
|
//--------------------------------------------------------------------------
|
258
261
|
//
|
259
262
|
// Watch handlers
|
@@ -354,7 +357,7 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
|
|
354
357
|
*/
|
355
358
|
render() {
|
356
359
|
const themeClass = this.theme === "dark" ? "calcite-mode-dark" : "calcite-mode-light";
|
357
|
-
return (h(Host, { key: '
|
360
|
+
return (h(Host, { key: 'bb2f79258038360e5c0b894ce5a21dcdd41d0ce4' }, this._reportSubmitted && h("calcite-alert", { key: 'aa244cd93326c8817b851d2465c7b9c453117ad2', "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: '25d6d6bd01ee8dc260bce41ea6c43eafa609292e', slot: "message" }, this.reportSubmittedMessage ? this.reportSubmittedMessage : this._translations.submitMsg)), this._featureCreationFailedErrorMsg && h("calcite-alert", { key: '06851f2f8cabebd0e953c31bdddfdeac363a4e6e', "auto-close": true, class: themeClass, icon: "x-octagon", kind: "danger", label: "", onCalciteAlertClose: () => { this._featureCreationFailedErrorMsg = ""; }, open: true, placement: "top" }, h("div", { key: 'f0d73a00a8150a78c48cc09e8901ad7dcb438e90', slot: "title" }, this._translations.error), h("div", { key: '0747a85bbf4936a28dd85a9ea0e8b416f70ee7cf', slot: "message" }, this._featureCreationFailedErrorMsg)), this._commentSubmitted && h("calcite-alert", { key: '55017090c066ad4e12023315bde39e8c7fa67091', "auto-close": true, class: 'report-submitted ' + themeClass, icon: "check-circle", kind: "success", label: "", onCalciteAlertClose: () => { this._commentSubmitted = false; }, open: true, placement: "top" }, h("div", { key: 'cb63168c1fe507b7b93ac4f58d5283ad0d09b34b', slot: "message" }, this.commentSubmittedMessage || this._translations.commentSubmittedMsg)), this._addingCommentFailed && h("calcite-alert", { key: '36b551428b32c7d93f4d04639504bfe326bbc9c8', "auto-close": true, class: themeClass, icon: "x-octagon", kind: "danger", label: "", onCalciteAlertClose: () => { this._addingCommentFailed = false; }, open: true, placement: "top" }, h("div", { key: '2e9865c5611f4960bb622f75f386a489abcbb484', slot: "title" }, this._translations.error), h("div", { key: 'ebdf339d63369e18b1c68867cdffb9bd40f52766', slot: "message" }, this._translations.addingCommentFailedMsg)), h("div", { key: 'a08980aead377e11697e96e77aa514ed66dc9613' }, h("calcite-shell", { key: '6d96e769ece33073870f2b8f1a7ef6a44006c3f0', "content-behind": true }, this._getReporter()))));
|
358
361
|
}
|
359
362
|
//--------------------------------------------------------------------------
|
360
363
|
//
|
@@ -487,18 +490,29 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
|
|
487
490
|
this._filterActive = false;
|
488
491
|
this._filterUrlParams = null;
|
489
492
|
this._filterInitState = null;
|
490
|
-
|
493
|
+
if (this._featureList) {
|
494
|
+
await this._featureList.refresh();
|
495
|
+
}
|
496
|
+
if (this._layerList) {
|
497
|
+
await this._layerList.refresh();
|
498
|
+
}
|
491
499
|
}
|
492
500
|
/**
|
493
501
|
* Check if the layers definitionExpression has been modified and update the feature list depending on the applied filters
|
494
502
|
* @protected
|
495
503
|
*/
|
496
|
-
_handleFilterUpdate() {
|
504
|
+
async _handleFilterUpdate() {
|
505
|
+
this._showLoadingIndicator = true;
|
497
506
|
//if filter are applied the url params will be generated
|
498
507
|
//set the filter active state based on the length of applied filters
|
499
508
|
this._filterActive = this._filterList.urlParams.getAll('filter').length > 0;
|
500
509
|
this._filterUrlParams = this._filterList.urlParams.getAll('filter');
|
501
|
-
|
510
|
+
this._filterInitState = await this._filterList.getFilterInitState();
|
511
|
+
await this._featureList.refresh();
|
512
|
+
if (this._layerList) {
|
513
|
+
await this._layerList.refresh();
|
514
|
+
}
|
515
|
+
this._showLoadingIndicator = false;
|
502
516
|
}
|
503
517
|
/**
|
504
518
|
* Get the feature layer list
|
@@ -565,7 +579,6 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
|
|
565
579
|
*/
|
566
580
|
backFromCreateFeaturePanel() {
|
567
581
|
if (this._createFeature) {
|
568
|
-
void this._createFeature.close();
|
569
582
|
void this.updateNonVisibleLayersOnMap(false);
|
570
583
|
}
|
571
584
|
//on back form will be closed, so update the form state
|
@@ -586,7 +599,6 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
|
|
586
599
|
*/
|
587
600
|
backFromCreateRelatedFeaturePanel() {
|
588
601
|
if (this._createRelatedFeature) {
|
589
|
-
void this._createRelatedFeature.close();
|
590
602
|
this._showSubmitCancelButton = false;
|
591
603
|
}
|
592
604
|
//on back form will be closed, so update the form state
|
@@ -643,9 +655,6 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
|
|
643
655
|
* @protected
|
644
656
|
*/
|
645
657
|
async navigateToHomePage() {
|
646
|
-
if (this._createFeature) {
|
647
|
-
void this._createFeature.close();
|
648
|
-
}
|
649
658
|
if (this._layerList) {
|
650
659
|
void this._layerList.refresh();
|
651
660
|
}
|
@@ -667,6 +676,10 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
|
|
667
676
|
if (evt.detail.layerId && evt.detail.layerName) {
|
668
677
|
await this.setSelectedLayer(evt.detail.layerId, evt.detail.layerName);
|
669
678
|
}
|
679
|
+
// reset the applied filter when switching to another layer
|
680
|
+
if (this._selectedLayerId !== this._prevSelectedLayerId && this._filterActive) {
|
681
|
+
await this.resetFilter();
|
682
|
+
}
|
670
683
|
void this.updateNonVisibleLayersOnMap(true);
|
671
684
|
// get the form template elements to pass in create-feature to create a LEVELID field in feature-form
|
672
685
|
this._getFormElements();
|
@@ -726,27 +739,33 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
|
|
726
739
|
await this.loadFeatureFromURLParams();
|
727
740
|
}
|
728
741
|
}
|
729
|
-
/**
|
742
|
+
/**
|
743
|
+
* On click of layer list item show feature list
|
730
744
|
* @param evt Event which has details of selected layerId and layerName
|
731
745
|
* @protected
|
732
746
|
*/
|
733
|
-
displayFeaturesList(evt) {
|
747
|
+
async displayFeaturesList(evt) {
|
734
748
|
this._updatedSorting = {
|
735
749
|
field: '',
|
736
750
|
order: 'desc'
|
737
751
|
};
|
738
|
-
this._filterActive = false;
|
739
752
|
this._updatedSortOption = "sortNewest";
|
740
|
-
|
753
|
+
await this.setSelectedLayer(evt.detail.layerId, evt.detail.layerName);
|
741
754
|
this._flowItems = [...this._flowItems, "feature-list"];
|
755
|
+
// reset the applied filter when switching to another layer
|
756
|
+
if (this._selectedLayerId !== this._prevSelectedLayerId && this._filterActive) {
|
757
|
+
await this.resetFilter();
|
758
|
+
}
|
759
|
+
this._prevSelectedLayerId = this._selectedLayerId;
|
742
760
|
}
|
743
761
|
/**
|
744
|
-
*
|
762
|
+
* Reset's the applied filter
|
745
763
|
* @protected
|
746
764
|
*/
|
747
|
-
async
|
748
|
-
|
749
|
-
this.
|
765
|
+
async resetFilter() {
|
766
|
+
const prevLayer = await getLayerOrTable(this.mapView, this._prevSelectedLayerId);
|
767
|
+
prevLayer.definitionExpression = this._filterInitState.initDefExpressions[this._prevSelectedLayerId];
|
768
|
+
void this._handleFilterListReset();
|
750
769
|
}
|
751
770
|
/**
|
752
771
|
* On back from selected panel navigate to the previous panel
|
@@ -807,10 +826,14 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
|
|
807
826
|
*/
|
808
827
|
async getRelatedTable() {
|
809
828
|
const selectedLayer = this._currentFeature.layer;
|
810
|
-
const allRelatedTableIds = selectedLayer.relationships.map(a => a.relatedTableId);
|
811
829
|
const allTables = await getAllTables(this.mapView);
|
812
|
-
|
813
|
-
|
830
|
+
selectedLayer.relationships.some((relationship) => {
|
831
|
+
const relatedTables = allTables.filter((table) => selectedLayer.url === table.url && table.layerId === relationship.relatedTableId);
|
832
|
+
if (relatedTables && relatedTables.length > 0) {
|
833
|
+
this._relatedTable = relatedTables[0];
|
834
|
+
return true;
|
835
|
+
}
|
836
|
+
});
|
814
837
|
}
|
815
838
|
/**
|
816
839
|
* Show loading indicator while updating the feature details component
|
@@ -868,7 +891,7 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
|
|
868
891
|
*/
|
869
892
|
getFilterPanel() {
|
870
893
|
const currentLayersExpressions = this.layerExpressions ? this.layerExpressions.filter((exp) => exp.id === this._selectedLayerId) : [];
|
871
|
-
return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this._translations?.filterLayerTitle?.replace("{{title}}", this._selectedLayerName), loading: this._showLoadingIndicator, onCalciteFlowItemBack: this.
|
894
|
+
return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this._translations?.filterLayerTitle?.replace("{{title}}", this._selectedLayerName), loading: this._showLoadingIndicator, onCalciteFlowItemBack: this.backFromSelectedPanel.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", disabled: !this._filterActive, onClick: () => { void this._filterList?.forceReset(); }, width: "full" }, this._translations.resetFilter), h("calcite-button", { appearance: "outline", class: "footer-button", onClick: this.backFromSelectedPanel.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, resetBtn: false, resetFiltersOnDisconnect: false, view: this.mapView, zoomBtn: false }))));
|
872
895
|
}
|
873
896
|
/**
|
874
897
|
* Returns the calcite-flow item for feature details
|
@@ -1289,7 +1312,6 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
|
|
1289
1312
|
"_filterActive": [32],
|
1290
1313
|
"_flowItems": [32],
|
1291
1314
|
"_hasValidLayers": [32],
|
1292
|
-
"_loadingFeatureDetails": [32],
|
1293
1315
|
"_mapInfo": [32],
|
1294
1316
|
"_reportSubmitted": [32],
|
1295
1317
|
"_selectedLayerName": [32],
|