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

Improve promotion statuses #3157

Merged
merged 1 commit into from
May 29, 2019
Merged

Improve promotion statuses #3157

merged 1 commit into from
May 29, 2019

Conversation

JuanCrg90
Copy link
Contributor

@JuanCrg90 JuanCrg90 commented Apr 2, 2019

Description

The current promotions index page only shows two statuses, active and inactive, this doesn't give enough information when the store has many promotions. This adds the unstarted and expired promotion statuses looking for an improvement in the user experience in this admin section.

Before
image

After
image

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)

Copy link
Member

@spaghetticode spaghetticode left a comment

Choose a reason for hiding this comment

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

@JuanCrg90 🎉 thank you for this PR!

I've left a few comments, I'm probably splitting hairs with most of them, but let me know what you think.

One more sensible matter (of course IMO) is the lack of a integration test that verifies that the new feature actually works as expected in the browser. I think the PR would benefit for some coverage at that level too... thank you again 😄

core/app/models/spree/promotion.rb Outdated Show resolved Hide resolved
core/spec/models/spree/promotion_spec.rb Outdated Show resolved Hide resolved
core/spec/models/spree/promotion_spec.rb Outdated Show resolved Hide resolved
core/spec/models/spree/promotion_spec.rb Outdated Show resolved Hide resolved
@JuanCrg90
Copy link
Contributor Author

@spaghetticode , @kennyadsl I have updated the tests and added integration tests, what do you think 😄 ?

@spaghetticode
Copy link
Member

@JuanCrg90 looks good to me 👍

There are a few tests failing, rebasing with master should make everything green... thank you!

Copy link
Contributor

@aitbw aitbw left a comment

Choose a reason for hiding this comment

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

Great job @JuanCrg90! Left some non-blocking comments as further improvements, let me know what you think!

backend/spec/features/admin/promotions/promotion_spec.rb Outdated Show resolved Hide resolved
core/spec/models/spree/promotion_spec.rb Outdated Show resolved Hide resolved
core/spec/models/spree/promotion_spec.rb Outdated Show resolved Hide resolved
core/spec/models/spree/promotion_spec.rb Outdated Show resolved Hide resolved
core/spec/models/spree/promotion_spec.rb Outdated Show resolved Hide resolved
core/spec/models/spree/promotion_spec.rb Outdated Show resolved Hide resolved
core/spec/models/spree/promotion_spec.rb Outdated Show resolved Hide resolved
core/spec/models/spree/promotion_spec.rb Outdated Show resolved Hide resolved
core/spec/models/spree/promotion_spec.rb Outdated Show resolved Hide resolved
core/spec/models/spree/promotion_spec.rb Outdated Show resolved Hide resolved
@JuanCrg90
Copy link
Contributor Author

changes addressed @aitbw WDYT 😄

@aitbw
Copy link
Contributor

aitbw commented Apr 9, 2019

Great @JuanCrg90! Left one small comment, as I had a typo in my last review 😅 Sorry about that!

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 @JuanCrg90

I'm fine with this version as well and I'm not particuarly in love with helpers but, just for curiosity, did you consider moving the if/else of the view into an admin promotion helper that could allow to write something like:

<%= t(admin_promotion_status(promotion), scope: 'spree.promotion_status') %>

backend/app/views/spree/admin/promotions/index.html.erb Outdated Show resolved Hide resolved
@JuanCrg90
Copy link
Contributor Author

Updated @kennyadsl 😄 what do you think?

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.

I think there's an issue in the I18n file, the rest is ok for me!

core/config/locales/en.yml Outdated Show resolved Hide resolved
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 @JuanCrg90 !

The current promotions index page only shows two statuses, active and
inactive, this doesn't give enough information when the store has many
promotions. This adds started and expired statuses and their negative
methods to improve the user experience in the admin section.
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.

LGTM!

@kennyadsl kennyadsl merged commit 3ffc1f8 into solidusio:master May 29, 2019
@JuanCrg90 JuanCrg90 deleted the feature/promotion-statuses branch May 29, 2019 13:20
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

Successfully merging this pull request may close these issues.

5 participants