beyond_canvas 0.14.0.pre → 0.16.0.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +0 -6
- data/app/assets/images/icons/checkbox_checked.svg +1 -0
- data/app/assets/images/icons/checkbox_unchecked.svg +1 -0
- data/app/assets/images/icons/radiobutton_checked.svg +1 -0
- data/app/assets/images/icons/radiobutton_unchecked.svg +1 -0
- data/app/assets/javascripts/beyond_canvas/base.js +248 -87
- data/app/assets/stylesheets/beyond_canvas/base.scss +3 -0
- data/app/assets/stylesheets/beyond_canvas/components/_containers.scss +37 -0
- data/app/assets/stylesheets/beyond_canvas/components/_inputs.scss +47 -1
- data/app/assets/stylesheets/beyond_canvas/settings/_breakpoints.scss +6 -0
- data/app/assets/stylesheets/beyond_canvas/settings/_variables.scss +24 -0
- data/app/assets/stylesheets/beyond_canvas/utilities/_functions.scss +15 -0
- data/app/controllers/beyond_canvas/authentications_controller.rb +62 -0
- data/app/controllers/concerns/beyond_canvas/authentication.rb +24 -0
- data/app/controllers/concerns/beyond_canvas/request_validation.rb +1 -1
- data/app/controllers/concerns/beyond_canvas/resource_management.rb +33 -0
- data/app/form_builders/beyond_canvas/form_builder.rb +65 -8
- data/app/javascript/beyond_canvas/base.js +3 -6
- data/app/javascript/beyond_canvas/initializers/buttons.js +21 -39
- data/app/javascript/beyond_canvas/initializers/flash.js +5 -14
- data/app/javascript/beyond_canvas/initializers/functions.js +41 -0
- data/app/javascript/beyond_canvas/initializers/inputs.js +3 -8
- data/app/views/beyond_canvas/authentications/new.html.erb +18 -0
- data/config/locales/en.yml +4 -0
- data/config/routes.rb +6 -0
- data/lib/beyond_canvas.rb +22 -2
- data/lib/beyond_canvas/configuration.rb +4 -1
- data/lib/beyond_canvas/engine.rb +4 -0
- data/lib/beyond_canvas/models/authentication.rb +66 -0
- data/lib/beyond_canvas/models/shop.rb +28 -0
- data/lib/beyond_canvas/models/utils.rb +55 -0
- data/lib/beyond_canvas/parameter_sanitizer.rb +43 -0
- data/lib/beyond_canvas/rails/routes.rb +21 -0
- data/lib/beyond_canvas/version.rb +1 -1
- data/lib/generators/beyond_canvas/auth_model/auth_model_generator.rb +50 -0
- data/lib/generators/beyond_canvas/auth_model/templates/migration.erb +20 -0
- data/lib/generators/beyond_canvas/auth_model/templates/model.erb +5 -0
- data/lib/generators/beyond_canvas/controller/controller_generator.rb +20 -0
- data/lib/generators/beyond_canvas/controller/templates/controller.erb +37 -0
- data/lib/generators/beyond_canvas/install/install_generator.rb +15 -5
- data/lib/generators/beyond_canvas/install/templates/beyond_canvas.rb.erb +11 -0
- data/lib/generators/beyond_canvas/views/views_generator.rb +19 -0
- metadata +58 -6
@@ -0,0 +1,37 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class <%= scope.camelize %>Controller < BeyondCanvas::AuthenticationsController
|
4
|
+
# before_action :configure_params, only: [:create]
|
5
|
+
|
6
|
+
# def new
|
7
|
+
# super
|
8
|
+
# end
|
9
|
+
|
10
|
+
# def create
|
11
|
+
# super
|
12
|
+
# end
|
13
|
+
|
14
|
+
# private
|
15
|
+
|
16
|
+
# If you have extra params to permit, append them to the sanitizer.
|
17
|
+
# def configure_params
|
18
|
+
# beyond_canvas_parameter_sanitizer.permit(:attribute1, :attribute2)
|
19
|
+
# end
|
20
|
+
|
21
|
+
# The path used after creating the shop in the database
|
22
|
+
# def after_create_path
|
23
|
+
# resource.return_url
|
24
|
+
# end
|
25
|
+
|
26
|
+
# def handle_active_record_exception(exception)
|
27
|
+
# super
|
28
|
+
# end
|
29
|
+
|
30
|
+
# def handle_beyond_api_exception(exception)
|
31
|
+
# super
|
32
|
+
# end
|
33
|
+
|
34
|
+
# def handle_standard_error_exception(exception)
|
35
|
+
# super
|
36
|
+
# end
|
37
|
+
end
|
@@ -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
|
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,43 +1,71 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: beyond_canvas
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.16.0.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-
|
11
|
+
date: 2020-06-26 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.
|
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.
|
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
|
30
58
|
requirements:
|
31
59
|
- - "~>"
|
32
60
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
61
|
+
version: '5.1'
|
34
62
|
type: :runtime
|
35
63
|
prerelease: false
|
36
64
|
version_requirements: !ruby/object:Gem::Requirement
|
37
65
|
requirements:
|
38
66
|
- - "~>"
|
39
67
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
68
|
+
version: '5.1'
|
41
69
|
- !ruby/object:Gem::Dependency
|
42
70
|
name: colorize
|
43
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -169,18 +197,23 @@ files:
|
|
169
197
|
- README.md
|
170
198
|
- Rakefile
|
171
199
|
- app/assets/config/beyond_canvas_manifest.js
|
200
|
+
- app/assets/images/icons/checkbox_checked.svg
|
201
|
+
- app/assets/images/icons/checkbox_unchecked.svg
|
172
202
|
- app/assets/images/icons/file.svg
|
173
203
|
- app/assets/images/icons/flash_checkbox.svg
|
174
204
|
- app/assets/images/icons/flash_close.svg
|
175
205
|
- app/assets/images/icons/flash_error.svg
|
176
206
|
- app/assets/images/icons/flash_info.svg
|
177
207
|
- app/assets/images/icons/flash_warning.svg
|
208
|
+
- app/assets/images/icons/radiobutton_checked.svg
|
209
|
+
- app/assets/images/icons/radiobutton_unchecked.svg
|
178
210
|
- app/assets/javascripts/beyond_canvas/base.js
|
179
211
|
- app/assets/stylesheets/beyond_canvas/base.scss
|
180
212
|
- app/assets/stylesheets/beyond_canvas/components/_actions.scss
|
181
213
|
- app/assets/stylesheets/beyond_canvas/components/_buttons.scss
|
182
214
|
- app/assets/stylesheets/beyond_canvas/components/_cards.scss
|
183
215
|
- app/assets/stylesheets/beyond_canvas/components/_comments.scss
|
216
|
+
- app/assets/stylesheets/beyond_canvas/components/_containers.scss
|
184
217
|
- app/assets/stylesheets/beyond_canvas/components/_flash.scss
|
185
218
|
- app/assets/stylesheets/beyond_canvas/components/_forms.scss
|
186
219
|
- app/assets/stylesheets/beyond_canvas/components/_inputs.scss
|
@@ -195,14 +228,19 @@ files:
|
|
195
228
|
- app/assets/stylesheets/beyond_canvas/components/_tables.scss
|
196
229
|
- app/assets/stylesheets/beyond_canvas/components/_texts.scss
|
197
230
|
- app/assets/stylesheets/beyond_canvas/mailer.scss
|
231
|
+
- app/assets/stylesheets/beyond_canvas/settings/_breakpoints.scss
|
198
232
|
- app/assets/stylesheets/beyond_canvas/settings/_reset_css.scss
|
199
233
|
- app/assets/stylesheets/beyond_canvas/settings/_typography.scss
|
200
234
|
- app/assets/stylesheets/beyond_canvas/settings/_variables.scss
|
235
|
+
- app/assets/stylesheets/beyond_canvas/utilities/_functions.scss
|
201
236
|
- app/assets/stylesheets/beyond_canvas/utilities/_mixins.scss
|
202
237
|
- app/controllers/beyond_canvas/application_controller.rb
|
238
|
+
- app/controllers/beyond_canvas/authentications_controller.rb
|
203
239
|
- app/controllers/beyond_canvas/system_controller.rb
|
240
|
+
- app/controllers/concerns/beyond_canvas/authentication.rb
|
204
241
|
- app/controllers/concerns/beyond_canvas/locale_management.rb
|
205
242
|
- app/controllers/concerns/beyond_canvas/request_validation.rb
|
243
|
+
- app/controllers/concerns/beyond_canvas/resource_management.rb
|
206
244
|
- app/controllers/concerns/beyond_canvas/status_codes.rb
|
207
245
|
- app/form_builders/beyond_canvas/form_builder.rb
|
208
246
|
- app/helpers/beyond_canvas/application_helper.rb
|
@@ -210,7 +248,9 @@ files:
|
|
210
248
|
- app/javascript/beyond_canvas/base.js
|
211
249
|
- app/javascript/beyond_canvas/initializers/buttons.js
|
212
250
|
- app/javascript/beyond_canvas/initializers/flash.js
|
251
|
+
- app/javascript/beyond_canvas/initializers/functions.js
|
213
252
|
- app/javascript/beyond_canvas/initializers/inputs.js
|
253
|
+
- app/views/beyond_canvas/authentications/new.html.erb
|
214
254
|
- app/views/beyond_canvas/custom/_public_head.html.erb
|
215
255
|
- app/views/beyond_canvas/locales/_edit.html.erb
|
216
256
|
- app/views/beyond_canvas/mailer/_button.html.erb
|
@@ -224,20 +264,32 @@ files:
|
|
224
264
|
- app/views/layouts/beyond_canvas/public.html.erb
|
225
265
|
- config/initializers/beyond_canvas/filter_parameter_logging.rb
|
226
266
|
- config/initializers/beyond_canvas/form_utils.rb
|
267
|
+
- config/locales/en.yml
|
227
268
|
- config/routes.rb
|
228
269
|
- lib/beyond_canvas.rb
|
229
270
|
- lib/beyond_canvas/asset_registration.rb
|
230
271
|
- lib/beyond_canvas/configuration.rb
|
231
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
|
232
278
|
- lib/beyond_canvas/version.rb
|
233
279
|
- lib/generators/beyond_canvas/assets/assets_generator.rb
|
234
280
|
- lib/generators/beyond_canvas/assets/templates/beyond_canvas.js
|
235
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
|
236
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
|
237
288
|
- lib/generators/beyond_canvas/custom_styles/custom_styles_generator.rb
|
238
289
|
- lib/generators/beyond_canvas/custom_styles/templates/beyond_canvas_custom_styles.sass
|
239
290
|
- lib/generators/beyond_canvas/install/install_generator.rb
|
240
291
|
- lib/generators/beyond_canvas/install/templates/beyond_canvas.rb.erb
|
292
|
+
- lib/generators/beyond_canvas/views/views_generator.rb
|
241
293
|
- lib/generators/beyond_canvas/webpacker/plugins/jquery.js
|
242
294
|
- lib/generators/beyond_canvas/webpacker/templates/beyond_canvas.js
|
243
295
|
- lib/generators/beyond_canvas/webpacker/templates/beyond_canvas.scss
|