-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Canvas] Clean up expression function definitions #37305
Conversation
68f3ccf
to
096d145
Compare
💚 Build Succeeded |
Pinging @elastic/kibana-canvas |
8361fb4
to
effaf61
Compare
💚 Build Succeeded |
761a8b7
to
ead8fdf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only change I'd say is needed here is the required setting on sort.by
, the rest is mostly questions.
x-pack/plugins/canvas/canvas_plugin_src/functions/browser/markdown.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/axis_config.js
Show resolved
Hide resolved
x-pack/plugins/canvas/canvas_plugin_src/functions/common/containerStyle.ts
Show resolved
Hide resolved
x-pack/plugins/canvas/canvas_plugin_src/functions/common/plot/series_style_to_flot.ts
Show resolved
Hide resolved
x-pack/plugins/canvas/canvas_plugin_src/functions/common/sort.ts
Outdated
Show resolved
Hide resolved
@@ -63,14 +63,14 @@ export function font(): NullContextFunction<'font', Arguments, Style> { | |||
types: ['boolean'], | |||
}, | |||
lHeight: { | |||
aliases: ['lineHeight'], | |||
aliases: ['lineHeight', 'null'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think null
was supposed to be added to types
instead of aliases
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch! I meant to put to it on types. I'll fix it.
65bd457
to
125d17c
Compare
6757897
to
91f010d
Compare
💚 Build Succeeded |
💚 Build Succeeded |
* Cleaned up common function defs fixed broken tests Remove boolean and null as context/arg valid types in lt, lte, gt, and gte Added 'function' alias Updated comparator tests Added neq to options in compare function null audit * Deleted obsolete 'browser' and 'server' functions * More clean up * Removed server and browser function i18n strings * Fixed broken tests * Addressing feedback * Removed browser and server from function_help * Added ts-ignore for constant import * Fixed help text label * Fixed font
* Cleaned up common function defs fixed broken tests Remove boolean and null as context/arg valid types in lt, lte, gt, and gte Added 'function' alias Updated comparator tests Added neq to options in compare function null audit * Deleted obsolete 'browser' and 'server' functions * More clean up * Removed server and browser function i18n strings * Fixed broken tests * Addressing feedback * Removed browser and server from function_help * Added ts-ignore for constant import * Fixed help text label * Fixed font
* Synced up docs with function defs * Updated docs with changes from PR elastic#37305 * Merged canvas function ref into a single doc * Fixed arg order * Fixed typo * Added alphabet links * Added alphabet headers * Removed B header * Added missing args from * Added edits from PR elastic#37614 * Updated containerStyle * Removed metafields. ESSQL doesn't support retrieving metafields * Edits to function copy * More edits * More edits * Final round of edits * Fixed i18n errors * Addressing feedback * Fixed jest test * Fixed missing import * Fixed i18n error * Restored metaFields arg in esdocs * Extracted i18n string constants * Fixed i18n errors * Updated translation files
* Synced up docs with function defs * Updated docs with changes from PR #37305 * Merged canvas function ref into a single doc * Fixed arg order * Fixed typo * Added alphabet links * Added alphabet headers * Removed B header * Added missing args from * Added edits from PR #37614 * Updated containerStyle * Removed metafields. ESSQL doesn't support retrieving metafields * Edits to function copy * More edits * More edits * Final round of edits * Fixed i18n errors * Addressing feedback * Fixed jest test * Fixed missing import * Fixed i18n error * Restored metaFields arg in esdocs * Extracted i18n string constants * Fixed i18n errors * Updated translation files
* Synced up docs with function defs * Updated docs with changes from PR elastic#37305 * Merged canvas function ref into a single doc * Fixed arg order * Fixed typo * Added alphabet links * Added alphabet headers * Removed B header * Added missing args from * Added edits from PR elastic#37614 * Updated containerStyle * Removed metafields. ESSQL doesn't support retrieving metafields * Edits to function copy * More edits * More edits * Final round of edits * Fixed i18n errors * Addressing feedback * Fixed jest test * Fixed missing import * Fixed i18n error * Restored metaFields arg in esdocs * Extracted i18n string constants * Fixed i18n errors * Updated translation files
* [Canvas][Docs] Merge Canvas function references (#38300) * Synced up docs with function defs * Updated docs with changes from PR #37305 * Merged canvas function ref into a single doc * Fixed arg order * Fixed typo * Added alphabet links * Added alphabet headers * Removed B header * Added missing args from * Added edits from PR #37614 * Updated containerStyle * Removed metafields. ESSQL doesn't support retrieving metafields * Edits to function copy * More edits * More edits * Final round of edits * Fixed i18n errors * Addressing feedback * Fixed jest test * Fixed missing import * Fixed i18n error * Restored metaFields arg in esdocs * Extracted i18n string constants * Fixed i18n errors * Updated translation files * Fixes Canvas doc headers (#40921)
* [Canvas][Docs] Merge Canvas function references (#38300) * Synced up docs with function defs * Updated docs with changes from PR #37305 * Merged canvas function ref into a single doc * Fixed arg order * Fixed typo * Added alphabet links * Added alphabet headers * Removed B header * Added missing args from * Added edits from PR #37614 * Updated containerStyle * Removed metafields. ESSQL doesn't support retrieving metafields * Edits to function copy * More edits * More edits * Final round of edits * Fixed i18n errors * Addressing feedback * Fixed jest test * Fixed missing import * Fixed i18n error * Restored metaFields arg in esdocs * Extracted i18n string constants * Fixed i18n errors * Updated translation files * Fixes Canvas doc headers (#40921) * Fixed imports
Summary
Related to #37614.
Updating all functions definitions to be more accurate/uniform. The changes in #37614 should reflect any updates made in this PR, so it'd be good to review both side-by-side. I tried my best change as little functionality as possible.
Changes:
content
as an alias for the unnamed arg formarkdown
required: true
context
type asnull
for functions that don't usecontext
or pass it alongnull
as valid context/arg type where applicablefn
,exp
,function
,expression
to all args that had a subset of these aliases to be consistentboolean
andnull
as context types andboolean
as value type forgt
,gte
,lt
, andlte
because these operations only make sense fornumbers
and sometimesstrings
browser
andserver
functions since the interpreter now runs every function in the browser unless it's a server functionChecklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.- [ ] This was checked for cross-browser compatibility, including a check against IE11- [ ] This was checked for keyboard-only and screenreader accessibilityFor maintainers