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

Add messaging to order (closes #327) #350

Merged
merged 1 commit into from Apr 10, 2015

Conversation

Projects
None yet
2 participants
@paroga
Member

paroga commented Feb 18, 2015

No description provided.

@wvengen

This comment has been minimized.

Show comment
Hide comment
@wvengen

wvengen Feb 18, 2015

Member

Yay, very good idea!

Messaging is done in a plugin, so this would need to go into a deface override. See this example.

Member

wvengen commented Feb 18, 2015

Yay, very good idea!

Messaging is done in a plugin, so this would need to go into a deface override. See this example.

@paroga

This comment has been minimized.

Show comment
Hide comment
@paroga

paroga Feb 18, 2015

Member

ad deface) i know, but I wasn't able to get it working :-/
ad check) yes, it's not necessary any more

Member

paroga commented Feb 18, 2015

ad deface) i know, but I wasn't able to get it working :-/
ad check) yes, it's not necessary any more

@wvengen

This comment has been minimized.

Show comment
Hide comment
@wvengen

wvengen Feb 18, 2015

Member

What did you try with deface?

Member

wvengen commented Feb 18, 2015

What did you try with deface?

@paroga

This comment has been minimized.

Show comment
Hide comment
@paroga

paroga Feb 18, 2015

Member

create a file in orders/show folder with similar content of your example

Member

paroga commented Feb 18, 2015

create a file in orders/show folder with similar content of your example

@wvengen

This comment has been minimized.

Show comment
Hide comment
@wvengen

wvengen Feb 18, 2015

Member

Ok, I'm trying now with deface - and run into the old bug where :javascript in the original breaks it - spree/deface#125. Solution would be to move the javascript in orders/show.html.haml to a separate file. I'm on it.

Member

wvengen commented Feb 18, 2015

Ok, I'm trying now with deface - and run into the old bug where :javascript in the original breaks it - spree/deface#125. Solution would be to move the javascript in orders/show.html.haml to a separate file. I'm on it.

@wvengen

This comment has been minimized.

Show comment
Hide comment
@wvengen

wvengen Feb 18, 2015

Member

Oh, and why not making the "x Ordergroups" a messaging link instead of the mail button? This would be in-line with other user names being a link to send a message.

Member

wvengen commented Feb 18, 2015

Oh, and why not making the "x Ordergroups" a messaging link instead of the mail button? This would be in-line with other user names being a link to send a message.

@paroga

This comment has been minimized.

Show comment
Hide comment
@paroga

paroga Feb 18, 2015

Member

Yes, that was exactly the error I got.
The "x Ordergroups" "expands" to the list of Ordergroups. How do you want to handle that then?

Member

paroga commented Feb 18, 2015

Yes, that was exactly the error I got.
The "x Ordergroups" "expands" to the list of Ordergroups. How do you want to handle that then?

@wvengen

This comment has been minimized.

Show comment
Hide comment
@wvengen

wvengen Feb 18, 2015

Member

That's the title attribute, a hyperlink could go to the messaging screen.

Member

wvengen commented Feb 18, 2015

That's the title attribute, a hyperlink could go to the messaging screen.

@paroga

This comment has been minimized.

Show comment
Hide comment
@paroga

paroga Feb 18, 2015

Member

If I do it that way I get some kind of "layering problem": a create_mail_link_for_ordergroups function should only need a list of order groups as parameter. The message page requires the order_id instead and passing a list of order groups/users via URL does not seam like a perfect solution for me either.

Member

paroga commented Feb 18, 2015

If I do it that way I get some kind of "layering problem": a create_mail_link_for_ordergroups function should only need a list of order groups as parameter. The message page requires the order_id instead and passing a list of order groups/users via URL does not seam like a perfect solution for me either.

@wvengen

This comment has been minimized.

Show comment
Hide comment
@wvengen

wvengen Feb 18, 2015

Member

I like the design pattern that info displayed on the screen is also a way to interact with it. In this way: seeing the ordergroups allows one to do something with it - sending them a message.

I think the technical problem of how to create the link is solvable. We can still use the order_id (since that can be used to get the same list of ordergroups).

Member

wvengen commented Feb 18, 2015

I like the design pattern that info displayed on the screen is also a way to interact with it. In this way: seeing the ordergroups allows one to do something with it - sending them a message.

I think the technical problem of how to create the link is solvable. We can still use the order_id (since that can be used to get the same list of ordergroups).

@wvengen

This comment has been minimized.

Show comment
Hide comment
@wvengen

wvengen Apr 3, 2015

Member

Thanks for your work! Testing this, I'm a bit confused on the message page, since it shows no addressee. I see a number of options:

  • Include all recipients in the recipients field
  • Add a special field "Order ..." to the Groups field
  • Replace the "Order ..." (and recipients?) fields with "Order: ...."
  • Allow to put members, groups and orders in the recipients input field (something I'd like to do in the future).
Member

wvengen commented Apr 3, 2015

Thanks for your work! Testing this, I'm a bit confused on the message page, since it shows no addressee. I see a number of options:

  • Include all recipients in the recipients field
  • Add a special field "Order ..." to the Groups field
  • Replace the "Order ..." (and recipients?) fields with "Order: ...."
  • Allow to put members, groups and orders in the recipients input field (something I'd like to do in the future).
@paroga

This comment has been minimized.

Show comment
Hide comment
@paroga

paroga Apr 9, 2015

Member

at least on my installation it adds all recipients to the recipients field. any idea? i had some "browser caching" problems at the beginning too, but they were gone later :-/

Member

paroga commented Apr 9, 2015

at least on my installation it adds all recipients to the recipients field. any idea? i had some "browser caching" problems at the beginning too, but they were gone later :-/

@wvengen

This comment has been minimized.

Show comment
Hide comment
@wvengen

wvengen Apr 10, 2015

Member

Ok, I'll try again. The code looks ok in that respect.
If you feel like it, you might want to git pull && git rebase master

Member

wvengen commented Apr 10, 2015

Ok, I'll try again. The code looks ok in that respect.
If you feel like it, you might want to git pull && git rebase master

@order_id = order_id
for ordergroup in Order.find(order_id).ordergroups
add_recipients ordergroup.users
end

This comment has been minimized.

@wvengen

wvengen Apr 10, 2015

Member

This would be shorter and more performant

add_recipients Order.find(order_id).ordergroups unless order_id.blank?
@wvengen

wvengen Apr 10, 2015

Member

This would be shorter and more performant

add_recipients Order.find(order_id).ordergroups unless order_id.blank?

This comment has been minimized.

@wvengen

wvengen Apr 10, 2015

Member

Silly me, that wouldn't work at all. Perhaps another has_many :through in Order would work, but let's leave it this way :o

@wvengen

wvengen Apr 10, 2015

Member

Silly me, that wouldn't work at all. Perhaps another has_many :through in Order would work, but let's leave it this way :o

This comment has been minimized.

@wvengen

wvengen Apr 10, 2015

Member

Ok, I couldn't resist. If you like:

# in app/models/order.rb
has_many :ordergroups, :through => :group_orders
has_many :users_ordered, :through => :ordergroups, :source => :users
# in plugins/messages/app/models/message.rb#order_id=
add_recipients Order.find(order_id).users_ordered if order_id
@wvengen

wvengen Apr 10, 2015

Member

Ok, I couldn't resist. If you like:

# in app/models/order.rb
has_many :ordergroups, :through => :group_orders
has_many :users_ordered, :through => :ordergroups, :source => :users
# in plugins/messages/app/models/message.rb#order_id=
add_recipients Order.find(order_id).users_ordered if order_id

@wvengen wvengen merged commit 124f77f into foodcoops:master Apr 10, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@paroga paroga deleted the paroga:order_message branch Mar 11, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment