easy_flow 0.8.0 → 0.8.1

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: c42186355c5aff4867710d2b43d50543a34be2ce290c9748bea1ab11b540e21c
4
- data.tar.gz: e0a902db995da05a8fed9e1c8f841b90f252277f31e2867d59a43a7855bcfa03
3
+ metadata.gz: e8b63728127549bbca04e9dd1ef8930a0f124c24b99b40f5eb8fcb2e1ab46071
4
+ data.tar.gz: e3ca65e0a6d5d094f9552d76d41d0357bb8ee623b61163a5fc14efec3f0ccf3e
5
5
  SHA512:
6
- metadata.gz: 907fdb2b8760253cf3eea079d3dbbd92d23050d296b9c1166b8150dd5d6cff1e52b1b5f069a65b2111786808bfbcf9e097125f92b60a7e725dc958cde58b73df
7
- data.tar.gz: 7db26de4465197e8983fd84c44f2bb2cc78cd79d4a999606adf11b8fa49a3af68699d19b96fa0686355bd53f5b0eaac93126627d7c37eb9b6aa2cb7c3dacc880
6
+ metadata.gz: 0fd4374064f2b229ca0b5efa3de4531a30da99fa2707f9875aebcc9294934e499d49dcd60675e4f7dbf678ec69fe48412f3d947b9b6852afc55a2339c5451a52
7
+ data.tar.gz: 17f7ce19456a3df5796436692373c3e2357f5a8473ee450414b826f2a0ff9df23bda54fb7cf3ccb69f73f4124c8bdf7d91113641378bf310d518065377dd695e
@@ -6,14 +6,17 @@ module EasyFlow
6
6
  @flows = ordered_flows
7
7
  end
8
8
 
9
+ def new
10
+ @flow = hosted_flows.new
11
+ end
12
+
9
13
  def create
10
14
  @flow = hosted_flows.new(create_params)
11
15
 
12
16
  if @flow.save
13
17
  redirect_to manage_flow_path(@flow), notice: "Flow created."
14
18
  else
15
- @flows = ordered_flows
16
- render :index, status: :unprocessable_entity
19
+ render :new, status: :unprocessable_entity
17
20
  end
18
21
  end
19
22
 
@@ -1,5 +1,9 @@
1
1
  <%= ui_page(max_width: :xl) do %>
2
- <%= ui_page_header(title: "Flows", subtitle: "Build and edit your flows") %>
2
+ <%= ui_page_header(title: "Flows", subtitle: "Build and edit your flows") do |header| %>
3
+ <% header.action do %>
4
+ <%= ui_button(label: "Create", href: flow_routes.new_manage_flow_path) %>
5
+ <% end %>
6
+ <% end %>
3
7
 
4
8
  <%= ui_data_table(
5
9
  items: @flows,
@@ -13,20 +17,4 @@
13
17
  <% end %>
14
18
  <% end %>
15
19
  <% end %>
16
-
17
- <%= ui_section(title: "Create a flow") do %>
18
- <% if @flow&.errors&.any? %>
19
- <%= ui_alert(message: @flow.errors.full_messages.to_sentence, type: :error) %>
20
- <% end %>
21
-
22
- <%= ui_form(action: flow_routes.manage_flows_path, method: :post) do %>
23
- <label class="block text-sm font-medium mb-1">Slug</label>
24
- <%= ui_input(name: "flow[slug]", placeholder: "e.g. business-scorecard") %>
25
-
26
- <label class="block text-sm font-medium mb-1 mt-4">Kind</label>
27
- <%= ui_select(name: "flow[kind]", options: [ [ "Scored", "scored" ], [ "Guide", "guide" ] ]) %>
28
-
29
- <%= ui_button(label: "Create", type: :submit, variant: :secondary) %>
30
- <% end %>
31
- <% end %>
32
20
  <% end %>
@@ -0,0 +1,17 @@
1
+ <%= ui_page(max_width: :md) do %>
2
+ <%= ui_page_header(title: "New flow") %>
3
+
4
+ <% if @flow.errors.any? %>
5
+ <%= ui_alert(message: @flow.errors.full_messages.to_sentence, type: :error) %>
6
+ <% end %>
7
+
8
+ <%= ui_form(action: flow_routes.manage_flows_path, method: :post) do %>
9
+ <label class="block text-sm font-medium mb-1">Slug</label>
10
+ <%= ui_input(name: "flow[slug]", value: @flow.slug, placeholder: "e.g. business-scorecard") %>
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
+ <%= ui_button(label: "Create", type: :submit) %>
16
+ <% end %>
17
+ <% end %>
data/config/routes.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  EasyFlow::Engine.routes.draw do
2
2
  namespace :manage do
3
- resources :flows, only: [ :index, :create, :show, :edit, :update, :destroy ] do
3
+ resources :flows, only: [ :index, :new, :create, :show, :edit, :update, :destroy ] do
4
4
  resource :definition, only: [ :edit, :update ]
5
5
  resource :preview, only: :show, controller: "previews" do
6
6
  get :step
@@ -1,3 +1,3 @@
1
1
  module EasyFlow
2
- VERSION = "0.8.0"
2
+ VERSION = "0.8.1"
3
3
  end
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.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - tylercschneider
@@ -127,6 +127,7 @@ files:
127
127
  - app/views/easy_flow/manage/definitions/edit.html.erb
128
128
  - app/views/easy_flow/manage/flows/edit.html.erb
129
129
  - app/views/easy_flow/manage/flows/index.html.erb
130
+ - app/views/easy_flow/manage/flows/new.html.erb
130
131
  - app/views/easy_flow/manage/flows/show.html.erb
131
132
  - app/views/easy_flow/manage/versions/index.html.erb
132
133
  - app/views/easy_flow/steps/_choosing.html.erb