Skip to content

Commit

Permalink
Merge pull request #1099 from Esri/onboarding-message
Browse files Browse the repository at this point in the history
add initialNotice prop
  • Loading branch information
jmhauck authored Jan 15, 2025
2 parents a7d377d + d1930b9 commit 65b1ebc
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1641,6 +1641,10 @@ export namespace Components {
* boolean: When enabled features will be highlighted when their notification list item is clicked.
*/
"featureHighlightEnabled": boolean;
/**
* string: The value to show in the initial notice to help with on boarding the user. When left empty the selectLayerAndAdd text from the nls will be used.
*/
"initialNotice": string;
/**
* string: The current user locale.
*/
Expand Down Expand Up @@ -4480,6 +4484,10 @@ declare namespace LocalJSX {
* boolean: When enabled features will be highlighted when their notification list item is clicked.
*/
"featureHighlightEnabled"?: boolean;
/**
* string: The value to show in the initial notice to help with on boarding the user. When left empty the selectLayerAndAdd text from the nls will be used.
*/
"initialNotice"?: string;
/**
* string: The current user locale.
*/
Expand Down
10 changes: 9 additions & 1 deletion src/components/public-notification/public-notification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@ export class PublicNotification {
*/
@Prop() noResultText: string;

/**
* string: The value to show in the initial notice to help with on boarding the user.
* When left empty the selectLayerAndAdd text from the nls will be used.
*/
@Prop() initialNotice = "";

/**
* ISearchConfiguration: Configuration details for the Search widget
*/
Expand Down Expand Up @@ -778,10 +784,12 @@ export class PublicNotification {
*/
protected _getListPage(): VNode {
const hasSets = this._hasSelections();
const noticeMessage = hasSets ? this._translations.listHasSetsTip :
this.initialNotice !== "" ? this.initialNotice : this._translations.selectLayerAndAdd;
return (
<calcite-panel>
{this._getLabel(this._translations.myLists)}
{this._getNotice(hasSets ? this._translations.listHasSetsTip : this._translations.selectLayerAndAdd, "padding-sides-1 padding-bottom-1", "word-wrap-anywhere")}
{this._getNotice(noticeMessage, "padding-sides-1 padding-bottom-1", "word-wrap-anywhere")}
{hasSets ? this._getSelectionSetList() : (this._getOnboardingImage())}
<div class="display-flex padding-1">
<calcite-button onClick={() => { this._setPageType(EPageType.SELECT) }} width="full"><span class="font-weight-500">{this._translations.add}</span></calcite-button>
Expand Down
1 change: 1 addition & 0 deletions src/components/public-notification/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
| `enableSketchTools` | `enable-sketch-tools` | boolean: When true sketch tools will be provided to allow users to draw a selection geometry | `boolean` | `true` |
| `featureEffect` | -- | The effect that will be applied when featureHighlightEnabled is true esri/layers/support/FeatureEffect: https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureEffect.html | `FeatureEffect` | `undefined` |
| `featureHighlightEnabled` | `feature-highlight-enabled` | boolean: When enabled features will be highlighted when their notification list item is clicked. | `boolean` | `undefined` |
| `initialNotice` | `initial-notice` | string: The value to show in the initial notice to help with on boarding the user. When left empty the selectLayerAndAdd text from the nls will be used. | `string` | `""` |
| `locale` | `locale` | string: The current user locale. | `string` | `undefined` |
| `mapView` | -- | esri/views/MapView: https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html | `MapView` | `undefined` |
| `noResultText` | `no-result-text` | string: The value to show for no results when left empty the default text "0 selected features from {layerTitle}" will be shown | `string` | `undefined` |
Expand Down

0 comments on commit 65b1ebc

Please sign in to comment.