Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/components/Insights/InsightsCatalog/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export const InsightsCatalog = (props: InsightsCatalogProps) => {
</s.Toolbar>
<InsightsPage
insights={insights}
isFilteringEnabled={searchInputValue !== null}
onJiraTicketCreate={onJiraTicketCreate}
/>
<s.Footer>
Expand Down
7 changes: 7 additions & 0 deletions src/components/Insights/InsightsPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,13 @@ export const InsightsPage = (props: InsightPageProps) => {
j === insightIndexWithJiraHint
);
})
) : props.isFilteringEnabled ? (
<Card
header={<>No data found</>}
content={
<Description>There are no insights for this criteria</Description>
}
/>
) : (
<Card
header={<>No data yet</>}
Expand Down
1 change: 1 addition & 0 deletions src/components/Insights/InsightsPage/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { GenericCodeObjectInsight } from "../types";

export interface InsightPageProps {
insights: GenericCodeObjectInsight[];
isFilteringEnabled: boolean;
onJiraTicketCreate: (
insight: GenericCodeObjectInsight,
spanCodeObjectId?: string
Expand Down
1 change: 1 addition & 0 deletions src/components/Insights/common/useInsightsData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export const useInsightsData = (props: UseInsightDataProps) => {
});

setIsInitialLoading(true);
setIsLoading(true);
const handleInsightsData = (data: unknown, timeStamp: number) => {
const insightsData = data as InsightsData;
insightsData.insightsStatus = InsightsStatus.DEFAULT;
Expand Down
11 changes: 2 additions & 9 deletions src/components/Insights/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ const renderInsightTicket = (
return null;
};

const sendMessage = (action: string, data?: any) => {
const sendMessage = (action: string, data?: object) => {
return window.sendMessageToDigma({
action,
payload: {
Expand Down Expand Up @@ -233,19 +233,12 @@ export const Insights = (props: InsightsProps) => {
};

const renderDefaultContent = (data: InsightsData): JSX.Element => {
if (data.insights.length === 0 && !isLoading) {
const emptyMsg =
query.searchQuery?.length === 0
? "No insights"
: "There are no insights for this criteria";
return <EmptyState icon={LightBulbSmallCrossedIcon} title={emptyMsg} />;
}
return (
<InsightsCatalog
insights={data.insights}
totalCount={data.totalCount}
onJiraTicketCreate={handleJiraTicketPopupOpen}
onQueryChange={(query) => {
onQueryChange={(query: InsightsQuery) => {
setQuery(query);
}}
defaultQuery={DEFAULT_QUERY}
Expand Down