This repository has been archived by the owner on Apr 28, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 30
Add selector to check if host can add machine #333
Merged
Merged
Conversation
This file contains 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
atiratree
suggested changes
Apr 10, 2019
}; | ||
|
||
export const BaremetalHostStatus = ({ host }) => { | ||
const hostStatus = getHostStatus(host); |
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.
we found out that for better reusability it is better to decouple status functionality from the UI (e.g. vmStatus is used at many places). Please see utils/status
. Could you use this approach here?
Basically it is a function which returns
{
status, // constant
...additionalUsefulData // e.g. message
}
import { getHostStatus } from '../../selectors/host/selectors'; | ||
|
||
// Status titles. Could be i18n'ed at some point. | ||
const statusTextMap = { |
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 string mapping could be done there
}; | ||
|
||
// Generic status component as a fallback | ||
export const GenericStatus = ({ host }) => <React.Fragment>{getStatusText(getHostStatus(host))}</React.Fragment>; |
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 the React.Fragment
?
sorry, I see it depends on the other PR now.. |
jtomasek
force-pushed
the
can_add_machine
branch
from
April 11, 2019 11:24
8d9bb8e
to
8fc1711
Compare
Pull Request Test Coverage Report for Build 1187
💛 - Coveralls |
Pull Request Test Coverage Report for Build 1164
💛 - Coveralls |
Add host machine name selector
jtomasek
force-pushed
the
can_add_machine
branch
from
April 12, 2019 08:18
8fc1711
to
6de50d6
Compare
Merged
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
No description provided.