-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[add data] prototype for string resources #7156
[add data] prototype for string resources #7156
Conversation
'Let\'s build a pipeline!', | ||
|
||
headerText: | ||
'Ingest pipelines are an easy way to modify documents before they\'re indexed in Elasticsearch. ' + |
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.
Using es6 backticks would eliminate the need for +'s at the end of each line.
I was thinking about it some more, and I think the Angular filter is ok if it remains a thin layer over a plain module that does the real internationalization work down the road. This way we can have the convenience of the filter in Kibana, but other plugins that might use different view technology can still make use of and add to the module. Along those lines, should we make this pluggable now? I'm thinking plugins should be able to both add and consume resource strings, and the strings should be namespaced with the name of the plugin that added them. One last thought at the moment. Could/should we combine this with the dynamic doc links module? #6989 |
I moved the strings into a registry and added them to a few more pages to get a better feel for what this would look like across the application. |
Why use a filter instead of a directive here?Using
Interestingly, in the future, you could expand the role of the thing passed to |
Also, much discussion has been had on this subject in this thread: #6515 |
@epixa your thoughts on the design here would be helpful |
What's the motivation here in the context of add data? |
@epixa this came up during a couple of discussions about in-page documentation for the Add Data wizards (#6851). Ideally the user will be able to use the wizards without getting dumped to outside documentation, so we plan on adding lots of help text to the page. @debadair told us this help text would be easier for the docs team to review and help manage if it were pulled out into separate string resource files. There are obvious benefits for internationalization down the road as well, but we're not trying to solve that entire problem here. Mainly we're just trying to get static text out of the html templates. |
That makes sense, thanks! The biggest concern I have is that we're using JS modules as a state management system - simply importing the registry results in an essentially-global, mutable singleton. I recommend at the very least changing I don't think these configurations should be created during runtime, either. Instead, we should put configuration like this inside static configuration files (json or yml) that we then load into memory at startup. This would allow us to develop more tooling around the configuration itself without being coupled to a running instance of Kibana, and it would also mean that we could handle errors in parsing configuration in helpful ways, whereas something like a missing comma in the current implementation would just crash the entire application. Finally, overall this seems like something that could be handled statically at build time rather than on the client at runtime. This whole implementation would essentially become a devDependency, and there would be no lingering issues with or concerns for performance impacts in production builds. |
@epixa @BigFunger perhaps we should chat over zoom or IRC about this. I have a few questions before we dive too deep:
|
Yeah now that I look at that PR and issue, there's a huge amount of overlap. Given that prototyping is already under way in #7247 it seems kinda foolish to reproduce that work here. Unless anyone has a compelling argument to the contrary, I think we should forget about trying to implement some half measure in Add Data that's just going to get thrown away after #6515 is complete. |
No objections here. For now, let's just put the add data help info directly into the templates. |
`v88.3.0`⏩`v88.5.0` closes #151514 --- ## [`88.5.0`](https://github.com/elastic/eui/tree/v88.5.0) - Updated `EuiCallOut` with a new `onDismiss` prop ([#7156](elastic/eui#7156)) - Added a new `renderCustomToolbar` prop to `EuiDataGrid`, which allows custom rendering of the toolbar. ([#7190](elastic/eui#7190)) - Added a new `allowResetButton` prop to `toolbarVisibility.showDisplaySelector` of `EuiDataGrid`, which allows hiding the "Reset to default" button from the display settings popover. ([#7190](elastic/eui#7190)) - Added a new `additionalDisplaySettings` prop to `toolbarVisibility.showDisplaySelector` of `EuiDataGrid`, which allows rendering extra settings inside the display settings popover. ([#7190](elastic/eui#7190)) - Updated `EuiDataGrid`'s toolbar display settings button icon ([#7190](elastic/eui#7190)) - Updated `EuiTextTruncate` with significantly improved iteration performance. Removed `measurementRenderAPI` prop, as `EuiTextTruncation` now only uses more performant canvas render API ([#7210](elastic/eui#7210)) - Updated `EuiPopover` with a new configurable `repositionToCrossAxis` prop ([#7211](elastic/eui#7211)) - Updated `EuiDatePicker` to support `compressed` input styling ([#7218](elastic/eui#7218)) - Added `gradient` and `palette` icon glyphs. ([#7220](elastic/eui#7220)) **Bug fixes** - Fixed `EuiPopover`'s missing animations on popover close ([#7211](elastic/eui#7211)) - Fixed `EuiInputPopover` anchoring to the wrong side and missing shadows on smaller screens ([#7211](elastic/eui#7211)) - Fixed `EuiSuperDatePicker` icon spacing on the quick select button ([#7217](elastic/eui#7217)) - Fixed a missing type in `EuiMarkdownEditor`'s default processing plugins ([#7221](elastic/eui#7221)) ## [`88.4.1`](https://github.com/elastic/eui/tree/v88.4.1) **Bug fixes** - Fixed missing `className`s on `EuiTextTruncate` ([#7212](elastic/eui#7212)) - Fixed `title`s on `EuiComboBox` dropdown options to always be present ([#7212](elastic/eui#7212)) - Fixed `EuiComboBox` truncation issues when search is an empty space ([#7212](elastic/eui#7212)) ## [`88.4.0`](https://github.com/elastic/eui/tree/v88.4.0) - Updated `EuiComboBox` to allow configuring text truncation behavior via `truncationProps`. These props can be set on the entire combobox as well as on on individual dropdown options. ([#7028](elastic/eui#7028)) - Updated `EuiInMemoryTable` with a new `searchFormat` prop (defaults to `eql`). When setting this prop to `text`, the built-in search bar will ignore EQL syntax and allow searching for plain strings with special characters and symbols. ([#7175](elastic/eui#7175)) **Bug fixes** - `EuiComboBox` now always shows the highlighted search text, even on truncated text ([#7028](elastic/eui#7028)) - Fixed missing i18n in `EuiSearchBar`'s default placeholder and aria-label text ([#7175](elastic/eui#7175)) - Fixed the inline compressed styles of `EuiDescriptionListTitle` to use a taller line-height for readability ([#7185](elastic/eui#7185)) - Fixed `EuiComboBox` to correctly truncate selected items when displayed as pills and plain text ([#7193](elastic/eui#7193)) **Accessibility** - Added `aria-current` attribute to `EuiTablePagination` ([#7186](elastic/eui#7186)) **CSS-in-JS conversions** - Converted `EuiDroppable` and `EuiDraggable` to Emotion; Removed `$euiDragAndDropSpacing` Sass variables ([#7187](elastic/eui#7187)) --------- Co-authored-by: Patryk Kopycinski <contact@patrykkopycinski.com> Co-authored-by: Jan Monschke <jan.monschke@elastic.co> Co-authored-by: Thomas Watson <watson@elastic.co>
Prototype Only
Adds string resources to the application. This allows us to define string resources outside of the views in which they are consumed.
This could also be modified in the future to create an i18n/l10n system.
This strings are stored in a registry that can added to by anywhere in the system.
Moving parts
.../add_data_steps/pipeline_setup/string_resources.js
.../pipeline_setup/index.js
.../views/pipeline_setup.html
.../directives/filebeat_wizard.js