@esri/solutions-components 0.10.30 → 0.10.31
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_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/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/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/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/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/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
|
@@ -575,7 +575,7 @@ const FlowItem = class {
|
|
|
575
575
|
};
|
|
576
576
|
FlowItem.style = CalciteFlowItemStyle0;
|
|
577
577
|
|
|
578
|
-
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)
|
|
578
|
+
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}}";
|
|
579
579
|
const CreateFeatureStyle0 = createFeatureCss;
|
|
580
580
|
|
|
581
581
|
const CreateFeature = class {
|
|
@@ -680,6 +680,14 @@ const CreateFeature = class {
|
|
|
680
680
|
* __esri.FeatureLayer: selected feature layer;
|
|
681
681
|
*/
|
|
682
682
|
_selectedLayer;
|
|
683
|
+
/**
|
|
684
|
+
* HTMLDivElement: refrence for search div element
|
|
685
|
+
*/
|
|
686
|
+
_searchDiv;
|
|
687
|
+
/**
|
|
688
|
+
* HTMLCalciteNoticeElement: calcite notice refrence element
|
|
689
|
+
*/
|
|
690
|
+
_calciteNotice;
|
|
683
691
|
//--------------------------------------------------------------------------
|
|
684
692
|
//
|
|
685
693
|
// Watch handlers
|
|
@@ -727,15 +735,6 @@ const CreateFeature = class {
|
|
|
727
735
|
// Methods (public)
|
|
728
736
|
//
|
|
729
737
|
//--------------------------------------------------------------------------
|
|
730
|
-
/**
|
|
731
|
-
* Destroy the Editor widget instance
|
|
732
|
-
* @returns Promise that resolves when the operation is complete
|
|
733
|
-
*/
|
|
734
|
-
async close() {
|
|
735
|
-
if (this._editor) {
|
|
736
|
-
this._editor.destroy();
|
|
737
|
-
}
|
|
738
|
-
}
|
|
739
738
|
/**
|
|
740
739
|
* Submit the created feature
|
|
741
740
|
* @returns Promise that resolves when the operation is complete
|
|
@@ -803,6 +802,26 @@ const CreateFeature = class {
|
|
|
803
802
|
async componentDidLoad() {
|
|
804
803
|
await this.init();
|
|
805
804
|
}
|
|
805
|
+
/**
|
|
806
|
+
* Called after each render
|
|
807
|
+
* Used to adjust the map top in case of mobile
|
|
808
|
+
*/
|
|
809
|
+
componentDidRender() {
|
|
810
|
+
// update the map top according to space occupied by notice msg and search
|
|
811
|
+
if (this.isMobile) {
|
|
812
|
+
// get the height of notice, search and add 80px(editor msg) height to adjust the map top
|
|
813
|
+
const top = this._calciteNotice.offsetHeight + this._searchDiv.offsetHeight + 80;
|
|
814
|
+
this._mapViewContainer.style.top = `${top}px`;
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
/**
|
|
818
|
+
* StencilJS: Called every time the component is disconnected from the DOM,
|
|
819
|
+
*/
|
|
820
|
+
disconnectedCallback() {
|
|
821
|
+
if (this._editor) {
|
|
822
|
+
this._editor.destroy();
|
|
823
|
+
}
|
|
824
|
+
}
|
|
806
825
|
/**
|
|
807
826
|
* Renders the component.
|
|
808
827
|
*/
|
|
@@ -820,7 +839,8 @@ const CreateFeature = class {
|
|
|
820
839
|
else if (this._currentPage === 'featureForm') {
|
|
821
840
|
guidingMsg = this._translations.provideDetailsMsg;
|
|
822
841
|
}
|
|
823
|
-
return (index.h(index.Fragment, { key: '
|
|
842
|
+
return (index.h(index.Fragment, { key: '89634bf5707ea8390416d3087bfbe4e747bafcd7' }, showGuidingMsg && index.h("calcite-notice", { key: '4269224c2904f29060081f6cb8f383f1cf8d741d', class: "notice-msg", icon: "lightbulb", kind: "success", open: true, ref: el => this._calciteNotice = el }, index.h("div", { key: 'ecc3cca85c81d1cb7ab7cdc89b99e31afcb55f76', slot: "message" }, guidingMsg)), index.h("calcite-loader", { key: '34e492c0c469b39d4cfbcda17c4ba196ccb39eb8', class: loaderClass, label: "", scale: "s" }), index.h("div", { key: 'b2073ef4b6124b54038de34798cdf83337626023', class: featureFormClass, id: "feature-form" }), this.enableSearch &&
|
|
843
|
+
index.h("div", { key: 'cd13e98b6a40d5d89d271b5785f797e9bfc19900', class: `search-widget ${showSearchWidget} ${featureFormClass}`, id: "search-widget-ref", ref: el => this._searchDiv = el }), index.h("div", { key: '2575b2d20f7713b05a2024e77452af93eb64e147', class: `${mobileMapClass}`, ref: (el) => { this._mapViewContainer = el; } })));
|
|
824
844
|
}
|
|
825
845
|
//--------------------------------------------------------------------------
|
|
826
846
|
//
|
|
@@ -868,7 +888,8 @@ const CreateFeature = class {
|
|
|
868
888
|
this._mapViewContainer.classList.add('hide-map');
|
|
869
889
|
await new this.MapView({
|
|
870
890
|
map: this.mapView.map,
|
|
871
|
-
container: this._mapViewContainer
|
|
891
|
+
container: this._mapViewContainer,
|
|
892
|
+
zoom: this.mapView.zoom
|
|
872
893
|
}).when((view) => {
|
|
873
894
|
// update the mapView and load all widgets
|
|
874
895
|
this._updatedMapView = view;
|
|
@@ -234,14 +234,6 @@ const CreateRelatedFeature = class {
|
|
|
234
234
|
// Methods (public)
|
|
235
235
|
//
|
|
236
236
|
//--------------------------------------------------------------------------
|
|
237
|
-
/**
|
|
238
|
-
* Destroy the Editor widget instance
|
|
239
|
-
*/
|
|
240
|
-
async close() {
|
|
241
|
-
if (this._editor) {
|
|
242
|
-
this._editor.destroy();
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
237
|
/**
|
|
246
238
|
* Submit the comment
|
|
247
239
|
*/
|
|
@@ -308,7 +300,7 @@ const CreateRelatedFeature = class {
|
|
|
308
300
|
}
|
|
309
301
|
render() {
|
|
310
302
|
const loaderClass = this._editorLoading ? "" : "display-none";
|
|
311
|
-
return (index.h(index.Fragment, { key: '
|
|
303
|
+
return (index.h(index.Fragment, { key: '641b4f6f51bce04b6263a1d7dc72a31839df970d' }, this.showGuidingMsg && index.h("calcite-notice", { key: '1a6e577bcc0632a7bc69dd411a692062a7ad176e', class: "notice-msg", icon: "lightbulb", kind: "success", open: true }, index.h("div", { key: '55c5836314fcca69a259be3a36e34c527edcabf3', slot: "message" }, this._translations.provideDetailsMsg)), index.h("calcite-loader", { key: '18c5603a4a75c67a160a71caa15e94790f66d60b', class: loaderClass, label: "", scale: "s" })));
|
|
312
304
|
}
|
|
313
305
|
/**
|
|
314
306
|
* StencilJS: Called once just after the component is fully loaded and the first render() occurs.
|
|
@@ -316,6 +308,14 @@ const CreateRelatedFeature = class {
|
|
|
316
308
|
async componentDidLoad() {
|
|
317
309
|
await this.init();
|
|
318
310
|
}
|
|
311
|
+
/**
|
|
312
|
+
* StencilJS: Called every time the component is disconnected from the DOM,
|
|
313
|
+
*/
|
|
314
|
+
disconnectedCallback() {
|
|
315
|
+
if (this._editor) {
|
|
316
|
+
this._editor.destroy();
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
319
|
/**
|
|
320
320
|
* Display editor widget to create the new feature
|
|
321
321
|
* @protected
|
|
@@ -704,14 +704,12 @@ const FeatureDetails = class {
|
|
|
704
704
|
const allTables = await mapViewUtils.getAllTables(this.mapView);
|
|
705
705
|
let relatedTable = null;
|
|
706
706
|
let validRelationshipId = null;
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
return true;
|
|
714
|
-
}
|
|
707
|
+
selectedLayer.relationships.some((relationship) => {
|
|
708
|
+
const relatedTables = allTables.filter((table) => selectedLayer.url === table.url && table.layerId === relationship.relatedTableId);
|
|
709
|
+
if (relatedTables && relatedTables.length > 0) {
|
|
710
|
+
relatedTable = relatedTables[0];
|
|
711
|
+
validRelationshipId = relationship.id;
|
|
712
|
+
return true;
|
|
715
713
|
}
|
|
716
714
|
});
|
|
717
715
|
this.relatedTableId = relatedTable?.id ?? '';
|
|
@@ -174,7 +174,6 @@ const CardManager = class {
|
|
|
174
174
|
*/
|
|
175
175
|
async _backFromCreateFeature() {
|
|
176
176
|
if (this._createFeature) {
|
|
177
|
-
await this._createFeature.close();
|
|
178
177
|
this._showCreateFeatureComponent = false;
|
|
179
178
|
this.backFromCreateWorkFlow.emit();
|
|
180
179
|
}
|
|
@@ -185,7 +184,6 @@ const CardManager = class {
|
|
|
185
184
|
* @protected
|
|
186
185
|
*/
|
|
187
186
|
_featureCreated() {
|
|
188
|
-
void this._createFeature.close();
|
|
189
187
|
this._showCreateFeatureComponent = false;
|
|
190
188
|
this._showSubmitBtn = false;
|
|
191
189
|
this._isFeatureCreated = true;
|
|
@@ -58,7 +58,6 @@ const CrowdsourceReporter = class {
|
|
|
58
58
|
this._filterActive = false;
|
|
59
59
|
this._flowItems = [];
|
|
60
60
|
this._hasValidLayers = false;
|
|
61
|
-
this._loadingFeatureDetails = undefined;
|
|
62
61
|
this._mapInfo = undefined;
|
|
63
62
|
this._reportSubmitted = false;
|
|
64
63
|
this._selectedLayerName = undefined;
|
|
@@ -211,6 +210,10 @@ const CrowdsourceReporter = class {
|
|
|
211
210
|
* FilterInitState: filter's init state
|
|
212
211
|
*/
|
|
213
212
|
_filterInitState;
|
|
213
|
+
/**
|
|
214
|
+
* string: Previous selected layer id
|
|
215
|
+
*/
|
|
216
|
+
_prevSelectedLayerId;
|
|
214
217
|
//--------------------------------------------------------------------------
|
|
215
218
|
//
|
|
216
219
|
// Watch handlers
|
|
@@ -311,7 +314,7 @@ const CrowdsourceReporter = class {
|
|
|
311
314
|
*/
|
|
312
315
|
render() {
|
|
313
316
|
const themeClass = this.theme === "dark" ? "calcite-mode-dark" : "calcite-mode-light";
|
|
314
|
-
return (index.h(index.Host, { key: '
|
|
317
|
+
return (index.h(index.Host, { key: 'bb2f79258038360e5c0b894ce5a21dcdd41d0ce4' }, this._reportSubmitted && index.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" }, index.h("div", { key: '25d6d6bd01ee8dc260bce41ea6c43eafa609292e', slot: "message" }, this.reportSubmittedMessage ? this.reportSubmittedMessage : this._translations.submitMsg)), this._featureCreationFailedErrorMsg && index.h("calcite-alert", { key: '06851f2f8cabebd0e953c31bdddfdeac363a4e6e', "auto-close": true, class: themeClass, icon: "x-octagon", kind: "danger", label: "", onCalciteAlertClose: () => { this._featureCreationFailedErrorMsg = ""; }, open: true, placement: "top" }, index.h("div", { key: 'f0d73a00a8150a78c48cc09e8901ad7dcb438e90', slot: "title" }, this._translations.error), index.h("div", { key: '0747a85bbf4936a28dd85a9ea0e8b416f70ee7cf', slot: "message" }, this._featureCreationFailedErrorMsg)), this._commentSubmitted && index.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" }, index.h("div", { key: 'cb63168c1fe507b7b93ac4f58d5283ad0d09b34b', slot: "message" }, this.commentSubmittedMessage || this._translations.commentSubmittedMsg)), this._addingCommentFailed && index.h("calcite-alert", { key: '36b551428b32c7d93f4d04639504bfe326bbc9c8', "auto-close": true, class: themeClass, icon: "x-octagon", kind: "danger", label: "", onCalciteAlertClose: () => { this._addingCommentFailed = false; }, open: true, placement: "top" }, index.h("div", { key: '2e9865c5611f4960bb622f75f386a489abcbb484', slot: "title" }, this._translations.error), index.h("div", { key: 'ebdf339d63369e18b1c68867cdffb9bd40f52766', slot: "message" }, this._translations.addingCommentFailedMsg)), index.h("div", { key: 'a08980aead377e11697e96e77aa514ed66dc9613' }, index.h("calcite-shell", { key: '6d96e769ece33073870f2b8f1a7ef6a44006c3f0', "content-behind": true }, this._getReporter()))));
|
|
315
318
|
}
|
|
316
319
|
//--------------------------------------------------------------------------
|
|
317
320
|
//
|
|
@@ -444,18 +447,29 @@ const CrowdsourceReporter = class {
|
|
|
444
447
|
this._filterActive = false;
|
|
445
448
|
this._filterUrlParams = null;
|
|
446
449
|
this._filterInitState = null;
|
|
447
|
-
|
|
450
|
+
if (this._featureList) {
|
|
451
|
+
await this._featureList.refresh();
|
|
452
|
+
}
|
|
453
|
+
if (this._layerList) {
|
|
454
|
+
await this._layerList.refresh();
|
|
455
|
+
}
|
|
448
456
|
}
|
|
449
457
|
/**
|
|
450
458
|
* Check if the layers definitionExpression has been modified and update the feature list depending on the applied filters
|
|
451
459
|
* @protected
|
|
452
460
|
*/
|
|
453
|
-
_handleFilterUpdate() {
|
|
461
|
+
async _handleFilterUpdate() {
|
|
462
|
+
this._showLoadingIndicator = true;
|
|
454
463
|
//if filter are applied the url params will be generated
|
|
455
464
|
//set the filter active state based on the length of applied filters
|
|
456
465
|
this._filterActive = this._filterList.urlParams.getAll('filter').length > 0;
|
|
457
466
|
this._filterUrlParams = this._filterList.urlParams.getAll('filter');
|
|
458
|
-
|
|
467
|
+
this._filterInitState = await this._filterList.getFilterInitState();
|
|
468
|
+
await this._featureList.refresh();
|
|
469
|
+
if (this._layerList) {
|
|
470
|
+
await this._layerList.refresh();
|
|
471
|
+
}
|
|
472
|
+
this._showLoadingIndicator = false;
|
|
459
473
|
}
|
|
460
474
|
/**
|
|
461
475
|
* Get the feature layer list
|
|
@@ -522,7 +536,6 @@ const CrowdsourceReporter = class {
|
|
|
522
536
|
*/
|
|
523
537
|
backFromCreateFeaturePanel() {
|
|
524
538
|
if (this._createFeature) {
|
|
525
|
-
void this._createFeature.close();
|
|
526
539
|
void this.updateNonVisibleLayersOnMap(false);
|
|
527
540
|
}
|
|
528
541
|
//on back form will be closed, so update the form state
|
|
@@ -543,7 +556,6 @@ const CrowdsourceReporter = class {
|
|
|
543
556
|
*/
|
|
544
557
|
backFromCreateRelatedFeaturePanel() {
|
|
545
558
|
if (this._createRelatedFeature) {
|
|
546
|
-
void this._createRelatedFeature.close();
|
|
547
559
|
this._showSubmitCancelButton = false;
|
|
548
560
|
}
|
|
549
561
|
//on back form will be closed, so update the form state
|
|
@@ -600,9 +612,6 @@ const CrowdsourceReporter = class {
|
|
|
600
612
|
* @protected
|
|
601
613
|
*/
|
|
602
614
|
async navigateToHomePage() {
|
|
603
|
-
if (this._createFeature) {
|
|
604
|
-
void this._createFeature.close();
|
|
605
|
-
}
|
|
606
615
|
if (this._layerList) {
|
|
607
616
|
void this._layerList.refresh();
|
|
608
617
|
}
|
|
@@ -624,6 +633,10 @@ const CrowdsourceReporter = class {
|
|
|
624
633
|
if (evt.detail.layerId && evt.detail.layerName) {
|
|
625
634
|
await this.setSelectedLayer(evt.detail.layerId, evt.detail.layerName);
|
|
626
635
|
}
|
|
636
|
+
// reset the applied filter when switching to another layer
|
|
637
|
+
if (this._selectedLayerId !== this._prevSelectedLayerId && this._filterActive) {
|
|
638
|
+
await this.resetFilter();
|
|
639
|
+
}
|
|
627
640
|
void this.updateNonVisibleLayersOnMap(true);
|
|
628
641
|
// get the form template elements to pass in create-feature to create a LEVELID field in feature-form
|
|
629
642
|
this._getFormElements();
|
|
@@ -683,27 +696,33 @@ const CrowdsourceReporter = class {
|
|
|
683
696
|
await this.loadFeatureFromURLParams();
|
|
684
697
|
}
|
|
685
698
|
}
|
|
686
|
-
/**
|
|
699
|
+
/**
|
|
700
|
+
* On click of layer list item show feature list
|
|
687
701
|
* @param evt Event which has details of selected layerId and layerName
|
|
688
702
|
* @protected
|
|
689
703
|
*/
|
|
690
|
-
displayFeaturesList(evt) {
|
|
704
|
+
async displayFeaturesList(evt) {
|
|
691
705
|
this._updatedSorting = {
|
|
692
706
|
field: '',
|
|
693
707
|
order: 'desc'
|
|
694
708
|
};
|
|
695
|
-
this._filterActive = false;
|
|
696
709
|
this._updatedSortOption = "sortNewest";
|
|
697
|
-
|
|
710
|
+
await this.setSelectedLayer(evt.detail.layerId, evt.detail.layerName);
|
|
698
711
|
this._flowItems = [...this._flowItems, "feature-list"];
|
|
712
|
+
// reset the applied filter when switching to another layer
|
|
713
|
+
if (this._selectedLayerId !== this._prevSelectedLayerId && this._filterActive) {
|
|
714
|
+
await this.resetFilter();
|
|
715
|
+
}
|
|
716
|
+
this._prevSelectedLayerId = this._selectedLayerId;
|
|
699
717
|
}
|
|
700
718
|
/**
|
|
701
|
-
*
|
|
719
|
+
* Reset's the applied filter
|
|
702
720
|
* @protected
|
|
703
721
|
*/
|
|
704
|
-
async
|
|
705
|
-
|
|
706
|
-
this.
|
|
722
|
+
async resetFilter() {
|
|
723
|
+
const prevLayer = await mapViewUtils.getLayerOrTable(this.mapView, this._prevSelectedLayerId);
|
|
724
|
+
prevLayer.definitionExpression = this._filterInitState.initDefExpressions[this._prevSelectedLayerId];
|
|
725
|
+
void this._handleFilterListReset();
|
|
707
726
|
}
|
|
708
727
|
/**
|
|
709
728
|
* On back from selected panel navigate to the previous panel
|
|
@@ -764,10 +783,14 @@ const CrowdsourceReporter = class {
|
|
|
764
783
|
*/
|
|
765
784
|
async getRelatedTable() {
|
|
766
785
|
const selectedLayer = this._currentFeature.layer;
|
|
767
|
-
const allRelatedTableIds = selectedLayer.relationships.map(a => a.relatedTableId);
|
|
768
786
|
const allTables = await mapViewUtils.getAllTables(this.mapView);
|
|
769
|
-
|
|
770
|
-
|
|
787
|
+
selectedLayer.relationships.some((relationship) => {
|
|
788
|
+
const relatedTables = allTables.filter((table) => selectedLayer.url === table.url && table.layerId === relationship.relatedTableId);
|
|
789
|
+
if (relatedTables && relatedTables.length > 0) {
|
|
790
|
+
this._relatedTable = relatedTables[0];
|
|
791
|
+
return true;
|
|
792
|
+
}
|
|
793
|
+
});
|
|
771
794
|
}
|
|
772
795
|
/**
|
|
773
796
|
* Show loading indicator while updating the feature details component
|
|
@@ -825,7 +848,7 @@ const CrowdsourceReporter = class {
|
|
|
825
848
|
*/
|
|
826
849
|
getFilterPanel() {
|
|
827
850
|
const currentLayersExpressions = this.layerExpressions ? this.layerExpressions.filter((exp) => exp.id === this._selectedLayerId) : [];
|
|
828
|
-
return (index.h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this._translations?.filterLayerTitle?.replace("{{title}}", this._selectedLayerName), loading: this._showLoadingIndicator, onCalciteFlowItemBack: this.
|
|
851
|
+
return (index.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(), index.h("div", { class: "width-full", slot: "footer" }, index.h("div", { class: "width-full", slot: "footer" }, index.h("calcite-button", { appearance: "solid", class: "footer-top-button footer-button", disabled: !this._filterActive, onClick: () => { void this._filterList?.forceReset(); }, width: "full" }, this._translations.resetFilter), index.h("calcite-button", { appearance: "outline", class: "footer-button", onClick: this.backFromSelectedPanel.bind(this), width: "full" }, this._translations.close))), index.h("calcite-panel", { "full-height": true }, index.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 }))));
|
|
829
852
|
}
|
|
830
853
|
/**
|
|
831
854
|
* Returns the calcite-flow item for feature details
|
|
@@ -128,7 +128,7 @@ const FeatureList = class {
|
|
|
128
128
|
* @returns Promise that resolves when the operation is complete
|
|
129
129
|
*/
|
|
130
130
|
async refresh(maintainPageState) {
|
|
131
|
-
if (maintainPageState) {
|
|
131
|
+
if (maintainPageState && this._pagination) {
|
|
132
132
|
const event = {
|
|
133
133
|
target: {
|
|
134
134
|
startItem: this._pagination.startItem
|
|
@@ -179,9 +179,9 @@ const FeatureList = class {
|
|
|
179
179
|
* Renders the component.
|
|
180
180
|
*/
|
|
181
181
|
render() {
|
|
182
|
-
return (index.h("calcite-panel", { key: '
|
|
183
|
-
index.h("calcite-notice", { key: '
|
|
184
|
-
index.h("div", { key: '
|
|
182
|
+
return (index.h("calcite-panel", { key: 'fc2cc60231efb7fc4a05d3ade0bad6a3dd649b8e', "full-height": true, "full-width": true }, this._isLoading && index.h("calcite-loader", { key: '43c8176c2aaf0cc7f36a9f1ff477f53890cfcf2d', label: "", scale: "m" }), this.showErrorWhenNoFeatures && this._featureItems.length === 0 && !this._isLoading &&
|
|
183
|
+
index.h("calcite-notice", { key: 'dff1bb7207397ded8a557b61e9185ea788520441', class: "error-msg", icon: "feature-details", kind: "info", open: true }, index.h("div", { key: 'c1dd4e7fb8398c4317270b50eba7e6270fd7051b', slot: "message" }, this.noFeaturesFoundMsg ? this.noFeaturesFoundMsg : this._translations.featureErrorMsg)), index.h("calcite-list", { key: '49019c011e8667d193f566826644b0693b0fb6f9', "selection-appearance": "border", "selection-mode": "none" }, !this._isLoading && this._featureItems.length > 0 && this._featureItems), this._featuresCount > this.pageSize &&
|
|
184
|
+
index.h("div", { key: '12e767a001c4dffec7e771d12b772fb43bbf9b0f', class: "width-full", slot: "footer" }, index.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 }))));
|
|
185
185
|
}
|
|
186
186
|
//--------------------------------------------------------------------------
|
|
187
187
|
//
|
|
@@ -355,10 +355,10 @@ const FeatureList = class {
|
|
|
355
355
|
let userInfo;
|
|
356
356
|
let featureSymbol;
|
|
357
357
|
if (this.showUserImageInList) {
|
|
358
|
-
const creatorField = this._selectedLayer.editFieldsInfo?.creatorField
|
|
358
|
+
const creatorField = this._selectedLayer.editFieldsInfo?.creatorField;
|
|
359
359
|
// if feature's creator field is present then only we can fetch the information of user
|
|
360
360
|
if (creatorField) {
|
|
361
|
-
userInfo = await this.getUserInformation(feature
|
|
361
|
+
userInfo = await this.getUserInformation(feature);
|
|
362
362
|
}
|
|
363
363
|
}
|
|
364
364
|
if (this.showFeatureSymbol) {
|
|
@@ -410,21 +410,27 @@ const FeatureList = class {
|
|
|
410
410
|
const popupTitleClass = this.textSize === 'small' ? 'feature-list-popup-title-small' : 'feature-list-popup-title';
|
|
411
411
|
const popupTitlePaddingClass = this.showUserImageInList || this.showFeatureSymbol ? 'feature-list-popup-title-padding-reduced' : 'feature-list-popup-title-padding';
|
|
412
412
|
return (index.h("calcite-list-item", { onCalciteListItemSelect: (e) => { void this.featureClicked(e, selectedFeature); }, onMouseLeave: () => { void this.clearHighlights(); }, onMouseOver: () => { void this.onFeatureHover(selectedFeature); }, value: oId }, this.showUserImageInList &&
|
|
413
|
-
index.h("calcite-avatar", { class: 'profile-img', "full-name": userInfo?.fullName,
|
|
413
|
+
index.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 &&
|
|
414
414
|
index.h("div", { class: 'feature-symbol', ref: (el) => el && el.appendChild(featureSymbol), slot: "content-start" }), index.h("div", { class: `${popupTitleClass} ${popupTitlePaddingClass}`, slot: "content-start" }, popupTitle), this._likeFieldAvailable &&
|
|
415
415
|
index.h("div", { class: "like-container", id: oId.concat("like"), slot: "content-end" }, index.h("span", null, this._abbreviatedLikeCount), index.h("calcite-icon", { icon: "thumbs-up", scale: 's' }), index.h("calcite-tooltip", { overlayPositioning: "fixed", placement: "top", "reference-element": oId.concat("like") }, formattedLikeCount)), index.h("calcite-icon", { flipRtl: true, icon: "chevron-right", scale: "s", slot: "content-end" })));
|
|
416
416
|
}
|
|
417
417
|
/**
|
|
418
418
|
*
|
|
419
419
|
* @param feature Each individual feature instance to be listed
|
|
420
|
-
* @param creatorField Feature's creator field from the layer
|
|
421
420
|
* @returns user information
|
|
422
421
|
* @protected
|
|
423
422
|
*/
|
|
424
|
-
async getUserInformation(feature
|
|
425
|
-
|
|
423
|
+
async getUserInformation(feature) {
|
|
424
|
+
let creatorField = this._selectedLayer.editFieldsInfo?.creatorField;
|
|
425
|
+
if (feature.attributes.hasOwnProperty(creatorField.toLowerCase())) {
|
|
426
|
+
creatorField = creatorField.toLowerCase();
|
|
427
|
+
}
|
|
428
|
+
else if (feature.attributes.hasOwnProperty(creatorField.toUpperCase())) {
|
|
429
|
+
creatorField = creatorField.toUpperCase();
|
|
430
|
+
}
|
|
426
431
|
//get the user information
|
|
427
432
|
let url = `${this.esriConfig.portalUrl}/sharing/rest/community/users/${feature.attributes[creatorField]}?f=json&returnUserLicensedItems=true`;
|
|
433
|
+
const userToken = this.mapView.map.portalItem.portal?.credential?.token;
|
|
428
434
|
if (userToken) {
|
|
429
435
|
url += `&token=${userToken}`;
|
|
430
436
|
}
|