diff --git a/src/components/flow/actions/sendmsg/SendMsg.tsx b/src/components/flow/actions/sendmsg/SendMsg.tsx index b9fb3861..9c135c07 100644 --- a/src/components/flow/actions/sendmsg/SendMsg.tsx +++ b/src/components/flow/actions/sendmsg/SendMsg.tsx @@ -7,10 +7,11 @@ import i18n from 'config/i18n'; import { renderAssetList } from '../helpers'; import { AssetType } from '../../../../store/flowContext'; import { MAX_TO_SHOW } from '../addlabels/AddLabels'; +import { fakePropType } from '../../../../config/ConfigProvider'; export const PLACEHOLDER = i18n.t('actions.send_msg.placeholder', 'Send a message to the contact'); -const SendMsgComp: React.SFC = (action: SendMsg): JSX.Element => { +const SendMsgComp: React.SFC = (action: SendMsg, context: any): JSX.Element => { if (action.text) { let replies = null; @@ -43,6 +44,13 @@ const SendMsgComp: React.SFC = (action: SendMsg): JSX.Element => { {action.labels ? renderAssetList( action.labels.map(label => { + if (label.name_match) { + return { + id: label.name_match, + name: label.name_match, + type: AssetType.NameMatch + }; + } return { id: label.uuid, name: label.name, @@ -50,7 +58,7 @@ const SendMsgComp: React.SFC = (action: SendMsg): JSX.Element => { }; }), MAX_TO_SHOW, - null + context.config.endpoints ) : null} @@ -71,4 +79,8 @@ const SendMsgComp: React.SFC = (action: SendMsg): JSX.Element => { return
{PLACEHOLDER}
; }; +SendMsgComp.contextTypes = { + config: fakePropType +}; + export default SendMsgComp; diff --git a/src/components/flow/actions/sendmsg/SendMsgForm.tsx b/src/components/flow/actions/sendmsg/SendMsgForm.tsx index f465a74a..c5bdc2cc 100644 --- a/src/components/flow/actions/sendmsg/SendMsgForm.tsx +++ b/src/components/flow/actions/sendmsg/SendMsgForm.tsx @@ -449,6 +449,7 @@ export default class SendMsgForm extends React.Component