-
Notifications
You must be signed in to change notification settings - Fork 34
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
feat(quantic): Allow RGA component to provide a custom "no answer" message when no answer is shown #4919
base: master
Are you sure you want to change the base?
Conversation
Pull Request ReportPR Title❌ Title should follow the conventional commit spec: Example: Live demo linksBundle Size
|
3a8a3c6
to
d272dc7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything looks good to me! One suggestion of a clearer name, but take it or leave it, up to you
* @example | ||
* <c-quantic-generated-answer engine-id={engineId} with-toggle collapsible></c-quantic-generated-answer> | ||
* <c-quantic-generated-answer engine-id={engineId} with-toggle collapsible> | ||
* <div slot="no-answer-message">No answer was generated.</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it slot= or name= ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is slot, name is for the element :P
return !!slot?.assignedNodes()?.length; | ||
} | ||
|
||
get shouldDisplayNoAnswerMessage() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe to be more specific as only a custom message would ever display a "no answer message"?
get shouldDisplayNoAnswerMessage() { | |
get shouldDisplayCustomNoAnswerMessage() { |
SFINT-5926
IN THIS PR:
name=no-answer-message
to thequanticGeneratedAnswer
component to display a custom error message whenever CRGA could not return an answer. If no slot is passed, we simply display nothingNotes about the solution:
cannotAnswer
was returned astrue
and 2) the Quantic user has passed a named slot in the component.shouldDisplayNoAnswerMessage
check and display the no answer HTML properly. This was the best way possible as LWC doesnt allow for conditional rendering and as it keeps the additional logic to make this feature work to a minimum in the JS file.DEMO:
Screen.Recording.2025-02-20.at.4.36.57.PM.mov
TESTS: