This component is a modal window that returns search results when a user wants to initiate a contact. As the name indicates, it is the last try to get a match before a ticket is created.
It appears in the form of a modal. This component automatically creates a new store for itself.
This is how you create this component:
sdk.component('last-chance', target: HTMLElement|String, options: Object);
By default, this component looks like this:
The following options can be set in this component:
||Filters to be sent in every request, along with the selected facet refinements. The format in explained in the
||The API parameters to send in every request. For the format to use, see the
Note: API parameters
You can use the component option
searchParams to modify the API search queries. Nonetheless, some of the API attributes can be also handled by other linked components. This means that even if you set some
searchParams, they may not applied if you are using certain components.
These are the components that may affect this option:
|Component||Affected API attributes|
|Results per page||
|Sort by selector||
The following methods can be used in this component:
||Shows the last chance modal, and it can do a new search in case the user provides the query string parameter|
||Hides the last chance modal|
||Adds selected element to the elements list where the component is going to get the query from. It only accepts HTML input, select and textarea elements|
||Stop listening to the element's input events to trigger queries.|
||Stop listening to the all input events to trigger queries.|
This component calls the API to do the following:
/federated-searchesrequest with the
typeparameter set to contact to get the result of the question and track the search as a contact_search event.
contact_ticketevent in the API when the user creates the issue.
|submit||Fired when the user clicks the submit button|
|cancel||Fired when the user clicks the cancel button|
This component uses the following labels:
||The heading text|
||The text for the cancel button|
||The text for the submit button|