Skip to content

Commit

Permalink
Merge pull request RocketChat#45 from Shailesh351/sb_upstream_catchup
Browse files Browse the repository at this point in the history
[Upstream Catchup] Merge RocketChat/Apps.Dialogflow:master to master
  • Loading branch information
chadgoss authored Feb 16, 2021
2 parents d3c8042 + 155ab14 commit 491e16c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
16 changes: 9 additions & 7 deletions docs/QuickReplies.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ These buttons perform a specific action in the app. You can add them by simply p

- Parameters:

| Param Name | Dependency | Param Type | Acceptable Value |
|:--------------------:|:------------:|:----------:|:--------------------------:|
| `actionId` | **Required** | String | `df_perform_handover` |
| `text` | **Required** | String | **Any** |
| `salesforceButtonId` | **Optional** | String | **Any Liveagent ButtonId** |
| `buttonStyle` | **Optional** | String | `primary` or `danger` |
| Param Name | Dependency | Param Type | Acceptable Value |
|:----------------:|:------------:|:----------:|:-----------------------------------:|
| `actionId` | **Required** | String | `df_perform_handover` |
| `text` | **Required** | String | **Any** |
| `buttonStyle` | **Optional** | String | `primary` or `danger` |
| `data` | **Optional** | String | **Object(Key: Value), departmentName : Any Omnichannel department name** |

- Example Structure:

Expand All @@ -87,7 +87,9 @@ These buttons perform a specific action in the app. You can add them by simply p
"text": "Perform Handover",
"buttonStyle": "primary",
"actionId": "df_perform_handover",
"departmentName": "sales"
"data": {
"departmentName": "sales",
}
}
```

Expand Down
1 change: 0 additions & 1 deletion enum/Dialogflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ export interface IDialogflowQuickReplyOptions {
text: string;
actionId?: string;
buttonStyle?: ButtonStyle;
salesforceButtonId?: string;
data?: {
[prop: string]: any;
};
Expand Down
5 changes: 3 additions & 2 deletions lib/Message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const createDialogflowMessage = async (rid: string, read: IRead, modify:
};

if (payload.actionId && payload.actionId === ActionIds.PERFORM_HANDOVER) {
buttonElement.value = payload.salesforceButtonId ? payload.salesforceButtonId : undefined;
buttonElement.value = payload.data && payload.data.departmentName ? payload.data.departmentName : undefined;
}

return buttonElement;
Expand Down Expand Up @@ -70,7 +70,8 @@ export const createDialogflowMessage = async (rid: string, read: IRead, modify:
};

if (cardElementPayload.actionId && cardElementPayload.actionId === ActionIds.PERFORM_HANDOVER) {
buttonElement.value = cardElementPayload.salesforceButtonId ? cardElementPayload.salesforceButtonId : undefined;
buttonElement.value = cardElementPayload.data && cardElementPayload.data.departmentName
? cardElementPayload.data.departmentName : undefined;
}

return buttonElement;
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 491e16c

Please sign in to comment.