bullet_train 1.7.13 → 1.7.14

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: 8b1643d265ac5b803e16a2409f8f2d92c73aa133c293f72bed124f62c62963d3
4
- data.tar.gz: 4fadb183db1dbfcd209e27dfbfdb2cf95e542febf82a53cf46664ee41c5523d5
3
+ metadata.gz: af0fca71392fe7d398e8176b5234018b0aab24dfe7a73576922f1cf5b74f081d
4
+ data.tar.gz: 4de50fcafe861f2a149edd6d85cb3683317c5025d7953dad95de99dea1f96357
5
5
  SHA512:
6
- metadata.gz: 07fc59fe7a9a7723c4e80f1f21be4e5b94b82f4157b01aaee4491ea3d2eec2965107a3e111fd6d98cd9d948f4cfd8e5228bdc652f3cbd88e9ba6bb0ae3e06c47
7
- data.tar.gz: 5d60f0e4821e7e5172346c2e5b2287690e2c5fd41b17f3ccadd7a335c3cee989465c887018a963c3a552e9cea947fae430dba18251030db4a312a92bc1e44153
6
+ metadata.gz: b9b2ae3b35bc83ab4eb173ee1e9531cddfc4c830c8f6f80b4731718739d7dc5e80acf93c548189b40197a5ebbb93d202d4e0afa4738049d9ff9a21985ae4c10b
7
+ data.tar.gz: 959e85a8d011dbe4104ffbdb0c051f8280f3fcae2e14f3e67adc530d218e1bcf1c18d66ce9d21e714ef80223783f7e879329c56234d640845bf2e6c441c0d8da
@@ -85,4 +85,4 @@ export default class extends Controller {
85
85
  field.value = this.allValue? 'true': 'false'
86
86
  this.element.appendChild(field)
87
87
  }
88
- }
88
+ }
@@ -22,7 +22,7 @@ export default class extends Controller {
22
22
 
23
23
  updateActions() {
24
24
  this.actionTargets.forEach(actionTarget => {
25
- actionTarget.dispatchEvent(new CustomEvent('update-ids', { detail: {
25
+ actionTarget.dispatchEvent(new CustomEvent(`${this.identifier}:update-ids`, { detail: {
26
26
  ids: this.selectedIds,
27
27
  all: this.allSelected
28
28
  }}))
@@ -59,14 +59,14 @@ export default class extends Controller {
59
59
  if (this.allSelected) {
60
60
  checkbox.checked = true
61
61
  checkbox.indeterminate = false
62
- label.dispatchEvent(new CustomEvent('toggle', { detail: { useAlternate: true }} ))
62
+ label.dispatchEvent(new CustomEvent(`${this.identifier}:toggle-select-all-label`, { detail: { useAlternate: true }} ))
63
63
  } else if (this.selectedIds.length > 0) {
64
64
  checkbox.indeterminate = true
65
- label.dispatchEvent(new CustomEvent('toggle', { detail: { useAlternate: false }} ))
65
+ label.dispatchEvent(new CustomEvent(`${this.identifier}:toggle-select-all-label`, { detail: { useAlternate: false }} ))
66
66
  } else {
67
67
  checkbox.checked = false
68
68
  checkbox.indeterminate = false
69
- label.dispatchEvent(new CustomEvent('toggle', { detail: { useAlternate: false }} ))
69
+ label.dispatchEvent(new CustomEvent(`${this.identifier}:toggle-select-all-label`, { detail: { useAlternate: false }} ))
70
70
  }
71
71
  }
72
72
 
@@ -77,7 +77,7 @@ export default class extends Controller {
77
77
 
78
78
  updateToggleLabel() {
79
79
  if (!this.hasSelectableToggleTarget) { return }
80
- this.selectableToggleTarget.dispatchEvent(new CustomEvent('toggle', { detail: { useAlternate: this.selectableValue }} ))
80
+ this.selectableToggleTarget.dispatchEvent(new CustomEvent(`${this.identifier}:toggle-select-all-label`, { detail: { useAlternate: this.selectableValue }} ))
81
81
  }
82
82
 
83
83
  get selectedIds() {
@@ -93,4 +93,4 @@ export default class extends Controller {
93
93
  get allSelected() {
94
94
  return this.selectedIds.length === this.checkboxTargets.length
95
95
  }
96
- }
96
+ }
@@ -1 +1 @@
1
- $("#two-factor").html("<%= j render partial: "devise/registrations/two_factor"%>");
1
+ jQuery("#two-factor").html("<%= j render partial: "devise/registrations/two_factor"%>");
@@ -1 +1 @@
1
- $("#two-factor").html("<%= j render partial: "devise/registrations/two_factor"%>");
1
+ jQuery("#two-factor").html("<%= j render partial: "devise/registrations/two_factor"%>");
@@ -1 +1 @@
1
- $("#two-factor").html("<%= j render partial: "devise/registrations/two_factor", locals: {verified: @verified}%>");
1
+ jQuery("#two-factor").html("<%= j render partial: "devise/registrations/two_factor", locals: {verified: @verified}%>");
@@ -1,11 +1,12 @@
1
1
  <% if @email %>
2
- $("#step-1").addClass("hidden");
3
- $("#step-2").removeClass("hidden");
2
+ document.querySelector("#step-1").classList.add("hidden");
3
+ document.querySelector("#step-2").classList.remove("hidden");
4
4
  <% if @user&.otp_required_for_login %>
5
- $("#step-2-otp").removeClass("hidden");
5
+ document.querySelector("#step-2-otp").classList.remove("hidden");
6
6
  <% end %>
7
7
  setTimeout(function() {
8
- $("#user_password").focus();
9
- $("#new_user").attr('action', '/users/sign_in').attr('data-remote', 'false');
8
+ document.querySelector("#user_password").focus();
9
+ document.querySelector("#new_user").setAttribute('action', '/users/sign_in')
10
+ document.querySelector("#new_user").setAttribute('data-remote', 'false');
10
11
  }, 1);
11
12
  <% end %>
@@ -66,6 +66,8 @@ You can get detailed information about using Super Scaffolding to generate diffe
66
66
  rails generate super_scaffold:action_models:targets_many
67
67
  rails generate super_scaffold:action_models:targets_one
68
68
  rails generate super_scaffold:action_models:targets_one_parent
69
+ rails generate super_scaffold:action_models:performs_import
70
+ rails generate super_scaffold:action_models:performs_export
69
71
  ```
70
72
 
71
73
  ## Basic Example
@@ -104,7 +106,7 @@ For example:
104
106
 
105
107
  ```
106
108
  # side quest: update the generated migration with `default: false` on the new boolean field.
107
- bin/super-scaffold crud-field Projects::ArchiveAction notify_users:boolean
109
+ rails g super_scaffold:crud_field Projects::ArchiveAction notify_users:boolean
108
110
  ```
109
111
 
110
112
  Now users will be prompted with that option when they perform this action, and you can update your logic to take action based on it, or at least pass on the information to another method that takes action based on it:
@@ -117,11 +119,13 @@ end
117
119
 
118
120
  ## Action Types
119
121
 
120
- Action Models can be generated in three flavors:
122
+ Action Models can be generated in five flavors:
121
123
 
122
- - `action-model:targets-many`
123
- - `action-model:targets-one`
124
- - `action-model:targets-one-parent`
124
+ - `rails g super_scaffold:action_models:targets_many`
125
+ - `rails g super_scaffold:action_models:targets_one`
126
+ - `rails g super_scaffold:action_models:targets_one_parent`
127
+ - `rails g super_scaffold:action_models:performs_import`
128
+ - `rails g super_scaffold:action_models:performs_export`
125
129
 
126
130
  ### Targets Many
127
131
 
@@ -137,7 +141,15 @@ When deciding between "targets many" and "targets one", our recommendation is th
137
141
 
138
142
  ### Targets One Parent
139
143
 
140
- This final type of action is available for things like importers that don't necessarily target specific existing objects by ID, but instead create many new or affect many existing objects under a specific parent based on the configuration of the action (like an attached CSV file.) These objects don't "target many" per se, but they live at the same level (and belong to the same parent) as the models they end up creating or affecting.
144
+ This type of action is available for things like custom/complex importers that don't necessarily target specific existing objects by ID, but instead create many new or affect many existing objects under a specific parent based on the configuration of the action (like an attached CSV file.) These objects don't "target many" per se, but they live at the same level (and belong to the same parent) as the models they end up creating or affecting.
145
+
146
+ ### Performs Import
147
+
148
+ This action is useful for allowing users to upload a CSV representing a list of models that they'd like to have created in the system. It handles mapping columns in the CSV to attributes on the model you're creating.
149
+
150
+ ### Performs Export
151
+
152
+ This action will allow users to export a CSV from a list of models in the application.
141
153
 
142
154
  ## Frequently Asked Questions
143
155
 
@@ -24,8 +24,49 @@ If you want to disable new registrations completely, put an unguessable value in
24
24
  Note that in both of these scenarios that existing users will still be able to invite new collaborators to their teams and those collaborators will have the option of creating a new account, but no users in the application will be allowed to create a new team without an invitation code and following the above URL.
25
25
 
26
26
  ## Enabling Two-Factor Authentication (2FA)
27
- Two-factor authentication is enabled by default in Bullet Train, but you must have Rails built-in encrypted secrets and Active Record Encryption configured. To do this, just run:
27
+ Two-factor authentication is enabled by default in Bullet Train, but you must have Rails built-in encrypted secrets and Active Record Encryption configured.
28
+
29
+ To do this, first run:
28
30
 
29
31
  ```
30
32
  bin/secrets
31
33
  ```
34
+
35
+ That will generate some credentails files for you.
36
+
37
+ Then you'll need to set encryption keys, either in those newly generated credentials files, or you can do it via environment variables.
38
+
39
+ Generate some keys by running:
40
+
41
+ ```
42
+ bin/rails db:encryption:init
43
+ ```
44
+
45
+ That will output something like this:
46
+
47
+ ```
48
+ active_record_encryption:
49
+ primary_key: NLngkt...
50
+ deterministic_key: edpu...
51
+ key_derivation_salt: Bfwy...
52
+ ```
53
+
54
+ Then to add them to your `development` credentials file run:
55
+
56
+ ```
57
+ bin/rails credentials:edit --environment development
58
+ ```
59
+
60
+ That will decrypt `config/credentials/development.yml.enc` and open it in your editor. Paste in the block of keys you generated in the previous step, save, and close the file.
61
+
62
+ If you'd rather set them via environment variables you could add something like this to `config/application.rb`:
63
+
64
+ ```
65
+ config.active_record.encryption.primary_key = ENV['ACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY']
66
+ config.active_record.encryption.deterministic_key = ENV['ACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY']
67
+ config.active_record.encryption.key_derivation_salt = ENV['ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT']
68
+ ```
69
+
70
+ And then populate those ENV variables by whatever means you use. (Maybe setting them in `.env` or possibly exporting them directly.)
71
+
72
+ After you have things working in development you'll need to follow the same process for your production environment, and any others.
@@ -1,3 +1,3 @@
1
1
  module BulletTrain
2
- VERSION = "1.7.13"
2
+ VERSION = "1.7.14"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bullet_train
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.13
4
+ version: 1.7.14
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-06-19 00:00:00.000000000 Z
11
+ date: 2024-06-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: standard