Skip to content

Commit

Permalink
fix(hitl): use renderPayload from ui-shared-lite to fix undefined (#5454
Browse files Browse the repository at this point in the history
)

* fix(hitl): use renderPaylood from ui-shared-lite to fix undefined

* fix(hitl): remove broken dependencies to extensions

Co-authored-by: Samuel Massé <59894025+samuelmasse@users.noreply.github.com>
  • Loading branch information
billsomen and samuelmasse committed Sep 15, 2021
1 parent 6f03d1c commit 56a020c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default class Message extends React.Component<{ message: HitlMessage }> {
}

renderDropdown() {
const Dropdown = getComponent('extensions', 'Dropdown')
const Dropdown = getComponent('channel-web', 'Dropdown')
return Dropdown ? (
<Dropdown isLastGroup={true} isLastOfGroup={true} options={this.props.message.raw_message.options} />
) : null
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { contentPayloads } from 'botpress/shared'
import _ from 'lodash'
import moment from 'moment'
import React, { FC } from 'react'
import { renderPayload } from '../../../../../../../packages/ui-shared-lite/Payloads'

import { Message as HitlMessage } from '../../../../backend/typings'

Expand All @@ -26,11 +26,7 @@ class MessageWrapper extends React.Component<{ message: any }> {
return <p className="bph-chat-error">* Cannot display message *</p>
}

return (
<Message
message={{ ...this.props.message, raw_message: contentPayloads.renderPayload(this.props.message.raw_message) }}
/>
)
return <Message message={{ ...this.props.message, raw_message: renderPayload(this.props.message.raw_message) }} />
}
}

Expand Down
3 changes: 0 additions & 3 deletions modules/hitl/src/views/full/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ export default class HitlModule extends React.Component<{ bp: any }, State> {
}

async componentDidMount() {
// Loads the extensions module to display dropdown components
window.botpress.injector.loadModuleView('extensions', true)

this.props.bp.events.on('hitl.message', this.updateSessionOverview)
this.props.bp.events.on('hitl.new_session', this.refreshSessions)
this.props.bp.events.on('hitl.session.changed', this.updateSession)
Expand Down

0 comments on commit 56a020c

Please sign in to comment.