From 48dcefad04c4e723a3f114a85c3dd355f101d84d Mon Sep 17 00:00:00 2001 From: Maggie Ghamry Date: Thu, 5 Mar 2020 17:46:06 -0500 Subject: [PATCH 01/24] Initial Commit Update to ESDocs datasource per team feedback --- .../uis/datasources/demodata.js | 2 +- .../uis/datasources/essql.js | 2 +- .../expression_types/datasources/esdocs.js | 97 +++++++++++-------- 3 files changed, 57 insertions(+), 44 deletions(-) diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/datasources/demodata.js b/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/datasources/demodata.js index 193d99e1c9533..ca44d4d0cea4a 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/datasources/demodata.js +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/datasources/demodata.js @@ -21,6 +21,6 @@ export const demodata = () => ({ name: 'demodata', displayName: strings.getDisplayName(), help: strings.getHelp(), - image: 'logoElasticStack', + image: 'visualizeApp', template: templateFromReactComponent(DemodataDatasource), }); diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/datasources/essql.js b/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/datasources/essql.js index 707f2305e1368..238c05266a943 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/datasources/essql.js +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/datasources/essql.js @@ -96,6 +96,6 @@ export const essql = () => ({ displayName: strings.getDisplayName(), help: strings.getHelp(), // Replace this with a SQL logo when we have one in EUI - image: 'logoElasticsearch', + image: 'sqlApp', template: templateFromReactComponent(EssqlDatasource), }); diff --git a/x-pack/legacy/plugins/canvas/public/expression_types/datasources/esdocs.js b/x-pack/legacy/plugins/canvas/public/expression_types/datasources/esdocs.js index eacb7e891b482..c12f121e4e5d7 100644 --- a/x-pack/legacy/plugins/canvas/public/expression_types/datasources/esdocs.js +++ b/x-pack/legacy/plugins/canvas/public/expression_types/datasources/esdocs.js @@ -6,7 +6,14 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { EuiFormRow, EuiSelect, EuiTextArea, EuiCallOut, EuiSpacer } from '@elastic/eui'; +import { + EuiFormRow, + EuiAccordion, + EuiSelect, + EuiTextArea, + EuiCallOut, + EuiSpacer, +} from '@elastic/eui'; import { getSimpleArg, setSimpleArg } from '../../lib/arg_helpers'; import { ESFieldsSelect } from '../../components/es_fields_select'; import { ESFieldSelect } from '../../components/es_field_select'; @@ -74,12 +81,6 @@ const EsdocsDatasource = ({ args, updateArgs, defaultIndex }) => { return (
- -

{strings.getWarning()}

-
- - - { setArg('index', index)} /> - - setArg(getArgName(), e.target.value)} - compressed - /> - - { /> - - setArg('sort', [field, sortOrder].join(', '))} - /> - + + setArg(getArgName(), e.target.value)} + compressed + /> + + + + setArg('sort', [field, sortOrder].join(', '))} + /> + + + + setArg('sort', [sortField, e.target.value].join(', '))} + options={sortOptions} + compressed + /> + + - - setArg('sort', [sortField, e.target.value].join(', '))} - options={sortOptions} - compressed - /> - + + + +

{strings.getWarning()}

+
); }; @@ -150,6 +163,6 @@ export const esdocs = () => ({ name: 'esdocs', displayName: strings.getDisplayName(), help: strings.getHelp(), - image: 'logoElasticsearch', + image: 'filebeatApp', template: templateFromReactComponent(EsdocsDatasource), }); From 361e8f21908bfb4219f6eaf2c83b783740362f46 Mon Sep 17 00:00:00 2001 From: Maggie Ghamry Date: Thu, 5 Mar 2020 22:07:21 -0500 Subject: [PATCH 02/24] Updates Updates per Ryan's mockups --- .../plugins/canvas/i18n/expression_types.ts | 5 +--- .../expression_types/datasources/esdocs.js | 26 +++++++++---------- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/x-pack/legacy/plugins/canvas/i18n/expression_types.ts b/x-pack/legacy/plugins/canvas/i18n/expression_types.ts index bdd190f26c97a..1326fd085cdc1 100644 --- a/x-pack/legacy/plugins/canvas/i18n/expression_types.ts +++ b/x-pack/legacy/plugins/canvas/i18n/expression_types.ts @@ -161,10 +161,7 @@ export const ExpressionDataSourceStrings = { getWarning: () => i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.warningDescription', { defaultMessage: ` - This datasource pulls directly from {elasticsearch} - without the use of aggregations. It is best used with low volume datasets and in - situations where you need to view raw documents or plot exact, non-aggregated values on a - chart.`, + This datasource does not use aggregations, and is best used with low volume datasets.`, values: { elasticsearch: ELASTICSEARCH, }, diff --git a/x-pack/legacy/plugins/canvas/public/expression_types/datasources/esdocs.js b/x-pack/legacy/plugins/canvas/public/expression_types/datasources/esdocs.js index c12f121e4e5d7..34747420b4fdf 100644 --- a/x-pack/legacy/plugins/canvas/public/expression_types/datasources/esdocs.js +++ b/x-pack/legacy/plugins/canvas/public/expression_types/datasources/esdocs.js @@ -103,21 +103,9 @@ const EsdocsDatasource = ({ args, updateArgs, defaultIndex }) => { - - setArg(getArgName(), e.target.value)} - compressed - /> - - { compressed /> + + + setArg(getArgName(), e.target.value)} + compressed + /> + From 6ea9917de01d301bf03d79271838f1642cf0512f Mon Sep 17 00:00:00 2001 From: Maggie Ghamry Date: Fri, 6 Mar 2020 16:51:45 -0500 Subject: [PATCH 03/24] Updates II Updates per Poff's review --- .../plugins/canvas/canvas_plugin_src/uis/datasources/essql.js | 1 - x-pack/legacy/plugins/canvas/i18n/expression_types.ts | 3 --- 2 files changed, 4 deletions(-) diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/datasources/essql.js b/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/datasources/essql.js index 238c05266a943..cd502175e634f 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/datasources/essql.js +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/datasources/essql.js @@ -95,7 +95,6 @@ export const essql = () => ({ name: 'essql', displayName: strings.getDisplayName(), help: strings.getHelp(), - // Replace this with a SQL logo when we have one in EUI image: 'sqlApp', template: templateFromReactComponent(EssqlDatasource), }); diff --git a/x-pack/legacy/plugins/canvas/i18n/expression_types.ts b/x-pack/legacy/plugins/canvas/i18n/expression_types.ts index 1326fd085cdc1..503c9665b105d 100644 --- a/x-pack/legacy/plugins/canvas/i18n/expression_types.ts +++ b/x-pack/legacy/plugins/canvas/i18n/expression_types.ts @@ -162,9 +162,6 @@ export const ExpressionDataSourceStrings = { i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.warningDescription', { defaultMessage: ` This datasource does not use aggregations, and is best used with low volume datasets.`, - values: { - elasticsearch: ELASTICSEARCH, - }, }), getIndexTitle: () => i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.indexTitle', { From cb85a63ed1fb05bca5b3f991d16809dc947a21b2 Mon Sep 17 00:00:00 2001 From: Maggie Ghamry Date: Fri, 6 Mar 2020 19:27:48 -0500 Subject: [PATCH 04/24] Updates III Update to some of the verbiage and card sizes - working on re-ordering and adding a link to the lucen query syntax --- x-pack/legacy/plugins/canvas/i18n/expression_types.ts | 11 ++++++----- .../plugins/canvas/i18n/functions/dict/demodata.ts | 2 +- x-pack/legacy/plugins/canvas/i18n/ui.ts | 3 +++ .../components/datasource/datasource_selector.js | 1 + 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/x-pack/legacy/plugins/canvas/i18n/expression_types.ts b/x-pack/legacy/plugins/canvas/i18n/expression_types.ts index 503c9665b105d..5c4d53b1b3cf1 100644 --- a/x-pack/legacy/plugins/canvas/i18n/expression_types.ts +++ b/x-pack/legacy/plugins/canvas/i18n/expression_types.ts @@ -145,14 +145,15 @@ export const ArgTypesStrings = { }; export const ExpressionDataSourceStrings = { + // Elasticsearch documents ESDocs: { getDisplayName: () => i18n.translate('xpack.canvas.expressionTypes.datasources.esdocsTitle', { - defaultMessage: 'Elasticsearch raw documents', + defaultMessage: 'Elasticsearch documents', }), getHelp: () => i18n.translate('xpack.canvas.expressionTypes.datasources.esdocsLabel', { - defaultMessage: 'Pull back raw documents from elasticsearch', + defaultMessage: 'Query documents from elasticsearch', }), getWarningTitle: () => i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.warningTitle', { @@ -161,7 +162,7 @@ export const ExpressionDataSourceStrings = { getWarning: () => i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.warningDescription', { defaultMessage: ` - This datasource does not use aggregations, and is best used with low volume datasets.`, + The Elasticsearch basic data source only retrieves non-aggregated data. Use with low volume data sets`, }), getIndexTitle: () => i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.indexTitle', { @@ -177,7 +178,7 @@ export const ExpressionDataSourceStrings = { }), getQueryLabel: () => i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.queryLabel', { - defaultMessage: '{lucene} query string syntax', + defaultMessage: 'Lucene query string syntax', values: { lucene: LUCENE, }, @@ -204,7 +205,7 @@ export const ExpressionDataSourceStrings = { }), getFieldsLabel: () => i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.fieldsLabel', { - defaultMessage: 'The fields to extract. Kibana scripted fields are not currently available', + defaultMessage: 'Scripted fields are unavailable', }), getFieldsWarningLabel: () => i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.fieldsWarningLabel', { diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/demodata.ts b/x-pack/legacy/plugins/canvas/i18n/functions/dict/demodata.ts index 20c7a88ea4f4d..caedbfdec5be4 100644 --- a/x-pack/legacy/plugins/canvas/i18n/functions/dict/demodata.ts +++ b/x-pack/legacy/plugins/canvas/i18n/functions/dict/demodata.ts @@ -13,7 +13,7 @@ import { DemoRows } from '../../../canvas_plugin_src/functions/server/demodata/g export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.demodataHelpText', { defaultMessage: - 'A mock data set that includes project {ci} times with usernames, countries, and run phases.', + 'A sample data set that includes project {ci} times with usernames, countries, and run phases.', values: { ci: 'CI', }, diff --git a/x-pack/legacy/plugins/canvas/i18n/ui.ts b/x-pack/legacy/plugins/canvas/i18n/ui.ts index 5b94cb0435b31..0525075604b03 100644 --- a/x-pack/legacy/plugins/canvas/i18n/ui.ts +++ b/x-pack/legacy/plugins/canvas/i18n/ui.ts @@ -308,6 +308,7 @@ export const ArgumentStrings = { }; export const DataSourceStrings = { + // Demo data source DemoData: { getDisplayName: () => i18n.translate('xpack.canvas.uis.dataSources.demoDataTitle', { @@ -330,6 +331,7 @@ export const DataSourceStrings = { }, }), }, + // Elasticsearch SQL data source Essql: { getDisplayName: () => i18n.translate('xpack.canvas.uis.dataSources.essqlTitle', { @@ -360,6 +362,7 @@ export const DataSourceStrings = { }, }), }, + // Timelion datasource Timelion: { getAbout: () => i18n.translate('xpack.canvas.uis.dataSources.timelion.aboutDetail', { diff --git a/x-pack/legacy/plugins/canvas/public/components/datasource/datasource_selector.js b/x-pack/legacy/plugins/canvas/public/components/datasource/datasource_selector.js index 92f9b92cb1f06..153a8a7ef75e6 100644 --- a/x-pack/legacy/plugins/canvas/public/components/datasource/datasource_selector.js +++ b/x-pack/legacy/plugins/canvas/public/components/datasource/datasource_selector.js @@ -15,6 +15,7 @@ export const DatasourceSelector = ({ onSelect, datasources, current }) => ( key={d.name} title={d.displayName} titleElement="h5" + titleSize="xs" icon={} description={d.help} layout="horizontal" From ef3032e0afe4bb81bdaf5be709ce1668ef94f46f Mon Sep 17 00:00:00 2001 From: Ryan Keairns Date: Mon, 9 Mar 2020 08:56:25 -0500 Subject: [PATCH 05/24] design tweaks --- .../uis/datasources/demodata.js | 2 +- .../uis/datasources/essql.js | 2 +- .../uis/datasources/timelion.js | 2 +- .../plugins/canvas/i18n/expression_types.ts | 4 +-- .../components/datasource/datasource.scss | 13 +++++----- .../datasource/datasource_component.js | 26 +++++++++---------- .../expression_types/datasources/esdocs.js | 20 +++++--------- 7 files changed, 32 insertions(+), 37 deletions(-) diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/datasources/demodata.js b/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/datasources/demodata.js index ca44d4d0cea4a..faadfd4bb26d7 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/datasources/demodata.js +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/datasources/demodata.js @@ -21,6 +21,6 @@ export const demodata = () => ({ name: 'demodata', displayName: strings.getDisplayName(), help: strings.getHelp(), - image: 'visualizeApp', + image: 'training', template: templateFromReactComponent(DemodataDatasource), }); diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/datasources/essql.js b/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/datasources/essql.js index cd502175e634f..44e335dd7b41f 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/datasources/essql.js +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/datasources/essql.js @@ -95,6 +95,6 @@ export const essql = () => ({ name: 'essql', displayName: strings.getDisplayName(), help: strings.getHelp(), - image: 'sqlApp', + image: 'database', template: templateFromReactComponent(EssqlDatasource), }); diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/datasources/timelion.js b/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/datasources/timelion.js index b30e43c1c3c57..8d30bc035d5a3 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/datasources/timelion.js +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/datasources/timelion.js @@ -124,6 +124,6 @@ export const timelion = () => ({ name: 'timelion', displayName: TIMELION, help: strings.getHelp(), - image: 'timelionApp', + image: 'visTimelion', template: templateFromReactComponent(TimelionDatasource), }); diff --git a/x-pack/legacy/plugins/canvas/i18n/expression_types.ts b/x-pack/legacy/plugins/canvas/i18n/expression_types.ts index 5c4d53b1b3cf1..38e4ef7422d1e 100644 --- a/x-pack/legacy/plugins/canvas/i18n/expression_types.ts +++ b/x-pack/legacy/plugins/canvas/i18n/expression_types.ts @@ -185,7 +185,7 @@ export const ExpressionDataSourceStrings = { }), getSortFieldTitle: () => i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.sortFieldTitle', { - defaultMessage: 'Sort Field', + defaultMessage: 'Sort field', }), getSortFieldLabel: () => i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.sortFieldLabel', { @@ -193,7 +193,7 @@ export const ExpressionDataSourceStrings = { }), getSortOrderTitle: () => i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.sortOrderTitle', { - defaultMessage: 'Sort Order', + defaultMessage: 'Sort order', }), getSortOrderLabel: () => i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.sortOrderLabel', { diff --git a/x-pack/legacy/plugins/canvas/public/components/datasource/datasource.scss b/x-pack/legacy/plugins/canvas/public/components/datasource/datasource.scss index 2407dcbbce593..52c473ac2dd38 100644 --- a/x-pack/legacy/plugins/canvas/public/components/datasource/datasource.scss +++ b/x-pack/legacy/plugins/canvas/public/components/datasource/datasource.scss @@ -6,8 +6,13 @@ padding: 0 $euiSizeS; } -.canvasDataSource__section { - padding: $euiSizeM; +.canvasDataSource__section, +.canvasDataSource__list { + padding: $euiSizeM $euiSizeM 0; +} + +.canvasDataSource__sectionFooter { + padding: 0 $euiSizeM; } .canvasDataSource__triggerButton { @@ -19,10 +24,6 @@ margin-right: $euiSizeS; } -.canvasDataSource__list { - padding: $euiSizeM; -} - .canvasDataSource__card .euiCard__content { padding-top: 0 !important; // sass-lint:disable-line no-important } diff --git a/x-pack/legacy/plugins/canvas/public/components/datasource/datasource_component.js b/x-pack/legacy/plugins/canvas/public/components/datasource/datasource_component.js index 8b0061e047f33..4c3bfc9949675 100644 --- a/x-pack/legacy/plugins/canvas/public/components/datasource/datasource_component.js +++ b/x-pack/legacy/plugins/canvas/public/components/datasource/datasource_component.js @@ -164,20 +164,20 @@ export class DatasourceComponent extends PureComponent { ) : ( datasourceRender )} - - - - setPreviewing(true)}> - {strings.getPreviewButtonLabel()} - - - - - {strings.getSaveButtonLabel()} - - - + + + + setPreviewing(true)}> + {strings.getPreviewButtonLabel()} + + + + + {strings.getSaveButtonLabel()} + + + {datasourcePreview} diff --git a/x-pack/legacy/plugins/canvas/public/expression_types/datasources/esdocs.js b/x-pack/legacy/plugins/canvas/public/expression_types/datasources/esdocs.js index 34747420b4fdf..23728b6f85638 100644 --- a/x-pack/legacy/plugins/canvas/public/expression_types/datasources/esdocs.js +++ b/x-pack/legacy/plugins/canvas/public/expression_types/datasources/esdocs.js @@ -101,16 +101,14 @@ const EsdocsDatasource = ({ args, updateArgs, defaultIndex }) => { /> + - + + { /> - + setArg('sort', [sortField, e.target.value].join(', '))} @@ -163,6 +157,6 @@ export const esdocs = () => ({ name: 'esdocs', displayName: strings.getDisplayName(), help: strings.getHelp(), - image: 'filebeatApp', + image: 'documents', template: templateFromReactComponent(EsdocsDatasource), }); From c1b48843bfe967e2140a3f3890af6231c4e22cce Mon Sep 17 00:00:00 2001 From: Maggie Ghamry Date: Mon, 9 Mar 2020 13:27:13 -0400 Subject: [PATCH 06/24] Adding lucene hyperlink update to add hyperlink help for Lucene query syntax --- x-pack/legacy/plugins/canvas/i18n/constants.ts | 1 + .../legacy/plugins/canvas/i18n/expression_types.ts | 2 +- .../public/expression_types/datasources/esdocs.js | 12 ++++++++++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/x-pack/legacy/plugins/canvas/i18n/constants.ts b/x-pack/legacy/plugins/canvas/i18n/constants.ts index 4cb05b0426fa1..597373d950f93 100644 --- a/x-pack/legacy/plugins/canvas/i18n/constants.ts +++ b/x-pack/legacy/plugins/canvas/i18n/constants.ts @@ -25,6 +25,7 @@ export const JS = 'JavaScript'; export const JSON = 'JSON'; export const KIBANA = 'Kibana'; export const LUCENE = 'Lucene'; +export const LUCENE_QUERY_URL = 'https://www.elastic.co/guide/en/kibana/current/lucene-query.html'; export const MARKDOWN = 'Markdown'; export const MOMENTJS = 'MomentJS'; export const MOMENTJS_TIMEZONE_URL = 'https://momentjs.com/timezone/'; diff --git a/x-pack/legacy/plugins/canvas/i18n/expression_types.ts b/x-pack/legacy/plugins/canvas/i18n/expression_types.ts index 38e4ef7422d1e..e89596183ae04 100644 --- a/x-pack/legacy/plugins/canvas/i18n/expression_types.ts +++ b/x-pack/legacy/plugins/canvas/i18n/expression_types.ts @@ -145,7 +145,7 @@ export const ArgTypesStrings = { }; export const ExpressionDataSourceStrings = { - // Elasticsearch documents + // Elasticsearch documents datasource/Elasticsearch basic datasource ESDocs: { getDisplayName: () => i18n.translate('xpack.canvas.expressionTypes.datasources.esdocsTitle', { diff --git a/x-pack/legacy/plugins/canvas/public/expression_types/datasources/esdocs.js b/x-pack/legacy/plugins/canvas/public/expression_types/datasources/esdocs.js index 23728b6f85638..59d37d3a0e673 100644 --- a/x-pack/legacy/plugins/canvas/public/expression_types/datasources/esdocs.js +++ b/x-pack/legacy/plugins/canvas/public/expression_types/datasources/esdocs.js @@ -13,13 +13,15 @@ import { EuiTextArea, EuiCallOut, EuiSpacer, + EuiLink, + EuiText, } from '@elastic/eui'; import { getSimpleArg, setSimpleArg } from '../../lib/arg_helpers'; import { ESFieldsSelect } from '../../components/es_fields_select'; import { ESFieldSelect } from '../../components/es_field_select'; import { ESIndexSelect } from '../../components/es_index_select'; import { templateFromReactComponent } from '../../lib/template_from_react_component'; -import { ExpressionDataSourceStrings } from '../../../i18n'; +import { ExpressionDataSourceStrings, LUCENE_QUERY_URL } from '../../../i18n'; const { ESDocs: strings } = ExpressionDataSourceStrings; @@ -127,7 +129,13 @@ const EsdocsDatasource = ({ args, updateArgs, defaultIndex }) => { + + {strings.getQueryLabel()} + + + } display="rowCompressed" > Date: Mon, 9 Mar 2020 15:17:46 -0400 Subject: [PATCH 07/24] Consollidating datasources to sort Consolidating the ESDocs datasource with the rest, so that we can order them --- .../plugins/canvas/i18n/expression_types.ts | 79 ----------------- x-pack/legacy/plugins/canvas/i18n/ui.ts | 86 +++++++++++++++++-- .../expression_types/datasources/esdocs.js | 4 +- 3 files changed, 82 insertions(+), 87 deletions(-) diff --git a/x-pack/legacy/plugins/canvas/i18n/expression_types.ts b/x-pack/legacy/plugins/canvas/i18n/expression_types.ts index e89596183ae04..5d3a3cd742bb4 100644 --- a/x-pack/legacy/plugins/canvas/i18n/expression_types.ts +++ b/x-pack/legacy/plugins/canvas/i18n/expression_types.ts @@ -5,7 +5,6 @@ */ import { i18n } from '@kbn/i18n'; -import { LUCENE, ELASTICSEARCH } from './constants'; export const ArgTypesStrings = { Color: { @@ -143,81 +142,3 @@ export const ArgTypesStrings = { }), }, }; - -export const ExpressionDataSourceStrings = { - // Elasticsearch documents datasource/Elasticsearch basic datasource - ESDocs: { - getDisplayName: () => - i18n.translate('xpack.canvas.expressionTypes.datasources.esdocsTitle', { - defaultMessage: 'Elasticsearch documents', - }), - getHelp: () => - i18n.translate('xpack.canvas.expressionTypes.datasources.esdocsLabel', { - defaultMessage: 'Query documents from elasticsearch', - }), - getWarningTitle: () => - i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.warningTitle', { - defaultMessage: 'Query with caution', - }), - getWarning: () => - i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.warningDescription', { - defaultMessage: ` - The Elasticsearch basic data source only retrieves non-aggregated data. Use with low volume data sets`, - }), - getIndexTitle: () => - i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.indexTitle', { - defaultMessage: 'Index', - }), - getIndexLabel: () => - i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.indexLabel', { - defaultMessage: 'Enter an index name or select an index pattern', - }), - getQueryTitle: () => - i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.queryTitle', { - defaultMessage: 'Query', - }), - getQueryLabel: () => - i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.queryLabel', { - defaultMessage: 'Lucene query string syntax', - values: { - lucene: LUCENE, - }, - }), - getSortFieldTitle: () => - i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.sortFieldTitle', { - defaultMessage: 'Sort field', - }), - getSortFieldLabel: () => - i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.sortFieldLabel', { - defaultMessage: 'Document sort field', - }), - getSortOrderTitle: () => - i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.sortOrderTitle', { - defaultMessage: 'Sort order', - }), - getSortOrderLabel: () => - i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.sortOrderLabel', { - defaultMessage: 'Document sort order', - }), - getFieldsTitle: () => - i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.fieldsTitle', { - defaultMessage: 'Fields', - }), - getFieldsLabel: () => - i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.fieldsLabel', { - defaultMessage: 'Scripted fields are unavailable', - }), - getFieldsWarningLabel: () => - i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.fieldsWarningLabel', { - defaultMessage: 'This datasource performs best with 10 or fewer fields', - }), - getAscendingOption: () => - i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.ascendingDropDown', { - defaultMessage: 'Ascending', - }), - getDescendingOption: () => - i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.descendingDropDown', { - defaultMessage: 'Descending', - }), - }, -}; diff --git a/x-pack/legacy/plugins/canvas/i18n/ui.ts b/x-pack/legacy/plugins/canvas/i18n/ui.ts index 0525075604b03..d8e0d4d162cea 100644 --- a/x-pack/legacy/plugins/canvas/i18n/ui.ts +++ b/x-pack/legacy/plugins/canvas/i18n/ui.ts @@ -320,7 +320,7 @@ export const DataSourceStrings = { }), getHelp: () => i18n.translate('xpack.canvas.uis.dataSources.demoDataLabel', { - defaultMessage: 'Mock data set with usernames, prices, projects, countries, and phases', + defaultMessage: 'Sample data set used to populate default elements', }), getDescription: () => i18n.translate('xpack.canvas.uis.dataSources.demoDataDescription', { @@ -331,6 +331,81 @@ export const DataSourceStrings = { }, }), }, + // Elasticsearch documents datasource + ESDocs: { + getDisplayName: () => + i18n.translate('xpack.canvas.expressionTypes.datasources.esdocsTitle', { + defaultMessage: 'Elasticsearch documents', + }), + getHelp: () => + i18n.translate('xpack.canvas.expressionTypes.datasources.esdocsLabel', { + defaultMessage: 'Select an index and field(s) to retrieve non-aggregated data', + }), + getWarningTitle: () => + i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.warningTitle', { + defaultMessage: 'Query with caution', + }), + getWarning: () => + i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.warningDescription', { + defaultMessage: ` + The Elasticsearch basic data source only retrieves non-aggregated data. Use with low volume data sets`, + }), + getIndexTitle: () => + i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.indexTitle', { + defaultMessage: 'Index', + }), + getIndexLabel: () => + i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.indexLabel', { + defaultMessage: 'Enter an index name or select an index pattern', + }), + getQueryTitle: () => + i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.queryTitle', { + defaultMessage: 'Query', + }), + getQueryLabel: () => + i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.queryLabel', { + defaultMessage: 'Lucene query string syntax', + values: { + lucene: LUCENE, + }, + }), + getSortFieldTitle: () => + i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.sortFieldTitle', { + defaultMessage: 'Sort field', + }), + getSortFieldLabel: () => + i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.sortFieldLabel', { + defaultMessage: 'Document sort field', + }), + getSortOrderTitle: () => + i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.sortOrderTitle', { + defaultMessage: 'Sort order', + }), + getSortOrderLabel: () => + i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.sortOrderLabel', { + defaultMessage: 'Document sort order', + }), + getFieldsTitle: () => + i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.fieldsTitle', { + defaultMessage: 'Fields', + }), + getFieldsLabel: () => + i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.fieldsLabel', { + defaultMessage: 'Scripted fields are unavailable', + }), + getFieldsWarningLabel: () => + i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.fieldsWarningLabel', { + defaultMessage: 'This datasource performs best with 10 or fewer fields', + }), + getAscendingOption: () => + i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.ascendingDropDown', { + defaultMessage: 'Ascending', + }), + getDescendingOption: () => + i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.descendingDropDown', { + defaultMessage: 'Descending', + }), + }, // Elasticsearch SQL data source Essql: { getDisplayName: () => @@ -343,7 +418,7 @@ export const DataSourceStrings = { }), getHelp: () => i18n.translate('xpack.canvas.uis.dataSources.essqlLabel', { - defaultMessage: 'Use {elasticsearch} {sql} to get a data table', + defaultMessage: 'Write an Elasticsearch SQL query to retrieve data', values: { elasticsearch: ELASTICSEARCH, sql: SQL, @@ -355,7 +430,7 @@ export const DataSourceStrings = { }), getLabelAppend: () => i18n.translate('xpack.canvas.uis.dataSources.essql.queryTitleAppend', { - defaultMessage: 'Learn {elasticsearchShort} {sql} syntax', + defaultMessage: 'Learn Elasticsearch SQL query syntax', values: { elasticsearchShort: ELASTICSEARCH_SHORT, sql: SQL, @@ -366,8 +441,7 @@ export const DataSourceStrings = { Timelion: { getAbout: () => i18n.translate('xpack.canvas.uis.dataSources.timelion.aboutDetail', { - defaultMessage: - 'Use {timelion} queries to pull back timeseries data that can be used with {canvas} elements.', + defaultMessage: 'Use Timelion syntax to retrieve timeseries data', values: { timelion: TIMELION, canvas: CANVAS, @@ -375,7 +449,7 @@ export const DataSourceStrings = { }), getHelp: () => i18n.translate('xpack.canvas.uis.dataSources.timelionLabel', { - defaultMessage: 'Use {timelion} syntax to retrieve a timeseries', + defaultMessage: 'Use Timelion syntax to retrieve timeseries data', values: { timelion: TIMELION, }, diff --git a/x-pack/legacy/plugins/canvas/public/expression_types/datasources/esdocs.js b/x-pack/legacy/plugins/canvas/public/expression_types/datasources/esdocs.js index 59d37d3a0e673..21963da15338d 100644 --- a/x-pack/legacy/plugins/canvas/public/expression_types/datasources/esdocs.js +++ b/x-pack/legacy/plugins/canvas/public/expression_types/datasources/esdocs.js @@ -21,9 +21,9 @@ import { ESFieldsSelect } from '../../components/es_fields_select'; import { ESFieldSelect } from '../../components/es_field_select'; import { ESIndexSelect } from '../../components/es_index_select'; import { templateFromReactComponent } from '../../lib/template_from_react_component'; -import { ExpressionDataSourceStrings, LUCENE_QUERY_URL } from '../../../i18n'; +import { DataSourceStrings, LUCENE_QUERY_URL } from '../../../i18n'; -const { ESDocs: strings } = ExpressionDataSourceStrings; +const { ESDocs: strings } = DataSourceStrings; const EsdocsDatasource = ({ args, updateArgs, defaultIndex }) => { const setArg = (name, value) => { From f4d00744118604aaa50620f3d5dae941e87b2653 Mon Sep 17 00:00:00 2001 From: Maggie Ghamry Date: Mon, 9 Mar 2020 17:53:51 -0400 Subject: [PATCH 08/24] updates for i18n updates for i18n --- x-pack/legacy/plugins/canvas/i18n/ui.ts | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/x-pack/legacy/plugins/canvas/i18n/ui.ts b/x-pack/legacy/plugins/canvas/i18n/ui.ts index d8e0d4d162cea..62ce13c8bc75f 100644 --- a/x-pack/legacy/plugins/canvas/i18n/ui.ts +++ b/x-pack/legacy/plugins/canvas/i18n/ui.ts @@ -335,7 +335,10 @@ export const DataSourceStrings = { ESDocs: { getDisplayName: () => i18n.translate('xpack.canvas.expressionTypes.datasources.esdocsTitle', { - defaultMessage: 'Elasticsearch documents', + defaultMessage: '{elasticsearch} documents', + values: { + elasticsearch: ELASTICSEARCH, + }, }), getHelp: () => i18n.translate('xpack.canvas.expressionTypes.datasources.esdocsLabel', { @@ -348,7 +351,10 @@ export const DataSourceStrings = { getWarning: () => i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.warningDescription', { defaultMessage: ` - The Elasticsearch basic data source only retrieves non-aggregated data. Use with low volume data sets`, + The {elasticsearch} basic data source only retrieves non-aggregated data. Use with low volume data sets`, + values: { + elasticsearch: ELASTICSEARCH, + }, }), getIndexTitle: () => i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.indexTitle', { @@ -364,7 +370,7 @@ export const DataSourceStrings = { }), getQueryLabel: () => i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.queryLabel', { - defaultMessage: 'Lucene query string syntax', + defaultMessage: '{lucene} query string syntax', values: { lucene: LUCENE, }, @@ -418,7 +424,7 @@ export const DataSourceStrings = { }), getHelp: () => i18n.translate('xpack.canvas.uis.dataSources.essqlLabel', { - defaultMessage: 'Write an Elasticsearch SQL query to retrieve data', + defaultMessage: 'Write an {elasticsearch} {sql} query to retrieve data', values: { elasticsearch: ELASTICSEARCH, sql: SQL, @@ -430,7 +436,7 @@ export const DataSourceStrings = { }), getLabelAppend: () => i18n.translate('xpack.canvas.uis.dataSources.essql.queryTitleAppend', { - defaultMessage: 'Learn Elasticsearch SQL query syntax', + defaultMessage: 'Learn {elasticsearch} {sql} query syntax', values: { elasticsearchShort: ELASTICSEARCH_SHORT, sql: SQL, @@ -441,7 +447,7 @@ export const DataSourceStrings = { Timelion: { getAbout: () => i18n.translate('xpack.canvas.uis.dataSources.timelion.aboutDetail', { - defaultMessage: 'Use Timelion syntax to retrieve timeseries data', + defaultMessage: 'Use {timelion} syntax in {canvas} to retrieve timeseries data', values: { timelion: TIMELION, canvas: CANVAS, @@ -449,7 +455,7 @@ export const DataSourceStrings = { }), getHelp: () => i18n.translate('xpack.canvas.uis.dataSources.timelionLabel', { - defaultMessage: 'Use Timelion syntax to retrieve timeseries data', + defaultMessage: 'Use {timelion} syntax to retrieve timeseries data', values: { timelion: TIMELION, }, From fd77af2138e762570415917598868896f6dc10c2 Mon Sep 17 00:00:00 2001 From: Maggie Ghamry Date: Tue, 17 Mar 2020 14:22:53 -0400 Subject: [PATCH 09/24] Updates Updates from Gail for verbiage and integrating Ryan's change for style --- x-pack/legacy/plugins/canvas/i18n/ui.ts | 4 +-- .../datasource/datasource_component.js | 26 +++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/x-pack/legacy/plugins/canvas/i18n/ui.ts b/x-pack/legacy/plugins/canvas/i18n/ui.ts index 62ce13c8bc75f..b2ace4122116c 100644 --- a/x-pack/legacy/plugins/canvas/i18n/ui.ts +++ b/x-pack/legacy/plugins/canvas/i18n/ui.ts @@ -342,7 +342,7 @@ export const DataSourceStrings = { }), getHelp: () => i18n.translate('xpack.canvas.expressionTypes.datasources.esdocsLabel', { - defaultMessage: 'Select an index and field(s) to retrieve non-aggregated data', + defaultMessage: 'Pull data directly from Elasticsearch without the use of aggregations', }), getWarningTitle: () => i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.warningTitle', { @@ -351,7 +351,7 @@ export const DataSourceStrings = { getWarning: () => i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.warningDescription', { defaultMessage: ` - The {elasticsearch} basic data source only retrieves non-aggregated data. Use with low volume data sets`, + Using this data source with larger data sets can result in slower performance. Use this source only when you need exact values.`, values: { elasticsearch: ELASTICSEARCH, }, diff --git a/x-pack/legacy/plugins/canvas/public/components/datasource/datasource_component.js b/x-pack/legacy/plugins/canvas/public/components/datasource/datasource_component.js index 4c3bfc9949675..8b0061e047f33 100644 --- a/x-pack/legacy/plugins/canvas/public/components/datasource/datasource_component.js +++ b/x-pack/legacy/plugins/canvas/public/components/datasource/datasource_component.js @@ -164,20 +164,20 @@ export class DatasourceComponent extends PureComponent { ) : ( datasourceRender )} + + + + setPreviewing(true)}> + {strings.getPreviewButtonLabel()} + + + + + {strings.getSaveButtonLabel()} + + + - - - - setPreviewing(true)}> - {strings.getPreviewButtonLabel()} - - - - - {strings.getSaveButtonLabel()} - - - {datasourcePreview} From b88fd32bd442487cf9d5be35d1d444d2a938b0c1 Mon Sep 17 00:00:00 2001 From: Maggie Ghamry Date: Tue, 17 Mar 2020 16:20:29 -0400 Subject: [PATCH 10/24] Update ui.ts Updates for i18n --- x-pack/legacy/plugins/canvas/i18n/ui.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/x-pack/legacy/plugins/canvas/i18n/ui.ts b/x-pack/legacy/plugins/canvas/i18n/ui.ts index b2ace4122116c..60b069e8b6f7a 100644 --- a/x-pack/legacy/plugins/canvas/i18n/ui.ts +++ b/x-pack/legacy/plugins/canvas/i18n/ui.ts @@ -342,7 +342,10 @@ export const DataSourceStrings = { }), getHelp: () => i18n.translate('xpack.canvas.expressionTypes.datasources.esdocsLabel', { - defaultMessage: 'Pull data directly from Elasticsearch without the use of aggregations', + defaultMessage: 'Pull data directly from {elasticsearch} without the use of aggregations', + values: { + elasticsearch: ELASTICSEARCH, + }, }), getWarningTitle: () => i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.warningTitle', { @@ -352,9 +355,6 @@ export const DataSourceStrings = { i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.warningDescription', { defaultMessage: ` Using this data source with larger data sets can result in slower performance. Use this source only when you need exact values.`, - values: { - elasticsearch: ELASTICSEARCH, - }, }), getIndexTitle: () => i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.indexTitle', { From 6a37a625968752d2b603a7531e93057782835059 Mon Sep 17 00:00:00 2001 From: Maggie Ghamry Date: Tue, 17 Mar 2020 19:43:12 -0400 Subject: [PATCH 11/24] Updates for datasource order moving the esdocs datasource to live with the rest of the UI datasources, and sorting them accordingly. --- .../uis}/datasources/esdocs.js | 10 +++++----- .../uis/datasources/index.js | 5 +++-- .../datasource/datasource_component.js | 2 +- .../datasource/datasource_selector.js | 20 ++++++++++++++++++- .../expression_types/datasources/index.js | 9 --------- .../public/lib/load_expression_types.js | 4 +--- 6 files changed, 29 insertions(+), 21 deletions(-) rename x-pack/legacy/plugins/canvas/{public/expression_types => canvas_plugin_src/uis}/datasources/esdocs.js (91%) delete mode 100644 x-pack/legacy/plugins/canvas/public/expression_types/datasources/index.js diff --git a/x-pack/legacy/plugins/canvas/public/expression_types/datasources/esdocs.js b/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/datasources/esdocs.js similarity index 91% rename from x-pack/legacy/plugins/canvas/public/expression_types/datasources/esdocs.js rename to x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/datasources/esdocs.js index 21963da15338d..282ec17e94c9b 100644 --- a/x-pack/legacy/plugins/canvas/public/expression_types/datasources/esdocs.js +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/datasources/esdocs.js @@ -16,11 +16,11 @@ import { EuiLink, EuiText, } from '@elastic/eui'; -import { getSimpleArg, setSimpleArg } from '../../lib/arg_helpers'; -import { ESFieldsSelect } from '../../components/es_fields_select'; -import { ESFieldSelect } from '../../components/es_field_select'; -import { ESIndexSelect } from '../../components/es_index_select'; -import { templateFromReactComponent } from '../../lib/template_from_react_component'; +import { getSimpleArg, setSimpleArg } from '../../../public/lib/arg_helpers'; +import { ESFieldsSelect } from '../../../public/components/es_fields_select'; +import { ESFieldSelect } from '../../../public/components/es_field_select'; +import { ESIndexSelect } from '../../../public/components/es_index_select'; +import { templateFromReactComponent } from '../../../public/lib/template_from_react_component'; import { DataSourceStrings, LUCENE_QUERY_URL } from '../../../i18n'; const { ESDocs: strings } = DataSourceStrings; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/datasources/index.js b/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/datasources/index.js index 13aa2a06306a0..5bddf1d3f4b6b 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/datasources/index.js +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/datasources/index.js @@ -4,8 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ -import { demodata } from './demodata'; import { essql } from './essql'; +import { esdocs } from './esdocs'; +import { demodata } from './demodata'; import { timelion } from './timelion'; -export const datasourceSpecs = [demodata, essql, timelion]; +export const datasourceSpecs = [essql, esdocs, demodata, timelion]; diff --git a/x-pack/legacy/plugins/canvas/public/components/datasource/datasource_component.js b/x-pack/legacy/plugins/canvas/public/components/datasource/datasource_component.js index 8b0061e047f33..78e8717d8521c 100644 --- a/x-pack/legacy/plugins/canvas/public/components/datasource/datasource_component.js +++ b/x-pack/legacy/plugins/canvas/public/components/datasource/datasource_component.js @@ -114,7 +114,7 @@ export class DatasourceComponent extends PureComponent { } = this.props; const { defaultIndex } = this.state; - + console.log({ datasources }); if (selecting) { return ( + } + title={`Elastic ${item}`} + isDisabled={item === 'Kibana' ? true : false} + description="Example of a card's description. Stick to one or two sentences." + onClick={() => window.alert('Card clicked')} + /> + + ); +}); + +export default () => {cardNodes}; export const DatasourceSelector = ({ onSelect, datasources, current }) => (
diff --git a/x-pack/legacy/plugins/canvas/public/expression_types/datasources/index.js b/x-pack/legacy/plugins/canvas/public/expression_types/datasources/index.js deleted file mode 100644 index 91dca7d275f8b..0000000000000 --- a/x-pack/legacy/plugins/canvas/public/expression_types/datasources/index.js +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -import { esdocs } from './esdocs'; - -export const datasourceSpecs = [esdocs]; diff --git a/x-pack/legacy/plugins/canvas/public/lib/load_expression_types.js b/x-pack/legacy/plugins/canvas/public/lib/load_expression_types.js index fb23f9459d30b..82699eb5b88fa 100644 --- a/x-pack/legacy/plugins/canvas/public/lib/load_expression_types.js +++ b/x-pack/legacy/plugins/canvas/public/lib/load_expression_types.js @@ -5,11 +5,9 @@ */ import { argTypeSpecs } from '../expression_types/arg_types'; -import { datasourceSpecs } from '../expression_types/datasources'; -import { argTypeRegistry, datasourceRegistry } from '../expression_types'; +import { argTypeRegistry } from '../expression_types'; export function loadExpressionTypes() { // register default args, arg types, and expression types argTypeSpecs.forEach(expFn => argTypeRegistry.register(expFn)); - datasourceSpecs.forEach(expFn => datasourceRegistry.register(expFn)); } From a55d3d8a405bb5c65c0a90f4ecfabe0cd6e45bd8 Mon Sep 17 00:00:00 2001 From: Maggie Ghamry Date: Tue, 17 Mar 2020 19:43:49 -0400 Subject: [PATCH 12/24] Update datasource_component.js removing console log, whoops --- .../canvas/public/components/datasource/datasource_component.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/legacy/plugins/canvas/public/components/datasource/datasource_component.js b/x-pack/legacy/plugins/canvas/public/components/datasource/datasource_component.js index 78e8717d8521c..8b0061e047f33 100644 --- a/x-pack/legacy/plugins/canvas/public/components/datasource/datasource_component.js +++ b/x-pack/legacy/plugins/canvas/public/components/datasource/datasource_component.js @@ -114,7 +114,7 @@ export class DatasourceComponent extends PureComponent { } = this.props; const { defaultIndex } = this.state; - console.log({ datasources }); + if (selecting) { return ( Date: Wed, 18 Mar 2020 09:28:22 -0400 Subject: [PATCH 13/24] Update ui.ts Update to fix i18n essql issue --- x-pack/legacy/plugins/canvas/i18n/ui.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/legacy/plugins/canvas/i18n/ui.ts b/x-pack/legacy/plugins/canvas/i18n/ui.ts index 60b069e8b6f7a..c1669975e0fe6 100644 --- a/x-pack/legacy/plugins/canvas/i18n/ui.ts +++ b/x-pack/legacy/plugins/canvas/i18n/ui.ts @@ -436,7 +436,7 @@ export const DataSourceStrings = { }), getLabelAppend: () => i18n.translate('xpack.canvas.uis.dataSources.essql.queryTitleAppend', { - defaultMessage: 'Learn {elasticsearch} {sql} query syntax', + defaultMessage: 'Learn {elasticsearchShort} {sql} query syntax', values: { elasticsearchShort: ELASTICSEARCH_SHORT, sql: SQL, From cd7e713f89da4af3a84ba154cc83e27780da6bb3 Mon Sep 17 00:00:00 2001 From: Maggie Ghamry Date: Wed, 18 Mar 2020 12:23:49 -0400 Subject: [PATCH 14/24] Update ui.ts Updates to fix i18n references for the esdocs datasource move --- x-pack/legacy/plugins/canvas/i18n/ui.ts | 34 ++++++++++++------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/x-pack/legacy/plugins/canvas/i18n/ui.ts b/x-pack/legacy/plugins/canvas/i18n/ui.ts index c1669975e0fe6..ce883d018c95c 100644 --- a/x-pack/legacy/plugins/canvas/i18n/ui.ts +++ b/x-pack/legacy/plugins/canvas/i18n/ui.ts @@ -334,81 +334,81 @@ export const DataSourceStrings = { // Elasticsearch documents datasource ESDocs: { getDisplayName: () => - i18n.translate('xpack.canvas.expressionTypes.datasources.esdocsTitle', { + i18n.translate('xpack.canvas.uis.dataSources.esdocsTitle', { defaultMessage: '{elasticsearch} documents', values: { elasticsearch: ELASTICSEARCH, }, }), getHelp: () => - i18n.translate('xpack.canvas.expressionTypes.datasources.esdocsLabel', { + i18n.translate('xpack.canvas.uis.dataSources.esdocsLabel', { defaultMessage: 'Pull data directly from {elasticsearch} without the use of aggregations', values: { elasticsearch: ELASTICSEARCH, }, }), getWarningTitle: () => - i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.warningTitle', { + i18n.translate('xpack.canvas.uis.dataSources.esdocs.warningTitle', { defaultMessage: 'Query with caution', }), getWarning: () => - i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.warningDescription', { + i18n.translate('xpack.canvas.uis.dataSources.esdocs.warningDescription', { defaultMessage: ` Using this data source with larger data sets can result in slower performance. Use this source only when you need exact values.`, }), getIndexTitle: () => - i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.indexTitle', { + i18n.translate('xpack.canvas.uis.dataSources.esdocs.indexTitle', { defaultMessage: 'Index', }), getIndexLabel: () => - i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.indexLabel', { + i18n.translate('xpack.canvas.uis.dataSources.esdocs.indexLabel', { defaultMessage: 'Enter an index name or select an index pattern', }), getQueryTitle: () => - i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.queryTitle', { + i18n.translate('xpack.canvas.uis.dataSources.esdocs.queryTitle', { defaultMessage: 'Query', }), getQueryLabel: () => - i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.queryLabel', { + i18n.translate('xpack.canvas.uis.dataSources.esdocs.queryLabel', { defaultMessage: '{lucene} query string syntax', values: { lucene: LUCENE, }, }), getSortFieldTitle: () => - i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.sortFieldTitle', { + i18n.translate('xpack.canvas.uis.dataSources.esdocs.sortFieldTitle', { defaultMessage: 'Sort field', }), getSortFieldLabel: () => - i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.sortFieldLabel', { + i18n.translate('xpack.canvas.uis.dataSources.esdocs.sortFieldLabel', { defaultMessage: 'Document sort field', }), getSortOrderTitle: () => - i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.sortOrderTitle', { + i18n.translate('xpack.canvas.uis.dataSources.esdocs.sortOrderTitle', { defaultMessage: 'Sort order', }), getSortOrderLabel: () => - i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.sortOrderLabel', { + i18n.translate('xpack.canvas.uis.dataSources.esdocs.sortOrderLabel', { defaultMessage: 'Document sort order', }), getFieldsTitle: () => - i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.fieldsTitle', { + i18n.translate('xpack.canvas.uis.dataSources.esdocs.fieldsTitle', { defaultMessage: 'Fields', }), getFieldsLabel: () => - i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.fieldsLabel', { + i18n.translate('xpack.canvas.uis.dataSources.esdocs.fieldsLabel', { defaultMessage: 'Scripted fields are unavailable', }), getFieldsWarningLabel: () => - i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.fieldsWarningLabel', { + i18n.translate('xpack.canvas.uis.dataSources.esdocs.fieldsWarningLabel', { defaultMessage: 'This datasource performs best with 10 or fewer fields', }), getAscendingOption: () => - i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.ascendingDropDown', { + i18n.translate('xpack.canvas.uis.dataSources.esdocs.ascendingDropDown', { defaultMessage: 'Ascending', }), getDescendingOption: () => - i18n.translate('xpack.canvas.expressionTypes.datasources.esdocs.descendingDropDown', { + i18n.translate('xpack.canvas.uis.dataSources.esdocs.descendingDropDown', { defaultMessage: 'Descending', }), }, From c96a4b022eb168b30dc9adb13d13a3f7e691f70e Mon Sep 17 00:00:00 2001 From: Maggie Ghamry Date: Wed, 18 Mar 2020 13:02:35 -0400 Subject: [PATCH 15/24] Update to Timelion URL I noticed that the Timelion datasource showed "Lucene query syntax" which wasn't relevant, so I updated it to "Timelion", along with a tutorial, as the link for current Timelion docs does not provide any syntax tutorial. --- .../uis/datasources/timelion.js | 17 +++++++++++++---- x-pack/legacy/plugins/canvas/i18n/constants.ts | 1 + x-pack/legacy/plugins/canvas/i18n/ui.ts | 4 ++-- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/datasources/timelion.js b/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/datasources/timelion.js index 8d30bc035d5a3..35d86e931f88b 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/datasources/timelion.js +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/datasources/timelion.js @@ -13,12 +13,14 @@ import { EuiSpacer, EuiCode, EuiTextArea, + EuiText, + EuiLink, } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; import { getSimpleArg, setSimpleArg } from '../../../public/lib/arg_helpers'; import { templateFromReactComponent } from '../../../public/lib/template_from_react_component'; -import { DataSourceStrings, TIMELION, CANVAS } from '../../../i18n'; -import { TooltipIcon } from '../../../public/components/tooltip_icon'; +import { DataSourceStrings, TIMELION_QUERY_URL, TIMELION, CANVAS } from '../../../i18n'; +//import { TooltipIcon } from '../../../public/components/tooltip_icon'; const { Timelion: strings } = DataSourceStrings; @@ -86,8 +88,14 @@ const TimelionDatasource = ({ args, updateArgs, defaultIndex }) => { } + labelAppend={ + + + {strings.getQueryHelp()} + + + } + display="rowCompressed" > { rows={15} /> + { // TODO: Time timelion interval picker should be a drop down } diff --git a/x-pack/legacy/plugins/canvas/i18n/constants.ts b/x-pack/legacy/plugins/canvas/i18n/constants.ts index 597373d950f93..099effc697fc5 100644 --- a/x-pack/legacy/plugins/canvas/i18n/constants.ts +++ b/x-pack/legacy/plugins/canvas/i18n/constants.ts @@ -38,6 +38,7 @@ export const SQL_URL = 'https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-spec.html'; export const SVG = 'SVG'; export const TIMELION = 'Timelion'; +export const TIMELION_QUERY_URL = 'https://www.elastic.co/blog/timelion-tutorial-from-zero-to-hero'; export const TINYMATH = '`TinyMath`'; export const TINYMATH_URL = 'https://www.elastic.co/guide/en/kibana/current/canvas-tinymath-functions.html'; diff --git a/x-pack/legacy/plugins/canvas/i18n/ui.ts b/x-pack/legacy/plugins/canvas/i18n/ui.ts index ce883d018c95c..f2b0ed836c028 100644 --- a/x-pack/legacy/plugins/canvas/i18n/ui.ts +++ b/x-pack/legacy/plugins/canvas/i18n/ui.ts @@ -477,9 +477,9 @@ export const DataSourceStrings = { }), getQueryHelp: () => i18n.translate('xpack.canvas.uis.dataSources.timelion.queryLabel', { - defaultMessage: '{lucene} Query String syntax', + defaultMessage: '{timelion} Query String syntax', values: { - lucene: LUCENE, + timelion: TIMELION, }, }), getQueryLabel: () => From 80f646cd1618624d53ff3fa23f3caee78514f2d2 Mon Sep 17 00:00:00 2001 From: Maggie Ghamry Date: Wed, 18 Mar 2020 13:04:53 -0400 Subject: [PATCH 16/24] Update ui.ts update for i18n --- x-pack/legacy/plugins/canvas/i18n/ui.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/x-pack/legacy/plugins/canvas/i18n/ui.ts b/x-pack/legacy/plugins/canvas/i18n/ui.ts index f2b0ed836c028..9b55010408a42 100644 --- a/x-pack/legacy/plugins/canvas/i18n/ui.ts +++ b/x-pack/legacy/plugins/canvas/i18n/ui.ts @@ -480,6 +480,7 @@ export const DataSourceStrings = { defaultMessage: '{timelion} Query String syntax', values: { timelion: TIMELION, + lucene: LUCENE, }, }), getQueryLabel: () => From 5779d30d968eff5fa0347137d1f55ba03d7890c2 Mon Sep 17 00:00:00 2001 From: Maggie Ghamry Date: Wed, 18 Mar 2020 13:13:03 -0400 Subject: [PATCH 17/24] Update ui.ts update for i18n --- x-pack/legacy/plugins/canvas/i18n/ui.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/legacy/plugins/canvas/i18n/ui.ts b/x-pack/legacy/plugins/canvas/i18n/ui.ts index 9b55010408a42..deb31543b728b 100644 --- a/x-pack/legacy/plugins/canvas/i18n/ui.ts +++ b/x-pack/legacy/plugins/canvas/i18n/ui.ts @@ -479,8 +479,8 @@ export const DataSourceStrings = { i18n.translate('xpack.canvas.uis.dataSources.timelion.queryLabel', { defaultMessage: '{timelion} Query String syntax', values: { - timelion: TIMELION, lucene: LUCENE, + timelion: TIMELION, }, }), getQueryLabel: () => From f49e3ca42f7771dad9bea304d9ece3e86c99d0f2 Mon Sep 17 00:00:00 2001 From: Maggie Ghamry Date: Wed, 18 Mar 2020 13:14:57 -0400 Subject: [PATCH 18/24] Update ui.ts Update to removed unused value - the i18n check gave me latent errors, sorry for the repost --- x-pack/legacy/plugins/canvas/i18n/ui.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/x-pack/legacy/plugins/canvas/i18n/ui.ts b/x-pack/legacy/plugins/canvas/i18n/ui.ts index deb31543b728b..f2b0ed836c028 100644 --- a/x-pack/legacy/plugins/canvas/i18n/ui.ts +++ b/x-pack/legacy/plugins/canvas/i18n/ui.ts @@ -479,7 +479,6 @@ export const DataSourceStrings = { i18n.translate('xpack.canvas.uis.dataSources.timelion.queryLabel', { defaultMessage: '{timelion} Query String syntax', values: { - lucene: LUCENE, timelion: TIMELION, }, }), From 7e458a58fe036c75a7ecbab477f99d0c9ac4ec49 Mon Sep 17 00:00:00 2001 From: Maggie Ghamry Date: Wed, 18 Mar 2020 15:12:21 -0400 Subject: [PATCH 19/24] i18n updates Updating nomenclature to get past i18n errors --- .../canvas/canvas_plugin_src/uis/datasources/timelion.js | 2 +- x-pack/legacy/plugins/canvas/i18n/ui.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/datasources/timelion.js b/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/datasources/timelion.js index 35d86e931f88b..dbbc8c888d039 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/datasources/timelion.js +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/datasources/timelion.js @@ -91,7 +91,7 @@ const TimelionDatasource = ({ args, updateArgs, defaultIndex }) => { labelAppend={ - {strings.getQueryHelp()} + {strings.getQueryUrl()} } diff --git a/x-pack/legacy/plugins/canvas/i18n/ui.ts b/x-pack/legacy/plugins/canvas/i18n/ui.ts index f2b0ed836c028..2b943c4502d33 100644 --- a/x-pack/legacy/plugins/canvas/i18n/ui.ts +++ b/x-pack/legacy/plugins/canvas/i18n/ui.ts @@ -475,8 +475,8 @@ export const DataSourceStrings = { i18n.translate('xpack.canvas.uis.dataSources.timelion.intervalTitle', { defaultMessage: 'Interval', }), - getQueryHelp: () => - i18n.translate('xpack.canvas.uis.dataSources.timelion.queryLabel', { + getQueryUrl: () => + i18n.translate('xpack.canvas.uis.dataSources.timelion.queryUrl', { defaultMessage: '{timelion} Query String syntax', values: { timelion: TIMELION, From 178704ebf70b7a6f3bbdda5780cf13d510b7160a Mon Sep 17 00:00:00 2001 From: Maggie Ghamry Date: Wed, 18 Mar 2020 16:25:41 -0400 Subject: [PATCH 20/24] Updates Code review updates to remove extraneous code --- .../datasource/datasource_selector.js | 20 +------------------ .../canvas/public/lib/find_expression_type.js | 5 +---- .../legacy/plugins/canvas/public/plugin.tsx | 3 --- 3 files changed, 2 insertions(+), 26 deletions(-) diff --git a/x-pack/legacy/plugins/canvas/public/components/datasource/datasource_selector.js b/x-pack/legacy/plugins/canvas/public/components/datasource/datasource_selector.js index 6d354c0c273ba..153a8a7ef75e6 100644 --- a/x-pack/legacy/plugins/canvas/public/components/datasource/datasource_selector.js +++ b/x-pack/legacy/plugins/canvas/public/components/datasource/datasource_selector.js @@ -6,25 +6,7 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { EuiCard, EuiIcon, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; - -const icons = ['essql', 'esdocs', 'demodata', 'timelion']; - -const cardNodes = icons.map(function(item, index) { - return ( - - } - title={`Elastic ${item}`} - isDisabled={item === 'Kibana' ? true : false} - description="Example of a card's description. Stick to one or two sentences." - onClick={() => window.alert('Card clicked')} - /> - - ); -}); - -export default () => {cardNodes}; +import { EuiCard, EuiIcon } from '@elastic/eui'; export const DatasourceSelector = ({ onSelect, datasources, current }) => (
diff --git a/x-pack/legacy/plugins/canvas/public/lib/find_expression_type.js b/x-pack/legacy/plugins/canvas/public/lib/find_expression_type.js index d6d395feade8b..2cd7c5efb74e9 100644 --- a/x-pack/legacy/plugins/canvas/public/lib/find_expression_type.js +++ b/x-pack/legacy/plugins/canvas/public/lib/find_expression_type.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { datasourceRegistry } from '../expression_types/datasource'; +//import { datasourceRegistry } from '../expression_types/datasource'; import { transformRegistry } from '../expression_types/transform'; import { modelRegistry } from '../expression_types/model'; import { viewRegistry } from '../expression_types/view'; @@ -28,9 +28,6 @@ export function findExpressionType(name, type) { case 'transform': expression = transformRegistry.get(name); return !expression ? acc : acc.concat(expression); - case 'datasource': - expression = datasourceRegistry.get(name); - return !expression ? acc : acc.concat(expression); default: return acc; } diff --git a/x-pack/legacy/plugins/canvas/public/plugin.tsx b/x-pack/legacy/plugins/canvas/public/plugin.tsx index 0a3faca1a2522..f4a3aed28a0a4 100644 --- a/x-pack/legacy/plugins/canvas/public/plugin.tsx +++ b/x-pack/legacy/plugins/canvas/public/plugin.tsx @@ -11,8 +11,6 @@ import { initLoadingIndicator } from './lib/loading_indicator'; import { featureCatalogueEntry } from './feature_catalogue_entry'; import { ExpressionsSetup, ExpressionsStart } from '../../../../../src/plugins/expressions/public'; // @ts-ignore untyped local -import { datasourceSpecs } from './expression_types/datasources'; -// @ts-ignore untyped local import { argTypeSpecs } from './expression_types/arg_types'; import { transitions } from './transitions'; import { legacyRegistries } from './legacy_plugin_support'; @@ -90,7 +88,6 @@ export class CanvasPlugin // Register core canvas stuff canvasApi.addFunctions(initFunctions({ typesRegistry: plugins.expressions.__LEGACY.types })); - canvasApi.addDatasourceUIs(datasourceSpecs); canvasApi.addArgumentUIs(argTypeSpecs); canvasApi.addTransitions(transitions); From 0f4fb1f34c2c531680fcd54f2b5e414762588971 Mon Sep 17 00:00:00 2001 From: Maggie Ghamry Date: Wed, 18 Mar 2020 16:29:18 -0400 Subject: [PATCH 21/24] Update timelion.js update to remove extraneous comment per code review --- .../plugins/canvas/canvas_plugin_src/uis/datasources/timelion.js | 1 - 1 file changed, 1 deletion(-) diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/datasources/timelion.js b/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/datasources/timelion.js index dbbc8c888d039..97a59d21cb9be 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/datasources/timelion.js +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/datasources/timelion.js @@ -20,7 +20,6 @@ import { FormattedMessage } from '@kbn/i18n/react'; import { getSimpleArg, setSimpleArg } from '../../../public/lib/arg_helpers'; import { templateFromReactComponent } from '../../../public/lib/template_from_react_component'; import { DataSourceStrings, TIMELION_QUERY_URL, TIMELION, CANVAS } from '../../../i18n'; -//import { TooltipIcon } from '../../../public/components/tooltip_icon'; const { Timelion: strings } = DataSourceStrings; From 5bdb2c19e7821f764b1766bb5a0cc6f5298ec376 Mon Sep 17 00:00:00 2001 From: Maggie Ghamry Date: Wed, 18 Mar 2020 17:52:51 -0400 Subject: [PATCH 22/24] More i18n updates translation updates to accommodate the esdocs datasource move --- .../uis/datasources/timelion.js | 2 +- x-pack/legacy/plugins/canvas/i18n/ui.ts | 2 +- .../translations/translations/ja-JP.json | 34 +++++++++---------- .../translations/translations/zh-CN.json | 34 +++++++++---------- 4 files changed, 36 insertions(+), 36 deletions(-) diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/datasources/timelion.js b/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/datasources/timelion.js index 97a59d21cb9be..b36f1a747f120 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/datasources/timelion.js +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/datasources/timelion.js @@ -90,7 +90,7 @@ const TimelionDatasource = ({ args, updateArgs, defaultIndex }) => { labelAppend={ - {strings.getQueryUrl()} + {strings.queryLabel()} } diff --git a/x-pack/legacy/plugins/canvas/i18n/ui.ts b/x-pack/legacy/plugins/canvas/i18n/ui.ts index 2b943c4502d33..aa4030de7e287 100644 --- a/x-pack/legacy/plugins/canvas/i18n/ui.ts +++ b/x-pack/legacy/plugins/canvas/i18n/ui.ts @@ -475,7 +475,7 @@ export const DataSourceStrings = { i18n.translate('xpack.canvas.uis.dataSources.timelion.intervalTitle', { defaultMessage: 'Interval', }), - getQueryUrl: () => + queryLabel: () => i18n.translate('xpack.canvas.uis.dataSources.timelion.queryUrl', { defaultMessage: '{timelion} Query String syntax', values: { diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index 86a6f958cf258..fe0740849a938 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -4464,22 +4464,6 @@ "xpack.canvas.expressionTypes.argTypes.seriesStyle.styleLabel": "スタイル", "xpack.canvas.expressionTypes.argTypes.seriesStyleLabel": "選択された名前付きの数列のスタイルを設定", "xpack.canvas.expressionTypes.argTypes.seriesStyleTitle": "数列スタイル", - "xpack.canvas.expressionTypes.datasources.esdocs.ascendingDropDown": "昇順", - "xpack.canvas.expressionTypes.datasources.esdocs.descendingDropDown": "降順", - "xpack.canvas.expressionTypes.datasources.esdocs.fieldsLabel": "抽出するフィールドです。Kibana スクリプトフィールドは現在利用できません", - "xpack.canvas.expressionTypes.datasources.esdocs.fieldsTitle": "フィールド", - "xpack.canvas.expressionTypes.datasources.esdocs.fieldsWarningLabel": "このデータソースは、10 個以下のフィールドで最も高い性能を発揮します", - "xpack.canvas.expressionTypes.datasources.esdocs.indexLabel": "インデックス名を入力するか、インデックスパターンを選択してください", - "xpack.canvas.expressionTypes.datasources.esdocs.indexTitle": "インデックス", - "xpack.canvas.expressionTypes.datasources.esdocs.queryLabel": "{lucene} クエリ文字列の構文", - "xpack.canvas.expressionTypes.datasources.esdocs.queryTitle": "クエリ", - "xpack.canvas.expressionTypes.datasources.esdocs.sortFieldLabel": "ドキュメントソートフィールド", - "xpack.canvas.expressionTypes.datasources.esdocs.sortFieldTitle": "ソートフィールド", - "xpack.canvas.expressionTypes.datasources.esdocs.sortOrderLabel": "ドキュメントの並べ替え順", - "xpack.canvas.expressionTypes.datasources.esdocs.sortOrderTitle": "並べ替え順", - "xpack.canvas.expressionTypes.datasources.esdocs.warningTitle": "ご注意ください", - "xpack.canvas.expressionTypes.datasources.esdocsLabel": "Elasticsearch から未加工のドキュメントを読み込みます", - "xpack.canvas.expressionTypes.datasources.esdocsTitle": "Elasticsearch 未加工ドキュメント", "xpack.canvas.functionForm.contextError": "エラー: {errorMessage}", "xpack.canvas.functionForm.functionUnknown.unknownArgumentTypeError": "未知の表現タイプ「{expressionType}」", "xpack.canvas.functions.all.args.conditionHelpText": "確認する条件です。", @@ -4990,13 +4974,29 @@ "xpack.canvas.uis.arguments.textareaTitle": "テキストエリア", "xpack.canvas.uis.arguments.toggleLabel": "true/false トグルスイッチ", "xpack.canvas.uis.arguments.toggleTitle": "切り替え", + "xpack.canvas.uis.dataSources.esdocs.ascendingDropDown": "昇順", + "xpack.canvas.uis.dataSources.esdocs.descendingDropDown": "降順", + "xpack.canvas.uis.dataSources.esdocs.fieldsLabel": "抽出するフィールドです。Kibana スクリプトフィールドは現在利用できません", + "xpack.canvas.uis.dataSources.esdocs.fieldsTitle": "フィールド", + "xpack.canvas.uis.dataSources.esdocs.fieldsWarningLabel": "このデータソースは、10 個以下のフィールドで最も高い性能を発揮します", + "xpack.canvas.uis.dataSources.esdocs.indexLabel": "インデックス名を入力するか、インデックスパターンを選択してください", + "xpack.canvas.uis.dataSources.esdocs.indexTitle": "インデックス", + "xpack.canvas.uis.dataSources.esdocs.queryLabel": "{lucene} クエリ文字列の構文", + "xpack.canvas.uis.dataSources.esdocs.queryTitle": "クエリ", + "xpack.canvas.uis.dataSources.esdocs.sortFieldLabel": "ドキュメントソートフィールド", + "xpack.canvas.uis.dataSources.esdocs.sortFieldTitle": "ソートフィールド", + "xpack.canvas.uis.dataSources.esdocs.sortOrderLabel": "ドキュメントの並べ替え順", + "xpack.canvas.uis.dataSources.esdocs.sortOrderTitle": "並べ替え順", + "xpack.canvas.uis.dataSources.esdocs.warningTitle": "ご注意ください", + "xpack.canvas.uis.dataSources.esdocsLabel": "{elasticsearch} から未加工のドキュメントを読み込みます", + "xpack.canvas.uis.dataSources.esdocsTitle": "{elasticsearch} 未加工ドキュメント", "xpack.canvas.uis.dataSources.demoData.headingTitle": "デモデータを使用中です", "xpack.canvas.uis.dataSources.demoDataLabel": "ユーザー名、価格、プロジェクト、国、フェーズを含む模擬データセット", "xpack.canvas.uis.dataSources.demoDataTitle": "デモデータ", "xpack.canvas.uis.dataSources.essqlLabel": "{elasticsearch} {sql} でデータ表を取得します", "xpack.canvas.uis.dataSources.essqlTitle": "{elasticsearch} {sql}", "xpack.canvas.uis.dataSources.timelion.intervalTitle": "間隔", - "xpack.canvas.uis.dataSources.timelion.queryLabel": "{lucene} クエリ文字列の構文", + "xpack.canvas.uis.dataSources.timelion.queryLabel": "{timelion} クエリ文字列の構文", "xpack.canvas.uis.dataSources.timelion.queryTitle": "クエリ", "xpack.canvas.uis.dataSources.timelion.tips.functions": "{functionExample} などの一部 {timelion} 関数は {canvas} データ表に変換できません。データ操作に関する機能は正常に動作するはずです。", "xpack.canvas.uis.dataSources.timelion.tips.time": "{timelion} には時間範囲が必要です。ページのどこかに時間フィルターを追加するか、コードエディターで時間フィルターを渡す必要があります。", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index c580eb533feb9..7d67ec4e74283 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -4465,22 +4465,6 @@ "xpack.canvas.expressionTypes.argTypes.seriesStyle.styleLabel": "样式", "xpack.canvas.expressionTypes.argTypes.seriesStyleLabel": "设置选定已命名序列的样式", "xpack.canvas.expressionTypes.argTypes.seriesStyleTitle": "序列样式", - "xpack.canvas.expressionTypes.datasources.esdocs.ascendingDropDown": "升序", - "xpack.canvas.expressionTypes.datasources.esdocs.descendingDropDown": "降序", - "xpack.canvas.expressionTypes.datasources.esdocs.fieldsLabel": "要提取的字段。Kibana 脚本字段当前不可用", - "xpack.canvas.expressionTypes.datasources.esdocs.fieldsTitle": "字段", - "xpack.canvas.expressionTypes.datasources.esdocs.fieldsWarningLabel": "字段不超过 10 个时,此数据源性能最佳", - "xpack.canvas.expressionTypes.datasources.esdocs.indexLabel": "输入索引名称或选择索引模式", - "xpack.canvas.expressionTypes.datasources.esdocs.indexTitle": "索引", - "xpack.canvas.expressionTypes.datasources.esdocs.queryLabel": "{lucene} 查询字符串语法", - "xpack.canvas.expressionTypes.datasources.esdocs.queryTitle": "查询", - "xpack.canvas.expressionTypes.datasources.esdocs.sortFieldLabel": "文档排序字段", - "xpack.canvas.expressionTypes.datasources.esdocs.sortFieldTitle": "排序字段", - "xpack.canvas.expressionTypes.datasources.esdocs.sortOrderLabel": "文档排序顺序", - "xpack.canvas.expressionTypes.datasources.esdocs.sortOrderTitle": "排序顺序", - "xpack.canvas.expressionTypes.datasources.esdocs.warningTitle": "务必谨慎操作", - "xpack.canvas.expressionTypes.datasources.esdocsLabel": "从 Elasticsearch 拉取原始文档", - "xpack.canvas.expressionTypes.datasources.esdocsTitle": "Elasticsearch 原始文档", "xpack.canvas.functionForm.contextError": "错误:{errorMessage}", "xpack.canvas.functionForm.functionUnknown.unknownArgumentTypeError": "表达式类型“{expressionType}”未知", "xpack.canvas.functions.all.args.conditionHelpText": "要检查的条件。", @@ -4991,13 +4975,29 @@ "xpack.canvas.uis.arguments.textareaTitle": "文本区域", "xpack.canvas.uis.arguments.toggleLabel": "True/False 切换开关", "xpack.canvas.uis.arguments.toggleTitle": "切换", + "xpack.canvas.uis.dataSources.esdocs.ascendingDropDown": "升序", + "xpack.canvas.uis.dataSources.esdocs.descendingDropDown": "降序", + "xpack.canvas.uis.dataSources.esdocs.fieldsLabel": "要提取的字段。Kibana 脚本字段当前不可用", + "xpack.canvas.uis.dataSources.esdocs.fieldsTitle": "字段", + "xpack.canvas.uis.dataSources.esdocs.fieldsWarningLabel": "字段不超过 10 个时,此数据源性能最佳", + "xpack.canvas.uis.dataSources.esdocs.indexLabel": "输入索引名称或选择索引模式", + "xpack.canvas.uis.dataSources.esdocs.indexTitle": "索引", + "xpack.canvas.uis.dataSources.esdocs.queryLabel": "{lucene} 查询字符串语法", + "xpack.canvas.uis.dataSources.esdocs.queryTitle": "查询", + "xpack.canvas.uis.dataSources.esdocs.sortFieldLabel": "文档排序字段", + "xpack.canvas.uis.dataSources.esdocs.sortFieldTitle": "排序字段", + "xpack.canvas.uis.dataSources.esdocs.sortOrderLabel": "文档排序顺序", + "xpack.canvas.uis.dataSources.esdocs.sortOrderTitle": "排序顺序", + "xpack.canvas.uis.dataSources.esdocs.warningTitle": "务必谨慎操作", + "xpack.canvas.uis.dataSources.esdocsLabel": "从 {elasticsearch} 拉取原始文档", + "xpack.canvas.uis.dataSources.esdocsTitle": "{elasticsearch} 原始文档", "xpack.canvas.uis.dataSources.demoData.headingTitle": "您正在使用演示数据", "xpack.canvas.uis.dataSources.demoDataLabel": "使用用户名、价格、项目、国家/地区和阶段模拟数据集", "xpack.canvas.uis.dataSources.demoDataTitle": "演示数据", "xpack.canvas.uis.dataSources.essqlLabel": "使用 {elasticsearch} {sql} 以获取数据表", "xpack.canvas.uis.dataSources.essqlTitle": "{elasticsearch} {sql}", "xpack.canvas.uis.dataSources.timelion.intervalTitle": "时间间隔", - "xpack.canvas.uis.dataSources.timelion.queryLabel": "{lucene} 查询字符串语法", + "xpack.canvas.uis.dataSources.timelion.queryLabel": "{timelion} 查询字符串语法", "xpack.canvas.uis.dataSources.timelion.queryTitle": "查询", "xpack.canvas.uis.dataSources.timelion.tips.functions": "一些 {timelion} 函数(如 {functionExample})不转换成 {canvas} 数据表。任何与数据操作有关的内容都适用。", "xpack.canvas.uis.dataSources.timelion.tips.time": "{timelion} 需要时间范围,您应将时间筛选元素添加到页面上的某个位置,或使用代码编辑器传入时间筛选。", From e44347ff02068c250b787ae547396c38794d49e7 Mon Sep 17 00:00:00 2001 From: Maggie Ghamry Date: Wed, 18 Mar 2020 18:43:51 -0400 Subject: [PATCH 23/24] Update datasource_component.js Update to toggle datasource icon in selected element mode --- .../canvas/public/components/datasource/datasource_component.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/legacy/plugins/canvas/public/components/datasource/datasource_component.js b/x-pack/legacy/plugins/canvas/public/components/datasource/datasource_component.js index 8b0061e047f33..285b69f057cd8 100644 --- a/x-pack/legacy/plugins/canvas/public/components/datasource/datasource_component.js +++ b/x-pack/legacy/plugins/canvas/public/components/datasource/datasource_component.js @@ -153,7 +153,7 @@ export class DatasourceComponent extends PureComponent { flush="left" size="s" > - + {stateDatasource.displayName} From ba956280290075098fb3ee1d38449e16e3bf812b Mon Sep 17 00:00:00 2001 From: Maggie Ghamry Date: Wed, 18 Mar 2020 18:47:24 -0400 Subject: [PATCH 24/24] Update ui.ts hopefully last i18n fix --- x-pack/legacy/plugins/canvas/i18n/ui.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/legacy/plugins/canvas/i18n/ui.ts b/x-pack/legacy/plugins/canvas/i18n/ui.ts index aa4030de7e287..1abe56c99dc89 100644 --- a/x-pack/legacy/plugins/canvas/i18n/ui.ts +++ b/x-pack/legacy/plugins/canvas/i18n/ui.ts @@ -476,7 +476,7 @@ export const DataSourceStrings = { defaultMessage: 'Interval', }), queryLabel: () => - i18n.translate('xpack.canvas.uis.dataSources.timelion.queryUrl', { + i18n.translate('xpack.canvas.uis.dataSources.timelion.queryLabel', { defaultMessage: '{timelion} Query String syntax', values: { timelion: TIMELION,