-
Notifications
You must be signed in to change notification settings - Fork 24
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
Bug 2072797: Add duration to top consumers card #683
Bug 2072797: Add duration to top consumers card #683
Conversation
@pcbailey: This pull request references Bugzilla bug 2072797, which is invalid:
Comment In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/bugzilla refresh |
@pcbailey: This pull request references Bugzilla bug 2072797, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker. 3 validation(s) were run on this bug
Requesting review from QA contact: In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
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.
Hey Phillip, nice work 😄
I left you some comments
src/views/clusteroverview/overview/components/top-consumers-card/utils/DurationDropdown.tsx
Outdated
Show resolved
Hide resolved
src/views/clusteroverview/overview/components/top-consumers-card/utils/DurationDropdown.tsx
Outdated
Show resolved
Hide resolved
|
||
class DurationOption extends DropdownEnum<string> { | ||
static readonly FIVE_MIN = new DurationOption('5m', { | ||
// t('5 minutes') |
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 this should be // t('plugin__kubevirt-plugin~5 minutes')
and should be moved to src/utils/i18n.ts as well as the other similar comments in this file
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.
Why? yarn i18n
picked them up. Is there something I'm missing?
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.
AFAIK src/utils/i18n.ts is to make some file that contains all these kind of comments to the translation parser, not as a strict rule but more of a convention to us :)
and Im almost sure when you put it in a comment like you did, we need to prefix plugin__kubevirt-plugin~
to the string we want to translate.
adding @glekner to this since he has more knowledge on this than I :)
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 went ahead and changed it, but further explanation would be helpful so I'll understand the difference. =)
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.
no need for prefix
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.
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.
@glekner Thanks! Can you explain what the difference is between adding the comment in src/utils/i18n.ts
vs any other file?
1f0be5d
to
dbbaa55
Compare
dbbaa55
to
ed37e9b
Compare
@@ -0,0 +1,18 @@ | |||
import { ObjectEnum } from '@kubevirt-utils/utils/ObjectEnum'; |
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.
@pcbailey I feel like using ObjectEnum
is a pain from the past that we should try to avoid at all cost.
I do understand that you have portions of your feature relying on it, so IMO its ok to use it for porting features like the Virtualization dashboard. But I strongly recommend to move over to plain objects and hooks when implementing new features from now on.
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: avivtur, pcbailey The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@pcbailey: All pull requests linked via external trackers have merged: Bugzilla bug 2072797 has been moved to the MODIFIED state. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
This PR adds the option to select a duration to the top consumers card.
Screenshots