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

Display originator email in stock movement admin #3673

Conversation

jacquesporveau
Copy link
Contributor

Description

This gets #3666 started.

From the issue:

Add an originator for stock movements initiated by admin users. Admin stock movements currently have no originator, but it's useful to see who made the movement, so the originator in this case should just be the admin user who initiated it.

This PR is meant to remedy that trouble.

One point that might be worth discussing is whether or not we should link to the actual user. I think it would be kind of difficult to figure out whether the originator is a user unless we do a class check and I think those are not in favour.

Since we can't really figure out if the originator is a user then providing a link in the admin to the originator becomes difficult. It may be worth going after the most common use case which is that if the originator responds to email then it's probably a Spree::User and we could do another conditional and provide a link if it's a user.

Let me know what you think!

Screenshot:

Screen Shot 2020-06-20 at 12 06 25 PM

Checklist:

  • I have followed Pull Request guidelines
  • I have added a detailed description into each commit message
  • I have updated Guides and README accordingly to this change (if needed)
  • I have added tests to cover this change (if needed)
  • I have attached screenshots to this PR for visual changes (if needed)

Building these instances instead of persisting to the database will
speed up the spec suite and they do not need to be persisted.
I think ideally the #pretty_originator method doesn't even take a stock
movement but rather a originator since we never actually operate on the
stock movement but I don't want to step that far so for now I will just
save the originator as a variable so we can cut down on the amount of
code someone working here needs to read/comprehend.
Previously on the stock movements page if a stock movement was
originated by a user then we would not display any information about the
originator.

This commit alters that interface to display the users email address.
@kennyadsl kennyadsl added changelog:solidus_backend Changes to the solidus_backend gem UI labels Jun 22, 2020
@kennyadsl
Copy link
Member

Thank you @jacquesporveau, there's an unrelated failing spec that we need to take a look at but I think this is safe to merge.

@spaghetticode spaghetticode merged commit 16ed773 into solidusio:master Jun 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:solidus_backend Changes to the solidus_backend gem
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants