-
Notifications
You must be signed in to change notification settings - Fork 20
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 4.1 #45
Open
rishabhguptarishi
wants to merge
6
commits into
master
Choose a base branch
from
version-3.4-dev
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
spree 4.1 #45
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
3b13308
updated decorators overrides and views
b432f8d
added svg for send and fixed bootstrap issue and fixed helper issue
8df3b68
heroku button for spree 4-1
rishabhguptarishi 6f1a1ba
fixed jquery error
69c415f
Merge remote-tracking branch 'origin/version-3.4-dev' into version-3.…
97bb38f
fixed jquery-ujs
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
//= require 'spree/backend/returns/return_item_selection' | ||
//= require 'spree/frontend/return_item_options_selection' | ||
//= require jquery |
2 changes: 1 addition & 1 deletion
2
...elpers/spree/frontend_helper_decorator.rb → ...ers/spree/return_authorizations_helper.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module SpreeItemReturns::AppConfigurationDecorator | ||
|
||
def self.prepended(base) | ||
base.preference :return_initiation_admin_mail_address, :string, default: '[email protected]' | ||
end | ||
end | ||
|
||
Spree::AppConfiguration.prepend SpreeItemReturns::AppConfigurationDecorator |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
module SpreeItemReturns::OrderDecorator | ||
|
||
SHIPPED_STATES = ['shipped', 'partial'] | ||
|
||
def self.prepended(base) | ||
base.scope :returned, -> { where(shipment_state: SHIPPED_STATES) } | ||
end | ||
|
||
def has_returnable_products? | ||
products.returnable.exists? | ||
end | ||
|
||
def has_returnable_line_items? | ||
line_items.any?(&:is_returnable?) | ||
end | ||
|
||
end | ||
|
||
Spree::Order.prepend SpreeItemReturns::OrderDecorator |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module SpreeItemReturns::ProductDecorator | ||
|
||
def self.prepended(base) | ||
base.validates :return_time, numericality: { greater_than_or_equal_to: 0 } | ||
base.scope :returnable, -> { where(returnable: true) } | ||
end | ||
end | ||
|
||
Spree::Product.prepend SpreeItemReturns::ProductDecorator |
34 changes: 34 additions & 0 deletions
34
app/models/spree_item_returns/return_authorization_decorator.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
module SpreeItemReturns::ReturnAuthorizationDecorator | ||
|
||
def self.prepended(base) | ||
stock_location_validations = base._validators[:stock_location] | ||
if stock_location_validations.present? | ||
stock_location_validations.reject! { |validation| validation.is_a? ActiveRecord::Validations::PresenceValidator } | ||
end | ||
|
||
base._validate_callbacks.each do |callback| | ||
callback.raw_filter.attributes.delete :stock_location if callback.raw_filter.is_a?(ActiveModel::Validations::PresenceValidator) | ||
end | ||
|
||
base.validates :stock_location, presence: true, unless: :user_initiated? | ||
base.validates :return_items, presence: true, if: :user_initiated? | ||
|
||
base.after_commit :notify_admin, :notify_user, on: :create, if: :user_initiated? | ||
end | ||
|
||
def allow_return_item_changes? | ||
!customer_returned_items? | ||
end | ||
|
||
private | ||
def notify_admin | ||
Spree::ReturnAuthorizationMailer.notify_return_initialization_to_admin(number).deliver_later | ||
end | ||
|
||
def notify_user | ||
Spree::ReturnAuthorizationMailer.notify_return_initialization_to_user(number).deliver_later | ||
end | ||
|
||
end | ||
|
||
Spree::ReturnAuthorization.prepend SpreeItemReturns::ReturnAuthorizationDecorator |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module SpreeItemReturns::UserDecorator | ||
|
||
def self.prepended(base) | ||
base.has_many :return_authorizations, through: :orders | ||
end | ||
end | ||
|
||
Spree::User.prepend SpreeItemReturns::UserDecorator |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
app/overrides/spree/return_authorization/user_return_authorization_initailization_button.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,14 +2,14 @@ | |
Gem::Specification.new do |s| | ||
s.platform = Gem::Platform::RUBY | ||
s.name = 'spree_item_returns' | ||
s.version = '3.3.0' | ||
s.version = '3.4.0' | ||
s.summary = 'Spree Item Returns' | ||
s.description = ' | ||
At User-End | ||
- User can Initate items-return process | ||
- Can check return history | ||
' | ||
s.required_ruby_version = '>= 2.2.7' | ||
s.required_ruby_version = '>= 2.5.0' | ||
|
||
s.author = 'Anurag Bhardwaj' | ||
s.email = '[email protected]' | ||
|
@@ -21,23 +21,23 @@ Gem::Specification.new do |s| | |
s.require_path = 'lib' | ||
s.requirements << 'none' | ||
|
||
s.add_dependency 'spree_core', '>= 3.2.0', '< 4.0' | ||
s.add_dependency 'spree_extension', '~> 0.0.5' | ||
s.add_dependency 'spree_core', '>= 4.0.0' | ||
s.add_dependency 'spree_extension', '~> 0.0.9' | ||
|
||
s.add_development_dependency 'appraisal' | ||
s.add_development_dependency 'capybara', '~> 2.6' | ||
s.add_development_dependency 'coffee-rails', '~> 4.2.1' | ||
s.add_development_dependency 'capybara', '>= 3.30.0' | ||
s.add_development_dependency 'coffee-rails', '~> 5.0.0' | ||
s.add_development_dependency 'database_cleaner' | ||
s.add_development_dependency 'factory_bot' | ||
s.add_development_dependency 'ffaker' | ||
s.add_development_dependency 'rails-controller-testing', '~> 1.0.1' | ||
s.add_development_dependency 'rspec-activemodel-mocks', '~> 1.0.3' | ||
s.add_development_dependency 'rspec-rails', '~> 3.4' | ||
s.add_development_dependency 'sass-rails', '~> 5.0.0' | ||
s.add_development_dependency 'rails-controller-testing', '~> 1.0.4' | ||
s.add_development_dependency 'rspec-activemodel-mocks', '~> 1.1.0' | ||
s.add_development_dependency 'rspec-rails', '~> 4.0.0' | ||
s.add_development_dependency 'sass-rails', '>= 5.0.0' | ||
s.add_development_dependency 'selenium-webdriver', '~> 3.0.8' | ||
s.add_development_dependency 'shoulda-matchers', '~> 3.1.1' | ||
s.add_development_dependency 'shoulda-matchers', '~> 4.3' | ||
s.add_development_dependency 'shoulda-callback-matchers', '~> 1.1.1' | ||
s.add_development_dependency 'simplecov', '~> 0.13.0' | ||
s.add_development_dependency 'sqlite3', '~> 1.3.13' | ||
s.add_development_dependency 'simplecov', '~> 0.18.0' | ||
s.add_development_dependency 'sqlite3', '~> 1.4' | ||
|
||
end |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 >= ?
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.
move to gemspec