beyond_canvas 0.15.1.pre → 0.16.2.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +0 -6
  3. data/Rakefile +3 -3
  4. data/app/assets/javascripts/beyond_canvas/base.js +248 -99
  5. data/app/assets/stylesheets/beyond_canvas/settings/_breakpoints.scss +6 -6
  6. data/app/assets/stylesheets/beyond_canvas/settings/_variables.scss +13 -13
  7. data/app/controllers/beyond_canvas/authentications_controller.rb +62 -0
  8. data/app/controllers/concerns/beyond_canvas/authentication.rb +24 -0
  9. data/app/controllers/concerns/beyond_canvas/request_validation.rb +1 -1
  10. data/app/controllers/concerns/beyond_canvas/resource_management.rb +33 -0
  11. data/app/javascript/beyond_canvas/base.js +0 -2
  12. data/app/javascript/beyond_canvas/initializers/buttons.js +7 -40
  13. data/app/javascript/beyond_canvas/initializers/flash.js +5 -13
  14. data/app/javascript/beyond_canvas/initializers/functions.js +41 -0
  15. data/app/javascript/beyond_canvas/initializers/inputs.js +3 -7
  16. data/app/views/beyond_canvas/authentications/new.html.erb +18 -0
  17. data/app/views/layouts/beyond_canvas/public.html.erb +3 -1
  18. data/config/locales/en.yml +4 -0
  19. data/config/routes.rb +6 -0
  20. data/lib/beyond_canvas.rb +18 -2
  21. data/lib/beyond_canvas/configuration.rb +4 -1
  22. data/lib/beyond_canvas/engine.rb +4 -0
  23. data/lib/beyond_canvas/models/authentication.rb +66 -0
  24. data/lib/beyond_canvas/models/shop.rb +28 -0
  25. data/lib/beyond_canvas/models/utils.rb +55 -0
  26. data/lib/beyond_canvas/parameter_sanitizer.rb +43 -0
  27. data/lib/beyond_canvas/rails/routes.rb +21 -0
  28. data/lib/beyond_canvas/version.rb +1 -1
  29. data/lib/generators/beyond_canvas/auth_model/auth_model_generator.rb +50 -0
  30. data/lib/generators/beyond_canvas/auth_model/templates/migration.erb +20 -0
  31. data/lib/generators/beyond_canvas/auth_model/templates/model.erb +5 -0
  32. data/lib/generators/beyond_canvas/controller/controller_generator.rb +20 -0
  33. data/lib/generators/beyond_canvas/controller/templates/controller.erb +37 -0
  34. data/lib/generators/beyond_canvas/custom_styles/templates/beyond_canvas_custom_styles.scss +153 -0
  35. data/lib/generators/beyond_canvas/install/install_generator.rb +15 -5
  36. data/lib/generators/beyond_canvas/install/templates/beyond_canvas.rb.erb +11 -0
  37. data/lib/generators/beyond_canvas/views/views_generator.rb +19 -0
  38. metadata +50 -5
  39. data/lib/generators/beyond_canvas/custom_styles/templates/beyond_canvas_custom_styles.sass +0 -123
@@ -6,19 +6,17 @@ module BeyondCanvas
6
6
  desc 'Installs Beyond Canvas and generates the necessary files'
7
7
 
8
8
  class_option :skip_webpacker, type: :boolean, default: false, desc: 'Use Sprockets assets instead of Webpacker'
9
+ class_option :auth_model, type: :string, default: 'shop', desc: 'Authentication model'
9
10
 
10
11
  source_root File.expand_path('templates', __dir__)
11
12
 
12
13
  def copy_initializer
13
14
  @skip_webpacker = options[:skip_webpacker]
15
+ @auth_model = options[:auth_model]
14
16
 
15
17
  template 'beyond_canvas.rb.erb', 'config/initializers/beyond_canvas.rb'
16
18
  end
17
19
 
18
- def setup_routes
19
- route "mount BeyondCanvas::Engine => '/'"
20
- end
21
-
22
20
  def create_assets
23
21
  if options[:skip_webpacker]
24
22
  generate 'beyond_canvas:assets'
@@ -28,7 +26,19 @@ module BeyondCanvas
28
26
  end
29
27
 
30
28
  def install_beyond_api
31
- generate 'beyond_api:install'
29
+ generate 'beyond_canvas:beyond_api'
30
+ end
31
+
32
+ def generate_auth_model
33
+ generate "beyond_canvas:auth_model #{@auth_model}"
34
+ end
35
+
36
+ def setup_routes
37
+ route "beyond_canvas_for :#{@auth_model.pluralize}"
38
+ end
39
+
40
+ def copy_locale
41
+ copy_file '../../../../../config/locales/en.yml', 'config/locales/beyond_canvas.en.yml'
32
42
  end
33
43
  end
34
44
  end
@@ -37,4 +37,15 @@ BeyondCanvas.setup do |config|
37
37
  # You can switch to using Sprocket's asset pipeline here.
38
38
  #
39
39
  <% unless @skip_webpacker %># <% end %>config.skip_webpacker = <%= @skip_webpacker %>
40
+
41
+ # ==> Authentication with ePages Beyond API
42
+
43
+ # Default model is shop
44
+ #
45
+ config.encryption_key = '<%= SecureRandom.hex(32) %>'
46
+ config.blind_index_key = '<%= SecureRandom.hex(32) %>'
47
+
48
+ # ==> Mountable engine configuration
49
+ #
50
+ # config.namespace = '/'
40
51
  end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'rails/generators/active_record'
4
+
5
+ module BeyondCanvas
6
+ module Generators
7
+ class ViewsGenerator < Rails::Generators::Base # :nodoc:
8
+ desc 'Creates a view in the app/view folder'
9
+
10
+ argument :scope, required: true, desc: 'The scope to copy views to'
11
+
12
+ source_root File.expand_path('../../../../app/views/beyond_canvas/authentications', __dir__)
13
+
14
+ def create_view
15
+ copy_file 'new.html.erb', "app/views/#{scope}/new.html.erb"
16
+ end
17
+ end
18
+ end
19
+ end
metadata CHANGED
@@ -1,29 +1,57 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beyond_canvas
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.1.pre
4
+ version: 0.16.2.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Unai Abrisketa
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-01 00:00:00.000000000 Z
11
+ date: 2020-08-06 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: attr_encrypted
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '3.1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '3.1'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: beyond_api
15
29
  requirement: !ruby/object:Gem::Requirement
16
30
  requirements:
17
31
  - - "~>"
18
32
  - !ruby/object:Gem::Version
19
- version: '0.8'
33
+ version: '0.11'
20
34
  type: :runtime
21
35
  prerelease: false
22
36
  version_requirements: !ruby/object:Gem::Requirement
23
37
  requirements:
24
38
  - - "~>"
25
39
  - !ruby/object:Gem::Version
26
- version: '0.8'
40
+ version: '0.11'
41
+ - !ruby/object:Gem::Dependency
42
+ name: blind_index
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.0'
27
55
  - !ruby/object:Gem::Dependency
28
56
  name: bourbon
29
57
  requirement: !ruby/object:Gem::Requirement
@@ -207,9 +235,12 @@ files:
207
235
  - app/assets/stylesheets/beyond_canvas/utilities/_functions.scss
208
236
  - app/assets/stylesheets/beyond_canvas/utilities/_mixins.scss
209
237
  - app/controllers/beyond_canvas/application_controller.rb
238
+ - app/controllers/beyond_canvas/authentications_controller.rb
210
239
  - app/controllers/beyond_canvas/system_controller.rb
240
+ - app/controllers/concerns/beyond_canvas/authentication.rb
211
241
  - app/controllers/concerns/beyond_canvas/locale_management.rb
212
242
  - app/controllers/concerns/beyond_canvas/request_validation.rb
243
+ - app/controllers/concerns/beyond_canvas/resource_management.rb
213
244
  - app/controllers/concerns/beyond_canvas/status_codes.rb
214
245
  - app/form_builders/beyond_canvas/form_builder.rb
215
246
  - app/helpers/beyond_canvas/application_helper.rb
@@ -217,7 +248,9 @@ files:
217
248
  - app/javascript/beyond_canvas/base.js
218
249
  - app/javascript/beyond_canvas/initializers/buttons.js
219
250
  - app/javascript/beyond_canvas/initializers/flash.js
251
+ - app/javascript/beyond_canvas/initializers/functions.js
220
252
  - app/javascript/beyond_canvas/initializers/inputs.js
253
+ - app/views/beyond_canvas/authentications/new.html.erb
221
254
  - app/views/beyond_canvas/custom/_public_head.html.erb
222
255
  - app/views/beyond_canvas/locales/_edit.html.erb
223
256
  - app/views/beyond_canvas/mailer/_button.html.erb
@@ -231,20 +264,32 @@ files:
231
264
  - app/views/layouts/beyond_canvas/public.html.erb
232
265
  - config/initializers/beyond_canvas/filter_parameter_logging.rb
233
266
  - config/initializers/beyond_canvas/form_utils.rb
267
+ - config/locales/en.yml
234
268
  - config/routes.rb
235
269
  - lib/beyond_canvas.rb
236
270
  - lib/beyond_canvas/asset_registration.rb
237
271
  - lib/beyond_canvas/configuration.rb
238
272
  - lib/beyond_canvas/engine.rb
273
+ - lib/beyond_canvas/models/authentication.rb
274
+ - lib/beyond_canvas/models/shop.rb
275
+ - lib/beyond_canvas/models/utils.rb
276
+ - lib/beyond_canvas/parameter_sanitizer.rb
277
+ - lib/beyond_canvas/rails/routes.rb
239
278
  - lib/beyond_canvas/version.rb
240
279
  - lib/generators/beyond_canvas/assets/assets_generator.rb
241
280
  - lib/generators/beyond_canvas/assets/templates/beyond_canvas.js
242
281
  - lib/generators/beyond_canvas/assets/templates/beyond_canvas.scss
282
+ - lib/generators/beyond_canvas/auth_model/auth_model_generator.rb
283
+ - lib/generators/beyond_canvas/auth_model/templates/migration.erb
284
+ - lib/generators/beyond_canvas/auth_model/templates/model.erb
243
285
  - lib/generators/beyond_canvas/beyond_api/beyond_api_generator.rb
286
+ - lib/generators/beyond_canvas/controller/controller_generator.rb
287
+ - lib/generators/beyond_canvas/controller/templates/controller.erb
244
288
  - lib/generators/beyond_canvas/custom_styles/custom_styles_generator.rb
245
- - lib/generators/beyond_canvas/custom_styles/templates/beyond_canvas_custom_styles.sass
289
+ - lib/generators/beyond_canvas/custom_styles/templates/beyond_canvas_custom_styles.scss
246
290
  - lib/generators/beyond_canvas/install/install_generator.rb
247
291
  - lib/generators/beyond_canvas/install/templates/beyond_canvas.rb.erb
292
+ - lib/generators/beyond_canvas/views/views_generator.rb
248
293
  - lib/generators/beyond_canvas/webpacker/plugins/jquery.js
249
294
  - lib/generators/beyond_canvas/webpacker/templates/beyond_canvas.js
250
295
  - lib/generators/beyond_canvas/webpacker/templates/beyond_canvas.scss
@@ -1,123 +0,0 @@
1
- // ************************************************************
2
- // Colors
3
- // ************************************************************
4
-
5
- // $palette-primary: rgb(78, 183, 168)
6
- // $palette-secondary: rgb(28, 53, 69)
7
- // $palette-cancel: rgb(153, 153, 153)
8
- // $palette-danger: rgb(218, 60, 60)
9
-
10
- // ************************************************************
11
- // General styles
12
- // ************************************************************
13
-
14
- // $main-background: rgb(233, 232, 220)
15
-
16
- // ************************************************************
17
- // Typography
18
- // ************************************************************
19
-
20
- // $main-color: rgb(62, 62, 62)
21
-
22
- // ************************************************************
23
- // Headlines
24
- // ************************************************************
25
-
26
- // $headline-color: rgb(122, 118, 76)
27
-
28
- // ************************************************************
29
- // Links
30
- // ************************************************************
31
-
32
- // $link-primary-color: darken($palette-primary, 10%)
33
- // $link-secondary-color: darken($palette-cancel, 10%)
34
- // $link-danger-color: darken($palette-danger, 10%)
35
-
36
- // ************************************************************
37
- // Buttons
38
- // ************************************************************
39
-
40
- // $button-primary-background: $palette-primary
41
- // $button-primary-color: $white
42
-
43
- // $button-secondary-background: $palette-cancel
44
- // $button-secondary-color: $white
45
-
46
- // $button-danger-background: $palette-danger
47
- // $button-danger-color: $white
48
-
49
- // $button-border-radius: 3px
50
- // $button-box-shadow: true
51
-
52
- // ************************************************************
53
- // Cards
54
- // ************************************************************
55
-
56
- // $card-border-radius: 3px
57
- // $card-box-shadow: 0 2px 7px rgba($black, .2)
58
- // $card-separator-color: rgb(222, 222, 222)
59
- // $card-title-color: rgb(247, 133, 96)
60
-
61
- // ************************************************************
62
- // Labels
63
- // ************************************************************
64
-
65
- // $label-color: rgb(128, 128, 128)
66
-
67
- // ************************************************************
68
- // Inputs
69
- // ************************************************************
70
-
71
- // $input-border-color: rgb(217, 216, 195)
72
- // $input-border-color-focus: $palette-primary
73
- // $input-errors-color: $palette-danger
74
-
75
- // ************************************************************
76
- // Hints
77
- // ************************************************************
78
-
79
- // $hint-color: rgb(158, 158, 158)
80
-
81
- // ************************************************************
82
- // Logo
83
- // ************************************************************
84
-
85
- // $logo-margin-top-public: 0
86
- // $logo-margin-bottom-public: 34px
87
-
88
- // ************************************************************
89
- // Flash
90
- // ************************************************************
91
-
92
- // $flash-success: rgb(123, 170, 81)
93
- // $flash-info: rgb(90, 129, 171)
94
- // $flash-warning: rgb(193, 179, 26)
95
- // $flash-error: rgb(162, 66, 60)
96
- // $flash-border-radius: 4px
97
- // $flash-box-shadow: 0 1px 2px 0 rgba($black, 0.2)
98
- // $flash-color: rgb(128, 128, 128)
99
-
100
- // ************************************************************
101
- // Tables
102
- // ************************************************************
103
-
104
- // $table-header-background: rgb(243, 242, 236)
105
- // $table-border-color: rgb(233, 232, 220)
106
-
107
- // ************************************************************
108
- // Comments
109
- // ************************************************************
110
-
111
- // $comment-background: rgb(246, 246, 243)
112
- // $comment-color: rgb(170, 169, 156)
113
-
114
- // ************************************************************
115
- // Notices
116
- // ************************************************************
117
-
118
- // $notice-success-background: rgb(123, 170, 81)
119
- // $notice-info-background: rgb(90, 129, 171)
120
- // $notice-warning-background: rgb(193, 179, 26)
121
- // $notice-error-background: rgb(162, 66, 60)
122
- // $notice-border-radius: 4px
123
- // $notice-color: rgb(255, 255, 255)