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

[RFC] New stock management #2862

Merged
merged 7 commits into from
Oct 9, 2018
Merged

Conversation

tvdeyen
Copy link
Member

@tvdeyen tvdeyen commented Sep 24, 2018

The current stock management view had some flaws:

  1. You have to input absolute values. Something that is not reflecting how people actually set stock in their stores
  2. The layout was broken, because the HTML we was using is invalid
  3. The "add stock item" validation was broken, because the code was not updated after we are not using select2 anymore.

This view could definitely be improved even more, but for now I am proposing to make these small changes.

Update stock

solidus-stock-items-modify

Propagate stock to location not fulfilling the variant yet

solidus-add-stock-item

Closes #2857 #2028 #2530

@tvdeyen tvdeyen added the WIP label Sep 24, 2018
@tvdeyen tvdeyen self-assigned this Sep 24, 2018
@kennyadsl
Copy link
Member

Thanks @tvdeyen . I agree we need a UX/UI person opinion but in the meantime I personally think it's better than what we have now.

@tvdeyen tvdeyen added changelog:solidus_backend Changes to the solidus_backend gem Code review needed and removed WIP labels Sep 24, 2018
@tvdeyen tvdeyen removed their assignment Sep 24, 2018
@tvdeyen
Copy link
Member Author

tvdeyen commented Sep 24, 2018

Thanks @kennyadsl I think so as well.

Copy link
Contributor

@jacobherrington jacobherrington left a comment

Choose a reason for hiding this comment

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

Tons of room for improvement on this part of the admin, but this is a huge step in the right direction!

Copy link
Contributor

@ericsaupe ericsaupe left a comment

Choose a reason for hiding this comment

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

I like this a lot!

@ccarruitero
Copy link
Contributor

@tvdeyen the changes looks good. Definitely better than the current view.

But, I'm not sure we should allow the user just update the stock. I think will be better keep a record about why the stock change, maybe generating a stock movement, that way is more easy track an error when occurred.

@tvdeyen
Copy link
Member Author

tvdeyen commented Oct 1, 2018

@ccarruitero thanks for the feedback.

But, I'm not sure we should allow the user just update the stock. I think will be better keep a record about why the stock change, maybe generating a stock movement, that way is more easy track an error when occurred.

This PR does not make any changes to our current stock API at all. It behaves exactly like before. It's only UI.

The only difference is that instead of passing the ?force=true parameter (to set an absolute stock value), it uses the default behaviour of our API that increases and decreases current stock by utilizing stock movements.

Copy link
Member

@kennyadsl kennyadsl left a comment

Choose a reason for hiding this comment

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

Thanks @tvdeyen !

The both stylesheets treat the same table.
If no stock location is selected in the variant search forms stock
location select we display all stock locations.
Nest the stock location stock items into the stock management table.
Previous we misused the rowspan table attribute that led to broken
table layouts if shop is having multiple stock locations.
1. Fixes add stock item validation. Since we use native selects instead of select2 for most of our selects, this feature was broken.

2. Clarify what the purpose of add stock item select actually is

3. Update the behavior to reflect the changes we made to the edit stock item view.
@tvdeyen
Copy link
Member Author

tvdeyen commented Oct 5, 2018

I updated the PR in that you are not able to create negative stock via UI. This is prevented in the API already, but I call this better UX if we check that already in the UI.

@ericsaupe
Copy link
Contributor

Agreed, I like to have the UI handle those edge cases before a server call is made when possible. Good change!

@tvdeyen tvdeyen merged commit a79bc74 into solidusio:master Oct 9, 2018
@tvdeyen tvdeyen deleted the stock-items-modify branch October 9, 2018 07:49
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.

5 participants