Skip to content

Commit

Permalink
add features flow item and props
Browse files Browse the repository at this point in the history
  • Loading branch information
jmhauck committed Nov 9, 2023
1 parent 743372f commit b98b88a
Show file tree
Hide file tree
Showing 7 changed files with 242 additions and 5 deletions.
13 changes: 13 additions & 0 deletions src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@ export namespace Components {
}
interface FeatureFormFlowItem {
}
interface FeaturesFlowItem {
}
interface FloorFilter {
/**
* boolean: when true the Floor Filter widget will be available
Expand Down Expand Up @@ -1167,6 +1169,12 @@ declare global {
prototype: HTMLFeatureFormFlowItemElement;
new (): HTMLFeatureFormFlowItemElement;
};
interface HTMLFeaturesFlowItemElement extends Components.FeaturesFlowItem, HTMLStencilElement {
}
var HTMLFeaturesFlowItemElement: {
prototype: HTMLFeaturesFlowItemElement;
new (): HTMLFeaturesFlowItemElement;
};
interface HTMLFloorFilterElement extends Components.FloorFilter, HTMLStencilElement {
}
var HTMLFloorFilterElement: {
Expand Down Expand Up @@ -1571,6 +1579,7 @@ declare global {
"edit-card": HTMLEditCardElement;
"feature-comments": HTMLFeatureCommentsElement;
"feature-form-flow-item": HTMLFeatureFormFlowItemElement;
"features-flow-item": HTMLFeaturesFlowItemElement;
"floor-filter": HTMLFloorFilterElement;
"info-card": HTMLInfoCardElement;
"json-editor": HTMLJsonEditorElement;
Expand Down Expand Up @@ -1838,6 +1847,8 @@ declare namespace LocalJSX {
}
interface FeatureFormFlowItem {
}
interface FeaturesFlowItem {
}
interface FloorFilter {
/**
* boolean: when true the Floor Filter widget will be available
Expand Down Expand Up @@ -2611,6 +2622,7 @@ declare namespace LocalJSX {
"edit-card": EditCard;
"feature-comments": FeatureComments;
"feature-form-flow-item": FeatureFormFlowItem;
"features-flow-item": FeaturesFlowItem;
"floor-filter": FloorFilter;
"info-card": InfoCard;
"json-editor": JsonEditor;
Expand Down Expand Up @@ -2662,6 +2674,7 @@ declare module "@stencil/core" {
"edit-card": LocalJSX.EditCard & JSXBase.HTMLAttributes<HTMLEditCardElement>;
"feature-comments": LocalJSX.FeatureComments & JSXBase.HTMLAttributes<HTMLFeatureCommentsElement>;
"feature-form-flow-item": LocalJSX.FeatureFormFlowItem & JSXBase.HTMLAttributes<HTMLFeatureFormFlowItemElement>;
"features-flow-item": LocalJSX.FeaturesFlowItem & JSXBase.HTMLAttributes<HTMLFeaturesFlowItemElement>;
"floor-filter": LocalJSX.FloorFilter & JSXBase.HTMLAttributes<HTMLFloorFilterElement>;
"info-card": LocalJSX.InfoCard & JSXBase.HTMLAttributes<HTMLInfoCardElement>;
"json-editor": LocalJSX.JsonEditor & JSXBase.HTMLAttributes<HTMLJsonEditorElement>;
Expand Down
55 changes: 50 additions & 5 deletions src/components/crowdsource-reporter/crowdsource-reporter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/

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

@Component({
tag: "crowdsource-reporter",
Expand All @@ -27,6 +28,7 @@ export class CrowdsourceReporter {
// Host element access
//
//--------------------------------------------------------------------------

@Element() el: HTMLCrowdsourceReporterElement;

//--------------------------------------------------------------------------
Expand All @@ -40,6 +42,36 @@ export class CrowdsourceReporter {
*/
@Prop() description: string;

/**
* boolean: When true the anonymous users will be allowed to submit reports and comments
*/
@Prop() enableAnonymousAccess: boolean;

/**
* boolean: When true the anonymous users will be allowed to submit comments
*/
@Prop() enableAnonymousComments: boolean;

/**
* boolean: When true the user will be allowed to submit comments
*/
@Prop() enableComments: boolean;

/**
* boolean: When true the user will be provided a login page
*/
@Prop() enableLogin: boolean;

/**
* boolean: When true the user will be allowed to submit new reports
*/
@Prop() enableNewReports: boolean;

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

/**
* string: The text that will display at the top of the landing page
*/
Expand All @@ -51,16 +83,29 @@ export class CrowdsourceReporter {
@Prop() mapView: __esri.MapView;

/**
* string: landing page image
* string: The word(s) to display in the reports submit button
*/
@Prop() image: string;
@Prop() reportButtonText: string;

/**
* string[]: list of layer ids
* string: The word(s) to display in the reports header
*/
@Prop() layers: string[];
@Prop() reportsHeader: string;

// TODO think about how we will handle related table comment field
/**
* string: The message to display when the report has been submitted
*/
@Prop() reportSubmittedMessage: string;

/**
* ISearchConfiguration: Configuration details for the Search widget
*/
@Prop() searchConfiguration: ISearchConfiguration;

/**
* boolean: When true the comments from all users will be visible
*/
@Prop() showComments: boolean;

//--------------------------------------------------------------------------
//
Expand Down
19 changes: 19 additions & 0 deletions src/components/features-flow-item/features-flow-item.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/** @license
* Copyright 2022 Esri
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

:host {
display: block;
}
89 changes: 89 additions & 0 deletions src/components/features-flow-item/features-flow-item.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
/** @license
* Copyright 2022 Esri
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

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

@Component({
tag: 'features-flow-item',
styleUrl: 'features-flow-item.css',
shadow: true,
})
export class FeaturesFlowItem {
//--------------------------------------------------------------------------
//
// Host element access
//
//--------------------------------------------------------------------------

@Element() el: HTMLLocationFlowItemElement;

//--------------------------------------------------------------------------
//
// Properties (public)
//
//--------------------------------------------------------------------------

//--------------------------------------------------------------------------
//
// State (internal)
//
//--------------------------------------------------------------------------

//--------------------------------------------------------------------------
//
// Properties (protected)
//
//--------------------------------------------------------------------------

//--------------------------------------------------------------------------
//
// Watch handlers
//
//--------------------------------------------------------------------------

//--------------------------------------------------------------------------
//
// Methods (public)
//
//--------------------------------------------------------------------------

//--------------------------------------------------------------------------
//
// Events (public)
//
//--------------------------------------------------------------------------

//--------------------------------------------------------------------------
//
// Functions (lifecycle)
//
//--------------------------------------------------------------------------

render() {
return (
<Host>
<slot/>
</Host>
);
}

//--------------------------------------------------------------------------
//
// Functions (protected)
//
//--------------------------------------------------------------------------

}
10 changes: 10 additions & 0 deletions src/components/features-flow-item/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# features-flow-item



<!-- Auto Generated Below -->


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

*Built with [StencilJS](https://stenciljs.com/)*
27 changes: 27 additions & 0 deletions src/components/features-flow-item/test/features-flow-item.e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/** @license
* Copyright 2022 Esri
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { newE2EPage } from '@stencil/core/testing';

xdescribe('features-flow-item', () => {
it('renders', async () => {
const page = await newE2EPage();
await page.setContent('<features-flow-item></features-flow-item>');

const element = await page.find('features-flow-item');
expect(element).toHaveClass('hydrated');
});
});
34 changes: 34 additions & 0 deletions src/components/features-flow-item/test/features-flow-item.spec.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/** @license
* Copyright 2022 Esri
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { newSpecPage } from '@stencil/core/testing';
import { FeaturesFlowItem } from '../features-flow-item';

xdescribe('features-flow-item', () => {
it('renders', async () => {
const page = await newSpecPage({
components: [FeaturesFlowItem],
html: `<features-flow-item></features-flow-item>`,
});
expect(page.root).toEqualHtml(`
<features-flow-item>
<mock:shadow-root>
<slot></slot>
</mock:shadow-root>
</features-flow-item>
`);
});
});

0 comments on commit b98b88a

Please sign in to comment.