Skip to content

Commit

Permalink
Merge back with master (#24746)
Browse files Browse the repository at this point in the history
* Translate global navigation bar component (#23993)

Translate global navigation bar component

* [backport] add back earlier 6.x minor versions

We still backport to these branches, primarily for doc changes.

* [dev/build] fix invalid assertion

* Skip this test until snapshots are updated (#24650)

* Feat/expression threading (#24598)

Replaces #23301
Closes #23080

---

This is a minimal threading implementation for Canvas. There's still a lot to be done to make this concept great, but this is a start. 

What it does:
- Creates a server side abstraction on top of the interpreter
- Determines where to send the expression by checking the first function to be run
- Loads common functions in a separate worker thread on the server. 
- Routes to a single forked worker (thread), the main thread (server), or the browser (browser), in that order
- Defers back to the router when a function isn't found. Fails if the function isn't found in any of the above 3 environments
- Times out the worker if it takes too long, and respawns it as needed.
- Simplifies the error dialog to remove the stack. 

What is does not.:
- Round robin a pool of workers
- Queue. If one expression in the threaded env fails then anything sent to it in the meantime will fail. The upstream environment handles managing timeouts. I think this would only make sense todo with a pool.
- Client side. This doesn't implement web workers, but we could use roughly the same architecture. 
- Implement a specific, pluggable `worker` environment on the server. Right now it's just common functions, so plugin authors will always end up in a thread if they put their function in the common directory.

What I don't like:
- The socketProvider code. This was reused across the server & browser, but now that it's only used in the browser there's no good reason for the abstraction
- The serialize/deserialize stuff feels messy. Do we really need serialization?

* Polish 6.5 (#24556)

* Updates waterfall item design for timeline rows

* Adjusts span and tx flyouts and updates tooltips to EUI

* Heading size fixes and clean up

* Updates tooltip snapshots

* Review tweaks and snapshot updates

* Revert experiment :)

Co-Authored-By: jasonrhodes <jason.matthew.rhodes@gmail.com>

* Fixes bug with v1 waterfall state

* Fixes bug with timeline bar height

* Updates snapshot tests

* Updated test so it doesn't mount and rely on EUI makeId() which is non-deterministic per test run

* Don't throw errors in optimizer (#24660)

* Fixed label position on progress elements (#24623)

* [kbn/es] add context to error message (#24664)

This just tweaks the kbn-es error message to provide more context than just `Not Found`

* [BeatsCM] Beats without tags should return an empty array via the config API (#24665)

* [ML] Change file data visualizer JSON format label to NDJSON (#24643)

* [ML] Change file datavisualizer JSON format label to NDJSON
* [ML] Update edit flyout overrides snapshot

* Translations for Coordinate Map (#23952)

translate Coordinate Map

* Translations for Region Map (#23875)

add translations for region_map plugin

* [Tools] Add TemplateLiteral parsing to i18n_check tool (#24580)

* [Tools] Add TemplateLiteral parsing to i18n_check tool

* Add comments

* [ML] Remove obsolete sentence from info tooltip. (#24716)

* Translate security/users component (#23940)

Translate security/users

* [Docs] Remove beta notes for ML and Query bar (#24718)

* Translations for Table Vis plugin (#23679)

add translations for table vis plugin

* Feature/translate new nav bar (#24326)

translate new_nav_bar

* center content in fullscreen mode, hide K7 top nav (#24589)

* [APM] Fixes rare cases where KibanaLink is loaded outside of React context (#24705)

* Fixes rare cases where KibanaLink will be loaded outside of React context and requires no redux connect dependency

* Fixes tests for updated Kibana link component

* Removes obsolete snapshot

* Secops structure code (#24652)

* add basic structure for secops application
* finalize skeleton for secops
* fix type issue and hapi new version
* remove route home, not needed for now
* Add configuration + delete noise
* prepend elastic license to generated file

* Cut down on all tests except for secops tests and one example of infr… (#24693)

* Cut down on all tests except for secops tests and one example of infra integration tests
* Commented out code for only this branch
* Added comments and "please see issue number"
* https://github.com/elastic/ingest-dev/issues/60
  • Loading branch information
XavierM committed Oct 29, 2018
1 parent 35ef51f commit ca73f36
Show file tree
Hide file tree
Showing 92 changed files with 3,543 additions and 2,509 deletions.
2 changes: 1 addition & 1 deletion .backportrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"upstream": "elastic/kibana",
"branches": [{ "name": "6.x", "checked": true }, "6.5", "6.4", "6.3", "5.6"],
"branches": [{ "name": "6.x", "checked": true }, "6.5", "6.4", "6.3", "6.2", "6.1", "6.0", "5.6"],
"labels": ["backport"]
}
6 changes: 5 additions & 1 deletion .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@
"kbnVislibVisTypes": "src/core_plugins/kbn_vislib_vis_types",
"markdownVis": "src/core_plugins/markdown_vis",
"metricVis": "src/core_plugins/metric_vis",
"tableVis": "src/core_plugins/table_vis",
"regionMap": "src/core_plugins/region_map",
"statusPage": "src/core_plugins/status_page",
"tileMap": "src/core_plugins/tile_map",
"tagCloud": "src/core_plugins/tagcloud",
"xpack.idxMgmt": "x-pack/plugins/index_management",
"xpack.watcher": "x-pack/plugins/watcher"
"xpack.watcher": "x-pack/plugins/watcher",
"xpack.security": "x-pack/plugins/security"
},
"exclude": [
"src/ui/ui_render/bootstrap/app_bootstrap.js",
Expand Down
14 changes: 2 additions & 12 deletions docs/apm/using-the-apm-ui.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,7 @@ Watches are managed separately in the dedicated Watcher UI available in Advanced
image::apm/images/apm-errors-watcher-assistant.png[Example view of the Watcher assistant for errors in APM UI in Kibana]

[[machine-learning-integration]]
=== Machine Learning integration (beta)

[NOTE]
============
Please note this feature is in beta. We kindly ask that you https://discuss.elastic.co/c/apm[provide feedback] if you experience any issues.
============
=== Machine Learning integration

The Machine Learning integration will initiate a new job predefined to calculate anomaly scores on transaction response times. The response time graph will show the expected bounds and annotate the graph when the anomaly score is 75 or above.

Expand All @@ -80,12 +75,7 @@ image::apm/images/apm-ml-integration.png[Example view of anomaly scores on respo
Jobs can be created per transaction type and based on the average response time. You can manage jobs in the Machine Learning jobs management page. It might take some time for results to appear on the graph.

[[query-bar]]
=== Query bar (beta)

[NOTE]
============
Please note this feature is in beta. We kindly ask that you https://discuss.elastic.co/c/apm[provide feedback] if you experience any issues.
============
=== Query bar

The query bar is a powerful data query feature. Similar to the query bar in {kibana-ref}/discover.html[Discover] it enables you to pass advanced queries on your data to filter on particular pieces of information that you're interested in. It comes with a handy autocomplete that helps find the fields and even provides suggestions to the data they include. The query bar is available on Services, Transaction and Errors views, and any input will persist as you move between them.

Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-es/src/install/snapshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ function downloadFile(url, dest, log) {
}

if (!res.ok) {
return reject(new Error(res.statusText));
return reject(new Error(`Unable to download elasticsearch snapshot: ${res.statusText}`));
}

const stream = fs.createWriteStream(downloadPath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,7 @@ exports[`mlEnabled 1`] = `
type="button"
>
<FormattedMessage
defaultMessage="Import a JSON, CSV, or log file"
defaultMessage="Import a CSV, NDJSON, or log file"
id="kbn.home.addData.uploadFileLink"
values={Object {}}
/>
Expand Down
2 changes: 1 addition & 1 deletion src/core_plugins/kibana/public/home/components/add_data.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ const AddDataUi = ({ apmUiEnabled, isNewKibanaInstance, intl, mlEnabled }) => {
>
<FormattedMessage
id="kbn.home.addData.uploadFileLink"
defaultMessage="Import a JSON, CSV, or log file"
defaultMessage="Import a CSV, NDJSON, or log file"
/>
</EuiLink>
</EuiText>
Expand Down
24 changes: 18 additions & 6 deletions src/core_plugins/region_map/public/choropleth_layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import $ from 'jquery';
import L from 'leaflet';
import _ from 'lodash';
import d3 from 'd3';
import { i18n } from '@kbn/i18n';
import { KibanaMapLayer } from 'ui/vis/map/kibana_map_layer';
import { truncatedColorMaps } from 'ui/vislib/components/color/truncated_colormaps';
import * as topojson from 'topojson-client';
Expand Down Expand Up @@ -123,7 +124,10 @@ export default class ChoroplethLayer extends KibanaMapLayer {
featureCollection = topojson.feature(data, features);//conversion to geojson
} else {
//should never happen
throw new Error('Unrecognized format ' + formatType);
throw new Error(i18n.translate('regionMap.choroplethLayer.unrecognizedFormatErrorMessage', {
defaultMessage: 'Unrecognized format {formatType}',
values: { formatType },
}));
}
this._sortedFeatures = featureCollection.features.slice();
this._sortFeatures();
Expand All @@ -143,15 +147,23 @@ export default class ChoroplethLayer extends KibanaMapLayer {

let errorMessage;
if (e.status === 404) {
errorMessage = `Server responding with '404' when attempting to fetch ${geojsonUrl}.
Make sure the file exists at that location.`;
errorMessage = i18n.translate('regionMap.choroplethLayer.downloadingVectorData404ErrorMessage', {
defaultMessage: 'Server responding with \'404\' when attempting to fetch {geojsonUrl}. \
Make sure the file exists at that location.',
values: { geojsonUrl },
});
} else {
errorMessage = `Cannot download ${geojsonUrl} file. Please ensure the
CORS configuration of the server permits requests from the Kibana application on this host.`;
errorMessage = i18n.translate('regionMap.choroplethLayer.downloadingVectorDataErrorMessage', {
defaultMessage: 'Cannot download {geojsonUrl} file. Please ensure the \
CORS configuration of the server permits requests from the Kibana application on this host.',
values: { geojsonUrl },
});
}

toastNotifications.addDanger({
title: 'Error downloading vector data',
title: i18n.translate('regionMap.choroplethLayer.downloadingVectorDataErrorMessageTitle', {
defaultMessage: 'Error downloading vector data',
}),
text: errorMessage,
});

Expand Down
20 changes: 10 additions & 10 deletions src/core_plugins/region_map/public/region_map_vis.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { mapToLayerWithId } from './util';
import { RegionMapsVisualizationProvider } from './region_map_visualization';
import { Status } from 'ui/vis/update_status';

VisTypesRegistryProvider.register(function RegionMapProvider(Private, regionmapsConfig, config) {
VisTypesRegistryProvider.register(function RegionMapProvider(Private, regionmapsConfig, config, i18n) {
const VisFactory = Private(VisFactoryProvider);
const RegionMapsVisualization = Private(RegionMapsVisualizationProvider);

Expand All @@ -37,9 +37,9 @@ VisTypesRegistryProvider.register(function RegionMapProvider(Private, regionmaps

return VisFactory.createBaseVisualization({
name: 'region_map',
title: 'Region Map',
description: 'Show metrics on a thematic map. Use one of the provided base maps, or add your own. ' +
'Darker colors represent higher values.',
title: i18n('regionMap.mapVis.regionMapTitle', { defaultMessage: 'Region Map' }),
description: i18n('regionMap.mapVis.regionMapDescription', { defaultMessage: 'Show metrics on a thematic map. Use one of the \
provided base maps, or add your own. Darker colors represent higher values.' }),
category: CATEGORY.MAP,
icon: 'visMapRegion',
visConfig: {
Expand All @@ -65,16 +65,16 @@ VisTypesRegistryProvider.register(function RegionMapProvider(Private, regionmaps
collections: {
legendPositions: [{
value: 'bottomleft',
text: 'bottom left',
text: i18n('regionMap.mapVis.regionMapEditorConfig.bottomLeftText', { defaultMessage: 'bottom left' }),
}, {
value: 'bottomright',
text: 'bottom right',
text: i18n('regionMap.mapVis.regionMapEditorConfig.bottomRightText', { defaultMessage: 'bottom right' }),
}, {
value: 'topleft',
text: 'top left',
text: i18n('regionMap.mapVis.regionMapEditorConfig.topLeftText', { defaultMessage: 'top left' }),
}, {
value: 'topright',
text: 'top right',
text: i18n('regionMap.mapVis.regionMapEditorConfig.topRightText', { defaultMessage: 'top right' }),
}],
colorSchemas: Object.keys(truncatedColorMaps),
vectorLayers: vectorLayers
Expand All @@ -83,7 +83,7 @@ VisTypesRegistryProvider.register(function RegionMapProvider(Private, regionmaps
{
group: 'metrics',
name: 'metric',
title: 'Value',
title: i18n('regionMap.mapVis.regionMapEditorConfig.schemas.metricTitle', { defaultMessage: 'Value' }),
min: 1,
max: 1,
aggFilter: ['count', 'avg', 'sum', 'min', 'max', 'cardinality', 'top_hits',
Expand All @@ -96,7 +96,7 @@ VisTypesRegistryProvider.register(function RegionMapProvider(Private, regionmaps
group: 'buckets',
name: 'segment',
icon: 'fa fa-globe',
title: 'shape field',
title: i18n('regionMap.mapVis.regionMapEditorConfig.schemas.segmentTitle', { defaultMessage: 'shape field' }),
min: 1,
max: 1,
aggFilter: ['terms']
Expand Down
109 changes: 75 additions & 34 deletions src/core_plugins/region_map/public/region_map_vis_params.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
<div class="kuiSideBarSection">
<div class="form-group">
<div class="kuiSideBarSectionTitle">
<div class="kuiSideBarSectionTitle__text">
Layer Settings
</div>
<div
class="kuiSideBarSectionTitle__text"
i18n-id="regionMap.visParams.layerSettingsTitle"
i18n-default-message="Layer Settings"
></div>
</div>

<div class="kuiSideBarFormRow">
<label class="kuiSideBarFormRow__label" for="regionMap">
Vector map
</label>
<label
class="kuiSideBarFormRow__label"
for="regionMap"
i18n-id="regionMap.visParams.vectorMapLabel"
i18n-default-message="Vector map"
></label>
<div class="kuiSideBarFormRow__control">
<select
id="regionMap"
Expand All @@ -22,53 +27,79 @@
</div>

<div class="form-group clearfix" ng-hide="!editorState.params.emsHotLink">
<a
class="rgmEMSLink pull-right"
target="_blank"
rel="noopener noreferrer"
ng-href="{{editorState.params.emsHotLink}}"
target="_blank"
title="Preview {{editorState.params.selectedLayer.name}} on the Elastic Maps Service"
><icon aria-hidden size="'s'" type="'link'" /> Preview on EMS
</a>
<a
class="rgmEMSLink pull-right"
target="_blank"
rel="noopener noreferrer"
ng-href="{{editorState.params.emsHotLink}}"
target="_blank"
title="{{'regionMap.visParams.previewOnEMSLinkTitle' | i18n: {
defaultMessage: 'Preview {selectedLayerName} on the Elastic Maps Service',
values: { selectedLayerName: editorState.params.selectedLayer.name }
} }}"
>
<icon aria-hidden size="'s'" type="'link'" />
<span
i18n-id="regionMap.visParams.previewOnEMSLinkText"
i18n-default-message="Preview on EMS"
></span>
</a>
</div>

<div class="kuiSideBarFormRow">
<label class="kuiSideBarFormRow__label" for="joinField">
Join field
</label>
<label
class="kuiSideBarFormRow__label"
for="joinField"
i18n-id="regionMap.visParams.joinFieldLabel"
i18n-default-message="Join field"
></label>
<div class="kuiSideBarFormRow__control">
<select id="joinField"
class="kuiSelect kuiSideBarSelect"
ng-model="editorState.params.selectedJoinField"
ng-options="field.description for field in editorState.params.selectedLayer.fields track by field.name"
>
<option value=''>Select</option></select>
<option
value=''
i18n-id="regionMap.visParams.selectOptionLabel"
i18n-default-message="Select"
></option>
</select>
</div>
</div>
<div class="kuiSideBarFormRow">
<label class="kuiSideBarFormRow__label" for="displayWarnings">
Display warnings
</label>
<label
class="kuiSideBarFormRow__label"
for="displayWarnings"
i18n-id="regionMap.visParams.displayWarningsLabel"
i18n-default-message="Display warnings"
></label>

<div class="kuiSideBarFormRow__control">
<input id="displayWarnings" type="checkbox" ng-model="editorState.params.isDisplayWarning">
&nbsp;
<icon-tip
content="'Turns on/off warnings. When turned on, warning will be shown for each term that cannot be matched to a shape in the vector layer based on the join field. When turned off, these warnings will be turned off.'"
content="{{::'regionMap.visParams.switchWarningsTipText' | i18n: {
defaultMessage: '&quot;Turns on/off warnings. When turned on, warning will be shown for each term that cannot be matched to a shape in the vector layer based on the join field. When turned off, these warnings will be turned off.&quot;'
} }}"
position="'right'"
></icon-tip>
</div>
</div>
<div class="kuiSideBarFormRow">
<label class="kuiSideBarFormRow__label" for="onlyShowMatchingShapes">
Show all shapes
</label>
<label
class="kuiSideBarFormRow__label"
for="onlyShowMatchingShapes"
i18n-id="regionMap.visParams.showAllShapesLabel"
i18n-default-message="Show all shapes"
></label>
<div class="kuiSideBarFormRow__control">
<input id="onlyShowMatchingShapes" type="checkbox" ng-model="editorState.params.showAllShapes">
&nbsp;
<icon-tip
content="'Turning this off only shows the shapes that were matched with a corresponding term'"
content="{{::'regionMap.visParams.turnOffShowingAllShapesTipText' | i18n: {
defaultMessage: '&quot;Turning this off only shows the shapes that were matched with a corresponding term&quot;'
} }}"
position="'right'"
></icon-tip>
</div>
Expand All @@ -79,12 +110,19 @@
<div class="kuiSideBarSection">

<div class="kuiSideBarSectionTitle">
<div class="kuiSideBarSectionTitle__text">Style settings</div>
<div
class="kuiSideBarSectionTitle__text"
i18n-id="regionMap.visParams.styleSettingsLabel"
i18n-default-message="Style settings"
></div>
</div>
<div class="kuiSideBarFormRow" >
<label class="kuiSideBarFormRow__label" for="colorSchema">
Color Schema
</label>
<label
class="kuiSideBarFormRow__label"
for="colorSchema"
i18n-id="regionMap.visParams.colorSchemaLabel"
i18n-default-message="Color Schema"
></label>
<div class="kuiSideBarFormRow__control">
<select
id="colorSchema"
Expand All @@ -95,9 +133,12 @@
</div>
</div>
<div class="kuiSideBarFormRow" >
<label class="kuiSideBarFormRow__label" for="outlineWeight">
Outline weight
</label>
<label
class="kuiSideBarFormRow__label"
for="outlineWeight"
i18n-id="regionMap.visParams.outlineWeightLabel"
i18n-default-message="Outline weight"
></label>
<div class="kuiSideBarFormRow__control">
<input
id="outlineWeight"
Expand Down
17 changes: 14 additions & 3 deletions src/core_plugins/region_map/public/region_map_visualization.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import AggResponsePointSeriesTooltipFormatterProvider from './tooltip_formatter'
import 'ui/vis/map/service_settings';
import { toastNotifications } from 'ui/notify';

export function RegionMapsVisualizationProvider(Private, config) {
export function RegionMapsVisualizationProvider(Private, config, i18n) {

const tooltipFormatter = Private(AggResponsePointSeriesTooltipFormatterProvider);
const BaseMapsVisualization = Private(BaseMapsVisualizationProvider);
Expand Down Expand Up @@ -161,8 +161,19 @@ export function RegionMapsVisualizationProvider(Private, config) {
const shouldShowWarning = this._vis.params.isDisplayWarning && config.get('visualization:regionmap:showWarnings');
if (event.mismatches.length > 0 && shouldShowWarning) {
toastNotifications.addWarning({
title: `Unable to show ${event.mismatches.length} ${event.mismatches.length > 1 ? 'results' : 'result'} on map`,
text: `Ensure that each of these term matches a shape on that shape's join field: ${event.mismatches.join(', ')}`,
title: i18n('regionMap.visualization.unableToShowMismatchesWarningTitle', {
defaultMessage: 'Unable to show {mismatchesLength} {oneMismatch, plural, one {result} other {results}} on map',
values: {
mismatchesLength: event.mismatches.length,
oneMismatch: event.mismatches.length > 1 ? 0 : 1,
},
}),
text: i18n('regionMap.visualization.unableToShowMismatchesWarningText', {
defaultMessage: 'Ensure that each of these term matches a shape on that shape\'s join field: {mismatches}',
values: {
mismatches: event.mismatches.join(', '),
},
}),
});
}
});
Expand Down
5 changes: 4 additions & 1 deletion src/core_plugins/table_vis/public/table_vis.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<div ng-controller="KbnTableVisController" class="table-vis">
<div ng-if="!hasSomeRows && hasSomeRows !== null" class="table-vis-error">
<h2 aria-hidden="true"><i aria-hidden="true" class="fa fa-meh-o"></i></h2>
<h4>No results found</h4>
<h4
i18n-id="tableVis.vis.noResultsFoundTitle"
i18n-default-message="No results found"
></h4>
</div>

<div ng-if="tableGroups" class="table-vis-container" data-test-subj="tableVis">
Expand Down
Loading

0 comments on commit ca73f36

Please sign in to comment.