bullet_train-super_scaffolding 1.12.1 → 1.12.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9908a2e0dd5dd994cc3e21d373eac8a7356e578a8d5fc65cefeb8dcd380d57d8
4
- data.tar.gz: 43eb9de411aff5ef44b27ffe5d753abdbc5246de40f8d521281571ed01e9ffdf
3
+ metadata.gz: be0df510fd098c114487239ac00e69b54856df38cef8655d61316f8119c1d9ce
4
+ data.tar.gz: 0aec8526362652c9003780d54cd2245e5b137ececb2d162997588517f37e51c8
5
5
  SHA512:
6
- metadata.gz: eb7f0b23b2d7eafae67006a5ca09c39c63e0dba35dde1f7a3631477706851aa0fb3248bae3e15f9caced1aee852b1b068d85216fca2fba4da0b378366d22e8ea
7
- data.tar.gz: 783294ea778a5a80d612f3019c0661d49f2725e107cdaa1956555a1f27199610f876a3e5b421889032c8535fc445d51f0080e84aa7eaceb372828865b6da3d8f
6
+ metadata.gz: 87e04a49f198d65ea4c71f67641b59c68387a61dfd064cf30ac42cfa3f987f612ca5bd9db5d0569f407f4d177b1a12c52f0e0e5b74a7d4042165dba526d011b5
7
+ data.tar.gz: 313288579b1ccb287d0026c65d77d11da4b24527321719ddfb6f046b553ecd7b293666e140a1f0598a00e817c9eb848045091e835119eb6295fd67bdda7e1246
@@ -74,6 +74,7 @@ class Account::Scaffolding::CompletelyConcrete::TangibleThingsController < Accou
74
74
  def process_params(strong_params)
75
75
  # 🚅 skip this section when scaffolding.
76
76
  assign_boolean(strong_params, :boolean_button_value)
77
+ assign_boolean(strong_params, :boolean_checkbox_value)
77
78
  assign_checkboxes(strong_params, :multiple_button_values)
78
79
  assign_checkboxes(strong_params, :multiple_option_values)
79
80
  assign_select_options(strong_params, :multiple_super_select_values)
@@ -48,6 +48,7 @@ if defined?(Api::V1::ApplicationController)
48
48
  :text_field_value,
49
49
  :action_text_value,
50
50
  :boolean_button_value,
51
+ :boolean_checkbox_value,
51
52
  :button_value,
52
53
  :color_picker_value,
53
54
  :cloudinary_image_value,
@@ -9,6 +9,7 @@
9
9
  <%= render 'shared/fields/text_field', method: :text_field_value, options: {autofocus: true} %>
10
10
 
11
11
  <%= render 'shared/fields/buttons', method: :boolean_button_value %>
12
+ <%= render 'shared/fields/checkbox', method: :boolean_checkbox_value %>
12
13
 
13
14
  <div class="grid grid-cols-1 gap-y gap-x sm:grid-cols-2">
14
15
  <div class="sm:col-span-1">
@@ -14,6 +14,7 @@
14
14
  <%# 🚅 skip this section when scaffolding. %>
15
15
  <%= render 'shared/attributes/text', attribute: :text_field_value %>
16
16
  <%= render 'shared/attributes/boolean', attribute: :boolean_button_value %>
17
+ <%= render 'shared/attributes/option', attribute: :boolean_checkbox_value %>
17
18
  <%= render 'shared/attributes/option', attribute: :button_value %>
18
19
  <%= render 'shared/attributes/options', attribute: :multiple_button_values %>
19
20
  <%= render 'shared/attributes/code', attribute: :color_picker_value %>
@@ -53,6 +53,13 @@ en:
53
53
  options:
54
54
  true: "Yes"
55
55
  false: "No"
56
+ boolean_checkbox_value:
57
+ _: &boolean_checkbox_value Boolean Checkbox Value
58
+ label: *boolean_checkbox_value
59
+ heading: *boolean_checkbox_value
60
+ options:
61
+ true: "Yes"
62
+ false: "No"
56
63
  color_picker_value:
57
64
  _: &color_picker_value Color Picker Value
58
65
  label: *color_picker_value
@@ -1,5 +1,5 @@
1
1
  module BulletTrain
2
2
  module SuperScaffolding
3
- VERSION = "1.12.1"
3
+ VERSION = "1.12.2"
4
4
  end
5
5
  end
@@ -93,7 +93,7 @@ class Scaffolding::Attribute
93
93
  end
94
94
 
95
95
  def is_boolean?
96
- original_type == "boolean"
96
+ original_type == "boolean" || original_type == "checkbox"
97
97
  end
98
98
 
99
99
  def file_field?
@@ -166,7 +166,7 @@ class Scaffolding::Attribute
166
166
  case type
167
167
  when "trix_editor", "ckeditor"
168
168
  "html"
169
- when "buttons", "super_select", "options", "boolean"
169
+ when "buttons", "super_select", "options", "boolean", "checkbox"
170
170
  if is_ids?
171
171
  "has_many"
172
172
  elsif is_id?
@@ -11,6 +11,7 @@ FIELD_PARTIALS = {
11
11
  address_field: nil,
12
12
  boolean: "boolean",
13
13
  buttons: "string",
14
+ checkbox: "boolean",
14
15
  cloudinary_image: "string",
15
16
  color_picker: "string",
16
17
  date_and_time_field: "datetime",
@@ -835,8 +835,10 @@ class Scaffolding::Transformer
835
835
  end
836
836
 
837
837
  show_page_doesnt_exist = child == "User"
838
- scaffold_add_line_to_file("./app/views/account/scaffolding/completely_concrete/tangible_things/show.html.erb", field_content.strip, ERB_NEW_FIELDS_HOOK, prepend: true, suppress_could_not_find: show_page_doesnt_exist)
839
-
838
+ show_page_target = (child == "Membership") ?
839
+ "./app/views/account/scaffolding/completely_concrete/tangible_things/_attributes.html.erb" :
840
+ "./app/views/account/scaffolding/completely_concrete/tangible_things/show.html.erb"
841
+ scaffold_add_line_to_file(show_page_target, field_content.strip, ERB_NEW_FIELDS_HOOK, prepend: true, suppress_could_not_find: show_page_doesnt_exist)
840
842
  end
841
843
 
842
844
  #
@@ -848,7 +850,7 @@ class Scaffolding::Transformer
848
850
  # table header.
849
851
  field_content = "<th#{cell_attributes.present? ? " " + cell_attributes : ""}><%= t('.fields.#{attribute.is_vanilla? ? attribute.name : attribute.name_without_id_suffix}.heading') %></th>"
850
852
 
851
- unless ["Team", "User"].include?(child)
853
+ unless ["Team", "User", "Membership"].include?(child)
852
854
  scaffold_add_line_to_file("./app/views/account/scaffolding/completely_concrete/tangible_things/_index.html.erb", field_content, "<%# 🚅 super scaffolding will insert new field headers above this line. %>", prepend: true)
853
855
  end
854
856
 
@@ -884,7 +886,7 @@ class Scaffolding::Transformer
884
886
  field_content.gsub!(/\s%>/, ", one_line: true %>")
885
887
  end
886
888
 
887
- unless ["Team", "User"].include?(child)
889
+ unless ["Team", "User", "Membership"].include?(child)
888
890
  scaffold_add_line_to_file("./app/views/account/scaffolding/completely_concrete/tangible_things/_tangible_thing.html.erb", field_content.strip, ERB_NEW_FIELDS_HOOK, prepend: true)
889
891
  end
890
892
 
data/lib/scaffolding.rb CHANGED
@@ -10,6 +10,7 @@ module Scaffolding
10
10
  "address_field",
11
11
  "boolean",
12
12
  "buttons",
13
+ "checkbox",
13
14
  # TODO: We're leaving cloudinary_image here for now for backwards compatibility.
14
15
  # We should remove it in a future major update.
15
16
  "cloudinary_image",
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bullet_train-super_scaffolding
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.12.1
4
+ version: 1.12.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Culver
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-12-16 00:00:00.000000000 Z
11
+ date: 2024-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: standard