Skip to content

Conversation

GilbertCherrie
Copy link
Member

This pr removes the constant error messages on the import form

Before:
Screenshot 2025-06-13 at 1 54 44 PM

After:
Screenshot 2025-06-13 at 1 53 26 PM

@GilbertCherrie GilbertCherrie requested a review from a team as a code owner June 13, 2025 17:55
@GilbertCherrie GilbertCherrie requested a review from Fryguy June 13, 2025 17:56
@GilbertCherrie GilbertCherrie added bug and removed bug labels Jun 13, 2025
@miq-bot
Copy link
Member

miq-bot commented Jun 13, 2025

Checked commit GilbertCherrie@6b099c4 with ruby 3.1.5, rubocop 1.56.3, haml-lint 0.62.0, and yamllint
0 files checked, 0 offenses detected
Everything looks fine. 🍰

@@ -66,7 +66,7 @@ window.ImportSetup = {
window.addEventListener('message', function(event) {
var messageData = event.data.message;

if (messageData.level === 'error') {
if (messageData && messageData.level === 'error') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use the chaining operator?

Suggested change
if (messageData && messageData.level === 'error') {
if (messageData?.level === 'error') {

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure, its throwing these errors with it

Screenshot 2025-06-13 at 3 44 53 PM

Copy link
Member

@Fryguy Fryguy Jun 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ugh why is Javascript so terrible - ok I guess back to the original code :(

https://stackoverflow.com/questions/59972341/how-to-make-webpack-accept-optional-chaining-without-babel

Looks like it's in webpack 5

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a good solution is to upgrade webpack and babel packages. However, even with Webpack 4, we can enable optional chaining support by updating the Babel configuration to include the necessary transform plugin, as discussed here

@GilbertCherrie
Copy link
Member Author

@elsamaryv can you review please.

@Fryguy Fryguy merged commit 94786b7 into ManageIQ:master Aug 18, 2025
18 checks passed
@GilbertCherrie GilbertCherrie deleted the fix_import_form_error branch August 18, 2025 13:51
@jrafanie
Copy link
Member

this should go back... updated label

@Fryguy
Copy link
Member

Fryguy commented Aug 19, 2025

Backported to spassky in commit 2919572.

commit 2919572963c1d390d597f568a3f030fa09b21454
Author: Jason Frey <[email protected]>
Date:   Mon Aug 18 09:37:05 2025 -0400

    Merge pull request #9498 from GilbertCherrie/fix_import_form_error
    
    Fix import form errors
    
    (cherry picked from commit 94786b7f3945b94b978d214033582fdc21a03cc9)

Fryguy added a commit that referenced this pull request Aug 19, 2025
Fix import form errors

(cherry picked from commit 94786b7)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants