diff --git a/changelogs/fragments/7891.yml b/changelogs/fragments/7891.yml new file mode 100644 index 00000000000..6300c0905a5 --- /dev/null +++ b/changelogs/fragments/7891.yml @@ -0,0 +1,2 @@ +refactor: +- [Look&Feel] Updated Discover No Results panel ([#7891](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7891)) \ No newline at end of file diff --git a/src/plugins/discover/public/application/components/no_results/no_results.tsx b/src/plugins/discover/public/application/components/no_results/no_results.tsx index 90804ba2326..2c64bd6a041 100644 --- a/src/plugins/discover/public/application/components/no_results/no_results.tsx +++ b/src/plugins/discover/public/application/components/no_results/no_results.tsx @@ -28,19 +28,11 @@ * under the License. */ -import React, { Fragment } from 'react'; -import { FormattedMessage, I18nProvider } from '@osd/i18n/react'; +import React from 'react'; +import { I18nProvider } from '@osd/i18n/react'; -import { - EuiCallOut, - EuiCode, - EuiDescriptionList, - EuiLink, - EuiPanel, - EuiSpacer, - EuiText, -} from '@elastic/eui'; -import { getServices } from '../../../opensearch_dashboards_services'; +import { EuiEmptyPrompt, EuiPanel, EuiText } from '@elastic/eui'; +import { i18n } from '@osd/i18n'; interface Props { timeFieldName?: string; @@ -48,164 +40,150 @@ interface Props { } export const DiscoverNoResults = ({ timeFieldName, queryLanguage }: Props) => { - let timeFieldMessage; - - if (timeFieldName) { - timeFieldMessage = ( - - - - -

- -

- -

- -

-
-
- ); - } - - let luceneQueryMessage; - - if (queryLanguage === 'lucene') { - const searchExamples = [ - { - description: 200, - title: ( - - - - - - ), - }, - { - description: status:200, - title: ( - - - - - - ), - }, - { - description: status:[400 TO 499], - title: ( - - - - - - ), - }, - { - description: status:[400 TO 499] AND extension:PHP, - title: ( - - - - - - ), - }, - { - description: status:[400 TO 499] AND (extension:php OR extension:html), - title: ( - - - - - - ), - }, - ]; - - luceneQueryMessage = ( - - - - -

- -

- -

- - - - ), - }} - /> -

-
- - - - - - -
- ); - } + // Commented out due to no usage in code + // See: https://github.com/opensearch-project/OpenSearch-Dashboards/issues/8149 + // + // let luceneQueryMessage; + // + // if (queryLanguage === 'lucene') { + // const searchExamples = [ + // { + // description: 200, + // title: ( + // + // + // + // + // + // ), + // }, + // { + // description: status:200, + // title: ( + // + // + // + // + // + // ), + // }, + // { + // description: status:[400 TO 499], + // title: ( + // + // + // + // + // + // ), + // }, + // { + // description: status:[400 TO 499] AND extension:PHP, + // title: ( + // + // + // + // + // + // ), + // }, + // { + // description: status:[400 TO 499] AND (extension:php OR extension:html), + // title: ( + // + // + // + // + // + // ), + // }, + // ]; + // + // luceneQueryMessage = ( + // + // + // + // + //

+ // + //

+ // + //

+ // + // + // + // ), + // }} + // /> + //

+ //
+ // + // + // + // + // + // + //
+ // ); + // } return ( - + +

+ {i18n.translate('discover.emptyPrompt.title', { + defaultMessage: 'No Results', + })} +

+
+ } + body={ + +

+ {i18n.translate('discover.emptyPrompt.body', { + defaultMessage: + 'Try selecting a different data source, expanding your time range or modifying the query & filters.', + })} +

+
} - color="warning" - iconType="help" - data-test-subj="discoverNoResults" /> - {timeFieldMessage} - {luceneQueryMessage}
);