Skip to content

Commit 53e2af4

Browse files
committed
Merge branch 'assistant_rename_bot_to_assistant' into 'master'
Rename "bot" to "assistant" in all text occurrences See merge request postgres-ai/database-lab!912
2 parents 78f8262 + 285293e commit 53e2af4

File tree

8 files changed

+32
-16
lines changed

8 files changed

+32
-16
lines changed

ui/packages/platform/src/components/Dashboard/Dashboard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ class Dashboard extends Component<DashboardWithStylesProps, DashboardState> {
128128
document.cookie = `${cookieName}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; domain=.${window.location.hostname.split('.').slice(-2).join('.')}`;
129129
if (userProfile && userProfile.data && userProfile.data.orgs) {
130130
if (userProfile.data.orgs.hasOwnProperty('demo')) {
131-
that.props.history.push(`demo/bot/${response.final_thread_id}`);
131+
that.props.history.push(`demo/assistant/${response.final_thread_id}`);
132132
}
133133
}
134134
}

ui/packages/platform/src/components/IndexPage/IndexPage.tsx

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -362,12 +362,12 @@ function OrganizationMenu(parentProps: OrganizationMenuProps) {
362362
<NavLink
363363
className={parentProps.classes.menuSectionHeaderLink}
364364
activeClassName={cn(parentProps.classes.menuSectionHeaderActiveLink, parentProps.classes.menuSingleSectionHeaderActiveLink)}
365-
to={'/' + org + '/bot'}
365+
to={'/' + org + '/assistant'}
366366
>
367367
<span className={parentProps.classes.menuSectionHeaderIcon}>
368368
{icons.aiBotIcon}
369369
</span>
370-
AI Bot<span className={cn(parentProps.classes.menuItemLabel, parentProps.classes.headerLinkMenuItemLabel)}>NEW</span>
370+
AI Assistant<span className={cn(parentProps.classes.menuItemLabel, parentProps.classes.headerLinkMenuItemLabel)}>NEW</span>
371371
</NavLink>
372372
</ListItem>}
373373
<ListItem
@@ -589,7 +589,7 @@ function OrganizationMenu(parentProps: OrganizationMenuProps) {
589589
activeClassName={parentProps.classes.menuItemActiveLink}
590590
to={'/' + org + '/bot-settings'}
591591
>
592-
AI Bot
592+
AI Assistant
593593
</NavLink>
594594
</ListItem>*/}
595595
<ListItem
@@ -862,19 +862,35 @@ function OrganizationWrapper(parentProps: OrganizationWrapperProps) {
862862
)}
863863
/>
864864
<Route
865-
path="/:org/bot/:threadId"
865+
path="/:org/assistant/:threadId"
866866
exact
867867
render={(props) => (
868868
<BotWrapper {...props} {...customProps} {...queryProps} />
869869
)}
870870
/>
871871
<Route
872-
path="/:org/bot"
872+
path="/:org/assistant"
873873
exact
874874
render={(props) => (
875875
<BotWrapper {...props} {...customProps} {...queryProps} />
876876
)}
877877
/>
878+
<Route
879+
path="/:org/bot/:threadId"
880+
exact
881+
render={(props) => {
882+
const { org, threadId } = props.match.params;
883+
return <Redirect to={`/${org}/assistant/${threadId}`} />;
884+
}}
885+
/>
886+
<Route
887+
path="/:org/bot"
888+
exact
889+
render={(props) => {
890+
const { org } = props.match.params;
891+
return <Redirect to={`/${org}/assistant`} />;
892+
}}
893+
/>
878894
<Route
879895
path="/:org/joe-instances"
880896
render={(props) => (
@@ -894,7 +910,7 @@ function OrganizationWrapper(parentProps: OrganizationWrapperProps) {
894910
)}
895911
/>
896912
<Route
897-
path="/:org/bot-settings"
913+
path="/:org/assistant-settings"
898914
render={(props) => (
899915
<BotSettingsFormWrapper {...props} {...customProps} {...queryProps} />
900916
)}

ui/packages/platform/src/pages/Bot/ChatsList/ChatsList.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,9 @@ export const ChatsList = (props: ChatsListProps) => {
126126
const matches = useMediaQuery(theme.breakpoints.down('sm'));
127127
const linkBuilder = (msgId: string) => {
128128
if (params.org) {
129-
return `/${params.org}/bot/${msgId}`
129+
return `/${params.org}/assistant/${msgId}`
130130
} else {
131-
return `/bot/${msgId}`
131+
return `/assistant/${msgId}`
132132
}
133133
}
134134

ui/packages/platform/src/pages/Bot/Messages/Message/Message.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ export const Message = React.memo((props: MessageProps) => {
302302
{isAi
303303
? <img
304304
src="/images/bot_avatar.png"
305-
alt="Postgres.AI Bot avatar"
305+
alt="Postgres.AI Assistant avatar"
306306
className={classes.messageAvatarImage}
307307
/>
308308
: icons.userChatIcon}

ui/packages/platform/src/pages/Bot/Messages/Messages.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ export const Messages = React.memo(() => {
221221
return (
222222
<div className={cn(classes.root, classes.emptyChat)}>
223223
<Typography className={classes.emptyChatMessage}>
224-
Postgres.AI Bot can make mistakes. <br />
224+
Postgres.AI Assistant can make mistakes. <br />
225225
Consider checking important information. <br />
226226
Depending on settings, LLM service provider such as GCP or OpenAI is used.
227227
</Typography>

ui/packages/platform/src/pages/Bot/hooks.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ export const useAiBotProviderValue = (args: UseAiBotArgs): UseAiBotReturnType =>
188188
if (document.visibilityState === "hidden") {
189189
if (Notification.permission === "granted") {
190190
new Notification("New message", {
191-
body: 'New message from Postgres.AI Bot',
191+
body: 'New message from Postgres.AI Assistant',
192192
icon: '/images/bot_avatar.png'
193193
});
194194
}

ui/packages/platform/src/pages/Bot/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ export const BotPage = (props: BotPageProps) => {
122122
org={match.params.org}
123123
project={project}
124124
breadcrumbs={[
125-
{ name: 'Bot', url: 'bot' },
125+
{ name: 'Assistant', url: 'assistant' },
126126
]}
127127
/>
128128
);
@@ -146,7 +146,7 @@ export const BotPage = (props: BotPageProps) => {
146146

147147
const handleCreateNewChat = () => {
148148
clearChat();
149-
history.push(`/${match.params.org}/bot`);
149+
history.push(`/${match.params.org}/assistant`);
150150
}
151151

152152
const handleChatListLinkClick = (targetThreadId: string) => {
@@ -158,7 +158,7 @@ export const BotPage = (props: BotPageProps) => {
158158
useEffect(() => {
159159
if (!match.params.threadId && !prevThreadId && messages && messages.length > 0 && messages[0].id) {
160160
// hack that skip additional loading chats_ancestors_and_descendants
161-
history.replace(`/${match.params.org}/bot/${messages[0].id}`, { skipReloading: true })
161+
history.replace(`/${match.params.org}/assistant/${messages[0].id}`, { skipReloading: true })
162162
getChatsList();
163163
} else if (prevThreadId && !match.params.threadId) {
164164
clearChat()

ui/packages/platform/src/utils/urls.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,6 @@ export default {
223223
linkBotChat: function (props: PropsType, msgId: string) {
224224
const basePath = this.getBasePath(props)
225225

226-
return basePath + '/bot/' + msgId
226+
return basePath + '/assistant/' + msgId
227227
},
228228
}

0 commit comments

Comments
 (0)