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

Fix invalid property types #19505

Merged
merged 3 commits into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
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
5 changes: 2 additions & 3 deletions pkg/lib/cockpit-components-dialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,7 @@ class Dialog extends React.Component {
</Popover>;

const error = this.props.error || this.props.static_error;
const error_alert = error &&
<Alert variant='danger' isInline title={React.isValidElement(error) ? error : error.toString() }>{error.details}</Alert>;
const error_alert = error && <Alert variant='danger' isInline title={error} />;
martinpitt marked this conversation as resolved.
Show resolved Hide resolved

return (
<Modal position="top" variant={this.props.variant || "medium"}
Expand All @@ -262,9 +261,9 @@ Dialog.propTypes = {
title: PropTypes.string, // is effectively required, but show_modal_dialog() provides initially no props and resets them later.
body: PropTypes.element, // is effectively required, see above
static_error: PropTypes.string,
error: PropTypes.string,
footer: PropTypes.element, // is effectively required, see above
id: PropTypes.string,
error: PropTypes.object,
showClose: PropTypes.bool,
};

Expand Down
6 changes: 2 additions & 4 deletions pkg/storaged/dialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -354,12 +354,10 @@ export const dialog_open = (def) => {
};

const props = () => {
const title = (def.Action && (def.Action.Danger || def.Action.DangerButton)
? <><ExclamationTriangleIcon className="ct-icon-exclamation-triangle" /> {def.Title}</>
: def.Title);
return {
id: "dialog",
title,
title: def.Title,
titleIconVariant: (def.Action && (def.Action.Danger || def.Action.DangerButton)) ? "warning" : null,
body: <Body body={def.Body}
teardown={def.Teardown}
fields={nested_fields}
Expand Down
1 change: 0 additions & 1 deletion test/common/testlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -1704,7 +1704,6 @@ def login_and_go(self, path: Optional[str] = None, user: Optional[str] = None, h
default_allowed_console_errors = [
# HACK: Fix these ASAP, these are major bugs
"Warning: validateDOMNesting.*cannot appear as a",
"Warning: Failed.*type.*prop Invalid prop",
"Warning: React does not recognize the.*prop on a DOM element",
"Warning: .*prop on .* should not be null",
# HACK: These should be fixed, but debugging these is not trivial, and the impact is very low
Expand Down
2 changes: 1 addition & 1 deletion test/reference
Submodule reference updated 35 files
+ TestStorageMounting-testMounting-busy-unmount-dark-pixels.png
+ TestStorageMounting-testMounting-busy-unmount-medium-pixels.png
+ TestStorageMounting-testMounting-busy-unmount-mobile-pixels.png
+ TestStorageMounting-testMounting-busy-unmount-pixels.png
+ TestStorageMounting-testMounting-busy-unmount-rtl-pixels.png
+ TestStorageNfs-testNfsBusy-unmount-dark-pixels.png
+ TestStorageNfs-testNfsBusy-unmount-medium-pixels.png
+ TestStorageNfs-testNfsBusy-unmount-mobile-pixels.png
+ TestStorageNfs-testNfsBusy-unmount-pixels.png
+ TestStorageNfs-testNfsBusy-unmount-rtl-pixels.png
+ TestStorageStratis-testBasic-delete-fsys-dark-pixels.png
+ TestStorageStratis-testBasic-delete-fsys-medium-pixels.png
+ TestStorageStratis-testBasic-delete-fsys-mobile-pixels.png
+ TestStorageStratis-testBasic-delete-fsys-pixels.png
+ TestStorageStratis-testBasic-delete-fsys-rtl-pixels.png
+ TestStorageStratis-testBasic-delete-pool-dark-pixels.png
+ TestStorageStratis-testBasic-delete-pool-medium-pixels.png
+ TestStorageStratis-testBasic-delete-pool-mobile-pixels.png
+ TestStorageStratis-testBasic-delete-pool-pixels.png
+ TestStorageStratis-testBasic-delete-pool-rtl-pixels.png
+ TestStorageUsed-testUsed-delete-dark-pixels.png
+ TestStorageUsed-testUsed-delete-medium-pixels.png
+ TestStorageUsed-testUsed-delete-mobile-pixels.png
+ TestStorageUsed-testUsed-delete-pixels.png
+ TestStorageUsed-testUsed-delete-rtl-pixels.png
+ TestStorageUsed-testUsed-format-dark-pixels.png
+ TestStorageUsed-testUsed-format-disk-dark-pixels.png
+ TestStorageUsed-testUsed-format-disk-medium-pixels.png
+ TestStorageUsed-testUsed-format-disk-mobile-pixels.png
+ TestStorageUsed-testUsed-format-disk-pixels.png
+ TestStorageUsed-testUsed-format-disk-rtl-pixels.png
+ TestStorageUsed-testUsed-format-medium-pixels.png
+ TestStorageUsed-testUsed-format-mobile-pixels.png
+ TestStorageUsed-testUsed-format-pixels.png
+ TestStorageUsed-testUsed-format-rtl-pixels.png