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

add info callout for s3 datasources #1575

Merged
merged 3 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
4 changes: 4 additions & 0 deletions public/components/event_analytics/explorer/log_explorer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,8 @@

.search-area {
position: relative;
}

pre.euiCodeBlock__pre.euiCodeBlock__pre--whiteSpacePreWrap {
margin-bottom: 0;
}
75 changes: 64 additions & 11 deletions public/components/event_analytics/explorer/no_results.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
*/

import {
EuiButtonIcon,

Check failure on line 7 in public/components/event_analytics/explorer/no_results.tsx

View workflow job for this annotation

GitHub Actions / Lint

'EuiButtonIcon' is defined but never used. Allowed unused vars must match /^_/u
EuiCallOut,
EuiCodeBlock,
EuiCopy,

Check failure on line 10 in public/components/event_analytics/explorer/no_results.tsx

View workflow job for this annotation

GitHub Actions / Lint

'EuiCopy' is defined but never used. Allowed unused vars must match /^_/u
EuiEmptyPrompt,
EuiFlexGroup,
EuiFlexItem,
Expand All @@ -19,12 +22,18 @@
import { coreRefs } from '../../../framework/core_refs';
import { selectQueryAssistantSummarization } from '../redux/slices/query_assistant_summarization_slice';
import { selectQueries } from '../redux/slices/query_slice';
import { selectSearchMetaData } from '../redux/slices/search_meta_data_slice';
import { DATA_SOURCE_TYPES, QUERY_LANGUAGE } from '../../../../common/constants/data_sources';

export const NoResults = ({ tabId }: any) => {

Check warning on line 28 in public/components/event_analytics/explorer/no_results.tsx

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type
// get the queries isLoaded, if it exists AND is true = show no res
const queryInfo = useSelector(selectQueries)[tabId];
const summaryData = useSelector(selectQueryAssistantSummarization)[tabId];
const queryAssistLoading = summaryData?.loading;
const explorerSearchMeta = useSelector(selectSearchMetaData)[tabId];

const datasourceName = explorerSearchMeta?.datasources[0]?.name;
const languageInUse = explorerSearchMeta?.lang;

return (
<EuiPage paddingSize="s">
Expand Down Expand Up @@ -81,17 +90,61 @@
) : (
<EuiFlexGroup justifyContent="center" direction="column">
<EuiFlexItem grow={false}>
<EuiCallOut
title={
<FormattedMessage
id="observability.noResults.noResultsMatchSearchCriteriaTitle"
defaultMessage="No results match your search criteria"
/>
}
color="warning"
iconType="help"
data-test-subj="observabilityNoResultsCallout"
/>
{explorerSearchMeta?.datasources[0]?.type === DATA_SOURCE_TYPES.S3Glue ? (
<EuiCallOut

Check warning on line 94 in public/components/event_analytics/explorer/no_results.tsx

View check run for this annotation

Codecov / codecov/patch

public/components/event_analytics/explorer/no_results.tsx#L94

Added line #L94 was not covered by tests
title={
<FormattedMessage
id="observability.noResults.noResultsMatchSearchCriteriaTitle"
defaultMessage="Explore S3 data source"
/>
}
color="warning"
iconType="help"
data-test-subj="observabilityNoResultsCallout"
>
{languageInUse === QUERY_LANGUAGE.SQL ? (
<EuiFlexGroup direction="column">

Check warning on line 106 in public/components/event_analytics/explorer/no_results.tsx

View check run for this annotation

Codecov / codecov/patch

public/components/event_analytics/explorer/no_results.tsx#L106

Added line #L106 was not covered by tests
<EuiFlexItem grow={false}>
<h4>Explore Databases</h4>
<EuiCodeBlock isCopyable={true} paddingSize="none" fontSize="s">
{`SHOW SCHEMAS IN ${datasourceName}`}
</EuiCodeBlock>
</EuiFlexItem>
<EuiFlexItem>
<h4>Explore Tables</h4>
<EuiCodeBlock isCopyable={true} paddingSize="none" fontSize="s">
{`SHOW TABLES EXTENDED IN ${datasourceName}.<database> LIKE '*'`}
</EuiCodeBlock>
</EuiFlexItem>
<EuiFlexItem>
<h4>Sample Query</h4>
<EuiCodeBlock isCopyable={true} paddingSize="none" fontSize="s">
{`SELECT * FROM ${datasourceName}.<database>.<table> LIMIT 10`}
</EuiCodeBlock>
</EuiFlexItem>
</EuiFlexGroup>
) : (
<>

Check warning on line 127 in public/components/event_analytics/explorer/no_results.tsx

View check run for this annotation

Codecov / codecov/patch

public/components/event_analytics/explorer/no_results.tsx#L127

Added line #L127 was not covered by tests
<h4>Sample Query</h4>
<EuiCodeBlock isCopyable={true} paddingSize="none" fontSize="s">
{`source = ${datasourceName}.<database>.<table> | head 10`}
</EuiCodeBlock>
</>
)}
</EuiCallOut>
) : (
<EuiCallOut
title={
<FormattedMessage
id="observability.noResults.noResultsMatchSearchCriteriaTitle"
defaultMessage="No results match your search criteria"
/>
}
color="warning"
iconType="help"
data-test-subj="observabilityNoResultsCallout"
/>
)}
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiSpacer size="s" />
Expand Down
Loading