easy_flow 0.38.0 → 0.39.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: f6e3917c026a19b26bda2e359502b982a224acb117fa83a73bbed2c8c50be70e
4
- data.tar.gz: bfb5803080cb0ce7b91734d1ca3798b010fa5e5d55fa1502a449e6c7ca7811a0
3
+ metadata.gz: 6b149b55629914a9ccc0cb3d30f7dc4688f6a24e85131cc4706cd969e4dde44e
4
+ data.tar.gz: e0f11051707fe000eb4c755e7c2f8bb3ac18bffb79addb9f5490ae318d633e84
5
5
  SHA512:
6
- metadata.gz: b9b2f93f31c3c1dbf35a238acda8f614b6655ebcf62f60a26a72f55eed87054551f4e76a2943b6d3959cea4e8fbed927fefbebd47f683193aa26e353c1cf047a
7
- data.tar.gz: a66b7d38f6f02c1aef0e2cc02232bdbc4ed948f822992fc4a6db63cd5560ab49357829b337c4bb5dd22b0a8ec7213aa76066d96d6cdbc2da381e6e925817cdaf
6
+ metadata.gz: 4872c78fe7b63df9b8b75e9eab0765001b559ecd72416eb4528b4b317d8665fb318deed214ae74871acd3036e531287f2039d690c97fc9f0ea1b4a438ede1752
7
+ data.tar.gz: 99cc4153c0540f2395e0edc3e56b542a2340181a565dd70280f49c703cfe42af33fa11fa41b7e3f514f3b35a361e65382c3039f97fc4cdc165d75883f96451a0
@@ -23,7 +23,7 @@ module EasyFlow
23
23
  def show
24
24
  @flow = hosted_flows.find_by_public_code!(params[:id])
25
25
  @parent = parent_flow
26
- @back_link = flow_host.back_link
26
+ @back_link = flow_host.back_link_for(@flow)
27
27
  @canvas = canvas_payload(@flow)
28
28
  end
29
29
 
@@ -11,7 +11,11 @@ module EasyFlow
11
11
  end
12
12
 
13
13
  def back_link=(link)
14
- @back_link = link && BackLink.new(**link)
14
+ @back_link = link.respond_to?(:call) ? link : link && BackLink.new(**link)
15
+ end
16
+
17
+ def back_link_for(flow)
18
+ @back_link.respond_to?(:call) ? BackLink.new(**@back_link.call(flow)) : @back_link
15
19
  end
16
20
 
17
21
  def setting_explanations=(explanations)
@@ -1,3 +1,3 @@
1
1
  module EasyFlow
2
- VERSION = "0.38.0"
2
+ VERSION = "0.39.0"
3
3
  end
@@ -101,7 +101,7 @@ easy_flow declares no commands of its own for this local. Its surface is split b
101
101
  - **Always-visible insert buttons** — a setting a host may turn on, `always_show_insert_buttons`, that shows each connection's button for inserting a step on its canvas without the pointer over the connection, with the connection's label moved to the right of the line. It is off by default, and with it off the button shows only with the pointer over the connection.
102
102
  - **Hidden step type codes** — a setting a host may turn on, `hide_step_type_codes`, that hides step type code names on its canvas. The add menu lists each step type by its name alone, and a step's box shows its step type's name in place of the code name, with a step that has no name of its own headed by its step type's name. It is off by default, and with it off the add menu and step boxes show the code names. The settings panel shows a step's id and code name either way.
103
103
  - **Publish note** — a setting a host may set, `publish_note`, whose sentence is shown directly under the Publish button in its flow panel. With none set, the panel shows no note.
104
- - **Back link** — a setting a host may set, `back_link`, holding a label and an address, that shows a button with that label and address in its builder header in place of `All flows`. With none set, the header shows `All flows`.
104
+ - **Back link** — a setting a host may set, `back_link`, holding a label and an address, or a callable that takes the flow being shown and returns them, that shows a button with that label and address in its builder header in place of `All flows`. With a callable, each flow's canvas shows the back link worked out for that flow. With none set, the header shows `All flows`.
105
105
  - **Host setting explanations** — a setting a host may set, `setting_explanations`, giving its own explanation for one setting of one step type, including a setting inside a list. It shows in place of the step type's own. A setting it gives none for shows the step type's own, and with none set nothing changes.
106
106
  - **Flow panel** — the panel the `This flow` button opens on the canvas, on every host. It shows Create version and Publish above its lists of problems and changes. Each problem is a sentence naming the step by its name, or by its step type's name when it has none, never by its id, and saying what to do to clear it. Several saves to the same step in a row show as one line in the changes list, named by the step's latest name. A save, a move and any other change each keep their own line, and the history of versions still lists every change a version captured.
107
107
  - **Picture mark** — the words `Has a picture` on the box of a step with a picture on the canvas, on every host.
@@ -62,7 +62,7 @@ A Rails engine for flows an admin draws on a canvas and a visitor runs one step
62
62
  - `hide_step_type_codes` — set to `true` to hide step type code names on this host's canvas. The add menu then lists each step type by its name alone, and a step's box shows its step type's name in place of the code name. With none set, the add menu and step boxes show the code names. The settings panel shows a step's id and code name either way.
63
63
  - `marks_ends` — set to `true` to have this host's admins mark each End step as success or failure. The End step's settings then show a Mark with those two choices, and publishing one of this host's flows with an End left unmarked is refused, the refusal shown on that End's card. With none set, End steps show no mark and publish as they do. Ask the developer whether this host's runs need to say if they ended well.
64
64
  - `publish_note` — a sentence shown directly under the Publish button in this host's flow panel. It is shown as plain text. With none set, the panel shows no note.
65
- - `back_link` — a hash with a `label` and an `address`, such as `{ label: "Games", address: "/admin/games" }`, that shows a button with that label and address in this host's builder header in place of `All flows`. The header then has no `All flows` button. A hash missing either key raises `ArgumentError` when the host is declared, and a blank value is not refused. The address is used as written and is not checked, so it comes from the app's own configuration and never from a request. With none set, the header shows `All flows`.
65
+ - `back_link` — a hash with a `label` and an `address`, such as `{ label: "Games", address: "/admin/games" }`, that shows a button with that label and address in this host's builder header in place of `All flows`. The header then has no `All flows` button. A hash missing either key raises `ArgumentError` when the host is declared, and a blank value is not refused. The address is used as written and is not checked, so it comes from the app's own configuration and never from a request. It may instead be a callable that takes the flow being shown and returns that hash, such as `->(flow) { { label: "Funnel", address: "/funnels/#{flow.owner_id}" } }`, so each flow's canvas links to a page of its own, such as its owner record's page. A returned hash missing either key raises `ArgumentError` when that flow's canvas is opened. With none set, the header shows `All flows`.
66
66
  - `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.
67
67
 
68
68
  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.38.0
4
+ version: 0.39.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - tylercschneider