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

spree 4.7 #161

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

rahul2103
Copy link

No description provided.

with_manage_ability_check(::Spree::BookkeepingDocument).
with_label_translation_key('admin.documents').
with_items(items).
build

Choose a reason for hiding this comment

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

Layout/MultilineMethodCallIndentation: Use 2 (not 4) spaces for indenting an expression spanning multiple lines.

::Spree::Admin::MainMenu::SectionBuilder.new('documents', 'file.svg').
with_manage_ability_check(::Spree::BookkeepingDocument).
with_label_translation_key('admin.documents').
with_items(items).

Choose a reason for hiding this comment

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

Layout/MultilineMethodCallIndentation: Use 2 (not 4) spaces for indenting an expression spanning multiple lines.
Layout/DotPosition: Place the . on the next line, together with the method name.


::Spree::Admin::MainMenu::SectionBuilder.new('documents', 'file.svg').
with_manage_ability_check(::Spree::BookkeepingDocument).
with_label_translation_key('admin.documents').

Choose a reason for hiding this comment

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

Layout/MultilineMethodCallIndentation: Use 2 (not 4) spaces for indenting an expression spanning multiple lines.
Layout/DotPosition: Place the . on the next line, together with the method name.

]

::Spree::Admin::MainMenu::SectionBuilder.new('documents', 'file.svg').
with_manage_ability_check(::Spree::BookkeepingDocument).

Choose a reason for hiding this comment

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

Layout/MultilineMethodCallIndentation: Use 2 (not 4) spaces for indenting an expression spanning multiple lines.
Layout/DotPosition: Place the . on the next line, together with the method name.

build
]

::Spree::Admin::MainMenu::SectionBuilder.new('documents', 'file.svg').

Choose a reason for hiding this comment

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

Layout/DotPosition: Place the . on the next line, together with the method name.

def build
items = [
::Spree::Admin::MainMenu::ItemBuilder.new('invoices', ::Spree::Core::Engine.routes.url_helpers.admin_bookkeeping_documents_path(q: { template_eq: 'invoice' })).
with_label_translation_key('admin.invoices').

Choose a reason for hiding this comment

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

Layout/DotPosition: Place the . on the next line, together with the method name.


def build
items = [
::Spree::Admin::MainMenu::ItemBuilder.new('invoices', ::Spree::Core::Engine.routes.url_helpers.admin_bookkeeping_documents_path(q: { template_eq: 'invoice' })).

Choose a reason for hiding this comment

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

Metrics/LineLength: Line is too long. [172/80]
Layout/DotPosition: Place the . on the next line, together with the method name.

class PrintInvoiceBuilder
include ::Spree::Core::Engine.routes.url_helpers

def build

Choose a reason for hiding this comment

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

Metrics/AbcSize: Assignment Branch Condition size for build is too high. [21.02/15]
Metrics/MethodLength: Method has too many lines. [17/10]

module SpreePrintInvoice
module Admin
module MainMenu
class PrintInvoiceBuilder

Choose a reason for hiding this comment

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

Style/Documentation: Missing top-level class documentation comment.

@@ -0,0 +1,30 @@
module SpreePrintInvoice

Choose a reason for hiding this comment

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

Style/FrozenStringLiteralComment: Missing magic comment # frozen_string_literal: true.

end

def pdf_storage_path(template)
ActiveSupport::Deprecation.warn('This API has changed: Please use order.{packaging_slip, invoice}.pdf_file_path instead')

Choose a reason for hiding this comment

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

Metrics/LineLength: Line is too long. [129/80]

end

def pdf_file_path
ActiveSupport::Deprecation.warn('This API has changed: Please use order.invoice.pdf_file_path instead')

Choose a reason for hiding this comment

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

Metrics/LineLength: Line is too long. [111/80]

end

def pdf_filename
ActiveSupport::Deprecation.warn('This API has changed: Please use order.invoice.file_name instead')

Choose a reason for hiding this comment

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

Metrics/LineLength: Line is too long. [107/80]

# ones on Spree::BookkeepingDocument
#
def pdf_file
ActiveSupport::Deprecation.warn('This API has changed: Please use order.invoice.pdf instead')

Choose a reason for hiding this comment

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

Metrics/LineLength: Line is too long. [101/80]

base.state_machine.before_transition to: :complete, do: :invoice_for_order
end

# Backwards compatibility stuff. Please don't use these methods, rather use the

Choose a reason for hiding this comment

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

Metrics/LineLength: Line is too long. [85/80]

)

Rails.application.config.spree_backend.main_menu.add_to_section('settings',
::Spree::Admin::MainMenu::ItemBuilder.new('print_invoice.settings', ::Spree::Core::Engine.routes.url_helpers.edit_admin_print_invoice_settings_path).

Choose a reason for hiding this comment

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

Layout/AlignParameters: Align the parameters of a method call if they span more than one line.
Metrics/LineLength: Line is too long. [155/80]
Layout/DotPosition: Place the . on the next line, together with the method name.

build
)

Rails.application.config.spree_backend.main_menu.add_to_section('settings',

Choose a reason for hiding this comment

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

Layout/IndentationConsistency: Inconsistent indentation detected.

Rails.application.config.spree_backend.tabs[:order].add(
::Spree::Admin::Tabs::TabBuilder.new(::Spree.t(:documents, scope: [:print_invoice]), ->(resource) { ::Spree::Core::Engine.routes.url_helpers.admin_order_bookkeeping_documents_path(resource) }).
with_icon_key('file.svg').
with_active_check.

Choose a reason for hiding this comment

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

Layout/DotPosition: Place the . on the next line, together with the method name.


Rails.application.config.spree_backend.tabs[:order].add(
::Spree::Admin::Tabs::TabBuilder.new(::Spree.t(:documents, scope: [:print_invoice]), ->(resource) { ::Spree::Core::Engine.routes.url_helpers.admin_order_bookkeeping_documents_path(resource) }).
with_icon_key('file.svg').

Choose a reason for hiding this comment

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

Layout/DotPosition: Place the . on the next line, together with the method name.

Rails.application.config.spree_backend.main_menu.insert_after('dashboard', ::SpreePrintInvoice::Admin::MainMenu::PrintInvoiceBuilder.new.build)

Rails.application.config.spree_backend.tabs[:order].add(
::Spree::Admin::Tabs::TabBuilder.new(::Spree.t(:documents, scope: [:print_invoice]), ->(resource) { ::Spree::Core::Engine.routes.url_helpers.admin_order_bookkeeping_documents_path(resource) }).

Choose a reason for hiding this comment

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

Metrics/LineLength: Line is too long. [199/80]
Layout/DotPosition: Place the . on the next line, together with the method name.

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.

2 participants