From 74569497915220aecae38da80799693acc901c73 Mon Sep 17 00:00:00 2001 From: Jason Zimdars Date: Tue, 19 Nov 2024 14:54:01 -0600 Subject: [PATCH 1/9] Stub everyone switch --- app/assets/images/everyone.svg | 1 + app/views/buckets/edit.html.erb | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 app/assets/images/everyone.svg diff --git a/app/assets/images/everyone.svg b/app/assets/images/everyone.svg new file mode 100644 index 000000000..eb8a9a92d --- /dev/null +++ b/app/assets/images/everyone.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/views/buckets/edit.html.erb b/app/views/buckets/edit.html.erb index f37c0330d..48931ac1c 100644 --- a/app/views/buckets/edit.html.erb +++ b/app/views/buckets/edit.html.erb @@ -30,6 +30,29 @@
+
  • +
    + <%= image_tag "everyone.svg", aria: { hidden: "true" }, class: "colorize--black" %> + Everyone +
    + +
    +
    Everyone
    +
    + + + + <%= link_to nil, class: "btn--faux flex-inline", tabindex: "-1" do %> + + <% end %> +
  • + + + <% if User.active.count > 20 %> <% end %> From 47208a20dae9510de48ba2c8f54303c6c291bd4c Mon Sep 17 00:00:00 2001 From: Jason Zimdars Date: Tue, 19 Nov 2024 20:20:13 -0600 Subject: [PATCH 2/9] Rework Workflows creation and editing flows --- app/assets/images/remove-med.svg | 1 + app/views/accounts/users/index.html.erb | 14 +++++---- app/views/workflows/_workflow.html.erb | 23 +++++--------- app/views/workflows/edit.html.erb | 33 ++++++++++++-------- app/views/workflows/index.html.erb | 28 +++++++++++++++-- app/views/workflows/new.html.erb | 28 ++++++++++++++--- app/views/workflows/stages/_stage.html.erb | 18 ++--------- app/views/workflows/stages/edit.html.erb | 36 +++++++++++++--------- app/views/workflows/stages/new.html.erb | 13 ++++++-- 9 files changed, 120 insertions(+), 74 deletions(-) create mode 100644 app/assets/images/remove-med.svg diff --git a/app/assets/images/remove-med.svg b/app/assets/images/remove-med.svg new file mode 100644 index 000000000..c15d589ec --- /dev/null +++ b/app/assets/images/remove-med.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/views/accounts/users/index.html.erb b/app/views/accounts/users/index.html.erb index d77d1e11e..5d93666d8 100644 --- a/app/views/accounts/users/index.html.erb +++ b/app/views/accounts/users/index.html.erb @@ -7,7 +7,14 @@ Go back <% end %> - <%= button_to session_path, method: :delete, class: "btn", form_class: "flex-item-justify-end" do %> +

    <%= @page_title %>

    + + <%= link_to workflows_path, class: "btn flex-item-justify-end" do %> + <%= image_tag "bolt.svg", aria: { hidden: true }, size: 24 %> + Workflows + <% end %> + + <%= button_to session_path, method: :delete, class: "btn" do %> <%= image_tag "logout.svg", aria: { hidden: true }, size: 24 %> Sign out <% end %> @@ -21,8 +28,3 @@
    <%= render partial: "accounts/users/user", collection: @users %>
    - -
    -

    Workflows

    - <%= turbo_frame_tag :workflows, src: workflows_path %> -
    diff --git a/app/views/workflows/_workflow.html.erb b/app/views/workflows/_workflow.html.erb index be235aa4f..b6307822a 100644 --- a/app/views/workflows/_workflow.html.erb +++ b/app/views/workflows/_workflow.html.erb @@ -1,27 +1,20 @@ <%= turbo_frame_tag workflow do %> -
    -
    +
    +
    <%= turbo_frame_tag dom_id(workflow, :header) do %> - <%= link_to edit_workflow_path(workflow), class: "btn btn--small" do %> - <%= image_tag "pencil.svg", aria: { hidden: true }, size: 24 %> - Edit <%= workflow.name %> - <% end %> - -

    <%= workflow.name %>

    - - <%= button_to workflow_path(workflow), method: :delete, class: "btn btn--negative btn--small", data: { turbo_frame: :workflows, turbo_confirm: "Are you sure you want to delete this workflow?" } do %> - <%= image_tag "minus.svg", aria: { hidden: true }, size: 24 %> - Delete <%= workflow.name %> + <%= link_to edit_workflow_path(workflow) do %> +

    <%= workflow.name %>

    <% end %> <% end %>
    - + -
    +
    <%= turbo_frame_tag dom_id(workflow, :stages) do %> <%= render partial: "workflows/stages/stage", collection: workflow.stages %> - <%= link_to new_workflow_stage_path(workflow), class: "btn btn--positive btn--small" do %> + + <%= link_to new_workflow_stage_path(workflow), class: "btn btn--small" do %> <%= image_tag "add.svg", aria: { hidden: true }, size: 24 %> New stage <% end %> diff --git a/app/views/workflows/edit.html.erb b/app/views/workflows/edit.html.erb index ce2f4e027..6414e9347 100644 --- a/app/views/workflows/edit.html.erb +++ b/app/views/workflows/edit.html.erb @@ -1,17 +1,24 @@ <%= turbo_frame_tag dom_id(@workflow, :header) do %> - <%= form_with model: @workflow, url: workflow_path(@workflow) do |form| %> -
    - <%= form.text_field :name, required: true, autofocus: true %> +
    + <%= form_with model: @workflow, url: workflow_path(@workflow), id: dom_id(@workflow, :form), class: "full-width" do |form| %> +

    + <%= form.text_field :name, required: true, autofocus: true, class: "input full-width", style: "--input-padding: 0.2em 0.5em;" %> +

    + <% end %> -
    - <%= form.button type: :submit, class: "btn btn--small" do %> - <%= image_tag "check.svg", aria: { hidden: true }, size: 24 %> - <% end %> + <%= tag.button type: :submit, class: "btn btn--small btn--positive", form: dom_id(@workflow, :form) do %> + <%= image_tag "check.svg", aria: { hidden: true }, size: 24 %> + Save + <% end %> - <%= link_to workflow_path(@workflow), class: "btn btn--small", data: { turbo_frame: dom_id(@workflow) } do %> - <%= image_tag "remove.svg", aria: { hidden: true }, size: 24 %> - <% end %> -
    -
    - <% end %> + <%= link_to workflow_path(@workflow), class: "btn btn--small", data: { turbo_frame: dom_id(@workflow) } do %> + <%= image_tag "remove-med.svg", aria: { hidden: true }, size: 24 %> + Cancel + <% end %> + + <%= button_to workflow_path(@workflow), method: :delete, class: "btn btn--small btn--negative", data: { turbo_frame: :workflows, turbo_confirm: "Are you sure you want to delete this workflow?" } do %> + <%= image_tag "minus.svg", aria: { hidden: true }, size: 24 %> + Delete <%= @workflow.name %> + <% end %> +
    <% end %> diff --git a/app/views/workflows/index.html.erb b/app/views/workflows/index.html.erb index 17ab2b158..bd8cc5c2a 100644 --- a/app/views/workflows/index.html.erb +++ b/app/views/workflows/index.html.erb @@ -1,7 +1,29 @@ +<% @page_title = "Workflows" %> + +<% content_for :header do %> + +<% end %> + <%= turbo_frame_tag :workflows do %> -
    +
    <%= render partial: "workflows/workflow", collection: @workflows %>
    - - <%= link_to "New workflow", new_workflow_path, class: "btn" %> <% end %> diff --git a/app/views/workflows/new.html.erb b/app/views/workflows/new.html.erb index fa4a66828..aac4ac355 100644 --- a/app/views/workflows/new.html.erb +++ b/app/views/workflows/new.html.erb @@ -1,6 +1,24 @@ -<%= turbo_frame_tag :workflows do %> - <%= form_with model: @workflow, url: workflows_path do |form| %> - <%= form.text_field :name, required: true, autofocus: true %> - <%= form.submit %> - <% end %> +<% @page_title = "Create a new Workflow" %> + +<% content_for :header do %> + +<% end %> + +<%= turbo_frame_tag :workflows do %> +
    + <%= form_with model: @workflow, url: workflows_path do |form| %> + <%= form.text_field :name, required: true, autofocus: true, class: "input txt-large", placeholder: "Name your Workflow…" %> + <%= form.button type: :submit, class: "btn btn--reversed center margin-block-start txt-large" do %> + <%= image_tag "check.svg", aria: { hidden: true }, size: 24 %> + Create Workflow + <% end %> + <% end %> +
    <% end %> diff --git a/app/views/workflows/stages/_stage.html.erb b/app/views/workflows/stages/_stage.html.erb index 34680f8d9..21cf0cf0b 100644 --- a/app/views/workflows/stages/_stage.html.erb +++ b/app/views/workflows/stages/_stage.html.erb @@ -1,19 +1,7 @@ -
    +
    <%= turbo_frame_tag stage do %> -

    <%= stage.name %>

    - - - - <%= link_to edit_workflow_stage_path(stage.workflow, stage), class: "btn btn--small" do %> - <%= image_tag "pencil.svg", aria: { hidden: true }, size: 24 %> - Edit <%= stage.name %> - <% end %> - - <% if stage_counter >= 1 %> - <%= button_to workflow_stage_path(stage.workflow, stage), method: :delete, class: "btn btn--negative btn--small", data: { turbo_frame: dom_id(stage.workflow), turbo_confirm: "Are you sure you want to delete this stage?" } do %> - <%= image_tag "minus.svg", aria: { hidden: true }, size: 24 %> - Delete <%= stage.name %> - <% end %> + <%= link_to edit_workflow_stage_path(stage.workflow, stage) do %> + <%= stage.name %> <% end %> <% end %>
    diff --git a/app/views/workflows/stages/edit.html.erb b/app/views/workflows/stages/edit.html.erb index f2eb8cb0e..bb3be76e8 100644 --- a/app/views/workflows/stages/edit.html.erb +++ b/app/views/workflows/stages/edit.html.erb @@ -1,17 +1,25 @@ <%= turbo_frame_tag @stage do %> - <%= form_with model: @stage, url: workflow_stage_path(@stage.workflow, @stage) do |form| %> -
    - <%= form.text_field :name, required: true, autofocus: true %> - -
    - <%= form.button type: :submit, class: "btn btn--small" do %> - <%= image_tag "check.svg", aria: { hidden: true }, size: 24 %> - <% end %> - - <%= link_to workflow_path(@workflow), class: "btn btn--small", data: { turbo_frame: dom_id(@workflow) } do %> - <%= image_tag "remove.svg", aria: { hidden: true }, size: 24 %> - <% end %> -
    -
    + <%= form_with model: @stage, url: workflow_stage_path(@stage.workflow, @stage), id: dom_id(@stage, :form), class: "full-width" do |form| %> + <%= form.text_field :name, required: true, autofocus: true, class: "input full-width" %> <% end %> + +
    + <%= tag.button type: :submit, class: "btn btn--small btn--positive", form: dom_id(@stage, :form) do %> + <%= image_tag "check.svg", aria: { hidden: true }, size: 24 %> + Save + <% end %> + + <%= link_to workflow_path(@workflow), class: "btn btn--small", data: { turbo_frame: dom_id(@workflow) } do %> + <%= image_tag "remove-med.svg", aria: { hidden: true }, size: 24 %> + Cancel + <% end %> + + <% if @stage.workflow.stages.many? %> + <%= button_to workflow_stage_path(@stage.workflow, @stage), method: :delete, class: "btn btn--negative btn--small", + data: { turbo_frame: dom_id(@workflow), turbo_confirm: "Are you sure you want to delete this stage?" } do %> + <%= image_tag "minus.svg", aria: { hidden: true }, size: 24 %> + Delete <%= @stage.name %> + <% end %> + <% end %> +
    <% end %> diff --git a/app/views/workflows/stages/new.html.erb b/app/views/workflows/stages/new.html.erb index 86479ee19..ce9ef5fb8 100644 --- a/app/views/workflows/stages/new.html.erb +++ b/app/views/workflows/stages/new.html.erb @@ -1,6 +1,13 @@ <%= turbo_frame_tag dom_id(@stage.workflow, :stages) do %> - <%= form_with model: @stage, url: workflow_stages_path(@stage.workflow) do |form| %> - <%= form.text_field :name, required: true, autofocus: true %> - <%= form.submit %> + <%= form_with model: @stage, url: workflow_stages_path(@stage.workflow), class: "flex align-center gap-half" do |form| %> + <%= form.text_field :name, required: true, autofocus: true, class: "input" %> + <%= form.button type: :submit, class: "btn btn--positive txt-small" do %> + <%= image_tag "check.svg", aria: { hidden: true }, size: 24 %> + Add stage + <% end %> + <%= link_to workflow_path(@workflow), class: "btn btn--small" do %> + <%= image_tag "remove-med.svg", aria: { hidden: true }, size: 24 %> + Cancel + <% end %> <% end %> <% end %> From a1a3a2cb24ff91f56710f6e7e3c2d1f4885880eb Mon Sep 17 00:00:00 2001 From: Jason Zimdars Date: Wed, 20 Nov 2024 09:03:34 -0600 Subject: [PATCH 3/9] Polish --- app/views/bubbles/stage_pickers/new.html.erb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/views/bubbles/stage_pickers/new.html.erb b/app/views/bubbles/stage_pickers/new.html.erb index 2783bc6aa..d3826ddaa 100644 --- a/app/views/bubbles/stage_pickers/new.html.erb +++ b/app/views/bubbles/stage_pickers/new.html.erb @@ -3,11 +3,12 @@