Nudge
Overview
Important
|
Please be aware that Nudge is available only for Private Red Apps |
In-line encouragement also known as Nudge is a SR360 widget acting as an extension to the current "decision support bar".
The Nudge widget is only available in the following response drawers:
-
Air Shopping
-
Flights Shopping
-
Air Availability
-
Sell
-
Pricing
-
Hotel
-
Car
Workflow
This simplified chart illustrates how Nudge is used in SR360 and how it is decided whether the widget should be displayed in a response drawer or not based on the data that is present in the response drawer.
Contributing
Red Apps can contribute a Nudge widget via ExtensionPointService
. Here is a list of all required imports for this step:
import {ExtensionPointService} from 'sabre-ngv-xp/services/ExtensionPointService';
import {NudgeConfig} from 'sabre-ngv-xp/configs/NudgeConfig';
Red Apps can contribute under nudge
key as follows:
getService(ExtensionPointService).addConfig('nudge', new NudgeConfig(
icon,
text,
actions,
filter
));
Config Properties
The following properties can be defined for config:
Property | Description |
---|---|
icon |
An icon for this widget, it can be |
text |
Text to be displayed in the widget. |
actions |
An array of |
filter |
A filter function to determine where this widget should be displayed, based on data availiable in the currently displayed response drawer. An array of |
Entry Properties
NgvNudgeEntry
represents one segment displayed in the response drawer. The following properties are defined for Nudge entry:
Property | Description |
---|---|
location |
Indicates which of the response drawers that supports Nudge contributions is currently displayed. Possible values: |
origin (optional) |
Defines starting point in encoded domain. Domain will depend on the response drawer. |
destination |
Defines end point in encoded domain. Domain will depend on the response drawer. |
start |
Defines start date in |
end |
Defines end date in |
Button Properties
INudgeAction
represents a button that can be displayed in the Nudge widget. The following properties can be defined for button:
Property | Description |
---|---|
id |
Id of this action. It will be used as |
label |
Label for a button tied to this action. |
action |
Function to be called when the button is pressed. An array of |
TypeScript API
Detailed information about the NudgeConfig
, NgvNudgeEntry
and INudgeAction
is available in TypeScript API Documentation of sabre-ngv-xp
module.
Example
com.sabre.redapp.example3.web.nudge SDK sample project contains examples on how to use the Nudge widget.