Skip to content

Commit f3af868

Browse files
feat(metadataeditor): add agent selector (#4098)
* feat(metadataeditor): add agent selector * feat(metadataeditor): add agent selector * feat(metadataeditor): add agent selector * feat(metadataeditor): add agent selector * feat(metadataeditor): add agent selector --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
1 parent e265cfe commit f3af868

File tree

3 files changed

+38
-1
lines changed

3 files changed

+38
-1
lines changed

src/features/metadata-instance-editor/CascadePolicy.js

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
import * as React from 'react';
33
import { FormattedMessage } from 'react-intl';
44

5-
import { InlineNotice } from '@box/blueprint-web';
5+
import { BoxAiAgentSelector } from '@box/box-ai-agent-selector';
6+
import { InlineNotice, TooltipProvider } from '@box/blueprint-web';
67
import BoxAiLogo from '@box/blueprint-web-assets/icons/Logo/BoxAiLogo';
78

89
import Toggle from '../../components/toggle';
@@ -15,6 +16,20 @@ import './CascadePolicy.scss';
1516
const COMMUNITY_LINK = 'https://support.box.com/hc/en-us/articles/360044195873-Cascading-metadata-in-folders';
1617
const AI_LINK = 'https://www.box.com/ai';
1718
const PRICING_LINK = 'https://www.box.com/pricing';
19+
20+
const agents = [
21+
{
22+
id: '1',
23+
name: 'Basic',
24+
isEnterpriseDefault: true,
25+
},
26+
{
27+
id: '2',
28+
name: 'Enhanced (Gemini 2.5 Pro)',
29+
isEnterpriseDefault: false,
30+
},
31+
];
32+
1833
type Props = {
1934
canEdit: boolean,
2035
canUseAIFolderExtraction: boolean,
@@ -126,6 +141,17 @@ const CascadePolicy = ({
126141
<FormattedMessage {...messages.aiAutofillLearnMore} />
127142
</Link>
128143
</div>
144+
<div className="metadata-cascade-ai-agent-selector">
145+
<TooltipProvider>
146+
<BoxAiAgentSelector
147+
agents={agents}
148+
onErrorAction={() => {}}
149+
requestState="success"
150+
selectedAgent={agents[0]}
151+
variant="sidebar"
152+
/>
153+
</TooltipProvider>
154+
</div>
129155
<InlineNotice className="metadata-cascade-ai-notice" variant="info">
130156
<FormattedMessage
131157
{...messages.aiAutofillNotice}

src/features/metadata-instance-editor/CascadePolicy.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,7 @@ $cascade-policy-background: #f1e2fd;
7878
}
7979
}
8080
}
81+
82+
.metadata-cascade-ai-agent-selector {
83+
margin-top: 4px;
84+
}

src/features/metadata-instance-editor/__tests__/CascadePolicy.test.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,4 +92,11 @@ describe('features/metadata-instance-editor/CascadePolicy', () => {
9292
expect(pricingLink.closest('a')).toHaveAttribute('target', '_blank');
9393
});
9494
});
95+
96+
describe('AI Agent Selector', () => {
97+
test('should render AI agent selector with default to basic when AI features are enabled', () => {
98+
render(<CascadePolicy canEdit canUseAIFolderExtraction shouldShowCascadeOptions />);
99+
expect(screen.getByRole('button', { name: 'Agent Basic' })).toBeInTheDocument();
100+
});
101+
});
95102
});

0 commit comments

Comments
 (0)