workarea-product_content 0.0.1.pre

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +21 -0
  3. data/Gemfile +17 -0
  4. data/LICENSE +52 -0
  5. data/README.md +36 -0
  6. data/Rakefile +56 -0
  7. data/app/models/workarea/catalog/product.decorator +21 -0
  8. data/app/view_models/workarea/admin/product_view_model.decorator +11 -0
  9. data/app/view_models/workarea/storefront/product_view_model.decorator +9 -0
  10. data/app/views/.keep +0 -0
  11. data/app/views/workarea/admin/catalog_products/_cards.html.haml +266 -0
  12. data/app/views/workarea/admin/catalog_products/content.html.haml +42 -0
  13. data/bin/rails +25 -0
  14. data/config/initializers/workarea.rb +5 -0
  15. data/config/routes.rb +2 -0
  16. data/lib/workarea/product_content.rb +8 -0
  17. data/lib/workarea/product_content/engine.rb +10 -0
  18. data/lib/workarea/product_content/version.rb +5 -0
  19. data/test/dummy/.ruby-version +1 -0
  20. data/test/dummy/Rakefile +6 -0
  21. data/test/dummy/app/assets/config/manifest.js +2 -0
  22. data/test/dummy/app/assets/images/.keep +0 -0
  23. data/test/dummy/app/assets/stylesheets/application.css +15 -0
  24. data/test/dummy/app/controllers/application_controller.rb +2 -0
  25. data/test/dummy/app/controllers/concerns/.keep +0 -0
  26. data/test/dummy/app/helpers/application_helper.rb +2 -0
  27. data/test/dummy/app/javascript/packs/application.js +14 -0
  28. data/test/dummy/app/jobs/application_job.rb +7 -0
  29. data/test/dummy/app/mailers/application_mailer.rb +4 -0
  30. data/test/dummy/app/models/concerns/.keep +0 -0
  31. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  32. data/test/dummy/app/views/layouts/mailer.html.erb +13 -0
  33. data/test/dummy/app/views/layouts/mailer.text.erb +1 -0
  34. data/test/dummy/bin/rails +4 -0
  35. data/test/dummy/bin/rake +4 -0
  36. data/test/dummy/bin/setup +25 -0
  37. data/test/dummy/config.ru +5 -0
  38. data/test/dummy/config/application.rb +33 -0
  39. data/test/dummy/config/boot.rb +5 -0
  40. data/test/dummy/config/environment.rb +5 -0
  41. data/test/dummy/config/environments/development.rb +53 -0
  42. data/test/dummy/config/environments/production.rb +101 -0
  43. data/test/dummy/config/environments/test.rb +48 -0
  44. data/test/dummy/config/initializers/application_controller_renderer.rb +8 -0
  45. data/test/dummy/config/initializers/assets.rb +12 -0
  46. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  47. data/test/dummy/config/initializers/content_security_policy.rb +28 -0
  48. data/test/dummy/config/initializers/cookies_serializer.rb +5 -0
  49. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  50. data/test/dummy/config/initializers/inflections.rb +16 -0
  51. data/test/dummy/config/initializers/mime_types.rb +4 -0
  52. data/test/dummy/config/initializers/workarea.rb +5 -0
  53. data/test/dummy/config/initializers/wrap_parameters.rb +9 -0
  54. data/test/dummy/config/locales/en.yml +33 -0
  55. data/test/dummy/config/puma.rb +38 -0
  56. data/test/dummy/config/routes.rb +5 -0
  57. data/test/dummy/config/spring.rb +6 -0
  58. data/test/dummy/db/seeds.rb +2 -0
  59. data/test/dummy/lib/assets/.keep +0 -0
  60. data/test/dummy/log/.keep +0 -0
  61. data/test/models/catalog/product_test.decorator +13 -0
  62. data/test/teaspoon_env.rb +6 -0
  63. data/test/test_helper.rb +10 -0
  64. data/workarea-product_content.gemspec +20 -0
  65. metadata +120 -0
@@ -0,0 +1,48 @@
1
+ # The test environment is used exclusively to run your application's
2
+ # test suite. You never need to work with it otherwise. Remember that
3
+ # your test database is "scratch space" for the test suite and is wiped
4
+ # and recreated between test runs. Don't rely on the data there!
5
+
6
+ Rails.application.configure do
7
+ # Settings specified here will take precedence over those in config/application.rb.
8
+
9
+ config.cache_classes = false
10
+ config.action_view.cache_template_loading = true
11
+
12
+ # Do not eager load code on boot. This avoids loading your whole application
13
+ # just for the purpose of running a single test. If you are using a tool that
14
+ # preloads Rails for running tests, you may have to set it to true.
15
+ config.eager_load = false
16
+
17
+ # Configure public file server for tests with Cache-Control for performance.
18
+ config.public_file_server.enabled = true
19
+ config.public_file_server.headers = {
20
+ 'Cache-Control' => "public, max-age=#{1.hour.to_i}"
21
+ }
22
+
23
+ # Show full error reports and disable caching.
24
+ config.consider_all_requests_local = true
25
+ config.action_controller.perform_caching = false
26
+ config.cache_store = :null_store
27
+
28
+ # Raise exceptions instead of rendering exception templates.
29
+ config.action_dispatch.show_exceptions = false
30
+
31
+ # Disable request forgery protection in test environment.
32
+ config.action_controller.allow_forgery_protection = false
33
+
34
+ config.action_mailer.perform_caching = false
35
+
36
+ # Tell Action Mailer not to deliver emails to the real world.
37
+ # The :test delivery method accumulates sent emails in the
38
+ # ActionMailer::Base.deliveries array.
39
+ config.action_mailer.delivery_method = :test
40
+
41
+ # Print deprecation notices to the stderr.
42
+ config.active_support.deprecation = :stderr
43
+
44
+ # Raises error for missing translations.
45
+ # config.action_view.raise_on_missing_translations = true
46
+
47
+ config.cache_store = :null_store
48
+ end
@@ -0,0 +1,8 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # ActiveSupport::Reloader.to_prepare do
4
+ # ApplicationController.renderer.defaults.merge!(
5
+ # http_host: 'example.org',
6
+ # https: false
7
+ # )
8
+ # end
@@ -0,0 +1,12 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Version of your assets, change this if you want to expire all your assets.
4
+ Rails.application.config.assets.version = '1.0'
5
+
6
+ # Add additional assets to the asset load path.
7
+ # Rails.application.config.assets.paths << Emoji.images_path
8
+
9
+ # Precompile additional assets.
10
+ # application.js, application.css, and all non-JS/CSS in the app/assets
11
+ # folder are already added.
12
+ # Rails.application.config.assets.precompile += %w( admin.js admin.css )
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
+ # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
+
6
+ # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7
+ # Rails.backtrace_cleaner.remove_silencers!
@@ -0,0 +1,28 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Define an application-wide content security policy
4
+ # For further information see the following documentation
5
+ # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
6
+
7
+ # Rails.application.config.content_security_policy do |policy|
8
+ # policy.default_src :self, :https
9
+ # policy.font_src :self, :https, :data
10
+ # policy.img_src :self, :https, :data
11
+ # policy.object_src :none
12
+ # policy.script_src :self, :https
13
+ # policy.style_src :self, :https
14
+
15
+ # # Specify URI for violation reports
16
+ # # policy.report_uri "/csp-violation-report-endpoint"
17
+ # end
18
+
19
+ # If you are using UJS then enable automatic nonce generation
20
+ # Rails.application.config.content_security_policy_nonce_generator = -> request { SecureRandom.base64(16) }
21
+
22
+ # Set the nonce only to specific directives
23
+ # Rails.application.config.content_security_policy_nonce_directives = %w(script-src)
24
+
25
+ # Report CSP violations to a specified URI
26
+ # For further information see the following documentation:
27
+ # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only
28
+ # Rails.application.config.content_security_policy_report_only = true
@@ -0,0 +1,5 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Specify a serializer for the signed and encrypted cookie jars.
4
+ # Valid options are :json, :marshal, and :hybrid.
5
+ Rails.application.config.action_dispatch.cookies_serializer = :json
@@ -0,0 +1,4 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Configure sensitive parameters which will be filtered from the log file.
4
+ Rails.application.config.filter_parameters += [:password]
@@ -0,0 +1,16 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new inflection rules using the following format. Inflections
4
+ # are locale specific, and you may define rules for as many different
5
+ # locales as you wish. All of these examples are active by default:
6
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
7
+ # inflect.plural /^(ox)$/i, '\1en'
8
+ # inflect.singular /^(ox)en/i, '\1'
9
+ # inflect.irregular 'person', 'people'
10
+ # inflect.uncountable %w( fish sheep )
11
+ # end
12
+
13
+ # These inflection rules are supported but not enabled by default:
14
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
15
+ # inflect.acronym 'RESTful'
16
+ # end
@@ -0,0 +1,4 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new mime types for use in respond_to blocks:
4
+ # Mime::Type.register "text/richtext", :rtf
@@ -0,0 +1,5 @@
1
+ Workarea.configure do |config|
2
+ # Basic site info
3
+ config.site_name = 'Workarea Product Content'
4
+ config.host = 'www.example.com'
5
+ end
@@ -0,0 +1,9 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # This file contains settings for ActionController::ParamsWrapper which
4
+ # is enabled by default.
5
+
6
+ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
+ ActiveSupport.on_load(:action_controller) do
8
+ wrap_parameters format: [:json]
9
+ end
@@ -0,0 +1,33 @@
1
+ # Files in the config/locales directory are used for internationalization
2
+ # and are automatically loaded by Rails. If you want to use locales other
3
+ # than English, add the necessary files in this directory.
4
+ #
5
+ # To use the locales, use `I18n.t`:
6
+ #
7
+ # I18n.t 'hello'
8
+ #
9
+ # In views, this is aliased to just `t`:
10
+ #
11
+ # <%= t('hello') %>
12
+ #
13
+ # To use a different locale, set it with `I18n.locale`:
14
+ #
15
+ # I18n.locale = :es
16
+ #
17
+ # This would use the information in config/locales/es.yml.
18
+ #
19
+ # The following keys must be escaped otherwise they will not be retrieved by
20
+ # the default I18n backend:
21
+ #
22
+ # true, false, on, off, yes, no
23
+ #
24
+ # Instead, surround them with single quotes.
25
+ #
26
+ # en:
27
+ # 'true': 'foo'
28
+ #
29
+ # To learn more, please read the Rails Internationalization guide
30
+ # available at https://guides.rubyonrails.org/i18n.html.
31
+
32
+ en:
33
+ hello: "Hello world"
@@ -0,0 +1,38 @@
1
+ # Puma can serve each request in a thread from an internal thread pool.
2
+ # The `threads` method setting takes two numbers: a minimum and maximum.
3
+ # Any libraries that use thread pools should be configured to match
4
+ # the maximum value specified for Puma. Default is set to 5 threads for minimum
5
+ # and maximum; this matches the default thread size of Active Record.
6
+ #
7
+ max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
8
+ min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count }
9
+ threads min_threads_count, max_threads_count
10
+
11
+ # Specifies the `port` that Puma will listen on to receive requests; default is 3000.
12
+ #
13
+ port ENV.fetch("PORT") { 3000 }
14
+
15
+ # Specifies the `environment` that Puma will run in.
16
+ #
17
+ environment ENV.fetch("RAILS_ENV") { "development" }
18
+
19
+ # Specifies the `pidfile` that Puma will use.
20
+ pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" }
21
+
22
+ # Specifies the number of `workers` to boot in clustered mode.
23
+ # Workers are forked web server processes. If using threads and workers together
24
+ # the concurrency of the application would be max `threads` * `workers`.
25
+ # Workers do not work on JRuby or Windows (both of which do not support
26
+ # processes).
27
+ #
28
+ # workers ENV.fetch("WEB_CONCURRENCY") { 2 }
29
+
30
+ # Use the `preload_app!` method when specifying a `workers` number.
31
+ # This directive tells Puma to first boot the application and load code
32
+ # before forking the application. This takes advantage of Copy On Write
33
+ # process behavior so workers use less memory.
34
+ #
35
+ # preload_app!
36
+
37
+ # Allow puma to be restarted by `rails restart` command.
38
+ plugin :tmp_restart
@@ -0,0 +1,5 @@
1
+ Rails.application.routes.draw do
2
+ mount Workarea::Core::Engine => '/'
3
+ mount Workarea::Admin::Engine => '/admin', as: 'admin'
4
+ mount Workarea::Storefront::Engine => '/', as: 'storefront'
5
+ end
@@ -0,0 +1,6 @@
1
+ Spring.watch(
2
+ ".ruby-version",
3
+ ".rbenv-vars",
4
+ "tmp/restart.txt",
5
+ "tmp/caching-dev.txt"
6
+ )
@@ -0,0 +1,2 @@
1
+ require 'workarea/seeds'
2
+ Workarea::Seeds.run
File without changes
File without changes
@@ -0,0 +1,13 @@
1
+ require 'test_helper'
2
+
3
+ module Workarea
4
+ decorate Catalog::ProductTest, with: :product_content do
5
+ # Define additional tests based on new functionality or
6
+ # override tests originally defined in the decorated class for
7
+ # changes that alter default behavior.
8
+ #
9
+ # While calling super to extend a test case is possible, it is
10
+ # recommended that you add a new test or completely override an
11
+ # existing test to avoid ambiguity in your test suite.
12
+ end
13
+ end
@@ -0,0 +1,6 @@
1
+ require 'workarea/testing/teaspoon'
2
+
3
+ Teaspoon.configure do |config|
4
+ config.root = Workarea::ProductContent::Engine.root
5
+ Workarea::Teaspoon.apply(config)
6
+ end
@@ -0,0 +1,10 @@
1
+ # Configure Rails Environment
2
+ ENV['RAILS_ENV'] = 'test'
3
+
4
+ require File.expand_path("../../test/dummy/config/environment.rb", __FILE__)
5
+ require 'rails/test_help'
6
+ require 'workarea/test_help'
7
+
8
+ # Filter out Minitest backtrace while allowing backtrace from other libraries
9
+ # to be shown.
10
+ Minitest.backtrace_filter = Minitest::BacktraceFilter.new
@@ -0,0 +1,20 @@
1
+ $:.push File.expand_path("lib", __dir__)
2
+
3
+ # Maintain your gem's version:
4
+ require "workarea/product_content/version"
5
+
6
+ # Describe your gem and declare its dependencies:
7
+ Gem::Specification.new do |spec|
8
+ spec.name = "workarea-product_content"
9
+ spec.version = Workarea::ProductContent::VERSION
10
+ spec.authors = ["Gunasekaran Raja"]
11
+ spec.email = ["guna.r@trikatechnologies.com"]
12
+ spec.homepage = "https://github.com/trikatechnologies"
13
+ spec.summary = "Add content block capabilities for product page"
14
+ spec.description = "This will enable content block in product details page"
15
+ spec.license = "Business Software License"
16
+
17
+ spec.files = `git ls-files`.split("\n")
18
+
19
+ spec.add_dependency 'workarea', '~> 3.x'
20
+ end
metadata ADDED
@@ -0,0 +1,120 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: workarea-product_content
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1.pre
5
+ platform: ruby
6
+ authors:
7
+ - Gunasekaran Raja
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2020-12-24 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: workarea
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 3.x
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 3.x
27
+ description: This will enable content block in product details page
28
+ email:
29
+ - guna.r@trikatechnologies.com
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - ".gitignore"
35
+ - Gemfile
36
+ - LICENSE
37
+ - README.md
38
+ - Rakefile
39
+ - app/models/workarea/catalog/product.decorator
40
+ - app/view_models/workarea/admin/product_view_model.decorator
41
+ - app/view_models/workarea/storefront/product_view_model.decorator
42
+ - app/views/.keep
43
+ - app/views/workarea/admin/catalog_products/_cards.html.haml
44
+ - app/views/workarea/admin/catalog_products/content.html.haml
45
+ - bin/rails
46
+ - config/initializers/workarea.rb
47
+ - config/routes.rb
48
+ - lib/workarea/product_content.rb
49
+ - lib/workarea/product_content/engine.rb
50
+ - lib/workarea/product_content/version.rb
51
+ - test/dummy/.ruby-version
52
+ - test/dummy/Rakefile
53
+ - test/dummy/app/assets/config/manifest.js
54
+ - test/dummy/app/assets/images/.keep
55
+ - test/dummy/app/assets/stylesheets/application.css
56
+ - test/dummy/app/controllers/application_controller.rb
57
+ - test/dummy/app/controllers/concerns/.keep
58
+ - test/dummy/app/helpers/application_helper.rb
59
+ - test/dummy/app/javascript/packs/application.js
60
+ - test/dummy/app/jobs/application_job.rb
61
+ - test/dummy/app/mailers/application_mailer.rb
62
+ - test/dummy/app/models/concerns/.keep
63
+ - test/dummy/app/views/layouts/application.html.erb
64
+ - test/dummy/app/views/layouts/mailer.html.erb
65
+ - test/dummy/app/views/layouts/mailer.text.erb
66
+ - test/dummy/bin/rails
67
+ - test/dummy/bin/rake
68
+ - test/dummy/bin/setup
69
+ - test/dummy/config.ru
70
+ - test/dummy/config/application.rb
71
+ - test/dummy/config/boot.rb
72
+ - test/dummy/config/environment.rb
73
+ - test/dummy/config/environments/development.rb
74
+ - test/dummy/config/environments/production.rb
75
+ - test/dummy/config/environments/test.rb
76
+ - test/dummy/config/initializers/application_controller_renderer.rb
77
+ - test/dummy/config/initializers/assets.rb
78
+ - test/dummy/config/initializers/backtrace_silencers.rb
79
+ - test/dummy/config/initializers/content_security_policy.rb
80
+ - test/dummy/config/initializers/cookies_serializer.rb
81
+ - test/dummy/config/initializers/filter_parameter_logging.rb
82
+ - test/dummy/config/initializers/inflections.rb
83
+ - test/dummy/config/initializers/mime_types.rb
84
+ - test/dummy/config/initializers/workarea.rb
85
+ - test/dummy/config/initializers/wrap_parameters.rb
86
+ - test/dummy/config/locales/en.yml
87
+ - test/dummy/config/puma.rb
88
+ - test/dummy/config/routes.rb
89
+ - test/dummy/config/spring.rb
90
+ - test/dummy/db/seeds.rb
91
+ - test/dummy/lib/assets/.keep
92
+ - test/dummy/log/.keep
93
+ - test/models/catalog/product_test.decorator
94
+ - test/teaspoon_env.rb
95
+ - test/test_helper.rb
96
+ - workarea-product_content.gemspec
97
+ homepage: https://github.com/trikatechnologies
98
+ licenses:
99
+ - Business Software License
100
+ metadata: {}
101
+ post_install_message:
102
+ rdoc_options: []
103
+ require_paths:
104
+ - lib
105
+ required_ruby_version: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - ">="
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ required_rubygems_version: !ruby/object:Gem::Requirement
111
+ requirements:
112
+ - - ">"
113
+ - !ruby/object:Gem::Version
114
+ version: 1.3.1
115
+ requirements: []
116
+ rubygems_version: 3.0.3
117
+ signing_key:
118
+ specification_version: 4
119
+ summary: Add content block capabilities for product page
120
+ test_files: []