easy_flow 0.49.0 → 0.50.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 +4 -4
- data/app/assets/builds/easy_flow/canvas.js +3 -1
- data/app/controllers/concerns/easy_flow/manage/draws_canvas.rb +4 -3
- data/app/controllers/easy_flow/manage/canvas_controller.rb +11 -2
- data/app/javascript/easy_flow/canvas/Canvas.jsx +34 -55
- data/app/javascript/easy_flow/canvas/Control.jsx +3 -2
- data/app/javascript/easy_flow/canvas/Inspector.jsx +2 -1
- data/app/javascript/easy_flow/canvas/flowSender.js +12 -2
- data/app/javascript/easy_flow/canvas/reading.js +33 -18
- data/app/javascript/easy_flow/canvas/topBar.js +8 -0
- data/app/models/easy_flow/all_or_any.rb +2 -0
- data/app/models/easy_flow/canvas.rb +21 -2
- data/app/models/easy_flow/compare.rb +9 -0
- data/app/models/easy_flow/compare_two_values.rb +13 -0
- data/app/models/easy_flow/condition.rb +1 -0
- data/app/models/easy_flow/count.rb +8 -0
- data/app/models/easy_flow/data_step.rb +1 -0
- data/app/models/easy_flow/document.rb +1 -0
- data/app/models/easy_flow/draft_status.rb +11 -2
- data/app/models/easy_flow/flow_step.rb +6 -0
- data/app/models/easy_flow/play_flows.rb +1 -0
- data/app/models/easy_flow/settings.rb +46 -6
- data/app/models/easy_flow/steps/checklist.rb +1 -0
- data/app/models/easy_flow/steps/file_upload.rb +1 -0
- data/app/models/easy_flow/steps/fill_in_the_blank.rb +1 -0
- data/app/models/easy_flow/steps/multiple_select.rb +1 -0
- data/app/models/easy_flow/steps/question.rb +5 -0
- data/app/models/easy_flow/switch.rb +2 -0
- data/app/models/easy_flow/wait.rb +8 -0
- data/app/views/easy_flow/manage/flows/_top_bar.html.erb +2 -2
- data/lib/easy_flow/engine.rb +1 -3
- data/lib/easy_flow/host.rb +12 -0
- data/lib/easy_flow/version.rb +1 -1
- data/the_local/agents/easy_flow-develop.md +4 -4
- data/the_local/agents/easy_flow-info.md +5 -3
- data/the_local/agents/easy_flow-install.md +3 -2
- metadata +22 -1
|
@@ -26,8 +26,8 @@ A Rails engine for flows an admin draws on a canvas and a visitor runs one step
|
|
|
26
26
|
|
|
27
27
|
## How to use it
|
|
28
28
|
|
|
29
|
-
1. Confirm the app
|
|
30
|
-
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.
|
|
29
|
+
1. Confirm Keystone UI is set up in the app. easy_flow declares `keystone_ui` 0.27 or a later 0.x release as a dependency, so bundling easy_flow installs the gem, but its install generator still has to have been run. If it has not, stop and hand off to the `keystone_ui-install` local before continuing.
|
|
30
|
+
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. Bundler will not install an older one alongside easy_flow, so an app whose `Gemfile.lock` holds an older version has to run `bundle update keystone_ui` when it adds easy_flow. It also accepts `keystone_ui-react` releases only up to 0.6.0, so an app that needs a newer `keystone_ui-react` waits for an easy_flow release that accepts it.
|
|
31
31
|
3. Add `gem "easy_flow"` to the host's `Gemfile` and run `bundle install`.
|
|
32
32
|
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`.
|
|
33
33
|
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.
|
|
@@ -68,6 +68,7 @@ A Rails engine for flows an admin draws on a canvas and a visitor runs one step
|
|
|
68
68
|
- `editor_buttons` — a list of hashes each with a `label` and an `address`, such as `[ { label: "Run tests", address: "/admin/flow_tests" }, { label: "Dry-run", address: "/admin/dry_runs" } ]`, shown as buttons in this host's editor top bar before `Save draft`, on the canvas and on the definition text page. On a phone they are reached from the bar's actions menu. It may instead be a callable that takes the flow being shown and returns that list, such as `->(flow) { [ { label: "Run tests", address: "/admin/flow_tests/#{flow.slug}" } ] }`, so each flow's buttons lead to pages of its own. A hash missing either key raises `ArgumentError` when the canvas is opened. Each address is used as written, so it comes from the app's own configuration and never from a request. The app decides what each address does. With none set, the bar shows no extra buttons. Ask the developer which buttons each host's editor needs.
|
|
69
69
|
- `drawer_tabs` — a list of hashes each with a `label`, an optional `count` and its `content` as HTML, such as `[ { label: "Fixtures", count: "12/12", content: "<p>12 of 12 fixtures pass.</p>" }, { label: "Dry-run", content: "<p>No dry-run yet.</p>" } ]`, shown as tabs after Validation in the drawer under this host's canvas. The count is written after the label, and a tab with no count shows only its label. It may instead be a callable that takes the flow being edited and returns that list, such as `->(flow) { [ { label: "Fixtures", count: FixtureRun.score(flow), content: ApplicationController.render(partial: "flows/fixtures", locals: { flow: flow }) } ] }`. The content is put on the page as given, so it is built by the app and any value from a record in it is escaped. The list is worked out each time the canvas is drawn, so a slow lookup slows the canvas. A hash missing `label` or `content` raises `ArgumentError` when the canvas is opened. With none set, the drawer shows only Validation. Ask the developer which tabs each host's drawer needs and what each shows.
|
|
70
70
|
- `on_publish` — a callable that takes a flow, such as `->(flow) { RecountJob.perform_later(flow.id) }`, that easy_flow calls each time a new version of one of this host's flows goes live, whether an admin pressed Publish on the canvas or the app called `publish` on the flow. It runs inside the publish request, so slow work belongs in a job it starts. Publishing a version that is already live does not call it. With none set, nothing is called. Ask the developer what the app must do when a flow goes live.
|
|
71
|
+
- `summaries` — this host's own summary lines for step cards, as a hash of step type name to a block given the step, such as `{ condition: ->(node) { "#{node.config['step']} must be #{node.config['answer']}" } }`. It replaces the summary of any step type, easy_flow's own included, so a host can word the cards of Condition, Wait and the other built-in types its own way without changing the gem. A block that returns `nil` or `""` shows no line. The block is called each time the canvas is drawn, so it must not be slow and must not change anything. When it raises, the step is drawn without a summary, the error is written to the app's log, and the flow still opens. With none set, every step shows its type's own summary. Ask the developer which step types' cards should read differently from easy_flow's own summaries.
|
|
71
72
|
- `setting_explanations` — this host's own explanations for step type settings, as a hash of step type name to setting name to a sentence, such as `{ multiple_select: { category: "The round this question counts toward.", "answers.weight" => "Points this answer adds to the score." } }`. A setting inside a list is named by the list and the setting joined with a dot, and a list setting's own explanation is named by the list alone. The sentence is shown as plain text under the setting in the step's settings, in place of the step type's own. A setting with none, or with a blank one, shows the step type's own, if it has one. A step type or setting name that matches nothing is ignored. A value that is not text, such as a nested hash, raises `ArgumentError` when the host is declared. With none set, every setting shows the step type's own explanation.
|
|
72
73
|
|
|
73
74
|
Each method named here must exist on the base controller. Ask the developer to point at it or write it. Do not invent its logic.
|
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.
|
|
4
|
+
version: 0.50.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- tylercschneider
|
|
@@ -37,6 +37,20 @@ dependencies:
|
|
|
37
37
|
- - "~>"
|
|
38
38
|
- !ruby/object:Gem::Version
|
|
39
39
|
version: '0.2'
|
|
40
|
+
- !ruby/object:Gem::Dependency
|
|
41
|
+
name: keystone_ui
|
|
42
|
+
requirement: !ruby/object:Gem::Requirement
|
|
43
|
+
requirements:
|
|
44
|
+
- - "~>"
|
|
45
|
+
- !ruby/object:Gem::Version
|
|
46
|
+
version: '0.27'
|
|
47
|
+
type: :runtime
|
|
48
|
+
prerelease: false
|
|
49
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
50
|
+
requirements:
|
|
51
|
+
- - "~>"
|
|
52
|
+
- !ruby/object:Gem::Version
|
|
53
|
+
version: '0.27'
|
|
40
54
|
- !ruby/object:Gem::Dependency
|
|
41
55
|
name: keystone_ui-react
|
|
42
56
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -44,6 +58,9 @@ dependencies:
|
|
|
44
58
|
- - ">="
|
|
45
59
|
- !ruby/object:Gem::Version
|
|
46
60
|
version: 0.1.2
|
|
61
|
+
- - "<="
|
|
62
|
+
- !ruby/object:Gem::Version
|
|
63
|
+
version: 0.6.0
|
|
47
64
|
type: :runtime
|
|
48
65
|
prerelease: false
|
|
49
66
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -51,6 +68,9 @@ dependencies:
|
|
|
51
68
|
- - ">="
|
|
52
69
|
- !ruby/object:Gem::Version
|
|
53
70
|
version: 0.1.2
|
|
71
|
+
- - "<="
|
|
72
|
+
- !ruby/object:Gem::Version
|
|
73
|
+
version: 0.6.0
|
|
54
74
|
description: EasyFlow stores flows as versioned documents of steps and the connections
|
|
55
75
|
between them, and runs a visitor through the live version one step at a time. Apps
|
|
56
76
|
register their own step types.
|
|
@@ -109,6 +129,7 @@ files:
|
|
|
109
129
|
- app/javascript/easy_flow/canvas/reading.js
|
|
110
130
|
- app/javascript/easy_flow/canvas/rows.js
|
|
111
131
|
- app/javascript/easy_flow/canvas/styles.js
|
|
132
|
+
- app/javascript/easy_flow/canvas/topBar.js
|
|
112
133
|
- app/javascript/easy_flow/canvas/useConnectors.js
|
|
113
134
|
- app/javascript/easy_flow/canvas/useFlow.js
|
|
114
135
|
- app/jobs/easy_flow/advance_parent_job.rb
|