@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
|
@@ -246,14 +246,12 @@ const FeatureDetails = /*@__PURE__*/ proxyCustomElement(class FeatureDetails ext
|
|
|
246
246
|
const allTables = await getAllTables(this.mapView);
|
|
247
247
|
let relatedTable = null;
|
|
248
248
|
let validRelationshipId = null;
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
return true;
|
|
256
|
-
}
|
|
249
|
+
selectedLayer.relationships.some((relationship) => {
|
|
250
|
+
const relatedTables = allTables.filter((table) => selectedLayer.url === table.url && table.layerId === relationship.relatedTableId);
|
|
251
|
+
if (relatedTables && relatedTables.length > 0) {
|
|
252
|
+
relatedTable = relatedTables[0];
|
|
253
|
+
validRelationshipId = relationship.id;
|
|
254
|
+
return true;
|
|
257
255
|
}
|
|
258
256
|
});
|
|
259
257
|
this.relatedTableId = relatedTable?.id ?? '';
|
|
@@ -137,7 +137,7 @@ const FeatureList = /*@__PURE__*/ proxyCustomElement(class FeatureList extends H
|
|
|
137
137
|
* @returns Promise that resolves when the operation is complete
|
|
138
138
|
*/
|
|
139
139
|
async refresh(maintainPageState) {
|
|
140
|
-
if (maintainPageState) {
|
|
140
|
+
if (maintainPageState && this._pagination) {
|
|
141
141
|
const event = {
|
|
142
142
|
target: {
|
|
143
143
|
startItem: this._pagination.startItem
|
|
@@ -188,9 +188,9 @@ const FeatureList = /*@__PURE__*/ proxyCustomElement(class FeatureList extends H
|
|
|
188
188
|
* Renders the component.
|
|
189
189
|
*/
|
|
190
190
|
render() {
|
|
191
|
-
return (h("calcite-panel", { key: '
|
|
192
|
-
h("calcite-notice", { key: '
|
|
193
|
-
h("div", { key: '
|
|
191
|
+
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 &&
|
|
192
|
+
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 &&
|
|
193
|
+
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 }))));
|
|
194
194
|
}
|
|
195
195
|
//--------------------------------------------------------------------------
|
|
196
196
|
//
|
|
@@ -364,10 +364,10 @@ const FeatureList = /*@__PURE__*/ proxyCustomElement(class FeatureList extends H
|
|
|
364
364
|
let userInfo;
|
|
365
365
|
let featureSymbol;
|
|
366
366
|
if (this.showUserImageInList) {
|
|
367
|
-
const creatorField = this._selectedLayer.editFieldsInfo?.creatorField
|
|
367
|
+
const creatorField = this._selectedLayer.editFieldsInfo?.creatorField;
|
|
368
368
|
// if feature's creator field is present then only we can fetch the information of user
|
|
369
369
|
if (creatorField) {
|
|
370
|
-
userInfo = await this.getUserInformation(feature
|
|
370
|
+
userInfo = await this.getUserInformation(feature);
|
|
371
371
|
}
|
|
372
372
|
}
|
|
373
373
|
if (this.showFeatureSymbol) {
|
|
@@ -419,21 +419,27 @@ const FeatureList = /*@__PURE__*/ proxyCustomElement(class FeatureList extends H
|
|
|
419
419
|
const popupTitleClass = this.textSize === 'small' ? 'feature-list-popup-title-small' : 'feature-list-popup-title';
|
|
420
420
|
const popupTitlePaddingClass = this.showUserImageInList || this.showFeatureSymbol ? 'feature-list-popup-title-padding-reduced' : 'feature-list-popup-title-padding';
|
|
421
421
|
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 &&
|
|
422
|
-
h("calcite-avatar", { class: 'profile-img', "full-name": userInfo?.fullName,
|
|
422
|
+
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 &&
|
|
423
423
|
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 &&
|
|
424
424
|
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" })));
|
|
425
425
|
}
|
|
426
426
|
/**
|
|
427
427
|
*
|
|
428
428
|
* @param feature Each individual feature instance to be listed
|
|
429
|
-
* @param creatorField Feature's creator field from the layer
|
|
430
429
|
* @returns user information
|
|
431
430
|
* @protected
|
|
432
431
|
*/
|
|
433
|
-
async getUserInformation(feature
|
|
434
|
-
|
|
432
|
+
async getUserInformation(feature) {
|
|
433
|
+
let creatorField = this._selectedLayer.editFieldsInfo?.creatorField;
|
|
434
|
+
if (feature.attributes.hasOwnProperty(creatorField.toLowerCase())) {
|
|
435
|
+
creatorField = creatorField.toLowerCase();
|
|
436
|
+
}
|
|
437
|
+
else if (feature.attributes.hasOwnProperty(creatorField.toUpperCase())) {
|
|
438
|
+
creatorField = creatorField.toUpperCase();
|
|
439
|
+
}
|
|
435
440
|
//get the user information
|
|
436
441
|
let url = `${this.esriConfig.portalUrl}/sharing/rest/community/users/${feature.attributes[creatorField]}?f=json&returnUserLicensedItems=true`;
|
|
442
|
+
const userToken = this.mapView.map.portalItem.portal?.credential?.token;
|
|
437
443
|
if (userToken) {
|
|
438
444
|
url += `&token=${userToken}`;
|
|
439
445
|
}
|
|
@@ -571,7 +571,7 @@ const FlowItem = class {
|
|
|
571
571
|
};
|
|
572
572
|
FlowItem.style = CalciteFlowItemStyle0;
|
|
573
573
|
|
|
574
|
-
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)
|
|
574
|
+
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}}";
|
|
575
575
|
const CreateFeatureStyle0 = createFeatureCss;
|
|
576
576
|
|
|
577
577
|
const CreateFeature = class {
|
|
@@ -676,6 +676,14 @@ const CreateFeature = class {
|
|
|
676
676
|
* __esri.FeatureLayer: selected feature layer;
|
|
677
677
|
*/
|
|
678
678
|
_selectedLayer;
|
|
679
|
+
/**
|
|
680
|
+
* HTMLDivElement: refrence for search div element
|
|
681
|
+
*/
|
|
682
|
+
_searchDiv;
|
|
683
|
+
/**
|
|
684
|
+
* HTMLCalciteNoticeElement: calcite notice refrence element
|
|
685
|
+
*/
|
|
686
|
+
_calciteNotice;
|
|
679
687
|
//--------------------------------------------------------------------------
|
|
680
688
|
//
|
|
681
689
|
// Watch handlers
|
|
@@ -723,15 +731,6 @@ const CreateFeature = class {
|
|
|
723
731
|
// Methods (public)
|
|
724
732
|
//
|
|
725
733
|
//--------------------------------------------------------------------------
|
|
726
|
-
/**
|
|
727
|
-
* Destroy the Editor widget instance
|
|
728
|
-
* @returns Promise that resolves when the operation is complete
|
|
729
|
-
*/
|
|
730
|
-
async close() {
|
|
731
|
-
if (this._editor) {
|
|
732
|
-
this._editor.destroy();
|
|
733
|
-
}
|
|
734
|
-
}
|
|
735
734
|
/**
|
|
736
735
|
* Submit the created feature
|
|
737
736
|
* @returns Promise that resolves when the operation is complete
|
|
@@ -799,6 +798,26 @@ const CreateFeature = class {
|
|
|
799
798
|
async componentDidLoad() {
|
|
800
799
|
await this.init();
|
|
801
800
|
}
|
|
801
|
+
/**
|
|
802
|
+
* Called after each render
|
|
803
|
+
* Used to adjust the map top in case of mobile
|
|
804
|
+
*/
|
|
805
|
+
componentDidRender() {
|
|
806
|
+
// update the map top according to space occupied by notice msg and search
|
|
807
|
+
if (this.isMobile) {
|
|
808
|
+
// get the height of notice, search and add 80px(editor msg) height to adjust the map top
|
|
809
|
+
const top = this._calciteNotice.offsetHeight + this._searchDiv.offsetHeight + 80;
|
|
810
|
+
this._mapViewContainer.style.top = `${top}px`;
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
/**
|
|
814
|
+
* StencilJS: Called every time the component is disconnected from the DOM,
|
|
815
|
+
*/
|
|
816
|
+
disconnectedCallback() {
|
|
817
|
+
if (this._editor) {
|
|
818
|
+
this._editor.destroy();
|
|
819
|
+
}
|
|
820
|
+
}
|
|
802
821
|
/**
|
|
803
822
|
* Renders the component.
|
|
804
823
|
*/
|
|
@@ -816,7 +835,8 @@ const CreateFeature = class {
|
|
|
816
835
|
else if (this._currentPage === 'featureForm') {
|
|
817
836
|
guidingMsg = this._translations.provideDetailsMsg;
|
|
818
837
|
}
|
|
819
|
-
return (h(Fragment, { key: '
|
|
838
|
+
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 &&
|
|
839
|
+
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; } })));
|
|
820
840
|
}
|
|
821
841
|
//--------------------------------------------------------------------------
|
|
822
842
|
//
|
|
@@ -864,7 +884,8 @@ const CreateFeature = class {
|
|
|
864
884
|
this._mapViewContainer.classList.add('hide-map');
|
|
865
885
|
await new this.MapView({
|
|
866
886
|
map: this.mapView.map,
|
|
867
|
-
container: this._mapViewContainer
|
|
887
|
+
container: this._mapViewContainer,
|
|
888
|
+
zoom: this.mapView.zoom
|
|
868
889
|
}).when((view) => {
|
|
869
890
|
// update the mapView and load all widgets
|
|
870
891
|
this._updatedMapView = view;
|
|
@@ -230,14 +230,6 @@ const CreateRelatedFeature = class {
|
|
|
230
230
|
// Methods (public)
|
|
231
231
|
//
|
|
232
232
|
//--------------------------------------------------------------------------
|
|
233
|
-
/**
|
|
234
|
-
* Destroy the Editor widget instance
|
|
235
|
-
*/
|
|
236
|
-
async close() {
|
|
237
|
-
if (this._editor) {
|
|
238
|
-
this._editor.destroy();
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
233
|
/**
|
|
242
234
|
* Submit the comment
|
|
243
235
|
*/
|
|
@@ -304,7 +296,7 @@ const CreateRelatedFeature = class {
|
|
|
304
296
|
}
|
|
305
297
|
render() {
|
|
306
298
|
const loaderClass = this._editorLoading ? "" : "display-none";
|
|
307
|
-
return (h(Fragment, { key: '
|
|
299
|
+
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" })));
|
|
308
300
|
}
|
|
309
301
|
/**
|
|
310
302
|
* StencilJS: Called once just after the component is fully loaded and the first render() occurs.
|
|
@@ -312,6 +304,14 @@ const CreateRelatedFeature = class {
|
|
|
312
304
|
async componentDidLoad() {
|
|
313
305
|
await this.init();
|
|
314
306
|
}
|
|
307
|
+
/**
|
|
308
|
+
* StencilJS: Called every time the component is disconnected from the DOM,
|
|
309
|
+
*/
|
|
310
|
+
disconnectedCallback() {
|
|
311
|
+
if (this._editor) {
|
|
312
|
+
this._editor.destroy();
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
315
|
/**
|
|
316
316
|
* Display editor widget to create the new feature
|
|
317
317
|
* @protected
|
|
@@ -700,14 +700,12 @@ const FeatureDetails = class {
|
|
|
700
700
|
const allTables = await getAllTables(this.mapView);
|
|
701
701
|
let relatedTable = null;
|
|
702
702
|
let validRelationshipId = null;
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
return true;
|
|
710
|
-
}
|
|
703
|
+
selectedLayer.relationships.some((relationship) => {
|
|
704
|
+
const relatedTables = allTables.filter((table) => selectedLayer.url === table.url && table.layerId === relationship.relatedTableId);
|
|
705
|
+
if (relatedTables && relatedTables.length > 0) {
|
|
706
|
+
relatedTable = relatedTables[0];
|
|
707
|
+
validRelationshipId = relationship.id;
|
|
708
|
+
return true;
|
|
711
709
|
}
|
|
712
710
|
});
|
|
713
711
|
this.relatedTableId = relatedTable?.id ?? '';
|
|
@@ -170,7 +170,6 @@ const CardManager = class {
|
|
|
170
170
|
*/
|
|
171
171
|
async _backFromCreateFeature() {
|
|
172
172
|
if (this._createFeature) {
|
|
173
|
-
await this._createFeature.close();
|
|
174
173
|
this._showCreateFeatureComponent = false;
|
|
175
174
|
this.backFromCreateWorkFlow.emit();
|
|
176
175
|
}
|
|
@@ -181,7 +180,6 @@ const CardManager = class {
|
|
|
181
180
|
* @protected
|
|
182
181
|
*/
|
|
183
182
|
_featureCreated() {
|
|
184
|
-
void this._createFeature.close();
|
|
185
183
|
this._showCreateFeatureComponent = false;
|
|
186
184
|
this._showSubmitBtn = false;
|
|
187
185
|
this._isFeatureCreated = true;
|
|
@@ -54,7 +54,6 @@ const CrowdsourceReporter = class {
|
|
|
54
54
|
this._filterActive = false;
|
|
55
55
|
this._flowItems = [];
|
|
56
56
|
this._hasValidLayers = false;
|
|
57
|
-
this._loadingFeatureDetails = undefined;
|
|
58
57
|
this._mapInfo = undefined;
|
|
59
58
|
this._reportSubmitted = false;
|
|
60
59
|
this._selectedLayerName = undefined;
|
|
@@ -207,6 +206,10 @@ const CrowdsourceReporter = class {
|
|
|
207
206
|
* FilterInitState: filter's init state
|
|
208
207
|
*/
|
|
209
208
|
_filterInitState;
|
|
209
|
+
/**
|
|
210
|
+
* string: Previous selected layer id
|
|
211
|
+
*/
|
|
212
|
+
_prevSelectedLayerId;
|
|
210
213
|
//--------------------------------------------------------------------------
|
|
211
214
|
//
|
|
212
215
|
// Watch handlers
|
|
@@ -307,7 +310,7 @@ const CrowdsourceReporter = class {
|
|
|
307
310
|
*/
|
|
308
311
|
render() {
|
|
309
312
|
const themeClass = this.theme === "dark" ? "calcite-mode-dark" : "calcite-mode-light";
|
|
310
|
-
return (h(Host, { key: '
|
|
313
|
+
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()))));
|
|
311
314
|
}
|
|
312
315
|
//--------------------------------------------------------------------------
|
|
313
316
|
//
|
|
@@ -440,18 +443,29 @@ const CrowdsourceReporter = class {
|
|
|
440
443
|
this._filterActive = false;
|
|
441
444
|
this._filterUrlParams = null;
|
|
442
445
|
this._filterInitState = null;
|
|
443
|
-
|
|
446
|
+
if (this._featureList) {
|
|
447
|
+
await this._featureList.refresh();
|
|
448
|
+
}
|
|
449
|
+
if (this._layerList) {
|
|
450
|
+
await this._layerList.refresh();
|
|
451
|
+
}
|
|
444
452
|
}
|
|
445
453
|
/**
|
|
446
454
|
* Check if the layers definitionExpression has been modified and update the feature list depending on the applied filters
|
|
447
455
|
* @protected
|
|
448
456
|
*/
|
|
449
|
-
_handleFilterUpdate() {
|
|
457
|
+
async _handleFilterUpdate() {
|
|
458
|
+
this._showLoadingIndicator = true;
|
|
450
459
|
//if filter are applied the url params will be generated
|
|
451
460
|
//set the filter active state based on the length of applied filters
|
|
452
461
|
this._filterActive = this._filterList.urlParams.getAll('filter').length > 0;
|
|
453
462
|
this._filterUrlParams = this._filterList.urlParams.getAll('filter');
|
|
454
|
-
|
|
463
|
+
this._filterInitState = await this._filterList.getFilterInitState();
|
|
464
|
+
await this._featureList.refresh();
|
|
465
|
+
if (this._layerList) {
|
|
466
|
+
await this._layerList.refresh();
|
|
467
|
+
}
|
|
468
|
+
this._showLoadingIndicator = false;
|
|
455
469
|
}
|
|
456
470
|
/**
|
|
457
471
|
* Get the feature layer list
|
|
@@ -518,7 +532,6 @@ const CrowdsourceReporter = class {
|
|
|
518
532
|
*/
|
|
519
533
|
backFromCreateFeaturePanel() {
|
|
520
534
|
if (this._createFeature) {
|
|
521
|
-
void this._createFeature.close();
|
|
522
535
|
void this.updateNonVisibleLayersOnMap(false);
|
|
523
536
|
}
|
|
524
537
|
//on back form will be closed, so update the form state
|
|
@@ -539,7 +552,6 @@ const CrowdsourceReporter = class {
|
|
|
539
552
|
*/
|
|
540
553
|
backFromCreateRelatedFeaturePanel() {
|
|
541
554
|
if (this._createRelatedFeature) {
|
|
542
|
-
void this._createRelatedFeature.close();
|
|
543
555
|
this._showSubmitCancelButton = false;
|
|
544
556
|
}
|
|
545
557
|
//on back form will be closed, so update the form state
|
|
@@ -596,9 +608,6 @@ const CrowdsourceReporter = class {
|
|
|
596
608
|
* @protected
|
|
597
609
|
*/
|
|
598
610
|
async navigateToHomePage() {
|
|
599
|
-
if (this._createFeature) {
|
|
600
|
-
void this._createFeature.close();
|
|
601
|
-
}
|
|
602
611
|
if (this._layerList) {
|
|
603
612
|
void this._layerList.refresh();
|
|
604
613
|
}
|
|
@@ -620,6 +629,10 @@ const CrowdsourceReporter = class {
|
|
|
620
629
|
if (evt.detail.layerId && evt.detail.layerName) {
|
|
621
630
|
await this.setSelectedLayer(evt.detail.layerId, evt.detail.layerName);
|
|
622
631
|
}
|
|
632
|
+
// reset the applied filter when switching to another layer
|
|
633
|
+
if (this._selectedLayerId !== this._prevSelectedLayerId && this._filterActive) {
|
|
634
|
+
await this.resetFilter();
|
|
635
|
+
}
|
|
623
636
|
void this.updateNonVisibleLayersOnMap(true);
|
|
624
637
|
// get the form template elements to pass in create-feature to create a LEVELID field in feature-form
|
|
625
638
|
this._getFormElements();
|
|
@@ -679,27 +692,33 @@ const CrowdsourceReporter = class {
|
|
|
679
692
|
await this.loadFeatureFromURLParams();
|
|
680
693
|
}
|
|
681
694
|
}
|
|
682
|
-
/**
|
|
695
|
+
/**
|
|
696
|
+
* On click of layer list item show feature list
|
|
683
697
|
* @param evt Event which has details of selected layerId and layerName
|
|
684
698
|
* @protected
|
|
685
699
|
*/
|
|
686
|
-
displayFeaturesList(evt) {
|
|
700
|
+
async displayFeaturesList(evt) {
|
|
687
701
|
this._updatedSorting = {
|
|
688
702
|
field: '',
|
|
689
703
|
order: 'desc'
|
|
690
704
|
};
|
|
691
|
-
this._filterActive = false;
|
|
692
705
|
this._updatedSortOption = "sortNewest";
|
|
693
|
-
|
|
706
|
+
await this.setSelectedLayer(evt.detail.layerId, evt.detail.layerName);
|
|
694
707
|
this._flowItems = [...this._flowItems, "feature-list"];
|
|
708
|
+
// reset the applied filter when switching to another layer
|
|
709
|
+
if (this._selectedLayerId !== this._prevSelectedLayerId && this._filterActive) {
|
|
710
|
+
await this.resetFilter();
|
|
711
|
+
}
|
|
712
|
+
this._prevSelectedLayerId = this._selectedLayerId;
|
|
695
713
|
}
|
|
696
714
|
/**
|
|
697
|
-
*
|
|
715
|
+
* Reset's the applied filter
|
|
698
716
|
* @protected
|
|
699
717
|
*/
|
|
700
|
-
async
|
|
701
|
-
|
|
702
|
-
this.
|
|
718
|
+
async resetFilter() {
|
|
719
|
+
const prevLayer = await getLayerOrTable(this.mapView, this._prevSelectedLayerId);
|
|
720
|
+
prevLayer.definitionExpression = this._filterInitState.initDefExpressions[this._prevSelectedLayerId];
|
|
721
|
+
void this._handleFilterListReset();
|
|
703
722
|
}
|
|
704
723
|
/**
|
|
705
724
|
* On back from selected panel navigate to the previous panel
|
|
@@ -760,10 +779,14 @@ const CrowdsourceReporter = class {
|
|
|
760
779
|
*/
|
|
761
780
|
async getRelatedTable() {
|
|
762
781
|
const selectedLayer = this._currentFeature.layer;
|
|
763
|
-
const allRelatedTableIds = selectedLayer.relationships.map(a => a.relatedTableId);
|
|
764
782
|
const allTables = await getAllTables(this.mapView);
|
|
765
|
-
|
|
766
|
-
|
|
783
|
+
selectedLayer.relationships.some((relationship) => {
|
|
784
|
+
const relatedTables = allTables.filter((table) => selectedLayer.url === table.url && table.layerId === relationship.relatedTableId);
|
|
785
|
+
if (relatedTables && relatedTables.length > 0) {
|
|
786
|
+
this._relatedTable = relatedTables[0];
|
|
787
|
+
return true;
|
|
788
|
+
}
|
|
789
|
+
});
|
|
767
790
|
}
|
|
768
791
|
/**
|
|
769
792
|
* Show loading indicator while updating the feature details component
|
|
@@ -821,7 +844,7 @@ const CrowdsourceReporter = class {
|
|
|
821
844
|
*/
|
|
822
845
|
getFilterPanel() {
|
|
823
846
|
const currentLayersExpressions = this.layerExpressions ? this.layerExpressions.filter((exp) => exp.id === this._selectedLayerId) : [];
|
|
824
|
-
return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this._translations?.filterLayerTitle?.replace("{{title}}", this._selectedLayerName), loading: this._showLoadingIndicator, onCalciteFlowItemBack: this.
|
|
847
|
+
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 }))));
|
|
825
848
|
}
|
|
826
849
|
/**
|
|
827
850
|
* Returns the calcite-flow item for feature details
|
|
@@ -124,7 +124,7 @@ const FeatureList = class {
|
|
|
124
124
|
* @returns Promise that resolves when the operation is complete
|
|
125
125
|
*/
|
|
126
126
|
async refresh(maintainPageState) {
|
|
127
|
-
if (maintainPageState) {
|
|
127
|
+
if (maintainPageState && this._pagination) {
|
|
128
128
|
const event = {
|
|
129
129
|
target: {
|
|
130
130
|
startItem: this._pagination.startItem
|
|
@@ -175,9 +175,9 @@ const FeatureList = class {
|
|
|
175
175
|
* Renders the component.
|
|
176
176
|
*/
|
|
177
177
|
render() {
|
|
178
|
-
return (h("calcite-panel", { key: '
|
|
179
|
-
h("calcite-notice", { key: '
|
|
180
|
-
h("div", { key: '
|
|
178
|
+
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 &&
|
|
179
|
+
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 &&
|
|
180
|
+
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 }))));
|
|
181
181
|
}
|
|
182
182
|
//--------------------------------------------------------------------------
|
|
183
183
|
//
|
|
@@ -351,10 +351,10 @@ const FeatureList = class {
|
|
|
351
351
|
let userInfo;
|
|
352
352
|
let featureSymbol;
|
|
353
353
|
if (this.showUserImageInList) {
|
|
354
|
-
const creatorField = this._selectedLayer.editFieldsInfo?.creatorField
|
|
354
|
+
const creatorField = this._selectedLayer.editFieldsInfo?.creatorField;
|
|
355
355
|
// if feature's creator field is present then only we can fetch the information of user
|
|
356
356
|
if (creatorField) {
|
|
357
|
-
userInfo = await this.getUserInformation(feature
|
|
357
|
+
userInfo = await this.getUserInformation(feature);
|
|
358
358
|
}
|
|
359
359
|
}
|
|
360
360
|
if (this.showFeatureSymbol) {
|
|
@@ -406,21 +406,27 @@ const FeatureList = class {
|
|
|
406
406
|
const popupTitleClass = this.textSize === 'small' ? 'feature-list-popup-title-small' : 'feature-list-popup-title';
|
|
407
407
|
const popupTitlePaddingClass = this.showUserImageInList || this.showFeatureSymbol ? 'feature-list-popup-title-padding-reduced' : 'feature-list-popup-title-padding';
|
|
408
408
|
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 &&
|
|
409
|
-
h("calcite-avatar", { class: 'profile-img', "full-name": userInfo?.fullName,
|
|
409
|
+
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 &&
|
|
410
410
|
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 &&
|
|
411
411
|
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" })));
|
|
412
412
|
}
|
|
413
413
|
/**
|
|
414
414
|
*
|
|
415
415
|
* @param feature Each individual feature instance to be listed
|
|
416
|
-
* @param creatorField Feature's creator field from the layer
|
|
417
416
|
* @returns user information
|
|
418
417
|
* @protected
|
|
419
418
|
*/
|
|
420
|
-
async getUserInformation(feature
|
|
421
|
-
|
|
419
|
+
async getUserInformation(feature) {
|
|
420
|
+
let creatorField = this._selectedLayer.editFieldsInfo?.creatorField;
|
|
421
|
+
if (feature.attributes.hasOwnProperty(creatorField.toLowerCase())) {
|
|
422
|
+
creatorField = creatorField.toLowerCase();
|
|
423
|
+
}
|
|
424
|
+
else if (feature.attributes.hasOwnProperty(creatorField.toUpperCase())) {
|
|
425
|
+
creatorField = creatorField.toUpperCase();
|
|
426
|
+
}
|
|
422
427
|
//get the user information
|
|
423
428
|
let url = `${this.esriConfig.portalUrl}/sharing/rest/community/users/${feature.attributes[creatorField]}?f=json&returnUserLicensedItems=true`;
|
|
429
|
+
const userToken = this.mapView.map.portalItem.portal?.credential?.token;
|
|
424
430
|
if (userToken) {
|
|
425
431
|
url += `&token=${userToken}`;
|
|
426
432
|
}
|