-
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] i18n work on workpad header (and a few header CTAs) and convert to typescript #44943
[Canvas] i18n work on workpad header (and a few header CTAs) and convert to typescript #44943
Conversation
Pinging @elastic/kibana-canvas |
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 work! Approving to unblock, but resolve the comments below before merging.
@@ -5,22 +5,40 @@ | |||
*/ | |||
|
|||
import { connect } from 'react-redux'; | |||
import { Dispatch } from 'redux'; | |||
// @ts-ignore: Local Untyped |
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.
nit: "Untyped local" - just so we can find them all later
setWriteable: (isWorkpadWriteable: boolean) => void; | ||
} | ||
|
||
const mapStateToProps = (state: any) => ({ |
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.
State
should be defined.
@@ -53,7 +76,7 @@ export class WorkpadHeader extends React.PureComponent { | |||
</EuiToolTip> | |||
); | |||
|
|||
_keyHandler = action => { | |||
_keyHandler = (action: string) => { |
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.
action
appears to be a predictable type.
type Action = 'EDITING' | 'FULLSCREEN' | ...?
_keyHandler = (action: Action) => {
Might chat with @cqliu1 about where these are defined, then enumerate them there as a type. Otherwise, for now, just create a type here that matches what we're expecting.
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.
Spoke with @cqliu1 about it.. seems like there's not a good way right now to grab all the actions. I looked briefly at defining them as a big union type but Catherine and I agreed it might be better to have them all listed as an enum that way you can reference them when adding to the keymap (not just referencing a magic string). Problem with doing that enum is that it might be a really not-fun refactor and I'm not sure we wanna block i18n work for it.
I went ahead and created this issue for it though: #45073
@@ -18,30 +19,52 @@ import { | |||
EuiModalFooter, | |||
EuiToolTip, | |||
} from '@elastic/eui'; | |||
|
|||
import { ComponentStrings } from '../../../i18n'; | |||
const { WorkpadHeader: strings } = ComponentStrings; |
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.
nit: place const
after all imports.
}), | ||
getSpaceUsedText: (percentageUsed: number) => | ||
i18n.translate('xpack.canvas.assetModal.spacedUsedText', { | ||
defaultMessage: `${percentageUsed}% space used`, |
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.
This should have a value, not use template strings:
defaultMessage: '{percentageUsed} space used',
values: {
percentageUsed
}
https://github.com/elastic/kibana/blob/master/src/dev/i18n/README.md
💔 Build Failed |
💚 Build Succeeded |
💚 Build Succeeded |
💔 Build Failed |
💚 Build Succeeded |
This reverts commit d00e48853bcb16fdb14f9bca8b2536c920e8d650.
2747510
to
27eb09a
Compare
💔 Build Failed |
retest |
💔 Build Failed |
💚 Build Succeeded |
…-to-np-ready * 'master' of github.com:elastic/kibana: (138 commits) [Canvas] i18n work on workpad header (and a few header CTAs) and convert to typescript (elastic#44943) update close/delete system index modals (elastic#45037) TS return type of createIndexPatternSelect (elastic#45107) [ML] Fix focus chart updating. (elastic#45146) [ML] Data frame transform: Fix progress in wizard create step. (elastic#45116) [Graph] Re-enable functional test (elastic#44683) [SIEM] unique table id for each top talkers table (elastic#45014) [SIEM] ip details heading draggable (elastic#45179) [Maps][File upload] Set complete on index pattern creation (elastic#44423) [Maps] unmount map embeddable component on destroy (elastic#45183) [SIEM] Adds error toasts to MapEmbeddable component (elastic#45088) fix redirect to maintain search query string (elastic#45184) [APM] One-line trace summary (elastic#44842) [Infra UI] Display non-metric details on Node Detail page (elastic#43551) [Maps][File upload] Removing bbox from parsed file pending upstream lib fix (elastic#45194) [Logs UI] Improve live streaming behavior when scrolling (elastic#44923) [APM] Fix indefinite loading state in agent settings for unauthorized user roles (elastic#44970) [Reporting] Rewrite addForceNowQuerystring to getFullUrls (elastic#44851) [Reporting/ESQueue] Improve logging of doc-update events (elastic#45077) [Reporting] Make screenshot capture less noisy by default (elastic#45185) ...
…ert to typescript (elastic#44943) * i18n work on workpad header and a few header ctas * Convert WorkpadHeader to typescript * String ordering cleanup * Addressing some feedback * Adding state * lint * Shortcut type refactor * Revert "Shortcut type refactor" This reverts commit d00e48853bcb16fdb14f9bca8b2536c920e8d650. * Using new State type * Removing unused type * Updating state type
…ert to typescript (#44943) (#45405) * i18n work on workpad header and a few header ctas * Convert WorkpadHeader to typescript * String ordering cleanup * Addressing some feedback * Adding state * lint * Shortcut type refactor * Revert "Shortcut type refactor" This reverts commit d00e48853bcb16fdb14f9bca8b2536c920e8d650. * Using new State type * Removing unused type * Updating state type
Summary
Converted
WorkpadHeader
to Typescript (with some adjustments to a few related components)Adding i18n strings for the following components:
WorkpadHeader
(subcomponents not yet complete)Asset
AssetManager
AssetModal
slight modification to the embeddable flyout
Checklist
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- [ ] Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support- [ ] Documentation was added for features that require explanation or tutorials- [ ] Unit or functional tests were updated or added to match the most common scenarios- [ ] This was checked for keyboard-only and screenreader accessibilityFor maintainers