Skip to content

Commit

Permalink
removed unused event emitter and update function name
Browse files Browse the repository at this point in the history
  • Loading branch information
jmhauck committed Nov 2, 2023
1 parent 2b61281 commit e450413
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 35 deletions.
19 changes: 0 additions & 19 deletions src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -966,10 +966,6 @@ export interface BufferToolsCustomEvent<T> extends CustomEvent<T> {
detail: T;
target: HTMLBufferToolsElement;
}
export interface CrowdsourceManagerCustomEvent<T> extends CustomEvent<T> {
detail: T;
target: HTMLCrowdsourceManagerElement;
}
export interface DeductCalculatorCustomEvent<T> extends CustomEvent<T> {
detail: T;
target: HTMLDeductCalculatorElement;
Expand Down Expand Up @@ -1074,18 +1070,7 @@ declare global {
prototype: HTMLCardManagerElement;
new (): HTMLCardManagerElement;
};
interface HTMLCrowdsourceManagerElementEventMap {
"urlParamsSet": any;
}
interface HTMLCrowdsourceManagerElement extends Components.CrowdsourceManager, HTMLStencilElement {
addEventListener<K extends keyof HTMLCrowdsourceManagerElementEventMap>(type: K, listener: (this: HTMLCrowdsourceManagerElement, ev: CrowdsourceManagerCustomEvent<HTMLCrowdsourceManagerElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeEventListener<K extends keyof HTMLCrowdsourceManagerElementEventMap>(type: K, listener: (this: HTMLCrowdsourceManagerElement, ev: CrowdsourceManagerCustomEvent<HTMLCrowdsourceManagerElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
}
var HTMLCrowdsourceManagerElement: {
prototype: HTMLCrowdsourceManagerElement;
Expand Down Expand Up @@ -1698,10 +1683,6 @@ declare namespace LocalJSX {
* IMapInfo[]: array of map infos (name and id)
*/
"mapInfos"?: IMapInfo[];
/**
* Emitted if any valid url params are provided
*/
"onUrlParamsSet"?: (event: CrowdsourceManagerCustomEvent<any>) => void;
/**
* boolean: When true only editable layers that support the update capability will be available
*/
Expand Down
7 changes: 1 addition & 6 deletions src/components/crowdsource-manager/crowdsource-manager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import { Component, Element, Event, EventEmitter, Host, h, Listen, Prop, State, VNode, Watch } from "@stencil/core";
import { Component, Element, Host, h, Listen, Prop, State, VNode, Watch } from "@stencil/core";
import CrowdsourceManager_T9n from "../../assets/t9n/crowdsource-manager/resources.json";
import { getLocaleComponentStrings } from "../../utils/locale";
import { ELayoutMode, IBasemapConfig, IMapChange, IMapInfo, ISearchConfiguration, theme } from "../../utils/interfaces";
Expand Down Expand Up @@ -233,11 +233,6 @@ export class CrowdsourceManager {
//
//--------------------------------------------------------------------------

/**
* Emitted if any valid url params are provided
*/
@Event() urlParamsSet: EventEmitter<any>;

/**
* Listen for layoutChanged event to be fired so we can adjust the layout
*/
Expand Down
7 changes: 0 additions & 7 deletions src/components/crowdsource-manager/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,6 @@
| `zoomAndScrollToSelected` | `zoom-and-scroll-to-selected` | boolean: When true the selected feature will zoomed to in the map and the row will be scrolled to within the table | `boolean` | `false` |


## Events

| Event | Description | Type |
| -------------- | -------------------------------------------- | ------------------ |
| `urlParamsSet` | Emitted if any valid url params are provided | `CustomEvent<any>` |


## Dependencies

### Depends on
Expand Down
4 changes: 2 additions & 2 deletions src/components/layer-table/layer-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import LayerTable_T9n from "../../assets/t9n/layer-table/resources.json";
import { loadModules } from "../../utils/loadModules";
import { getLocaleComponentStrings } from "../../utils/locale";
import { getLayerOrTable, goToSelection } from "../../utils/mapViewUtils";
import { queryAllIds, queryFeaturesByGlobalIDs } from "../../utils/queryUtils";
import { queryAllIds, queryFeaturesByGlobalID } from "../../utils/queryUtils";
import * as downloadUtils from "../../utils/downloadUtils";
import { IExportInfos, ILayerInfo, IMapClick, IMapInfo, IToolInfo, IToolSizeInfo } from "../../utils/interfaces";

Expand Down Expand Up @@ -1124,7 +1124,7 @@ export class LayerTable {
}

if (!this._defaultGlobalIdHonored && this.defaultGlobalId) {
const features = await queryFeaturesByGlobalIDs(this.defaultGlobalId, this._layer);
const features = await queryFeaturesByGlobalID(this.defaultGlobalId, this._layer);
const oid = features?.length > 0 ? features[0].getObjectId() : -1;
this._selectDefaultFeature(oid);
this._defaultGlobalIdHonored = true;
Expand Down
2 changes: 1 addition & 1 deletion src/utils/queryUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ export async function queryFeaturesByID(
*
* @returns Promise with the featureSet from the layer that match the provided globalId
*/
export async function queryFeaturesByGlobalIDs(
export async function queryFeaturesByGlobalID(
globalId: string,
layer: __esri.FeatureLayer
): Promise<__esri.Graphic[]> {
Expand Down

0 comments on commit e450413

Please sign in to comment.