@@ -33,7 +33,6 @@ export interface ActionItemProps {
3333 onForceToggle : ( ) => void ;
3434 onSourceManagementOpen ?: ( ) => void ;
3535 hasNoConnectors ?: boolean ;
36- hasNoKnowledgeSources ?: boolean ;
3736 toolAuthStatus ?: ToolAuthStatus ;
3837 onOAuthAuthenticate ?: ( ) => void ;
3938 onClose ?: ( ) => void ;
@@ -56,7 +55,6 @@ export default function ActionLineItem({
5655 onForceToggle,
5756 onSourceManagementOpen,
5857 hasNoConnectors = false ,
59- hasNoKnowledgeSources = false ,
6058 toolAuthStatus,
6159 onOAuthAuthenticate,
6260 onClose,
@@ -78,11 +76,6 @@ export default function ActionLineItem({
7876 tool ?. in_code_tool_id === SEARCH_TOOL_ID &&
7977 hasNoConnectors ;
8078
81- const isSearchToolWithNoKnowledgeSources =
82- ! currentProjectId &&
83- tool ?. in_code_tool_id === SEARCH_TOOL_ID &&
84- hasNoKnowledgeSources ;
85-
8679 const isSearchToolAndNotInProject =
8780 tool ?. in_code_tool_id === SEARCH_TOOL_ID && ! currentProjectId ;
8881
@@ -95,22 +88,14 @@ export default function ActionLineItem({
9588 sourceCounts . enabled > 0 &&
9689 sourceCounts . enabled < sourceCounts . total ;
9790
98- const tooltipText = isSearchToolWithNoKnowledgeSources
99- ? "No knowledge sources are available. Contact your admin to add a knowledge source to this agent."
100- : isUnavailable
101- ? unavailableReason
102- : tool ?. description ;
91+ const tooltipText = isUnavailable ? unavailableReason : tool ?. description ;
10392
10493 return (
10594 < SimpleTooltip tooltip = { tooltipText } className = "max-w-[30rem]" >
10695 < div data-testid = { `tool-option-${ toolName } ` } >
10796 < LineItem
10897 onClick = { ( ) => {
109- if (
110- isSearchToolWithNoConnectors ||
111- isSearchToolWithNoKnowledgeSources
112- )
113- return ;
98+ if ( isSearchToolWithNoConnectors ) return ;
11499 if ( isUnavailable ) {
115100 if ( isForced ) onForceToggle ( ) ;
116101 return ;
@@ -123,10 +108,7 @@ export default function ActionLineItem({
123108 } }
124109 selected = { isForced }
125110 strikethrough = {
126- disabled ||
127- isSearchToolWithNoConnectors ||
128- isSearchToolWithNoKnowledgeSources ||
129- isUnavailable
111+ disabled || isSearchToolWithNoConnectors || isUnavailable
130112 }
131113 icon = { Icon }
132114 rightChildren = {
@@ -201,31 +183,28 @@ export default function ActionLineItem({
201183 </ span >
202184 ) }
203185
204- { isSearchToolAndNotInProject &&
205- ! isSearchToolWithNoKnowledgeSources && (
206- < IconButton
207- icon = {
208- isSearchToolWithNoConnectors
209- ? SvgSettings
210- : SvgChevronRight
211- }
212- onClick = { noProp ( ( ) => {
213- if ( isSearchToolWithNoConnectors )
214- router . push ( "/admin/add-connector" ) ;
215- else onSourceManagementOpen ?.( ) ;
216- } ) }
217- internal
218- className = { cn (
219- isSearchToolWithNoConnectors &&
220- "invisible group-hover/LineItem:visible"
221- ) }
222- tooltip = {
223- isSearchToolWithNoConnectors
224- ? "Add Connectors"
225- : "Configure Connectors"
226- }
227- />
228- ) }
186+ { isSearchToolAndNotInProject && (
187+ < IconButton
188+ icon = {
189+ isSearchToolWithNoConnectors ? SvgSettings : SvgChevronRight
190+ }
191+ onClick = { noProp ( ( ) => {
192+ if ( isSearchToolWithNoConnectors )
193+ router . push ( "/admin/add-connector" ) ;
194+ else onSourceManagementOpen ?.( ) ;
195+ } ) }
196+ internal
197+ className = { cn (
198+ isSearchToolWithNoConnectors &&
199+ "invisible group-hover/LineItem:visible"
200+ ) }
201+ tooltip = {
202+ isSearchToolWithNoConnectors
203+ ? "Add Connectors"
204+ : "Configure Connectors"
205+ }
206+ />
207+ ) }
229208 </ Section >
230209 }
231210 >
0 commit comments