Skip to content

Commit

Permalink
Merge pull request #966 from Esri/CT-Manager-AGOL-2024.RO3
Browse files Browse the repository at this point in the history
Delivery for Reporter AGOL-2024.R03 - UAT
  • Loading branch information
jmhauck authored Oct 17, 2024
2 parents 8d795b4 + 50ec522 commit 9ed40e5
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 33 deletions.
3 changes: 2 additions & 1 deletion src/components/create-feature/create-feature.css
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@

.show-map {
padding: 10px !important;
position: absolute;
position: absolute !important;
bottom: 0;
height: auto !important;
width: calc(100% - 22px);
}

Expand Down
4 changes: 3 additions & 1 deletion src/components/create-feature/create-feature.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
49 changes: 26 additions & 23 deletions src/components/crowdsource-reporter/crowdsource-reporter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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) {
Expand Down Expand Up @@ -818,6 +820,7 @@ export class CrowdsourceReporter {
if (canRestoreFilter) {
void this._filterList.restoreFilters(this._filterUrlParams[0], this._filterInitState);
}
this._filterInitState = null;
}, 200);
}

Expand All @@ -830,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();
}
}

/**
Expand All @@ -848,11 +845,7 @@ 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();
}
this._showLoadingIndicator = false;
}

Expand Down Expand Up @@ -1068,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> {
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);
}
}

/**
Expand Down Expand Up @@ -1109,11 +1102,11 @@ export class CrowdsourceReporter {
* @protected
*/
protected async navigateToHomePage(): Promise<void> {
// 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"];
Expand Down Expand Up @@ -1228,6 +1221,16 @@ export class CrowdsourceReporter {
void this._handleFilterListReset();
}

/**
* On back from filter panel get the filter's init state
* @protected
*/
protected async backFromFilterPanel(): Promise<void> {
this._filterInitState = await this._filterList.getFilterInitState();
await this._featureList.refresh();
this.backFromSelectedPanel();
}

/**
* On back from selected panel navigate to the previous panel
* @protected
Expand Down Expand Up @@ -1415,7 +1418,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()}
<div class={"width-full"}
slot="footer">
Expand All @@ -1432,7 +1435,7 @@ export class CrowdsourceReporter {
<calcite-button
appearance="outline"
class={"footer-button"}
onClick={this.backFromSelectedPanel.bind(this)}
onClick={this.backFromFilterPanel.bind(this)}
width="full">
{this._translations.close}
</calcite-button>
Expand Down
12 changes: 7 additions & 5 deletions src/components/feature-details/feature-details.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -366,11 +366,13 @@ export class FeatureDetails {
* @protected
*/
protected async getCompleteGraphic(graphic: __esri.Graphic): Promise<void> {
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];
}
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/components/feature-list/feature-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ export class FeatureList {
{this.showFeatureSymbol &&
<div
class={'feature-symbol'}
ref={(el) => el && el.appendChild(featureSymbol)}
ref={(el) => el && el.replaceChildren(featureSymbol)}
slot="content-start" />}

<div
Expand Down
4 changes: 2 additions & 2 deletions src/components/layer-list/layer-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,13 @@ export class LayerList {
*/
async componentWillLoad(): Promise<void> {
await this._getTranslations();
this._isLoading = true;
}

/**
* StencilJS: Called once just after the component is fully loaded and the first render() occurs.
*/
async componentDidLoad() {
await this.setLayers();
this._isLoading = false;
}

/**
Expand Down Expand Up @@ -213,7 +211,9 @@ export class LayerList {
*/
async setLayers(): Promise<void> {
if (this.mapView) {
this._isLoading = true;
await this.initLayerHash();
this._isLoading = false;
}
}

Expand Down

0 comments on commit 9ed40e5

Please sign in to comment.