mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-09 15:35:22 +02:00
Merge branch 'main' into rule-name
This commit is contained in:
commit
0b8f77fad0
15 changed files with 49 additions and 29 deletions
12
Gemfile.lock
12
Gemfile.lock
|
@ -325,7 +325,7 @@ GEM
|
|||
ast (~> 2.4.1)
|
||||
racc
|
||||
pg (1.5.9)
|
||||
plaid (37.0.0)
|
||||
plaid (38.0.0)
|
||||
faraday (>= 1.0.1, < 3.0)
|
||||
faraday-multipart (>= 1.0.1, < 2.0)
|
||||
platform_agent (1.0.1)
|
||||
|
@ -444,13 +444,13 @@ GEM
|
|||
rubocop (>= 1.72)
|
||||
rubocop-performance (>= 1.24)
|
||||
rubocop-rails (>= 2.30)
|
||||
ruby-lsp (0.23.15)
|
||||
ruby-lsp (0.23.16)
|
||||
language_server-protocol (~> 3.17.0)
|
||||
prism (>= 1.2, < 2.0)
|
||||
rbs (>= 3, < 4)
|
||||
sorbet-runtime (>= 0.5.10782)
|
||||
ruby-lsp-rails (0.4.1)
|
||||
ruby-lsp (>= 0.23.14, < 0.24.0)
|
||||
ruby-lsp-rails (0.4.2)
|
||||
ruby-lsp (>= 0.23.16, < 0.24.0)
|
||||
ruby-openai (8.1.0)
|
||||
event_stream_parser (>= 0.3.0, < 2.0.0)
|
||||
faraday (>= 1)
|
||||
|
@ -465,7 +465,7 @@ GEM
|
|||
addressable (>= 2.3.5)
|
||||
faraday (>= 0.17.3, < 3)
|
||||
securerandom (0.4.1)
|
||||
selenium-webdriver (4.31.0)
|
||||
selenium-webdriver (4.32.0)
|
||||
base64 (~> 0.2)
|
||||
logger (~> 1.4)
|
||||
rexml (~> 3.2, >= 3.2.5)
|
||||
|
@ -495,7 +495,7 @@ GEM
|
|||
skylight (6.0.4)
|
||||
activesupport (>= 5.2.0)
|
||||
smart_properties (1.17.0)
|
||||
sorbet-runtime (0.5.12043)
|
||||
sorbet-runtime (0.5.12060)
|
||||
stimulus-rails (1.3.4)
|
||||
railties (>= 6.0.0)
|
||||
stringio (3.1.7)
|
||||
|
|
|
@ -35,7 +35,7 @@ class FilledIconComponent < ViewComponent::Base
|
|||
|
||||
def container_classes
|
||||
class_names(
|
||||
"flex justify-center items-center",
|
||||
"flex justify-center items-center shrink-0",
|
||||
size_classes,
|
||||
radius_classes,
|
||||
transparent? ? "border" : solid_bg_class
|
||||
|
|
|
@ -34,6 +34,11 @@ class TagsController < ApplicationController
|
|||
redirect_to tags_path, notice: t(".deleted")
|
||||
end
|
||||
|
||||
def destroy_all
|
||||
Current.family.tags.destroy_all
|
||||
redirect_back_or_to tags_path, notice: "All tags deleted"
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def set_tag
|
||||
|
|
|
@ -6,9 +6,9 @@ class CustomConfirm
|
|||
new(
|
||||
destructive: true,
|
||||
high_severity: high_severity,
|
||||
title: "Delete #{resource_name}?",
|
||||
body: "Are you sure you want to delete #{resource_name}? This is not reversible.",
|
||||
btn_text: "Delete #{resource_name}"
|
||||
title: "Delete #{resource_name.titleize}?",
|
||||
body: "Are you sure you want to delete #{resource_name.downcase}? This is not reversible.",
|
||||
btn_text: "Delete #{resource_name.titleize}"
|
||||
)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
href: account_path(account),
|
||||
method: :delete,
|
||||
icon: "trash-2",
|
||||
confirm: CustomConfirm.for_resource_deletion("Account", high_severity: true),
|
||||
confirm: CustomConfirm.for_resource_deletion("account", high_severity: true),
|
||||
data: { turbo_frame: :_top }
|
||||
) %>
|
||||
<% end %>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
href: destroy_all_categories_path,
|
||||
method: :delete,
|
||||
icon: "trash-2",
|
||||
confirm: CustomConfirm.for_resource_deletion("All categories", high_severity: true)) %>
|
||||
confirm: CustomConfirm.for_resource_deletion("all categories", high_severity: true)) %>
|
||||
<% end %>
|
||||
|
||||
<%= render LinkComponent.new(
|
||||
|
|
|
@ -17,6 +17,6 @@
|
|||
href: chat_path(chat),
|
||||
icon: "trash-2",
|
||||
method: :delete,
|
||||
confirm: CustomConfirm.for_resource_deletion("Chat")) %>
|
||||
confirm: CustomConfirm.for_resource_deletion("chat")) %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
href: chat_path(chat),
|
||||
icon: "trash-2",
|
||||
method: :delete,
|
||||
confirm: CustomConfirm.for_resource_deletion("Chat")) %>
|
||||
confirm: CustomConfirm.for_resource_deletion("chat")) %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</nav>
|
||||
|
|
|
@ -59,7 +59,7 @@
|
|||
href: import_path(import),
|
||||
icon: "trash-2",
|
||||
method: :delete,
|
||||
confirm: CustomConfirm.for_resource_deletion("Import")) %>
|
||||
confirm: CustomConfirm.for_resource_deletion("import")) %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
|
@ -11,9 +11,9 @@
|
|||
<p class="text-sm text-secondary">Your import is in progress. Check the imports menu for status updates or click 'Check Status' to refresh the page for updates. Feel free to continue using the app.</p>
|
||||
</div>
|
||||
|
||||
<div class="space-y-2">
|
||||
<%= render LinkComponent.new(text: "Check status", href: import_path(import), variant: "primary") %>
|
||||
<%= render LinkComponent.new(text: "Back to dashboard", href: root_path, variant: "secondary") %>
|
||||
<div class="space-y-2 flex flex-col">
|
||||
<%= render LinkComponent.new(text: "Check status", href: import_path(import), variant: "primary", full_width: true) %>
|
||||
<%= render LinkComponent.new(text: "Back to dashboard", href: root_path, variant: "secondary", full_width: true) %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<%# locals: (headers: [], rows: [], caption: nil) %>
|
||||
<div class="bg-container-inset rounded-xl overflow-hidden mx-1 md:mx-auto p-3 pl-2 md:pr-2 pr-0">
|
||||
<div class="bg-container-inset rounded-xl overflow-hidden mx-1 md:mx-auto p-3 pl-2 pr-2">
|
||||
<% if caption %>
|
||||
<div class="flex items-center mb-4">
|
||||
<div class="text-gray-500 mr-2">
|
||||
|
@ -9,7 +9,7 @@
|
|||
</div>
|
||||
<% end %>
|
||||
<div class="overflow-x-auto -webkit-overflow-scrolling-touch">
|
||||
<div class="inline-block min-w-full sm:w-full border border-secondary rounded-md shadow-border-xs text-sm bg-container">
|
||||
<div class="inline-block min-w-fit sm:w-full border border-secondary rounded-md shadow-border-xs text-sm bg-container">
|
||||
<table class="min-w-full divide-y divide-alpha-black-200">
|
||||
<thead>
|
||||
<tr>
|
||||
|
|
|
@ -77,7 +77,7 @@
|
|||
href: rule_path(rule),
|
||||
icon: "trash-2",
|
||||
method: :delete,
|
||||
confirm: CustomConfirm.for_resource_deletion("Rule")) %>
|
||||
confirm: CustomConfirm.for_resource_deletion("rule")) %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
href: destroy_all_rules_path,
|
||||
icon: "trash-2",
|
||||
method: :delete,
|
||||
confirm: CustomConfirm.for_resource_deletion("All rules", high_severity: true)) %>
|
||||
confirm: CustomConfirm.for_resource_deletion("all rules", high_severity: true)) %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
|
|
|
@ -1,13 +1,27 @@
|
|||
<header class="flex items-center justify-between">
|
||||
<h1 class="text-primary text-xl font-medium"><%= t(".tags") %></h1>
|
||||
|
||||
<%= render LinkComponent.new(
|
||||
text: t(".new"),
|
||||
variant: "primary",
|
||||
href: new_tag_path,
|
||||
icon: "plus",
|
||||
frame: :modal
|
||||
) %>
|
||||
<div class="flex items-center gap-2">
|
||||
<%= render MenuComponent.new do |menu| %>
|
||||
<% menu.with_item(
|
||||
variant: "button",
|
||||
text: "Delete all",
|
||||
href: destroy_all_tags_path,
|
||||
method: :delete,
|
||||
icon: "trash-2",
|
||||
confirm: CustomConfirm.for_resource_deletion("all tags", high_severity: true)) %>
|
||||
<% end %>
|
||||
|
||||
<%= render LinkComponent.new(
|
||||
text: t(".new"),
|
||||
variant: "primary",
|
||||
href: new_tag_path,
|
||||
icon: "plus",
|
||||
frame: :modal
|
||||
) %>
|
||||
|
||||
</div>
|
||||
|
||||
</header>
|
||||
|
||||
<div class="bg-container shadow-border-xs rounded-xl p-4">
|
||||
|
|
|
@ -64,6 +64,7 @@ Rails.application.routes.draw do
|
|||
|
||||
resources :tags, except: :show do
|
||||
resources :deletions, only: %i[new create], module: :tag
|
||||
delete :destroy_all, on: :collection
|
||||
end
|
||||
|
||||
namespace :category do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue