From 379d7132e93b527baa2176ae15970fabd841cbb1 Mon Sep 17 00:00:00 2001 From: Pratik Sabale Date: Thu, 17 Oct 2024 17:41:24 +0530 Subject: [PATCH 1/5] Fixed #547 - #547 --- src/components/create-feature/create-feature.css | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/create-feature/create-feature.css b/src/components/create-feature/create-feature.css index fe45be925..2dabe62aa 100644 --- a/src/components/create-feature/create-feature.css +++ b/src/components/create-feature/create-feature.css @@ -60,8 +60,9 @@ .show-map { padding: 10px !important; - position: absolute; + position: absolute !important; bottom: 0; + height: auto !important; width: calc(100% - 22px); } From a35ca6b03b75fe5c373321221b35951f1fc724e3 Mon Sep 17 00:00:00 2001 From: Pratik Sabale Date: Thu, 17 Oct 2024 17:44:12 +0530 Subject: [PATCH 2/5] Fixed #947 - #947 --- .../crowdsource-reporter.tsx | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/components/crowdsource-reporter/crowdsource-reporter.tsx b/src/components/crowdsource-reporter/crowdsource-reporter.tsx index 8d30e8631..2d6109769 100644 --- a/src/components/crowdsource-reporter/crowdsource-reporter.tsx +++ b/src/components/crowdsource-reporter/crowdsource-reporter.tsx @@ -818,6 +818,7 @@ export class CrowdsourceReporter { if (canRestoreFilter) { void this._filterList.restoreFilters(this._filterUrlParams[0], this._filterInitState); } + this._filterInitState = null; }, 200); } @@ -848,7 +849,6 @@ export class CrowdsourceReporter { //set the filter active state based on the length of applied filters this._filterActive = this._filterList.urlParams.getAll('filter').length > 0; this._filterUrlParams = this._filterList.urlParams.getAll('filter'); - this._filterInitState = await this._filterList.getFilterInitState(); await this._featureList.refresh(); if (this._layerList) { await this._layerList.refresh(); @@ -1228,6 +1228,16 @@ export class CrowdsourceReporter { void this._handleFilterListReset(); } + /** + * On back from filter panel get the filter's init state + * @protected + */ + protected async backFromFilterPanel(): Promise { + this._filterInitState = await this._filterList.getFilterInitState(); + await this._featureList.refresh(); + this.backFromSelectedPanel(); + } + /** * On back from selected panel navigate to the previous panel * @protected @@ -1415,7 +1425,7 @@ export class CrowdsourceReporter { collapsed={this.isMobile && this._sidePanelCollapsed} heading={this._translations?.filterLayerTitle?.replace("{{title}}", this._selectedLayerName)} loading={this._showLoadingIndicator} - onCalciteFlowItemBack={this.backFromSelectedPanel.bind(this)}> + onCalciteFlowItemBack={this.backFromFilterPanel.bind(this)}> {this.isMobile && this.getActionToExpandCollapsePanel()}
@@ -1432,7 +1442,7 @@ export class CrowdsourceReporter { {this._translations.close} From 256ce9dac2e387b94f22a65606c0130b8d1ee799 Mon Sep 17 00:00:00 2001 From: Pratik Sabale Date: Thu, 17 Oct 2024 17:47:02 +0530 Subject: [PATCH 3/5] Fixed #948 - #948 --- .../crowdsource-reporter/crowdsource-reporter.tsx | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/components/crowdsource-reporter/crowdsource-reporter.tsx b/src/components/crowdsource-reporter/crowdsource-reporter.tsx index 2d6109769..6f53f49c4 100644 --- a/src/components/crowdsource-reporter/crowdsource-reporter.tsx +++ b/src/components/crowdsource-reporter/crowdsource-reporter.tsx @@ -512,7 +512,8 @@ export class CrowdsourceReporter { } } } - if (this._layerList) { + // refresh layer list when user is on layer list panel + if (this._flowItems[this._flowItems.length - 1] === "layer-list" && this._layerList) { await this._layerList.refresh(); } if (this._featureList) { @@ -531,7 +532,8 @@ export class CrowdsourceReporter { if (this._editableLayerIds) { await this._updateFeatures(); setTimeout(() => { - if (this._layerList) { + // refresh layer list when user is on layer list panel + if (this._flowItems[this._flowItems.length - 1] === "layer-list" && this._layerList) { void this._layerList.refresh(); } if (this._featureList) { @@ -831,12 +833,6 @@ export class CrowdsourceReporter { this._filterActive = false; this._filterUrlParams = null; this._filterInitState = null; - if (this._featureList) { - await this._featureList.refresh(); - } - if (this._layerList) { - await this._layerList.refresh(); - } } /** @@ -850,9 +846,6 @@ export class CrowdsourceReporter { this._filterActive = this._filterList.urlParams.getAll('filter').length > 0; this._filterUrlParams = this._filterList.urlParams.getAll('filter'); await this._featureList.refresh(); - if (this._layerList) { - await this._layerList.refresh(); - } this._showLoadingIndicator = false; } From e947d1aad271671e6a8934f42f8d27059f0c1971 Mon Sep 17 00:00:00 2001 From: Pratik Sabale Date: Thu, 17 Oct 2024 17:49:22 +0530 Subject: [PATCH 4/5] Fixed multiple symbols in feature list Sometimes the symbol node was getting created multiple times so to avoid multiple symbol nodes instead of appendChild do replaceChildren --- src/components/feature-list/feature-list.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/feature-list/feature-list.tsx b/src/components/feature-list/feature-list.tsx index 69ecfac4c..1688e8512 100644 --- a/src/components/feature-list/feature-list.tsx +++ b/src/components/feature-list/feature-list.tsx @@ -607,7 +607,7 @@ export class FeatureList { {this.showFeatureSymbol &&
el && el.appendChild(featureSymbol)} + ref={(el) => el && el.replaceChildren(featureSymbol)} slot="content-start" />}
Date: Thu, 17 Oct 2024 17:50:54 +0530 Subject: [PATCH 5/5] Fixed internal issues Fixed other internal issues --- .../create-feature/create-feature.tsx | 4 +++- .../crowdsource-reporter.tsx | 18 +++++++++--------- .../feature-details/feature-details.tsx | 12 +++++++----- src/components/layer-list/layer-list.tsx | 4 ++-- 4 files changed, 21 insertions(+), 17 deletions(-) diff --git a/src/components/create-feature/create-feature.tsx b/src/components/create-feature/create-feature.tsx index 1d4ed27ff..9f4af9bc7 100644 --- a/src/components/create-feature/create-feature.tsx +++ b/src/components/create-feature/create-feature.tsx @@ -566,7 +566,9 @@ export class CreateFeature { if (state === 'ready') { this._mapViewContainer?.classList?.replace("show-map", "hide-map"); this._editor.viewModel.featureFormViewModel.on('submit', this.submitted.bind(this)); - void this._setFloorLevel(this.floorLevel); + setTimeout(() => { + void this._setFloorLevel(this.floorLevel); + }, 50); this._currentPage = 'featureForm'; this.progressStatus.emit(1); this.drawComplete.emit(); diff --git a/src/components/crowdsource-reporter/crowdsource-reporter.tsx b/src/components/crowdsource-reporter/crowdsource-reporter.tsx index 6f53f49c4..241f10a47 100644 --- a/src/components/crowdsource-reporter/crowdsource-reporter.tsx +++ b/src/components/crowdsource-reporter/crowdsource-reporter.tsx @@ -1061,15 +1061,15 @@ export class CrowdsourceReporter { * On submit report navigate to the layer list home page and refresh the layer list * @protected */ - protected onReportSubmitted(): void { - //on report submit form will be closed, so update the form state - if (this._showFullPanel) { - this.updatePanelState(this._sidePanelCollapsed, false); - } + protected async onReportSubmitted(): Promise { void this.updateNonVisibleLayersOnMap(false); + await this.navigateToHomePage(); this._reportSubmitted = true; this._updatedProgressBarStatus = 0.25; - void this.navigateToHomePage(); + //on report submit form will be closed, so update the form state + if (this._showFullPanel) { + this.updatePanelState(this._sidePanelCollapsed, false); + } } /** @@ -1102,11 +1102,11 @@ export class CrowdsourceReporter { * @protected */ protected async navigateToHomePage(): Promise { + // set the selected features and then refresh the layer list to maintain the layer's visibility state + await this.setSelectedFeatures([]); if (this._layerList) { - void this._layerList.refresh(); + await this._layerList.refresh(); } - await this.setSelectedFeatures([]); - if (this._editableLayerIds.length === 1) { await this._featureList.refresh(); this._flowItems = ["feature-list"]; diff --git a/src/components/feature-details/feature-details.tsx b/src/components/feature-details/feature-details.tsx index c1499fa28..1aeca72f5 100644 --- a/src/components/feature-details/feature-details.tsx +++ b/src/components/feature-details/feature-details.tsx @@ -366,11 +366,13 @@ export class FeatureDetails { * @protected */ protected async getCompleteGraphic(graphic: __esri.Graphic): Promise { - const layer = graphic.layer as __esri.FeatureLayer - const query = layer.createQuery(); - query.objectIds = [graphic.getObjectId()]; - const completeGraphic = await layer.queryFeatures(query); - this._selectedGraphic = completeGraphic.features[0]; + if (graphic) { + const layer = graphic.layer as __esri.FeatureLayer; + const query = layer.createQuery(); + query.objectIds = [graphic.getObjectId()]; + const completeGraphic = await layer.queryFeatures(query); + this._selectedGraphic = completeGraphic.features[0]; + } } /** diff --git a/src/components/layer-list/layer-list.tsx b/src/components/layer-list/layer-list.tsx index 127b4c660..b2c6df988 100644 --- a/src/components/layer-list/layer-list.tsx +++ b/src/components/layer-list/layer-list.tsx @@ -163,7 +163,6 @@ export class LayerList { */ async componentWillLoad(): Promise { await this._getTranslations(); - this._isLoading = true; } /** @@ -171,7 +170,6 @@ export class LayerList { */ async componentDidLoad() { await this.setLayers(); - this._isLoading = false; } /** @@ -213,7 +211,9 @@ export class LayerList { */ async setLayers(): Promise { if (this.mapView) { + this._isLoading = true; await this.initLayerHash(); + this._isLoading = false; } }