Skip to content
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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Qxisylolo
Copy link
Contributor

Description

This pr hides the assistant entry when there isn't data2summary agent

Screenshot

No agent:
截屏2025-01-27 13 44 44
Has agent:
截屏2025-01-27 13 45 13

Testing the changes

Changelog

  • fix: Hide the assistant entry when there isn't data2summary agent

Check List

  • All tests pass
    • yarn test:jest
    • yarn test:jest_integration
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

Copy link

codecov bot commented Jan 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 61.69%. Comparing base (1ac056a) to head (ef1ab32).

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     
Flag Coverage Δ
Linux_1 29.04% <ø> (ø)
Linux_2 56.46% <ø> (ø)
Linux_3 39.09% <ø> (+<0.01%) ⬆️
Linux_4 28.96% <100.00%> (-0.01%) ⬇️
Windows_1 29.07% <ø> (ø)
Windows_2 56.41% <ø> (ø)
Windows_3 39.09% <ø> (ø)
Windows_4 28.96% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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);
Copy link
Member

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$)?

Comment on lines -212 to -230
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]);
Copy link
Member

@SuZhou-Joe SuZhou-Joe Jan 27, 2025

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants