-
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
Use NP registry instead of ui/registry/field_formats #48108
Use NP registry instead of ui/registry/field_formats #48108
Conversation
💚 Build Succeeded |
💔 Build Failed |
💔 Build Failed |
💔 Build Failed |
💔 Build Failed |
💔 Build Failed |
💔 Build Failed |
💔 Build Failed |
💔 Build Failed |
💔 Build Failed |
💚 Build Succeeded |
💚 Build Succeeded |
💚 Build Succeeded |
* Create Field Format Provider * Pass Field Format as a start dependency * Register utils in the new field formats * Fix types issue * Make FieldFormats instance as a service * Exclude importing of register.js * Remove uiExports/fieldFormats imports * Migrate some dependencies to new Field Format * Migrate field format to new instance * Fix type errors * Fix Jest tests * Move from getFieldFormat to npSetup * Fix types errors * Fix reviews * Fix types errors * Fix types * fix CI * Bind getConfig to FieldFormatRegisty * Mock FieldFormat in FieldItem * Fix DataPanel tests * Fix DataPanel tests * Fix Jest tests * Create a fieldFormats mock for mocha tests * fix CI * fix CI * Mock fieldFormatsRegistry in all visualizations * Fix 'should create scripted field' functional test * Change FieldFormat.from return type * Fix reviews * Fix mocha test * Fix mocha tests * Encapsulate FieldFormatRegistry * Pretty field_item.tsx * Fix reviews * Fix PR comments * Fix CI * Replace any by a specific type * Fix mocha tests * Remove config from url converter * Expand Field Format ID type for creating custom converters * Fix a jest test * Update migration doc * Add quote and semicolon * Fix types errors which doesn't relate to the aim of PR
* Create Field Format Provider * Pass Field Format as a start dependency * Register utils in the new field formats * Fix types issue * Make FieldFormats instance as a service * Exclude importing of register.js * Remove uiExports/fieldFormats imports * Migrate some dependencies to new Field Format * Migrate field format to new instance * Fix type errors * Fix Jest tests * Move from getFieldFormat to npSetup * Fix types errors * Fix reviews * Fix types errors * Fix types * fix CI * Bind getConfig to FieldFormatRegisty * Mock FieldFormat in FieldItem * Fix DataPanel tests * Fix DataPanel tests * Fix Jest tests * Create a fieldFormats mock for mocha tests * fix CI * fix CI * Mock fieldFormatsRegistry in all visualizations * Fix 'should create scripted field' functional test * Change FieldFormat.from return type * Fix reviews * Fix mocha test * Fix mocha tests * Encapsulate FieldFormatRegistry * Pretty field_item.tsx * Fix reviews * Fix PR comments * Fix CI * Replace any by a specific type * Fix mocha tests * Remove config from url converter * Expand Field Format ID type for creating custom converters * Fix a jest test * Update migration doc * Add quote and semicolon * Fix types errors which doesn't relate to the aim of PR
Cleanup after merging elastic#48108
…ic#51419) Cleanup after merging elastic#48108
@paulyg321 Looks like you did everything right. At the Keep in mind that you can add custom field formats only at the |
@paulyg321 Is there a way for you to share your code? Perhaps point me to a PR on your own repo. |
@mattkime @alexwizp Here's a link to the Github repo with the code i'm working on. https://github.com/paulyg321/kibana-field-formatters/blob/master/public/dictionary-lookup.js |
@paulyg321 I think it would be helpful to try to use the kibana platform (aka the new platform) to create this plugin. It will be a little bit more work but it will help preserve future compatibility. Here's how I recommend we accomplish that - Clone the kibana repo, run You can also reach me on the elastic community slack - https://www.elastic.co/blog/join-our-elastic-stack-workspace-on-slack Anyway, I know I'm pointing you in a different direction but I hope you find it helpful. Oh, do you see any console errors with your current code? There might be a simple fix. |
Hello, I've been encountering the same issues as the previous poster. My code is very similar to what they linked on GitHub, but I'll also try to make mine publicly available shortly. The current issue only appears after clicking "edit" on a field within an index pattern (management tab). When the new page loads that would normally allow the selection of a field formatter, I see a console error "format.fieldType is undefined." It is however defined as such
Edit: plugin code is available here https://github.com/cliffplaysdrums/kibana-plugins/tree/master/cliff_test_plugin |
Hi @cliffplaysdrums. I looked at your code and found that you are still using an outdated approach that has already been removed. Please see our migration documentation: Also I can show you an example of how to register a custom format in a new platform: Please let me know if something is unclear. You can use the following command to generate new plugin: |
Summary
A part of #43443
uiExports/fieldFormats
;field_formats.js
;FieldFormatRegisty
and replace oldfield_formats.js
dependencies by the new one;FieldFormatRegisty
toplugins/data
;Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.For maintainers
Dev Docs
The
FieldFormats
service has been moved to thedata
plugin in the New Platform. If your plugin has any imports fromui/registry/field_formats
, you'll need to update your imports as follows:Use it in your New Platform plugin:
Or, in your legacy platform plugin, consume it through the
ui/new_platform
module: