Skip to content

Commit

Permalink
hide fit from suggestions (#119568)
Browse files Browse the repository at this point in the history
Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
flash1293 and kibanamachine authored Nov 27, 2021
1 parent 736e31a commit 6367b17
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/plugins/vis_types/timelion/common/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export interface TimelionFunctionArgs {
multi?: boolean;
types: TimelionFunctionArgsTypes[];
suggestions?: TimelionFunctionArgsSuggestion[];
hidden?: boolean;
}

export interface ITimelionFunction {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function getArgumentsHelp(

// ignore arguments that are already provided in function declaration
const functionArgNames = functionArgs.map((arg) => arg.name);
return argsHelp.filter((arg) => !functionArgNames.includes(arg.name));
return argsHelp.filter((arg) => !arg.hidden && !functionArgNames.includes(arg.name));
}

async function extractSuggestionsFromParsedResult(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export default class Datasource extends TimelionFunction {
fitFunctions: _.keys(fitFunctions).join(', '),
},
}),
hidden: Boolean(config.hideFitArg),
});

// Wrap the original function so we can modify inputs/outputs with offset & fit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import buildRequest from './lib/build_request';
import toSeriesList from './lib/agg_response_to_series_list';

export default new Datasource('es', {
hideFitArg: true,
args: [
{
name: 'q',
Expand Down

0 comments on commit 6367b17

Please sign in to comment.