Skip to content

Commit

Permalink
Merge pull request #416 from Esri/r-01
Browse files Browse the repository at this point in the history
R 01
  • Loading branch information
jmhauck authored Nov 9, 2023
2 parents f509147 + 8d7dcb3 commit de1ecf1
Show file tree
Hide file tree
Showing 14 changed files with 447 additions and 37 deletions.
113 changes: 113 additions & 0 deletions src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,22 @@ export namespace Components {
* boolean: when true the grid will display like the previous manager app with the table across the top
*/
"classicGrid": boolean;
/**
* string: Global ID of the feature to select
*/
"defaultGlobalId": string;
/**
* string: when provided this layer ID will be used when the app loads
*/
"defaultLayer": string;
/**
* string: Object ID of feature to select
*/
"defaultOid": string;
/**
* string: Item ID of the web map that should be selected by default
*/
"defaultWebmap": string;
/**
* boolean: when true the layer table will auto refresh the data
*/
Expand Down Expand Up @@ -157,6 +173,26 @@ export namespace Components {
"zoomAndScrollToSelected": boolean;
}
interface CrowdsourceReporter {
/**
* string: The text that will display under the title on the landing page
*/
"description": string;
/**
* string: landing page image
*/
"image": string;
/**
* string[]: list of layer ids
*/
"layers": string[];
/**
* string: The text that will display at the top of the landing page
*/
"loginTitle": string;
/**
* esri/views/MapView: https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html
*/
"mapView": __esri.MapView;
}
interface DeductCalculator {
}
Expand Down Expand Up @@ -254,6 +290,18 @@ export namespace Components {
"value": any;
}
interface LayerTable {
/**
* string: Global ID of the feature to select
*/
"defaultGlobalId": string[];
/**
* string: when provided this layer ID will be used when the app loads
*/
"defaultLayerId": string;
/**
* number: when provided this will be used to select a feature in the table by default
*/
"defaultOid": number[];
/**
* boolean: when true the layer table will auto refresh the data
*/
Expand Down Expand Up @@ -300,6 +348,10 @@ export namespace Components {
* IBasemapConfig: List of any basemaps to filter out from the basemap widget
*/
"basemapConfig": IBasemapConfig;
/**
* string: Item ID of the web map that should be selected by default when the app loads
*/
"defaultWebmapId": string;
/**
* boolean: when true the basemap widget will be available
*/
Expand Down Expand Up @@ -408,6 +460,10 @@ export namespace Components {
* "transparent" | "solid": controls the button appearance when using the "dropdown" type
*/
"appearance": "transparent" | "solid";
/**
* string: when provided this layer ID will be used when the app loads
*/
"defaultLayerId": string;
/**
* string[]: Optional list of enabled layer ids If empty all layers will be available
*/
Expand Down Expand Up @@ -460,6 +516,7 @@ export namespace Components {
* IMapInfo[]: array of map infos (name and id)
*/
"mapInfos": IMapInfo[];
"setMapByID": (id: string) => Promise<void>;
}
interface MapSearch {
/**
Expand Down Expand Up @@ -1582,6 +1639,22 @@ declare namespace LocalJSX {
* boolean: when true the grid will display like the previous manager app with the table across the top
*/
"classicGrid"?: boolean;
/**
* string: Global ID of the feature to select
*/
"defaultGlobalId"?: string;
/**
* string: when provided this layer ID will be used when the app loads
*/
"defaultLayer"?: string;
/**
* string: Object ID of feature to select
*/
"defaultOid"?: string;
/**
* string: Item ID of the web map that should be selected by default
*/
"defaultWebmap"?: string;
/**
* boolean: when true the layer table will auto refresh the data
*/
Expand Down Expand Up @@ -1652,6 +1725,26 @@ declare namespace LocalJSX {
"zoomAndScrollToSelected"?: boolean;
}
interface CrowdsourceReporter {
/**
* string: The text that will display under the title on the landing page
*/
"description"?: string;
/**
* string: landing page image
*/
"image"?: string;
/**
* string[]: list of layer ids
*/
"layers"?: string[];
/**
* string: The text that will display at the top of the landing page
*/
"loginTitle"?: string;
/**
* esri/views/MapView: https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html
*/
"mapView"?: __esri.MapView;
}
interface DeductCalculator {
/**
Expand Down Expand Up @@ -1740,6 +1833,18 @@ declare namespace LocalJSX {
"value"?: any;
}
interface LayerTable {
/**
* string: Global ID of the feature to select
*/
"defaultGlobalId"?: string[];
/**
* string: when provided this layer ID will be used when the app loads
*/
"defaultLayerId"?: string;
/**
* number: when provided this will be used to select a feature in the table by default
*/
"defaultOid"?: number[];
/**
* boolean: when true the layer table will auto refresh the data
*/
Expand Down Expand Up @@ -1798,6 +1903,10 @@ declare namespace LocalJSX {
* IBasemapConfig: List of any basemaps to filter out from the basemap widget
*/
"basemapConfig"?: IBasemapConfig;
/**
* string: Item ID of the web map that should be selected by default when the app loads
*/
"defaultWebmapId"?: string;
/**
* boolean: when true the basemap widget will be available
*/
Expand Down Expand Up @@ -1920,6 +2029,10 @@ declare namespace LocalJSX {
* "transparent" | "solid": controls the button appearance when using the "dropdown" type
*/
"appearance"?: "transparent" | "solid";
/**
* string: when provided this layer ID will be used when the app loads
*/
"defaultLayerId"?: string;
/**
* string[]: Optional list of enabled layer ids If empty all layers will be available
*/
Expand Down
53 changes: 53 additions & 0 deletions src/components/crowdsource-manager/crowdsource-manager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,26 @@ export class CrowdsourceManager {
*/
@Prop() classicGrid = false;

/**
* string: Global ID of the feature to select
*/
@Prop() defaultGlobalId = "";

/**
* string: when provided this layer ID will be used when the app loads
*/
@Prop() defaultLayer = "";

/**
* string: Object ID of feature to select
*/
@Prop() defaultOid = "";

/**
* string: Item ID of the web map that should be selected by default
*/
@Prop() defaultWebmap = "";

/**
* boolean: when true the layer table will auto refresh the data
*/
Expand Down Expand Up @@ -171,6 +191,16 @@ export class CrowdsourceManager {
//
//--------------------------------------------------------------------------

/**
* string[]: List of global ids that should be selected by default
*/
protected _defaultGlobalId: string[];

/**
* number[]: List of ids that should be selected by default
*/
protected _defaultOid: number[];

/**
* IMapChange: The current map change details
*/
Expand All @@ -193,6 +223,24 @@ export class CrowdsourceManager {
//
//--------------------------------------------------------------------------

/**
* Watch for globalid url param to be set
*/
@Watch("defaultGlobalId")
defaultGlobalIdWatchHandler(): void {
this._defaultGlobalId = !this.defaultGlobalId ? undefined :
this.defaultGlobalId.indexOf(",") > -1 ? this.defaultGlobalId.split(",") : [this.defaultGlobalId];
}

/**
* Watch for oid url param to be set
*/
@Watch("defaultOid")
defaultOidWatchHandler(): void {
this._defaultOid = !this.defaultOid ? undefined :
this.defaultOid.indexOf(",") > -1 ? this.defaultOid.split(",").map(o => parseInt(o, 10)) : [parseInt(this.defaultOid, 10)];
}

/**
* When true the map zoom tools will be available
*/
Expand Down Expand Up @@ -473,6 +521,7 @@ export class CrowdsourceManager {
<map-card
basemapConfig={this.basemapConfig}
class="width-full"
defaultWebmapId={this.defaultWebmap}
enableBasemap={this.enableBasemap}
enableFloorFilter={this.enableFloorFilter}
enableFullscreen={this.enableFullscreen}
Expand Down Expand Up @@ -584,6 +633,7 @@ export class CrowdsourceManager {
const toggleSlot = this.classicGrid && layoutMode !== ELayoutMode.VERTICAL ? "footer" :
this.classicGrid && layoutMode === ELayoutMode.VERTICAL ? "panel-end" :
layoutMode === ELayoutMode.HORIZONTAL ? "header" : "panel-start";
const hasMapAndLayer = this.defaultWebmap && this.defaultLayer;
return (
<calcite-shell class={tableSizeClass + " border-bottom"}>
<calcite-action-bar
Expand All @@ -609,6 +659,9 @@ export class CrowdsourceManager {
</calcite-action-bar>
<div class="width-full height-full position-relative">
<layer-table
defaultGlobalId={hasMapAndLayer ? this._defaultGlobalId : undefined}
defaultLayerId={hasMapAndLayer ? this.defaultLayer : ""}
defaultOid={hasMapAndLayer && !this.defaultGlobalId ? this._defaultOid : undefined}
enableAutoRefresh={this.enableAutoRefresh}
enableCSV={this.enableCSV}
enableInlineEdit={this.enableInlineEdit}
Expand Down
4 changes: 4 additions & 0 deletions src/components/crowdsource-manager/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
| ------------------------- | ----------------------------- | ------------------------------------------------------------------------------------------------------------------ | ---------------------- | ----------- |
| `basemapConfig` | -- | IBasemapConfig: List of any basemaps to filter out from the basemap widget | `IBasemapConfig` | `undefined` |
| `classicGrid` | `classic-grid` | boolean: when true the grid will display like the previous manager app with the table across the top | `boolean` | `false` |
| `defaultGlobalId` | `default-global-id` | string: Global ID of the feature to select | `string` | `""` |
| `defaultLayer` | `default-layer` | string: when provided this layer ID will be used when the app loads | `string` | `""` |
| `defaultOid` | `default-oid` | string: Object ID of feature to select | `string` | `""` |
| `defaultWebmap` | `default-webmap` | string: Item ID of the web map that should be selected by default | `string` | `""` |
| `enableAutoRefresh` | `enable-auto-refresh` | boolean: when true the layer table will auto refresh the data | `boolean` | `false` |
| `enableBasemap` | `enable-basemap` | boolean: when true the basemap widget will be available | `boolean` | `true` |
| `enableCSV` | `enable-c-s-v` | boolean: when true the export to csv button will be available | `boolean` | `true` |
Expand Down
65 changes: 63 additions & 2 deletions src/components/crowdsource-reporter/crowdsource-reporter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import { Component, Element, Host, h } from "@stencil/core";
import { Component, Element, Host, h, Prop } from "@stencil/core";

@Component({
tag: "crowdsource-reporter",
Expand All @@ -35,6 +35,33 @@ export class CrowdsourceReporter {
//
//--------------------------------------------------------------------------

/**
* string: The text that will display under the title on the landing page
*/
@Prop() description: string;

/**
* string: The text that will display at the top of the landing page
*/
@Prop() loginTitle: string;

/**
* esri/views/MapView: https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html
*/
@Prop() mapView: __esri.MapView;

/**
* string: landing page image
*/
@Prop() image: string;

/**
* string[]: list of layer ids
*/
@Prop() layers: string[];

// TODO think about how we will handle related table comment field

//--------------------------------------------------------------------------
//
// State (internal)
Expand Down Expand Up @@ -71,10 +98,25 @@ export class CrowdsourceReporter {
//
//--------------------------------------------------------------------------

/**
* StencilJS: Called once just after the component is first connected to the DOM.
*
* @returns Promise when complete
*/
// async componentWillLoad(): Promise<void> {
// await this._getTranslations();
// await this._initModules();
// }

/**
* Renders the component.
*/
render() {
return (
<Host>
<slot />
<slot>
{this.loginTitle + this.description}
</slot>
</Host>
);
}
Expand All @@ -85,6 +127,25 @@ export class CrowdsourceReporter {
//
//--------------------------------------------------------------------------

/**
* Load esri javascript api modules
*
* @returns Promise resolving when function is done
*
* @protected
*/
// protected async _initModules(): Promise<void> {
// const [geometryEngine, jsonUtils]: [
// __esri.geometryEngine,
// __esri.symbolsSupportJsonUtils
// ] = await loadModules([
// "esri/geometry/geometryEngine",
// "esri/symbols/support/jsonUtils"
// ]);
// this._geometryEngine = geometryEngine;
// this._jsonUtils = jsonUtils;
// }

/**
* Fetches the component's translations
*
Expand Down
Loading

0 comments on commit de1ecf1

Please sign in to comment.