-
Notifications
You must be signed in to change notification settings - Fork 937
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[workspace]Hide the assistant entry when there isn't data2summary agent #9277
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Qxisylolo <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #9277 +/- ##
=======================================
Coverage 61.69% 61.69%
=======================================
Files 3816 3815 -1
Lines 91693 91686 -7
Branches 14516 14515 -1
=======================================
- Hits 56569 56566 -3
+ Misses 31498 31496 -2
+ Partials 3626 3624 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
question$?: BehaviorSubject<string>; | ||
} | ||
|
||
const QueryAssistWrapper: React.FC<QueryAssistWrapperProps> = (props) => { | ||
const [visible, setVisible] = useState(false); | ||
const [question, setQuestion] = useState(''); | ||
const [isQuerySummaryCollapsed, setIsQuerySummaryCollapsed] = useState(true); | ||
const [isSummaryAgentAvailable, setIsSummaryAgentAvailable] = useState(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about we using useObservable(props.isSummaryAgentAvailable$)
?
useEffect(() => { | ||
setIsSummaryAgentAvailable(false); | ||
const fetchSummaryAgent = async () => { | ||
try { | ||
const summaryAgentStatus = await checkAgentsExist( | ||
props.http, | ||
DATA2SUMMARY_AGENT_CONFIG_ID, | ||
selectedDataset.current?.dataSource?.id | ||
); | ||
setIsSummaryAgentAvailable(summaryAgentStatus.exists); | ||
} catch (error) { | ||
// eslint-disable-next-line no-console | ||
console.error(error); | ||
} | ||
}; | ||
if (isEnabledByCapability) { | ||
fetchSummaryAgent(); | ||
} | ||
}, [selectedDataset.current?.dataSource?.id, props.http, isEnabledByCapability]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there case that assistant is not installed but we turn on result summary?
Description
This pr hides the assistant entry when there isn't data2summary agent
Screenshot
No agent:
Has agent:
Testing the changes
Changelog
Check List
yarn test:jest
yarn test:jest_integration