Skip to content

Commit

Permalink
Removes mentions of DSO from chatbot codebase
Browse files Browse the repository at this point in the history
  • Loading branch information
hosein1984 committed Nov 20, 2023
1 parent 3130c23 commit 38b39b4
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions src/components/ChatbotPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { PanelProps } from '@grafana/data'
import { useStyles2 } from '@grafana/ui'
import * as React from 'react'
import { TreeOptions } from 'types'
import { DsoChatBot } from 'components/dso-chat-bot/DsoChatbot'
import { ChatBot } from 'components/chat-bot/ChatBot'
import './style.css'

// let renderCount = 0
Expand Down Expand Up @@ -36,7 +36,7 @@ export const ChatbotPanel: React.FC<Props> = ({ options, data, width, height, re
`
)}
>
<DsoChatBot />
<ChatBot />
</div>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { BOT_SYSTEM_MESSAGE } from 'api/chatbot/system-message'
import { Input } from '@grafana/ui'
import { Button } from 'components/button/Button'

import './dso-chat-bot.scss'
import './chat-bot.scss'

interface ChatBotMessage {
role: CHATBOT_ROLE
Expand All @@ -18,7 +18,7 @@ interface ChatBotMessage {
includeInChatPanel: boolean
}

export const DsoChatBot = () => {
export const ChatBot = () => {
/** States and Refs */
const [text, setText] = useState('')
const [chatContent, setChatContent] = useState<undefined | ChatBotMessage[]>(undefined)
Expand Down Expand Up @@ -147,11 +147,11 @@ export const DsoChatBot = () => {

/** Renderer */
return (
<div className={classNames('dsoChartBot')}>
<div className={classNames('ChartBot')}>
{
<div className="dsoChartBot-header">
<span className="dsoChartBot-header-text">Talk to New Oil Management</span>
<div className="dsoChartBot-header-actions">
<div className="ChartBot-header">
<span className="ChartBot-header-text">Talk to New Oil Management</span>
<div className="ChartBot-header-actions">
<Button
title="Clear"
displayTitle={false}
Expand All @@ -163,49 +163,49 @@ export const DsoChatBot = () => {
</div>
</div>
}
<div className={classNames('dsoChartBot-chatPanel')} ref={chatContentRef}>
<div className={classNames('ChartBot-chatPanel')} ref={chatContentRef}>
{chatContent &&
chatContent
.filter(({ includeInChatPanel }) => includeInChatPanel)
.map(({ message, id, role }) => (
<div
key={id}
className={classNames('dsoChartBot-chatPanel-messageContainer', {
className={classNames('ChartBot-chatPanel-messageContainer', {
user: role === CHATBOT_ROLE.USER,
assistant: role === CHATBOT_ROLE.ASSISTANT,
})}
>
<div
className={classNames('dsoChartBot-chatPanel-messageContainer-avatar', {
className={classNames('ChartBot-chatPanel-messageContainer-avatar', {
user: role === CHATBOT_ROLE.USER,
assistant: role === CHATBOT_ROLE.ASSISTANT,
})}
title={role === CHATBOT_ROLE.ASSISTANT ? 'DSO bot' : 'You'}
title={role === CHATBOT_ROLE.ASSISTANT ? 'Bot' : 'You'}
>
{role === CHATBOT_ROLE.ASSISTANT ? (
<img
className="dsoChartBot-chatPanel-messageContainer-avatar-image"
className="ChartBot-chatPanel-messageContainer-avatar-image"
// @ts-ignore
src={AssistantAvatar}
alt="Bot"
/>
) : (
<img
className="dsoChartBot-chatPanel-messageContainer-avatar-image"
className="ChartBot-chatPanel-messageContainer-avatar-image"
// @ts-ignore
src={UserAvatar}
alt="User"
/>
)}
</div>
<div
className={classNames('dsoChartBot-chatPanel-messageContainer-message', {
className={classNames('ChartBot-chatPanel-messageContainer-message', {
user: role === CHATBOT_ROLE.USER,
assistant: role === CHATBOT_ROLE.ASSISTANT,
})}
>
<span
className={classNames('dsoChartBot-chatPanel-messageContainer-message-messageText', {
className={classNames('ChartBot-chatPanel-messageContainer-message-messageText', {
user: role === CHATBOT_ROLE.USER,
assistant: role === CHATBOT_ROLE.ASSISTANT,
})}
Expand All @@ -216,7 +216,7 @@ export const DsoChatBot = () => {
))}
</div>

<div className="dsoChartBot-inputContainer">
<div className="ChartBot-inputContainer">
<Input
label="Search"
placeholder="Search"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ $input-container-max-height: 144px;
$input-container-min-height: 72px;
$input-vertical-margin: 8px;

.dsoChartBot {
.ChartBot {
display: flex;
justify-content: center;
align-items: center;
Expand Down Expand Up @@ -175,7 +175,7 @@ $input-vertical-margin: 8px;
}
}

.panel-container:has(.dsoChartBot) {
.panel-container:has(.ChartBot) {
background-color: #eaeaea;
border: solid 1px #000000;
border-radius: 5px;
Expand Down

0 comments on commit 38b39b4

Please sign in to comment.