Skip to content
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

cockpit-components-dialog: React-related fixes #9341

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions pkg/lib/cockpit-components-dialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ var DialogFooter = React.createClass({
if (error_message) {
error_element = <div className="alert alert-danger dialog-error">
<span className="fa fa-exclamation-triangle" />
<span>{ error_message }</span>
<span>{ React.isValidElement(error_message) ? error_message : error_message.toString() }</span>
</div>;
}
return (
Expand Down Expand Up @@ -246,10 +246,11 @@ var DialogFooter = React.createClass({
*/
var Dialog = React.createClass({
propTypes: {
title: React.PropTypes.string.isRequired,
// TODO: fix following by refactoring the logic showing modal dialog (recently show_modal_dialog())
title: React.PropTypes.string, // is effectively required, but show_modal_dialog() provides initially no props and resets them later.
no_backdrop: React.PropTypes.bool,
body: React.PropTypes.element.isRequired,
footer: React.PropTypes.element.isRequired,
body: React.PropTypes.element, // is effectively required, see above
footer: React.PropTypes.element, // is effectively required, see above
id: React.PropTypes.string,
},
componentDidMount: function() {
Expand Down