-
-
Notifications
You must be signed in to change notification settings - Fork 725
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 admin new order page #3194
[Spree Upgrade] Fix admin new order page #3194
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome, keep going!
- Two JS errors coming from _form.html.haml:30 :
If you are stuck, please provide full details on the two JS errors you are seeing.
There are a lot of JS function that could/should be converted into Angular's
I wouldnt worry about converting everything to angular, at least not yet.
<button class="add_variant no-text icon-plus icon_link with-tip" data-stock-location-id="{{this.stock_location_id}}" title="Add" data-action="add"></button> | ||
</td> | ||
{{else}} | ||
<td><%= Spree.t(:out_of_stock) %></td> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all Spree.t entries should be replaced by normal lazy loaded entries (may need to add these to our en.yml file).
Oh no, we are working on the same thing. Have a look at #2938 (comment). Different approach. |
@mkllnk are you just working on the translation issue or on the whole new page ? |
Just on the translation issue. I'm trying to get ./spec/features/admin/orders_spec.rb:48 passing. |
But I am changing app/views/spree/admin/variants/_autocomplete.js.erb for that while you are replacing it. So there is a conflict in our work. |
I opened my pull request: #3195. You can see what I did. I think it is quite useful to have the count on hand in that view. But maybe not essential? Should we just x the on hand display? @luisramos0 @HugsDaniel Where did you get the original view from? I though Spree 2 switched to using the API and doesn't have that view any more. Did you import the Spree 1 view? |
|
Ah, sorry for the confusion @HugsDaniel. I mixed it up with |
Hugs I see this PR is updating adjustments on the order page. There's an issue for two of the specs here: #2940 |
af92634
to
cd21223
Compare
cd21223
to
ec78022
Compare
ec78022
to
ae32e82
Compare
ae32e82
to
88fab3d
Compare
@HugsDaniel I pushed a new commit that fixes line item controller spec |
9b38e9d
to
acc6fbd
Compare
acc6fbd
to
9ec0e97
Compare
4c3df43
to
79224f6
Compare
79224f6
to
701a3ad
Compare
No wonder @HugsDaniel was a bit stuck with this one. What a difficult job! |
e26801c
to
4d784c2
Compare
Add missing form tag and OC and shops injectors on order form to make the OC field, the distributor field and the update button work
…pec in admin orders spec
4d784c2
to
d598831
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't comprehend all the view changes. I would need to look into what's changed in Spree and look into our modifications. That would be almost as much work as doing it again. ;-)
It looks all good though. If there is something important missing, we should find it in the testing phase and write specs for it.
spec/features/admin/orders_spec.rb
Outdated
# Moves the order back to the cart state | ||
# A nil user keeps the order in the cart state | ||
# Even if the edit page tries to automatically progress the order workflow | ||
@order.state = 'cart'; @order.user = nil; @order.completed_at = nil; @order.save |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not in multiple lines? we can even extract a helper method where we can document in detail why this is needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
I keep it as multilines in the same place without extracting to method, I think the test is simple enough to take this.
see new commit.
@@ -101,18 +101,18 @@ def new_order_with_distribution(distributor, order_cycle) | |||
scenario "displays error when incorrect distribution for products is chosen" do | |||
d = create(:distributor_enterprise) | |||
oc = create(:simple_order_cycle, distributors: [d]) | |||
puts d.name | |||
puts @distributor.name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙈
hurray!!!! |
What? Why?
Closes #3109 and #3107 and #2416
The spec in #3107 should be green.
@HugsDaniel said:
New new/edit order page in back office! Upgraded Spree views to 2.0 and applied overrides.
There's no error anymore for blank line_items (it was added with deface), and line items can be added.
I used Spree default routes for these actions (see in
_routes.html.erb
to make this work.@luisramos0 said:
Regarding the fix to #2416 by adapting app/views/spree/admin/variants/_autocomplete.js.erb and the respective search.rabl file: this is a quick fix to the problem, there's plenty we could improve here, I suggest we leave for after the upgrade, I created this tech debt issue #3440
Remaining work to be done in follow up PRs:
For the review, I recommend reviewers to follow the commits in order.