easy_flow 0.23.0 → 0.24.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/controllers/concerns/easy_flow/manage/draws_canvas.rb +1 -1
- data/app/controllers/easy_flow/manage/canvas_controller.rb +1 -1
- data/app/controllers/easy_flow/manage/definitions_controller.rb +2 -2
- data/app/controllers/easy_flow/manage/flows_controller.rb +11 -5
- data/app/controllers/easy_flow/manage/previews_controller.rb +1 -1
- data/app/controllers/easy_flow/manage/versions_controller.rb +2 -2
- data/app/models/easy_flow/definition.rb +2 -0
- data/app/models/easy_flow/version.rb +2 -0
- data/db/migrate/20261012210000_add_public_code_to_easy_flow_definitions.rb +17 -0
- data/db/migrate/20261012210100_add_public_code_to_easy_flow_versions.rb +17 -0
- data/lib/easy_flow/version.rb +1 -1
- metadata +3 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 420a32e8886e881ee02d50a95fef57640e8a2d540d1d73313b2a9fdd66206d6b
|
|
4
|
+
data.tar.gz: 380a7ef18cf5f6af36ff32d5573a5ee7e70b680582e147ec30ede62d23635e5b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ccb487775af4e1ec1737ac27be7a46a6bb53fd804c14c8ed41b7ba8102d5001fc61311d55830ae5570178df79cbca3223071d255c5b812a2b1f30e1a86e2eb23
|
|
7
|
+
data.tar.gz: 01445f50ff3f85db4b67c38e66911bc8960ea9d17741af9c5f144d5b2320e14d649d44c335f35385844706e2aca312f2ef9ffe6308bfd49d0f07bd9d6af6badf
|
|
@@ -6,7 +6,7 @@ module EasyFlow
|
|
|
6
6
|
private
|
|
7
7
|
|
|
8
8
|
def canvas_payload(flow)
|
|
9
|
-
Canvas.new(canvas_document(flow), host: flow_host, flows: hosted_flows.order(:title), flow_path: ->(id) { manage_flow_path(id, from: flow
|
|
9
|
+
Canvas.new(canvas_document(flow), host: flow_host, flows: hosted_flows.order(:title), flow_path: ->(id) { manage_flow_path(hosted_flows.find_by(id: id) || id, from: flow) }, flow: flow).to_h
|
|
10
10
|
.merge("undoable" => flow.edit_history.undoable?, "redoable" => flow.edit_history.redoable?,
|
|
11
11
|
"changes" => listed_changes(flow), "flow" => flow_details(flow))
|
|
12
12
|
end
|
|
@@ -2,11 +2,11 @@ module EasyFlow
|
|
|
2
2
|
module Manage
|
|
3
3
|
class DefinitionsController < BaseController
|
|
4
4
|
def edit
|
|
5
|
-
@flow = hosted_flows.
|
|
5
|
+
@flow = hosted_flows.find_by_public_code!(params[:flow_id])
|
|
6
6
|
end
|
|
7
7
|
|
|
8
8
|
def update
|
|
9
|
-
@flow = hosted_flows.
|
|
9
|
+
@flow = hosted_flows.find_by_public_code!(params[:flow_id])
|
|
10
10
|
@flow.edit_history.edit_document(JSON.parse(params.require(:definition)))
|
|
11
11
|
redirect_to manage_flow_path(@flow), notice: "Definition saved."
|
|
12
12
|
end
|
|
@@ -21,23 +21,23 @@ module EasyFlow
|
|
|
21
21
|
end
|
|
22
22
|
|
|
23
23
|
def show
|
|
24
|
-
@flow = hosted_flows.
|
|
25
|
-
@parent =
|
|
24
|
+
@flow = hosted_flows.find_by_public_code!(params[:id])
|
|
25
|
+
@parent = parent_flow
|
|
26
26
|
@canvas = canvas_payload(@flow)
|
|
27
27
|
end
|
|
28
28
|
|
|
29
29
|
def edit
|
|
30
|
-
@flow = hosted_flows.
|
|
30
|
+
@flow = hosted_flows.find_by_public_code!(params[:id])
|
|
31
31
|
end
|
|
32
32
|
|
|
33
33
|
def update
|
|
34
|
-
@flow = hosted_flows.
|
|
34
|
+
@flow = hosted_flows.find_by_public_code!(params[:id])
|
|
35
35
|
@flow.update!(flow_params)
|
|
36
36
|
redirect_to manage_flow_path(@flow), notice: "Saved."
|
|
37
37
|
end
|
|
38
38
|
|
|
39
39
|
def destroy
|
|
40
|
-
flow = hosted_flows.
|
|
40
|
+
flow = hosted_flows.find_by_public_code!(params[:id])
|
|
41
41
|
return redirect_to manage_flows_path, alert: flow.errors.full_messages.to_sentence unless flow.destroy
|
|
42
42
|
|
|
43
43
|
redirect_to manage_flows_path, notice: "Flow removed."
|
|
@@ -45,6 +45,12 @@ module EasyFlow
|
|
|
45
45
|
|
|
46
46
|
private
|
|
47
47
|
|
|
48
|
+
def parent_flow
|
|
49
|
+
hosted_flows.find_by_public_code!(params[:from]) if params[:from].present?
|
|
50
|
+
rescue ActiveRecord::RecordNotFound
|
|
51
|
+
nil
|
|
52
|
+
end
|
|
53
|
+
|
|
48
54
|
def ordered_flows
|
|
49
55
|
hosted_flows.order(:slug)
|
|
50
56
|
end
|
|
@@ -7,7 +7,7 @@ module EasyFlow
|
|
|
7
7
|
end
|
|
8
8
|
|
|
9
9
|
def return
|
|
10
|
-
flow.return_to(flow.definition_versions.
|
|
10
|
+
flow.return_to(flow.definition_versions.find_by_public_code!(params[:id]))
|
|
11
11
|
|
|
12
12
|
redirect_to manage_flow_path(flow), notice: "The flow is back to that version."
|
|
13
13
|
end
|
|
@@ -15,7 +15,7 @@ module EasyFlow
|
|
|
15
15
|
private
|
|
16
16
|
|
|
17
17
|
def flow
|
|
18
|
-
@flow ||= hosted_flows.
|
|
18
|
+
@flow ||= hosted_flows.find_by_public_code!(params[:flow_id])
|
|
19
19
|
end
|
|
20
20
|
end
|
|
21
21
|
end
|
|
@@ -2,6 +2,8 @@ module EasyFlow
|
|
|
2
2
|
class Definition < ApplicationRecord
|
|
3
3
|
self.table_name = "easy_flow_definitions"
|
|
4
4
|
|
|
5
|
+
has_public_code
|
|
6
|
+
|
|
5
7
|
enum :status, { active: "active", hidden: "hidden", inactive: "inactive" }
|
|
6
8
|
enum :kind, { scored: "scored", guide: "guide" }
|
|
7
9
|
enum :persists, { unsaved: "unsaved", each_step: "each_step", on_finish: "on_finish" }
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
class AddPublicCodeToEasyFlowDefinitions < ActiveRecord::Migration[8.1]
|
|
2
|
+
class Record < ActiveRecord::Base
|
|
3
|
+
self.table_name = "easy_flow_definitions"
|
|
4
|
+
end
|
|
5
|
+
|
|
6
|
+
def up
|
|
7
|
+
add_column :easy_flow_definitions, :public_code, :string
|
|
8
|
+
Record.reset_column_information
|
|
9
|
+
Record.find_each { |record| record.update_columns(public_code: PublicCode.generate) }
|
|
10
|
+
change_column_null :easy_flow_definitions, :public_code, false
|
|
11
|
+
add_index :easy_flow_definitions, :public_code, unique: true
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def down
|
|
15
|
+
remove_column :easy_flow_definitions, :public_code
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
class AddPublicCodeToEasyFlowVersions < ActiveRecord::Migration[8.1]
|
|
2
|
+
class Record < ActiveRecord::Base
|
|
3
|
+
self.table_name = "easy_flow_versions"
|
|
4
|
+
end
|
|
5
|
+
|
|
6
|
+
def up
|
|
7
|
+
add_column :easy_flow_versions, :public_code, :string
|
|
8
|
+
Record.reset_column_information
|
|
9
|
+
Record.find_each { |record| record.update_columns(public_code: PublicCode.generate) }
|
|
10
|
+
change_column_null :easy_flow_versions, :public_code, false
|
|
11
|
+
add_index :easy_flow_versions, :public_code, unique: true
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def down
|
|
15
|
+
remove_column :easy_flow_versions, :public_code
|
|
16
|
+
end
|
|
17
|
+
end
|
data/lib/easy_flow/version.rb
CHANGED
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.24.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- tylercschneider
|
|
@@ -166,6 +166,8 @@ files:
|
|
|
166
166
|
- db/migrate/20261007120000_add_parent_run_to_easy_flow_runs.rb
|
|
167
167
|
- db/migrate/20261011130000_keep_step_visits_whole_in_easy_flow_runs.rb
|
|
168
168
|
- db/migrate/20261012200000_add_public_code_to_easy_flow_runs.rb
|
|
169
|
+
- db/migrate/20261012210000_add_public_code_to_easy_flow_definitions.rb
|
|
170
|
+
- db/migrate/20261012210100_add_public_code_to_easy_flow_versions.rb
|
|
169
171
|
- lib/easy_flow.rb
|
|
170
172
|
- lib/easy_flow/engine.rb
|
|
171
173
|
- lib/easy_flow/host.rb
|