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

[Spree Upgrade] Fix ShippingMethods Create page #2744

Closed
luisramos0 opened this issue Sep 18, 2018 · 20 comments
Closed

[Spree Upgrade] Fix ShippingMethods Create page #2744

luisramos0 opened this issue Sep 18, 2018 · 20 comments
Assignees

Comments

@luisramos0
Copy link
Contributor

luisramos0 commented Sep 18, 2018

Fix page /admin/shipping_methods/new

Currently broken with an error related to zone id.
It's a heavily defaced page, probably better to use the opportunity to move Spree code to OFN and create a view without deface.
Also, if the approach selected is removing deface, it's probably worth doing it in master and then adapting it to spree 2 in 2-0-stable.
Also, maybe we remove deface not just for new but also for index and edit pages.

This issue is related to #2010, same controller

@HugsDaniel
Copy link
Contributor

May I take this one ?

@luisramos0
Copy link
Contributor Author

Hi Hugo, yes!
You can see what Matt did here:
#2675

You need to pick this
../spree/backend/app/views/spree/admin/shipping_methods
mix with this
./openfoodnetwork/app/overrides/spree/admin/shipping_methods
convert to haml
and put it here
./openfoodnetwork/app/views/admin

My only question is that I'd not put it in app/views/spree/admin as Matt did, I'd put it in app/views/admin

@luisramos0
Copy link
Contributor Author

You can see better as you go but it's probably better to have one PR per page: new, index and edit.
Also, as I say above, I think it's better to do this in master first.

@HugsDaniel
Copy link
Contributor

I'm not sure rails will use the view if we put it in app/views/admin

@HugsDaniel
Copy link
Contributor

HugsDaniel commented Sep 19, 2018

Should I use views from 2-4-stable ? If so with spree step-6a used in master there's no method zones for Spree::ShippingMethods, so with 2-0-4-stable views against master it will end up crashing

@luisramos0
Copy link
Contributor Author

I'd check if step-6a is very different from 2-0-4 on this view.
If it is, I'd skip building it in master, but otherwise, I'd use step-6a to do this in master.
And then in 2-0-stable we can adapt to the changes like zone.
If you do it in 2-0-stable from 2-0-4-stable you will have to merge all changes that are done in master from now to the final migration...
What's easier?

@luisramos0
Copy link
Contributor Author

luisramos0 commented Sep 19, 2018

I'm not sure rails will use the view if we put it in app/views/admin

yeah, that's true! we would have to change the route and controller. For this one, maybe easier to keep in spree/. Thanks, I was not seeing this problem.

@HugsDaniel
Copy link
Contributor

@luisramos0 there's a whole bunch of I18n syntax changes and a couple of sections added, it would seem easier to use directly 2-0-4-stable views

@luisramos0
Copy link
Contributor Author

all right, lets do that!

@luisramos0
Copy link
Contributor Author

luisramos0 commented Sep 19, 2018

Just leaving a note here to address question from #2728

@luisramos0
Copy link
Contributor Author

several PRs connected to the same issue make all PRs move workflow together. I'll disconnect everything so that PRs move at their own pace... ok @sigmundpetersen ?

@luisramos0
Copy link
Contributor Author

PRs are 2752, 2753, 2754, 2755

@HugsDaniel
Copy link
Contributor

The zone_id error comes from the fact that there's no zone_id in spree_shipping_methods, instead there's a join table called spree_shipping_methods_zones. I'm not quite sure how to create a new record of spree_shipping_methods_zones instead... Nested form ? Do it in the controller ?

@sigmundpetersen
Copy link
Contributor

Sure @luisramos0 no problem! Multiple PRs on one issue is a tricky one scrum-wise

@luisramos0
Copy link
Contributor Author

So, after a slack talk with Hugo, we conclude there are a few things to do here now:

I think that's all. makes sense @HugsDaniel ?

@luisramos0
Copy link
Contributor Author

I have just realized this issue is a duplicate of #2497. There's more context on this one now that we are fixing it, so I'll close #2497

@luisramos0
Copy link
Contributor Author

moving this to in dev to represent reality.
@HugsDaniel you finished most things from my comment above but not everything I believe. correct?

@HugsDaniel
Copy link
Contributor

@luisramos0 I'm on the question from #2728 , still haven't found out what's wrong here. I'll keep you posted

@HugsDaniel
Copy link
Contributor

I opened a new issue #2881 for the question in #2728 since it's slightly different from what was intended here. I close this one now.

@luisramos0
Copy link
Contributor Author

Amazing, OFN v2 is starting to be usable! I gave this shipping methods UI a good try and it just works :-)
well done @HugsDaniel

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

No branches or pull requests

3 participants