Skip to content

Commit

Permalink
Merge branch '7.x' into backport/7.x/pr-80215
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored Oct 19, 2020
2 parents cfe11f9 + b63c001 commit e41d35b
Show file tree
Hide file tree
Showing 83 changed files with 8,201 additions and 1,258 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

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ export function displayHelp() {
export function processOptions(userOptions, defaultConfigPath) {
validateOptions(userOptions);

const config = userOptions.config || defaultConfigPath;
const useDefaultConfig = !userOptions.config;
const config = useDefaultConfig ? defaultConfigPath : userOptions.config;

if (!config) {
throw new Error(`functional_tests_server: config is required`);
Expand All @@ -100,6 +101,7 @@ export function processOptions(userOptions, defaultConfigPath) {
return {
...userOptions,
config: resolve(config),
useDefaultConfig,
createLogger,
extraKbnOpts: userOptions._,
};
Expand Down
9 changes: 8 additions & 1 deletion packages/kbn-test/src/functional_tests/tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,21 @@ import { readConfigFile } from '../functional_test_runner/lib';

const makeSuccessMessage = (options) => {
const installDirFlag = options.installDir ? ` --kibana-install-dir=${options.installDir}` : '';
const configPaths = Array.isArray(options.config) ? options.config : [options.config];
const pathsMessage = options.useDefaultConfig
? ''
: configPaths
.map((path) => relative(process.cwd(), path))
.map((path) => ` --config ${path}`)
.join('');

return (
'\n\n' +
dedent`
Elasticsearch and Kibana are ready for functional testing. Start the functional tests
in another terminal session by running this command from this directory:
node ${relative(process.cwd(), KIBANA_FTR_SCRIPT)}${installDirFlag}
node ${relative(process.cwd(), KIBANA_FTR_SCRIPT)}${installDirFlag}${pathsMessage}
` +
'\n\n'
);
Expand Down
10 changes: 9 additions & 1 deletion src/cli_keystore/add.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,15 @@ export async function add(keystore, key, options = {}) {
value = await question(`Enter value for ${key}`, { mask: '*' });
}

keystore.add(key, value.trim());
const parsedValue = value.trim();
let parsedJsonValue;
try {
parsedJsonValue = JSON.parse(parsedValue);
} catch {
// noop, only treat value as json if it parses as JSON
}

keystore.add(key, parsedJsonValue ?? parsedValue);
keystore.save();
}

Expand Down
11 changes: 11 additions & 0 deletions src/cli_keystore/add.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,17 @@ describe('Kibana keystore', () => {
expect(keystore.data.foo).toEqual('bar');
});

it('parses JSON values', async () => {
prompt.question.returns(Promise.resolve('["bar"]\n'));

const keystore = new Keystore('/data/test.keystore');
sandbox.stub(keystore, 'save');

await add(keystore, 'foo');

expect(keystore.data.foo).toEqual(['bar']);
});

it('persists updated keystore', async () => {
prompt.question.returns(Promise.resolve('bar\n'));

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e41d35b

Please sign in to comment.