Skip to content

Commit 706a379

Browse files
committed
add appName for the assistant
1 parent 2e94e42 commit 706a379

File tree

6 files changed

+18
-8
lines changed

6 files changed

+18
-8
lines changed

packages/compass-assistant/src/compass-assistant-drawer.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,10 @@ const assistantTitleTextStyles = css({
3535
* it's within an AssistantProvider.
3636
*/
3737
export const CompassAssistantDrawer: React.FunctionComponent<{
38+
appName: string;
3839
autoOpen?: boolean;
3940
hasNonGenuineConnections?: boolean;
40-
}> = ({ autoOpen, hasNonGenuineConnections = false }) => {
41+
}> = ({ appName, autoOpen, hasNonGenuineConnections = false }) => {
4142
const chat = useContext(AssistantContext);
4243
const { clearChat } = useContext(AssistantActionsContext);
4344

@@ -68,8 +69,6 @@ export const CompassAssistantDrawer: React.FunctionComponent<{
6869
);
6970
}
7071

71-
const appName = 'Compass'; // TODO
72-
7372
return (
7473
<DrawerSection
7574
id={ASSISTANT_DRAWER_ID}
@@ -97,7 +96,7 @@ export const CompassAssistantDrawer: React.FunctionComponent<{
9796
guideCue={{
9897
cueId: 'assistant-drawer',
9998
title: 'Introducing MongoDB Assistant',
100-
description: `AI-powered assistant to intelligently guide you through your database tasks. Get expert MongoDB help and streamline your workflow directly within ${appName}`,
99+
description: `AI-powered assistant to intelligently guide you through your database tasks. Get expert MongoDB help and streamline your workflow directly within ${appName}.`,
101100
buttonText: 'Got it',
102101
tooltipAlign: 'left',
103102
tooltipJustify: 'start',

packages/compass-assistant/src/compass-assistant-provider.spec.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ const TestComponent: React.FunctionComponent<{
8989
<DrawerAnchor>
9090
<div data-testid="provider-children">Provider children</div>
9191
<CompassAssistantDrawer
92+
appName="Compass"
9293
autoOpen={autoOpen}
9394
hasNonGenuineConnections={hasNonGenuineConnections}
9495
/>

packages/compass-web/src/compass-assistant-drawer.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ import { CompassAssistantDrawer } from '@mongodb-js/compass-assistant';
66
// TODO(COMPASS-7830): This is a temporary solution to pass the
77
// hasNonGenuineConnections prop to the CompassAssistantDrawer as otherwise
88
// we end up with a circular dependency.
9-
export function CompassAssistantDrawerWithConnections() {
9+
export function CompassAssistantDrawerWithConnections({
10+
appName,
11+
}: {
12+
appName: string;
13+
}) {
1014
// Check for non-genuine connections
1115
const activeConnectionIds = useConnectionIds(
1216
(conn) =>
@@ -15,6 +19,7 @@ export function CompassAssistantDrawerWithConnections() {
1519
);
1620
return (
1721
<CompassAssistantDrawer
22+
appName={appName}
1823
hasNonGenuineConnections={activeConnectionIds.length > 0}
1924
/>
2025
);

packages/compass-web/src/entrypoint.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ function CompassWorkspace({
305305
<CreateNamespacePlugin></CreateNamespacePlugin>
306306
<DropNamespacePlugin></DropNamespacePlugin>
307307
<RenameCollectionPlugin></RenameCollectionPlugin>
308-
<CompassAssistantDrawerWithConnections />
308+
<CompassAssistantDrawerWithConnections appName="Data Explorer" />
309309
</>
310310
);
311311
}}

packages/compass/src/app/components/compass-assistant-drawer.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ import { CompassAssistantDrawer } from '@mongodb-js/compass-assistant';
66
// TODO(COMPASS-7830): This is a temporary solution to pass the
77
// hasNonGenuineConnections prop to the CompassAssistantDrawer as otherwise
88
// we end up with a circular dependency.
9-
export function CompassAssistantDrawerWithConnections() {
9+
export function CompassAssistantDrawerWithConnections({
10+
appName,
11+
}: {
12+
appName: string;
13+
}) {
1014
// Check for non-genuine connections
1115
const activeConnectionIds = useConnectionIds(
1216
(conn) =>
@@ -15,6 +19,7 @@ export function CompassAssistantDrawerWithConnections() {
1519
);
1620
return (
1721
<CompassAssistantDrawer
22+
appName={appName}
1823
hasNonGenuineConnections={activeConnectionIds.length > 0}
1924
/>
2025
);

packages/compass/src/app/components/workspace.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ export default function Workspace({
112112
<CreateNamespacePlugin></CreateNamespacePlugin>
113113
<DropNamespacePlugin></DropNamespacePlugin>
114114
<RenameCollectionPlugin></RenameCollectionPlugin>
115-
<CompassAssistantDrawerWithConnections />
115+
<CompassAssistantDrawerWithConnections appName="Compass" />
116116
</>
117117
)}
118118
></WorkspacesPlugin>

0 commit comments

Comments
 (0)