Add i18n strings for deployment status messages
Change-Id: I4d9421a81d8787bdcff97f6d73988bcf722d832d
Closes-Bug: #1663210
(cherry picked from commit ac489dfb6d
)
This commit is contained in:
parent
69b98087c9
commit
b4d3b11589
|
@ -1,4 +1,4 @@
|
|||
import { defineMessages, FormattedMessage } from 'react-intl';
|
||||
import { defineMessages, FormattedMessage, injectIntl } from 'react-intl';
|
||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||
import React from 'react';
|
||||
|
||||
|
@ -13,16 +13,19 @@ const messages = defineMessages({
|
|||
}
|
||||
});
|
||||
|
||||
export default class DeploymentFailure extends React.Component {
|
||||
class DeploymentFailure extends React.Component {
|
||||
componentDidMount() {
|
||||
this.props.fetchStackResources(this.props.stack);
|
||||
}
|
||||
|
||||
render() {
|
||||
const status = this.props.intl.formatMessage(
|
||||
deploymentStatusMessages[this.props.stack.stack_status]);
|
||||
|
||||
return (
|
||||
<div className="col-sm-12 fixed-container-body-content">
|
||||
<InlineNotification type="error"
|
||||
title={deploymentStatusMessages[this.props.stack.stack_status]}>
|
||||
title={status}>
|
||||
<p>{this.props.stack.stack_status_reason}</p>
|
||||
</InlineNotification>
|
||||
<h2><FormattedMessage {...messages.resources}/></h2>
|
||||
|
@ -35,8 +38,11 @@ export default class DeploymentFailure extends React.Component {
|
|||
|
||||
DeploymentFailure.propTypes = {
|
||||
fetchStackResources: React.PropTypes.func.isRequired,
|
||||
intl: React.PropTypes.object,
|
||||
planName: React.PropTypes.string.isRequired,
|
||||
stack: ImmutablePropTypes.record.isRequired,
|
||||
stackResources: ImmutablePropTypes.map.isRequired,
|
||||
stackResourcesLoaded: React.PropTypes.bool.isRequired
|
||||
};
|
||||
|
||||
export default injectIntl(DeploymentFailure);
|
||||
|
|
|
@ -32,7 +32,9 @@ export default class DeploymentProgress extends React.Component {
|
|||
|
||||
render() {
|
||||
const statusMessage = (
|
||||
<strong>{statusMessages[this.props.stack.stack_status]}</strong>
|
||||
<strong>
|
||||
<FormattedMessage {...statusMessages[this.props.stack.stack_status]} />
|
||||
</strong>
|
||||
);
|
||||
|
||||
return (
|
||||
|
|
|
@ -1,16 +1,20 @@
|
|||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||
import React from 'react';
|
||||
import { injectIntl } from 'react-intl';
|
||||
|
||||
import { deploymentStatusMessages } from '../../constants/StacksConstants';
|
||||
import InlineNotification from '../ui/InlineNotification';
|
||||
import OvercloudInfo from './OvercloudInfo';
|
||||
|
||||
export default class DeploymentSuccess extends React.Component {
|
||||
class DeploymentSuccess extends React.Component {
|
||||
render() {
|
||||
const status = this.props.intl.formatMessage(
|
||||
deploymentStatusMessages[this.props.stack.stack_status]);
|
||||
|
||||
return (
|
||||
<div className="col-sm-12 fixed-container-body-content">
|
||||
<InlineNotification type="success"
|
||||
title={deploymentStatusMessages[this.props.stack.stack_status]}>
|
||||
title={status}>
|
||||
<p>{this.props.stack.stack_status_reason}</p>
|
||||
</InlineNotification>
|
||||
<OvercloudInfo stackResourcesLoaded={this.props.stackResourcesLoaded}
|
||||
|
@ -22,7 +26,10 @@ export default class DeploymentSuccess extends React.Component {
|
|||
}
|
||||
|
||||
DeploymentSuccess.propTypes = {
|
||||
intl: React.PropTypes.object,
|
||||
stack: ImmutablePropTypes.record.isRequired,
|
||||
stackResources: ImmutablePropTypes.map.isRequired,
|
||||
stackResourcesLoaded: React.PropTypes.bool.isRequired
|
||||
};
|
||||
|
||||
export default injectIntl(DeploymentSuccess);
|
||||
|
|
|
@ -25,11 +25,13 @@ const messages = defineMessages({
|
|||
class DeploymentFailure extends React.Component {
|
||||
render() {
|
||||
const { formatMessage } = this.props.intl;
|
||||
const status = formatMessage(
|
||||
deploymentStatusMessages[this.props.stack.stack_status]);
|
||||
|
||||
return (
|
||||
<div>
|
||||
<InlineNotification type="error"
|
||||
title={deploymentStatusMessages[this.props.stack.stack_status]}>
|
||||
title={status}>
|
||||
<p>
|
||||
{this.props.stack.stack_status_reason} <Link to="/deployment-plan/deployment-detail">
|
||||
<FormattedMessage {...messages.moreDetails}/></Link>
|
||||
|
|
|
@ -43,7 +43,9 @@ class DeploymentProgress extends React.Component {
|
|||
const { formatMessage } = this.props.intl;
|
||||
|
||||
const statusMessage = (
|
||||
<strong>{statusMessages[this.props.stack.stack_status]}</strong>
|
||||
<strong>
|
||||
<FormattedMessage {...statusMessages[this.props.stack.stack_status]} />
|
||||
</strong>
|
||||
);
|
||||
|
||||
const deleteButton = this.props.stack.stack_status !== stackStates.DELETE_IN_PROGRESS
|
||||
|
|
|
@ -26,11 +26,13 @@ class DeploymentSuccess extends React.Component {
|
|||
|
||||
render() {
|
||||
const { formatMessage } = this.props.intl;
|
||||
const status = formatMessage(
|
||||
deploymentStatusMessages[this.props.stack.stack_status]);
|
||||
|
||||
return (
|
||||
<div>
|
||||
<InlineNotification type="success"
|
||||
title={deploymentStatusMessages[this.props.stack.stack_status]}>
|
||||
title={status}>
|
||||
<p>{this.props.stack.stack_status_reason}</p>
|
||||
</InlineNotification>
|
||||
<OvercloudInfo stackResourcesLoaded={this.props.stackResourcesLoaded}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import keyMirror from 'keymirror';
|
||||
import { defineMessages } from 'react-intl';
|
||||
|
||||
export default keyMirror({
|
||||
DELETE_STACK_PENDING: null,
|
||||
|
@ -30,13 +31,37 @@ export const stackStates = keyMirror({
|
|||
UPDATE_COMPLETE: null
|
||||
});
|
||||
|
||||
export const deploymentStatusMessages = {
|
||||
CREATE_IN_PROGRESS: 'Deployment in progress',
|
||||
CREATE_COMPLETE: 'Deployment succeeded',
|
||||
CREATE_FAILED: 'Deployment failed',
|
||||
DELETE_IN_PROGRESS: 'Deletion in progress',
|
||||
DELETE_FAILED: 'Deployment deletion failed',
|
||||
UPDATE_IN_PROGRESS: 'Update in progress',
|
||||
UPDATE_FAILED: 'Update failed',
|
||||
UPDATE_COMPLETE: 'Update succeeded'
|
||||
};
|
||||
export const deploymentStatusMessages = defineMessages({
|
||||
CREATE_IN_PROGRESS: {
|
||||
id: 'DeploymentStatus.createInProgress',
|
||||
defaultMessage: 'Deployment in progress'
|
||||
},
|
||||
CREATE_COMPLETE: {
|
||||
id: 'DeploymentStatus.createComplete',
|
||||
defaultMessage: 'Deployment succeeded'
|
||||
},
|
||||
CREATE_FAILED: {
|
||||
id: 'DeploymentStatus.createFailed',
|
||||
defaultMessage: 'Deployment failed'
|
||||
},
|
||||
DELETE_IN_PROGRESS: {
|
||||
id: 'Deploy.deleteInProgress',
|
||||
defaultMessage: 'Deletion in progress'
|
||||
},
|
||||
DELETE_FAILED: {
|
||||
id: 'DeploymentStatus.deleteFailed',
|
||||
defaultMessage: 'Deployment deletion failed'
|
||||
},
|
||||
UPDATE_IN_PROGRESS: {
|
||||
id: 'DeploymentStatus.updateInProgress',
|
||||
defaultMessage: 'Update in progress'
|
||||
},
|
||||
UPDATE_FAILED: {
|
||||
id: 'DeploymentStatus.updateFailed',
|
||||
defaultMessage: 'Update failed'
|
||||
},
|
||||
UPDATE_COMPLETE: {
|
||||
id: 'DeploymentStatus.updateComplete',
|
||||
defaultMessage: 'Update succeeded'
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue