uiSettings - use validation field for image field maxSize#54522
uiSettings - use validation field for image field maxSize#54522mattkime merged 19 commits intoelastic:masterfrom
Conversation
|
@elasticmachine merge upstream |
src/legacy/core_plugins/kibana/public/management/sections/settings/components/field/field.js
Outdated
Show resolved
Hide resolved
…tkime/kibana into reporting_custom_logo_fix_uiSettings
|
Pinging @elastic/kibana-app-arch (Team:AppArch) |
| | [requiresPageReload](./kibana-plugin-server.uisettingsparams.requirespagereload.md) | <code>boolean</code> | a flag indicating whether new value applying requires page reloading | | ||
| | [type](./kibana-plugin-server.uisettingsparams.type.md) | <code>UiSettingsType</code> | defines a type of UI element [UiSettingsType](./kibana-plugin-server.uisettingstype.md) | | ||
| | [value](./kibana-plugin-server.uisettingsparams.value.md) | <code>SavedObjectAttribute</code> | default value to fall back to if a user doesn't provide any | | ||
|
|
||
| <!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
|
||
| [Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [UiSettingsParams](./kibana-plugin-server.uisettingsparams.md) | ||
|
|
||
| ## UiSettingsParams interface | ||
|
|
||
| UiSettings parameters defined by the plugins. |
There was a problem hiding this comment.
The generated doc files are using windows line feed (this is how the tool work so we decided to keep it like this), and you pushed them with LF (autocrlf probably). Please regenerate the doc and commit them with preserved line feeds.
There was a problem hiding this comment.
I don't think there is a way to configure it currently #53761 (comment)
There was a problem hiding this comment.
I don't think either, that's why we need to stick to CRLF for now. Issue is, a lot of developers uses core.autocrlf input git config to convert to LF (which is a good practice most of the time) and may push without even knowing they altered the linefeeds.
There was a problem hiding this comment.
we can enforce EOL format for all *.md files on the github repo level https://github.com/microsoft/rushstack/blob/2c941e21777393c67979b25dc087433485b12575/.gitattributes#L44
There was a problem hiding this comment.
Obviously I know very little about this tool, but I'd be tempted to wrap it in a script that converts the line endings. Having markdown files that must use different line endings is going to cause some headaches.
src/core/server/ui_settings/types.ts
Outdated
| /** defines a type of UI element {@link UiSettingsType} */ | ||
| type?: UiSettingsType; | ||
| /** field ui options */ | ||
| uiOptions?: Record<string, any>; |
There was a problem hiding this comment.
uiOptions sounds like anything used in UI, although reporting uses it for validation. There is the validation field for the same purpose added in #44678 although it's missed in TypeScript definition. Would you mind adding one?
We have the separate issue to introduce a proper validation for UI settings #46717
Thus, we should mark this validation field as deprecated.
type StringValidation = {
regexString: string,
message: string
};
type ImageValidation = {
maxSize: ...
}
interface UiSettingsParams {
...
/*
* Allows defining a custom validation applicable to value change on the client.
* @deprecated
*/
validation: StringValidation | ImageValidation;
}|
@elasticmachine merge upstream |
…tkime/kibana into reporting_custom_logo_fix_uiSettings
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
* upstream/master: (26 commits) Take page offset into account too (elastic#54567) [APM] Support error.{log,exception}.stacktrace.classname (elastic#54577) Np migration tsvb route validation (elastic#51850) [ML] MML calculator enhancements for multi-metric job wizard (elastic#54573) [SIEM] Fix Inspect query 'request timestamp' value changes when curso… (elastic#54223) Fix chromeless NP apps not using full page width (elastic#54550) Remove extraneous public import to prevent failing Kibana startup (elastic#54676) [Uptime] Temporarily skip flakey tests (elastic#54675) Skip failing uptime tests Create UI for alerting and actions plugin (elastic#48959) [dev/build/sass] build stylesheets for disabled plugins too (elastic#54654) [SIEM] Use bulk actions API when updating or deleting rules (elastic#54521) Support "Deprecated" label in advanced settings (elastic#54539) [Maps] add text halo color and width style properties (elastic#53827) Service Map Data API at Runtime (elastic#54027) [SIEM] Detection Engine Create Rule Design Review #1 (elastic#54442) Skip flaky test [Canvas] Enable Embeddable maps (elastic#53971) [SIEM][Detection Engine] Increases the number or rules you can view on a single page (elastic#54628) uiSettings - use validation field for image field maxSize (elastic#54522) ...
Summary
In
uiSettings, the image upload field required specifyingmaxSizevia theoptionsfield. This was in conflict with the stated use and type ofoptions- which is astring[]use to populate select fields. Use validation field for image field maxSizeChecklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.[ ] Any text added follows EUI's writing guidelines, uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/master/packages/kbn-i18n/README.md)[ ] Documentation was added for features that require explanation or tutorials[ ] This was checked for keyboard-only and screenreader accessibilityFor maintainers
Dev Docs
uiSettingsimage upload field configIn
uiSettings, the image upload field required specifyingmaxSizevia theoptionsfield. This was in conflict with the stated use and type ofoptions- which is astring[]use to populate select fields.uiOptionshas been provided instead, acceptingRecord<string, any>values.