Skip to content

Commit

Permalink
Merge branch 'master' into issue-73849-headers-timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
mshustov committed Oct 19, 2020
2 parents e1a2ea6 + 9aa4b4d commit e04b7ba
Show file tree
Hide file tree
Showing 130 changed files with 11,393 additions and 3,992 deletions.
86 changes: 86 additions & 0 deletions docs/user/dashboard/url-drilldown.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,92 @@ Example:

`{{ date event.from “YYYY MM DD”}}` +
`{{date “now-15”}}`

|formatNumber
a|Format numbers. Numbers can be formatted to look like currency, percentages, times or numbers with decimal places, thousands, and abbreviations.
Refer to the http://numeraljs.com/#format[numeral.js] for different formatting options.

Example:

`{{formatNumber event.value "0.0"}}`

|lowercase
a|Converts a string to lower case.

Example:

`{{lowercase event.value}}`

|uppercase
a|Converts a string to upper case.

Example:

`{{uppercase event.value}}`

|trim
a|Removes leading and trailing spaces from a string.

Example:

`{{trim event.value}}`

|trimLeft
a|Removes leading spaces from a string.

Example:

`{{trimLeft event.value}}`

|trimRight
a|Removes trailing spaces from a string.

Example:

`{{trimRight event.value}}`

|mid
a|Extracts a substring from a string by start position and number of characters to extract.

Example:

`{{mid event.value 3 5}}` - extracts five characters starting from a third character.

|left
a|Extracts a number of characters from a string (starting from left).

Example:

`{{left event.value 3}}`

|right
a|Extracts a number of characters from a string (starting from right).

Example:

`{{right event.value 3}}`

|concat
a|Concatenates two or more strings.

Example:

`{{concat event.value "," event.key}}`

|replace
a|Replaces all substrings within a string.

Example:

`{{replace event.value "stringToReplace" "stringToReplaceWith"}}`

|split
a|Splits a string using a provided splitter.

Example:

`{{split event.value ","}}`

|===


Expand Down
3 changes: 2 additions & 1 deletion docs/user/dashboard/vega-reference.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,8 @@ a configuration option for changing the tooltip position and padding:
kibana: {
tooltips: {
position: 'top',
padding: 15
padding: 15,
textTruncate: true,
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/legacy/server/i18n/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export async function i18nMixin(kbnServer: KbnServer, server: Server, config: Ki
const translationPaths = await Promise.all([
getTranslationPaths({
cwd: fromRoot('.'),
glob: I18N_RC,
glob: `*/${I18N_RC}`,
}),
...(config.get('plugins.paths') as string[]).map((cwd) =>
getTranslationPaths({ cwd, glob: I18N_RC })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ export const CheckBoxField = ({ field, euiFieldProps = {}, ...rest }: Props) =>
error={errorMessage}
isInvalid={isInvalid}
fullWidth
data-test-subj={rest['data-test-subj']}
describedByIds={rest.idAria ? [rest.idAria] : undefined}
{...rest}
>
<EuiCheckbox
label={field.label}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ export const ComboBoxField = ({ field, euiFieldProps = {}, ...rest }: Props) =>
error={errorMessage}
isInvalid={isInvalid}
fullWidth
data-test-subj={rest['data-test-subj']}
describedByIds={rest.idAria ? [rest.idAria] : undefined}
{...rest}
>
<EuiComboBox
noSuggestions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ export const MultiSelectField = ({ field, euiFieldProps = {}, ...rest }: Props)
error={errorMessage}
isInvalid={isInvalid}
fullWidth
data-test-subj={rest['data-test-subj']}
describedByIds={rest.idAria ? [rest.idAria] : undefined}
{...rest}
>
<EuiSelectable
allowExclusions={false}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ export const NumericField = ({ field, euiFieldProps = {}, ...rest }: Props) => {
error={errorMessage}
isInvalid={isInvalid}
fullWidth
data-test-subj={rest['data-test-subj']}
describedByIds={rest.idAria ? [rest.idAria] : undefined}
{...rest}
>
<EuiFieldNumber
isInvalid={isInvalid}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ export const RadioGroupField = ({ field, euiFieldProps = {}, ...rest }: Props) =
error={errorMessage}
isInvalid={isInvalid}
fullWidth
data-test-subj={rest['data-test-subj']}
describedByIds={rest.idAria ? [rest.idAria] : undefined}
{...rest}
>
<EuiRadioGroup
idSelected={field.value as string}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ export const RangeField = ({ field, euiFieldProps = {}, ...rest }: Props) => {
error={errorMessage}
isInvalid={isInvalid}
fullWidth
data-test-subj={rest['data-test-subj']}
describedByIds={rest.idAria ? [rest.idAria] : undefined}
{...rest}
>
<EuiRange
value={field.value as number}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ export const SelectField = ({ field, euiFieldProps, ...rest }: Props) => {
error={errorMessage}
isInvalid={isInvalid}
fullWidth
data-test-subj={rest['data-test-subj']}
describedByIds={rest.idAria ? [rest.idAria] : undefined}
{...rest}
>
<EuiSelect
fullWidth
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ export const SuperSelectField = ({ field, euiFieldProps = { options: [] }, ...re
error={errorMessage}
isInvalid={isInvalid}
fullWidth
data-test-subj={rest['data-test-subj']}
describedByIds={rest.idAria ? [rest.idAria] : undefined}
{...rest}
>
<EuiSuperSelect
fullWidth
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ export const TextAreaField = ({ field, euiFieldProps = {}, ...rest }: Props) =>
error={errorMessage}
isInvalid={isInvalid}
fullWidth
data-test-subj={rest['data-test-subj']}
describedByIds={rest.idAria ? [rest.idAria] : undefined}
{...rest}
>
<EuiTextArea
isInvalid={isInvalid}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ export const TextField = ({ field, euiFieldProps = {}, ...rest }: Props) => {
error={errorMessage}
isInvalid={isInvalid}
fullWidth
data-test-subj={rest['data-test-subj']}
describedByIds={rest.idAria ? [rest.idAria] : undefined}
{...rest}
>
<EuiFieldText
isInvalid={isInvalid}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ export const ToggleField = ({ field, euiFieldProps = {}, ...rest }: Props) => {
error={errorMessage}
isInvalid={isInvalid}
fullWidth
data-test-subj={rest['data-test-subj']}
describedByIds={rest.idAria ? [rest.idAria] : undefined}
{...rest}
>
<EuiSwitch
label={field.label}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ const SavedObjectsTablePage = ({
goInspectObject={(savedObject) => {
const { editUrl } = savedObject.meta;
if (editUrl) {
return coreStart.application.navigateToUrl('/app' + editUrl);
return coreStart.application.navigateToUrl(
coreStart.http.basePath.prepend(`/app${editUrl}`)
);
}
}}
canGoInApp={(savedObject) => {
Expand Down
2 changes: 2 additions & 0 deletions src/plugins/timelion/public/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import { initSavedObjectSaveAsCheckBoxDirective } from './directives/saved_objec
import { initSavedObjectFinderDirective } from './directives/saved_object_finder';
import { initTimelionTabsDirective } from './components/timelionhelp_tabs_directive';
import { initTimelionTDeprecationDirective } from './components/timelion_deprecation_directive';
import { initTimelionTopNavDirective } from './components/timelion_top_nav_directive';
import { initInputFocusDirective } from './directives/input_focus';
import { Chart } from './directives/chart/chart';
import { TimelionInterval } from './directives/timelion_interval/timelion_interval';
Expand Down Expand Up @@ -86,6 +87,7 @@ export function initTimelionApp(app, deps) {
initInputFocusDirective(app);
initTimelionTabsDirective(app, deps);
initTimelionTDeprecationDirective(app, deps);
initTimelionTopNavDirective(app, deps);
initSavedObjectFinderDirective(app, savedSheetLoader, deps.core.uiSettings);
initSavedObjectSaveAsCheckBoxDirective(app);
initCellsDirective(app);
Expand Down
15 changes: 1 addition & 14 deletions src/plugins/timelion/public/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,7 @@ import {
import { getTimeChart } from './panels/timechart/timechart';
import { Panel } from './panels/panel';

import {
configureAppAngularModule,
createTopNavDirective,
createTopNavHelper,
} from '../../kibana_legacy/public';
import { configureAppAngularModule } from '../../kibana_legacy/public';
import { TimelionPluginStartDependencies } from './plugin';
import { DataPublicPluginStart } from '../../data/public';
// @ts-ignore
Expand Down Expand Up @@ -120,11 +116,9 @@ function mountTimelionApp(appBasePath: string, element: HTMLElement, deps: Rende
function createLocalAngularModule(deps: RenderDeps) {
createLocalI18nModule();
createLocalIconModule();
createLocalTopNavModule(deps.plugins.navigation);

const dashboardAngularModule = angular.module(moduleName, [
...thirdPartyAngularDependencies,
'app/timelion/TopNav',
'app/timelion/I18n',
'app/timelion/icon',
]);
Expand All @@ -137,13 +131,6 @@ function createLocalIconModule() {
.directive('icon', (reactDirective) => reactDirective(EuiIcon));
}

function createLocalTopNavModule(navigation: TimelionPluginStartDependencies['navigation']) {
angular
.module('app/timelion/TopNav', ['react'])
.directive('kbnTopNav', createTopNavDirective)
.directive('kbnTopNavHelper', createTopNavHelper(navigation.ui));
}

function createLocalI18nModule() {
angular
.module('app/timelion/I18n', [])
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
import React from 'react';

export function initTimelionTopNavDirective(app, deps) {
app.directive('timelionTopNav', function (reactDirective) {
return reactDirective(
(props) => {
const { TopNavMenu } = deps.plugins.navigation.ui;
return (
<deps.core.i18n.Context>
<TopNavMenu
appName="timelion"
showTopNavMenu
config={props.topNavMenu}
setMenuMountPoint={deps.mountParams.setHeaderActionMenu}
onQuerySubmit={props.onTimeUpdate}
screenTitle="timelion"
showDatePicker
showFilterBar={false}
showQueryInput={false}
showSaveQuery={false}
showSearchBar
useDefaultBehaviors
/>
</deps.core.i18n.Context>
);
},
[
['topNavMenu', { watchDepth: 'reference' }],
['onTimeUpdate', { watchDepth: 'reference' }],
],
{
restrict: 'E',
scope: {
topNavMenu: '=',
onTimeUpdate: '=',
},
}
);
});
}
16 changes: 1 addition & 15 deletions src/plugins/timelion/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,7 @@
</span>
</span>
<!-- Local nav. -->
<kbn-top-nav
app-name="'timelion'"
config="topNavMenu"
show-search-bar="true"
show-search-bar-inline="true"
show-filter-bar="false"
show-query-input="false"
date-range-from="model.timeRange.from"
date-range-to="model.timeRange.to"
is-refresh-paused="model.refreshInterval.pause"
refresh-interval="model.refreshInterval.value"
on-refresh-change="onRefreshChange"
on-query-submit="onTimeUpdate">
</kbn-top-nav>

<timelion-top-nav top-nav-menu="topNavMenu" on-time-update="onTimeUpdate"></timelion-top-nav>

<div class="timApp__menus">
<timelion-deprecation></timelion-deprecation>
Expand Down
10 changes: 7 additions & 3 deletions src/plugins/vis_type_vega/public/_vega_vis.scss
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,19 @@
margin-bottom: $euiSizeS;
}

&--textTruncate {
td {
@include euiTextTruncate;
}
}

td {
@include euiTextTruncate;
padding-top: $euiSizeXS;
padding-bottom: $euiSizeXS;

&.key {
color: $euiColorMediumShade;
max-width: $euiSize * 10;
color: $euiColorMediumShade;
text-align: right;
padding-right: $euiSizeXS;
}
Expand All @@ -131,7 +136,6 @@
}
}


@media only screen and (max-width: map-get($euiBreakpoints, 'm')) {
td {
&.key {
Expand Down
Loading

0 comments on commit e04b7ba

Please sign in to comment.