-
Notifications
You must be signed in to change notification settings - Fork 392
fix(NotificationDrawer): add Translation capability #339
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
Merged
jeff-phillips-18
merged 1 commit into
patternfly:master
from
glekner:fix-notification-translation
May 14, 2018
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
packages/core/src/components/Notification/NotificationDrawer/NotificationDrawerEmptyState.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| import React from 'react'; | ||
| import PropTypes from 'prop-types'; | ||
| import { EmptyState, EmptyStateIcon, EmptyStateTitle } from '../../EmptyState'; | ||
|
|
||
| const NotificationDrawerEmptyState = ({ title, className, ...props }) => ( | ||
| <EmptyState> | ||
| <EmptyStateIcon name="info" /> | ||
| <EmptyStateTitle>{title}</EmptyStateTitle> | ||
| </EmptyState> | ||
| ); | ||
| NotificationDrawerEmptyState.propTypes = { | ||
| /** Additional element css classes */ | ||
| className: PropTypes.string, | ||
| /** Title */ | ||
| title: PropTypes.string | ||
| }; | ||
| NotificationDrawerEmptyState.defaultProps = { | ||
| className: '', | ||
| title: 'No Notifications Available' | ||
| }; | ||
|
|
||
| export default NotificationDrawerEmptyState; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
@gilad215 just curious what happens when someone accidentally replaces the entire
translationsobject instead of merging orObject.assigningit, or is that even a concern? If we are concerned, could a possible solution involve placing checks for the translation object property, or maybe they're, or it is, required?Uh oh!
There was an error while loading. Please reload this page.
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.
translationsis not a required prop.I don't see how someone can accidentally override the default object without actually writing
translations={...}If someone makes mistakes, thats their responsibility to fix it, because the object's properties are documented in the storybook
Uh oh!
There was an error while loading. Please reload this page.
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.
For clarity, if a consumer only handles these properties ...
What's the expected outcome?
Uh oh!
There was an error while loading. Please reload this page.
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.
The title will be empty, Do you think consumers will want to translate only some of the properties? seems weird to me. If they do it by mistake i'm pretty sure they will understand why. Also, having a prop for each component doesn't look like a solution either, this is a very rare case..