Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

R 01 #416

Merged
merged 14 commits into from
Nov 9, 2023
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[];
/**
* esri/views/MapView: https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html
*/
"mapView": __esri.MapView;
/**
* string: The text that will display at the top of the landing page
*/
"title": string;
}
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[];
/**
* esri/views/MapView: https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html
*/
"mapView"?: __esri.MapView;
/**
* string: The text that will display at the top of the landing page
*/
"title"?: string;
}
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
25 changes: 25 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 @@ -473,6 +493,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 +605,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 +631,9 @@ export class CrowdsourceManager {
</calcite-action-bar>
<div class="width-full height-full position-relative">
<layer-table
defaultGlobalId={hasMapAndLayer ? this.defaultGlobalId : ""}
defaultLayerId={hasMapAndLayer ? this.defaultLayer : ""}
defaultOid={hasMapAndLayer && !this.defaultGlobalId ? parseInt(this.defaultOid, 10) : 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() title: 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> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these placeholders needed for the future?

// await this._getTranslations();
// await this._initModules();
// }

/**
* Renders the component.
*/
render() {
return (
<Host>
<slot />
<slot>
{this.title + 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
11 changes: 11 additions & 0 deletions src/components/crowdsource-reporter/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@
<!-- Auto Generated Below -->


## Properties

| Property | Attribute | Description | Type | Default |
| ------------- | ------------- | --------------------------------------------------------------------------------------------------------- | ---------- | ----------- |
| `description` | `description` | string: The text that will display under the title on the landing page | `string` | `undefined` |
| `image` | `image` | string: landing page image | `string` | `undefined` |
| `layers` | -- | string[]: list of layer ids | `string[]` | `undefined` |
| `mapView` | -- | esri/views/MapView: https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html | `MapView` | `undefined` |
| `title` | `title` | string: The text that will display at the top of the landing page | `string` | `undefined` |


----------------------------------------------

*Built with [StencilJS](https://stenciljs.com/)*
Loading
Loading