easy_flow 0.31.0 → 0.32.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9c29c87cf730dc97ed5566ffe62dcd6c370fd10095d97e0155efd8f65b0589e7
4
- data.tar.gz: a43f91c9a2124ca19137a7dfec1ab1dc632cb26e67109227a9bc3c85b6254bca
3
+ metadata.gz: f39983d44d79fa66e7653155f28047e98682f5616094e8d0c39a32886d28840b
4
+ data.tar.gz: e09d1ff30083f204c5232277464a3410f0d997b4ff8915bf60d7bf94eade8e65
5
5
  SHA512:
6
- metadata.gz: cfb248eca765ea58f0a5d77a070131a67929592601485ab5f5a4106f5e8dcadbc711941d9736d55b41c81ffbf6b7b10949e7ed1911cf5e2ac35c967bca199e00
7
- data.tar.gz: c3863cb2a21b5866b87fc0b5f1d029f841ee46e6f8cb9492621bd1481f64a05b6767c2f5b6721e74f147d9d229fef37f3e97924dc963d77403f7d7db712b3fdf
6
+ metadata.gz: 0bcf5519e082d0895d22d53e9b628ed989a4259529839be64ad7cf0fac26121a430dc7cf45ef656ba8332826b7591f45f90b6c65e7c87e4175b59026d3b081aa
7
+ data.tar.gz: 7cf0777451486e714be4ebea1c4983d2c9fb6915ecfb88fffb7db7a5673ca32ebf4aca21e62f82dc39e6b6cf206fd5056cad131eb2c065994488149993a9451b
@@ -56,7 +56,7 @@ module EasyFlow
56
56
  end
57
57
 
58
58
  def create_params
59
- params.require(:flow).permit(:slug, :kind)
59
+ params.require(:flow).permit(:slug)
60
60
  end
61
61
 
62
62
  def flow_params
@@ -1,11 +1,11 @@
1
1
  module EasyFlow
2
2
  class Definition < ApplicationRecord
3
3
  self.table_name = "easy_flow_definitions"
4
+ self.ignored_columns += %w[kind]
4
5
 
5
6
  has_public_code
6
7
 
7
8
  enum :status, { active: "active", hidden: "hidden", inactive: "inactive" }
8
- enum :kind, { scored: "scored", guide: "guide" }
9
9
  enum :persists, { unsaved: "unsaved", each_step: "each_step", on_finish: "on_finish" }
10
10
 
11
11
  belongs_to :owner, polymorphic: true, optional: true
@@ -24,15 +24,15 @@ module EasyFlow
24
24
  return if value.blank?
25
25
  return "A file can only be uploaded in a flow that saves its runs." unless value.respond_to?(:original_filename)
26
26
 
27
- kinds = accepted_kinds(node)
28
- return if kinds.empty?
29
- return if kinds.include?(File.extname(value.original_filename).downcase)
27
+ extensions = accepted_extensions(node)
28
+ return if extensions.empty?
29
+ return if extensions.include?(File.extname(value.original_filename).downcase)
30
30
 
31
- "Choose a #{kinds.to_sentence(two_words_connector: ' or ', last_word_connector: ', or ')} file."
31
+ "Choose a #{extensions.to_sentence(two_words_connector: ' or ', last_word_connector: ', or ')} file."
32
32
  end
33
33
 
34
- def self.accepted_kinds(node)
35
- node.config["accepts"].to_s.split(",").map { |kind| kind.strip.downcase }.compact_blank
34
+ def self.accepted_extensions(node)
35
+ node.config["accepts"].to_s.split(",").map { |extension| extension.strip.downcase }.compact_blank
36
36
  end
37
37
  end
38
38
  end
@@ -7,7 +7,7 @@
7
7
 
8
8
  <%= ui_data_table(
9
9
  items: @flows,
10
- columns: [ { title: "Title" }, { slug: "Slug" }, { kind: "Kind" }, { status: "Status" } ],
10
+ columns: [ { title: "Title" }, { slug: "Slug" }, { status: "Status" } ],
11
11
  empty_message: "No flows yet."
12
12
  ) do |table| %>
13
13
  <% table.link(:title) { |flow| flow_routes.manage_flow_path(flow) } %>
@@ -9,9 +9,6 @@
9
9
  <label class="block text-sm font-medium mb-1">Slug</label>
10
10
  <%= ui_input(name: "flow[slug]", value: @flow.slug, placeholder: "e.g. business-scorecard") %>
11
11
 
12
- <label class="block text-sm font-medium mb-1 mt-4">Kind</label>
13
- <%= ui_select(name: "flow[kind]", options: [ [ "Scored", "scored" ], [ "Guide", "guide" ] ], selected: @flow.kind) %>
14
-
15
12
  <%= ui_button(label: "Create", type: :submit) %>
16
13
  <% end %>
17
14
  <% end %>
@@ -0,0 +1,9 @@
1
+ class RemoveKindFromEasyFlowDefinitions < ActiveRecord::Migration[8.1]
2
+ def up
3
+ remove_column :easy_flow_definitions, :kind, if_exists: true
4
+ end
5
+
6
+ def down
7
+ add_column :easy_flow_definitions, :kind, :string, if_not_exists: true
8
+ end
9
+ end
@@ -1,3 +1,3 @@
1
1
  module EasyFlow
2
- VERSION = "0.31.0"
2
+ VERSION = "0.32.0"
3
3
  end
@@ -28,7 +28,7 @@ A Rails engine for flows an admin draws on a canvas and a visitor runs one step
28
28
  1. Confirm the app has Keystone UI installed (`keystone_ui` in the Gemfile). easy_flow's controllers use its helpers and it is not pulled in by easy_flow. If it is missing, stop and hand off to the `keystone_ui-install` local before continuing.
29
29
  2. Read the `keystone_ui` version in the app's `Gemfile.lock`. easy_flow's visitor pages pass each answer's info text to Keystone UI's radio cards and checkbox rows and draw a File upload step with Keystone UI's file upload control, and easy_flow is built against `keystone_ui` 0.27.0. If the app's version is older, ask the developer whether to run `bundle update keystone_ui` before continuing.
30
30
  3. Add `gem "easy_flow"` to the host's `Gemfile` and run `bundle install`.
31
- 4. Run `bin/rails easy_flow:install:migrations`, then `bin/rails db:migrate`. This writes seven migrations into `db/migrate` and updates `db/schema.rb`.
31
+ 4. Run `bin/rails easy_flow:install:migrations`, then `bin/rails db:migrate`. This writes eleven migrations into `db/migrate` and updates `db/schema.rb`.
32
32
  5. Ask the developer which hosts the app needs. A host is one part of the app that owns its own set of flows, and one host never sees another's flows. Ask for each host's name and the path it is served under.
33
33
  6. Ask the developer which controller the engine should inherit from. Choosing `"ApplicationController"` gives the engine the app's own authentication methods and helpers. Create `config/initializers/easy_flow.rb` and set it on the first line:
34
34
 
@@ -113,6 +113,7 @@ A Rails engine for flows an admin draws on a canvas and a visitor runs one step
113
113
  - After install, check that an End step selected on the canvas shows an output setting. An admin fills it in on each End step, and it needs no migration and no setting in the initializer.
114
114
  - After publishing a flow with a checklist, check that a visitor can tick several answers and go on, and that a checklist marked required refuses to go on with nothing ticked.
115
115
  - After upgrading easy_flow, run `bin/rails easy_flow:install:migrations` again and then `bin/rails db:migrate`. Only migrations the app does not already have are copied.
116
+ - A flow has no kind. An app upgrading from a version that stored one stops setting `kind` on `EasyFlow::Definition` before upgrading, since setting it raises `ActiveModel::UnknownAttributeError`, and removes any use of the `scored` and `guide` scopes and the `scored?` and `guide?` methods. It deploys the upgraded gem first, then runs `bin/rails easy_flow:install:migrations` and `bin/rails db:migrate` in a later deploy, since a process of the earlier version cannot create a flow once the column is dropped. An app using alembic runs alembic's migration moving flows onto easy_flow on the earlier easy_flow version first.
116
117
  - After setting a host's `owner_method`, check that two different owners each see only their own flows on `<mount path>/manage/flows`.
117
118
  - After install, check that a Condition step placed on the canvas, once its earlier step is picked, offers that step's outputs, a comparison of "is" or "is not", and the answers of the output picked. It is named after that step, the comparison and the answer, decides a true or false result, and needs no setting in the initializer beyond being listed in a host's `offers` when that host sets `offers`.
118
119
  - After install, check that a Count step placed on the canvas, once its earlier step and answer are picked, is named "Count" followed by that step and that answer. It needs no setting in the initializer beyond being listed in a host's `offers` when that host sets `offers`.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easy_flow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.31.0
4
+ version: 0.32.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - tylercschneider
@@ -173,6 +173,7 @@ files:
173
173
  - db/migrate/20261012200000_add_public_code_to_easy_flow_runs.rb
174
174
  - db/migrate/20261012210000_add_public_code_to_easy_flow_definitions.rb
175
175
  - db/migrate/20261012210100_add_public_code_to_easy_flow_versions.rb
176
+ - db/migrate/20261104184315_remove_kind_from_easy_flow_definitions.rb
176
177
  - lib/easy_flow.rb
177
178
  - lib/easy_flow/engine.rb
178
179
  - lib/easy_flow/host.rb