Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Commit

Permalink
fix: bug 2382 reprompt and expected entity are mutually exclusive (#1398
Browse files Browse the repository at this point in the history
)
  • Loading branch information
LarsLiden authored Dec 3, 2019
1 parent 3275520 commit f691a35
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1885,6 +1885,8 @@ class ActionCreatorEditor extends React.Component<Props, ComponentState> {
<TC.TagPicker
data-testid="action-expected-entity"
label="Expected Entity in User reply..."
// Expected Entity and Reprompt can't both be in use
disabled={this.state.shouldReprompt}
onResolveSuggestions={this.onResolveExpectedEntityTags}
onEmptyResolveSuggestions={selectedItems => this.onResolveExpectedEntityTags('', selectedItems ?? [])}
onRenderItem={this.onRenderExpectedTag}
Expand Down Expand Up @@ -1966,7 +1968,12 @@ class ActionCreatorEditor extends React.Component<Props, ComponentState> {
label={Util.formatMessageId(intl, FM.ACTIONCREATOREDITOR_CHECKBOX_REPROMPT_LABEL)}
checked={this.state.shouldReprompt}
onChange={this.onChangeRepromptCheckbox}
disabled={!this.state.isTerminal || [CLM.ActionTypes.END_SESSION, CLM.ActionTypes.SET_ENTITY, CLM.ActionTypes.DISPATCH].includes(this.state.selectedActionTypeOptionKey as CLM.ActionTypes)}
disabled={
!this.state.isTerminal
|| [CLM.ActionTypes.END_SESSION, CLM.ActionTypes.SET_ENTITY, CLM.ActionTypes.DISPATCH].includes(this.state.selectedActionTypeOptionKey as CLM.ActionTypes)
// Expected Entity and Reprompt can't both be in use
|| this.state.expectedEntityTags.length > 0
}
tipType={ToolTip.TipType.ACTION_REPROMPT}
/>
{this.state.shouldReprompt &&
Expand Down
4 changes: 2 additions & 2 deletions src/react-intl-messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1197,7 +1197,7 @@ export default {
[FM.TOOLTIP_ACTION_IS_ENTRY_NODE]: "When selected and not in a Train Dialog, Bot will direct dialog flow to this action if it isn't confident on how to respond to the user's first input.",
[FM.TOOLTIP_ACTION_IS_ENTRY_NODE_TITLE]: 'Unknown user 1st turn input',

[FM.TOOLTIP_ACTION_REPROMPT]: "When selected and not in a Train Dialog, Bot will repeat the given action if it isn't confident on how to respond to the user's input.",
[FM.TOOLTIP_ACTION_REPROMPT]: "When checked (and not in a Train Dialog), Bot will take the given action if it isn't confident on how to respond to the user's input. This feature can not be used in conjunction with Expected Entity.",
[FM.TOOLTIP_ACTION_REPROMPT_TITLE]: 'Reprompt',

[FM.TOOLTIP_ACTION_RESPONSE]: 'Value of Response that Bot will take',
Expand All @@ -1221,7 +1221,7 @@ export default {
[FM.TOOLTIP_ACTION_SCORE_TRAINING]: `Action can't be scored yet as Conversation Learner is still training`,
[FM.TOOLTIP_ACTION_SCORE_DISQUALIFIED]: 'Action has been disqualified - Required Conditions are missing or Blocked Entities are present',

[FM.TOOLTIP_ACTION_SUGGESTED]: `Hint to Conversation Learner that the user's reply to this Action will likely be a value for this Entity. Pre-Trained Entities cannot be used as Expected Entities.`,
[FM.TOOLTIP_ACTION_SUGGESTED]: `Hint to Conversation Learner that the user's reply to this Action will likely be a value for this Entity. Pre-Trained Entities cannot be used as Expected Entities. This feature can not be used in conjuntion with prompts for unexpected input.`,
[FM.TOOLTIP_ACTION_SUGGESTED_TITLE]: 'Expected Response',
[FM.TOOLTIP_ACTION_SUGGESTED_ROW1]: '"What is your name?"',
[FM.TOOLTIP_ACTION_SUGGESTED_ROW2]: '$name',
Expand Down

0 comments on commit f691a35

Please sign in to comment.