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

Update gem to support the latest Solidus version(4.4) #306

Merged

Conversation

shahmayur001
Copy link
Contributor

@shahmayur001 shahmayur001 commented Dec 6, 2024

Summary

This pull request resolves compatibility issues with Solidus version updates by adding necessary gem dependencies, modifying forms for proper field rendering, fixing jQuery issues with subscription creation, and updating permission sets. These changes align Solidus Subscriptions with the latest Solidus architecture.

Enhancements:

  • Form Rendering Restriction

    • Updated the subscription fields form to render only when the associated product is subscribable.
  • jQuery Script Fix

    • Corrected the script used for creating subscription line items to ensure the correct subscribable_id is stored.
  • Permission Set Updates

    • Introduced new privilege and category methods for the permission sets to maintain compatibility with the latest Solidus versions.
  • Fixed breadcrumbs issue

  • Wrap deface overrides in a module

    • Zeitwerk expects a class or module correctly named in these files in newer versions of Solidus using Zeitwrek.

Checklist

Check out our PR guidelines for more details.

The following are mandatory for all PRs:

The following are not always needed:

  • 📖 I have updated the README to account for my changes.
  • 📑 I have documented new code with YARD.
  • 🛣️ I have opened a PR to update the guides.
  • ✅ I have added automated tests to cover my changes.
  • 📸 I have attached screenshots to demo visual changes.

@fthobe
Copy link

fthobe commented Dec 6, 2024

@jarednorman we still struggle with SQLite testing, everything else looks ok. I think the test routine for SQLite is a little flawed. I have the impression it's more SQLite than us.

@fthobe
Copy link

fthobe commented Dec 6, 2024

Hey @jarednorman I believe the sqlite tests are outdated. Is it a you task to fix them or our job? I would be in favor to just remove them as they seem malconfigured.

Copy link
Member

@jarednorman jarednorman left a comment

Choose a reason for hiding this comment

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

We can merge without those passing until someone can fix them, but for future contributions, please split up the individual changes and explain them in the commit messages. The PR description is for additional information that's relevant to reviewers. The commits are the authoritative record of information about changes to the project.

@fthobe
Copy link

fthobe commented Dec 12, 2024

@jarednorman you are getting soft

@fthobe
Copy link

fthobe commented Dec 12, 2024

#305 cross reference

insert_after: "[data-hook='admin_product_form_promotionable']",
partial: "spree/admin/products/subscribable_checkbox"
)
module Views
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 move these files into app/overrides/solidus_subscriptions/* and update the module? I don't want the extension defining random namespaces like Views that it doesn't "own".

Copy link

Choose a reason for hiding this comment

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

Seems doable, mayur is implementing that today.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Resolved, Moved files to proper location

@shahmayur001 shahmayur001 force-pushed the fix-solidus4-compatibility branch from 38a4189 to 64700df Compare December 12, 2024 12:14
Comment on lines -12 to -13
# Rerun the promotion handler to pickup subscription promotions
::Spree::PromotionHandler::Cart.new(line_item.order).activate
Copy link
Member

Choose a reason for hiding this comment

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

I guess my only concern is this. Is this safe? Do we need to do something different to handle legacy versus new promotions engines?

Copy link

Choose a reason for hiding this comment

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

@jarednorman Man, like really, from the bottom of my heart, could you be more specific, I am sure when you write this kind of comments you already have a very specific way in mind to do it.

Copy link

Choose a reason for hiding this comment

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

@mamhoff can you see anything that you dislike?

Copy link
Member

Choose a reason for hiding this comment

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

And I wish that the PR explained why this seemingly random line was removed, but it doesn't even mention it. 🤷🏻‍♂️

Copy link

Choose a reason for hiding this comment

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

@jarednorman that is actually a tangible point and helps much more than the previous comment!!!

Copy link

Choose a reason for hiding this comment

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

@jarednorman hey, sorry for replying so late. The issue of the removal of ::Spree::PromotionHandler::Cart.new(line_item.order).activate was discussed here: gms-electronics#1 If you have something else to consider please tell us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants