mirror of
https://github.com/we-promise/sure.git
synced 2026-05-12 23:25:00 +00:00
Added ability to bulk-edit transaction names for multiple selected transactions (#1553)
* Added ability to bulk-edit transaction names for multiple selected transactions. * Added ability to bulk-edit transaction names for multiple selected transactions. * Added ability to bulk-edit transaction names for multiple selected transactions. * Lint, minimize changes --------- Co-authored-by: Juan José Mata <jjmata@jjmata.com>
This commit is contained in:
@@ -16,7 +16,7 @@ class Transactions::BulkUpdatesController < ApplicationController
|
|||||||
private
|
private
|
||||||
def bulk_update_params
|
def bulk_update_params
|
||||||
params.require(:bulk_update)
|
params.require(:bulk_update)
|
||||||
.permit(:date, :notes, :category_id, :merchant_id, entry_ids: [], tag_ids: [])
|
.permit(:date, :notes, :name, :category_id, :merchant_id, entry_ids: [], tag_ids: [])
|
||||||
end
|
end
|
||||||
|
|
||||||
# Check if tag_ids was explicitly provided in the request.
|
# Check if tag_ids was explicitly provided in the request.
|
||||||
|
|||||||
@@ -440,6 +440,7 @@ class Entry < ApplicationRecord
|
|||||||
bulk_attributes = {
|
bulk_attributes = {
|
||||||
date: bulk_update_params[:date],
|
date: bulk_update_params[:date],
|
||||||
notes: bulk_update_params[:notes],
|
notes: bulk_update_params[:notes],
|
||||||
|
name: bulk_update_params[:name],
|
||||||
entryable_attributes: {
|
entryable_attributes: {
|
||||||
category_id: bulk_update_params[:category_id],
|
category_id: bulk_update_params[:category_id],
|
||||||
merchant_id: bulk_update_params[:merchant_id]
|
merchant_id: bulk_update_params[:merchant_id]
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
|
|
||||||
<%= render DS::Disclosure.new(title: "Transactions", open: true) do %>
|
<%= render DS::Disclosure.new(title: "Transactions", open: true) do %>
|
||||||
<div class="space-y-2">
|
<div class="space-y-2">
|
||||||
|
<%= form.text_field :name, label: t("transactions.bulk_updates.new.name_label"), placeholder: t("transactions.bulk_updates.new.name_placeholder") %>
|
||||||
<%= form.collection_select :category_id, Current.family.categories.alphabetically, :id, :name, { prompt: "Select a category", label: "Category", class: "text-subdued" } %>
|
<%= form.collection_select :category_id, Current.family.categories.alphabetically, :id, :name, { prompt: "Select a category", label: "Category", class: "text-subdued" } %>
|
||||||
<%= form.collection_select :merchant_id, Current.family.available_merchants_for(Current.user).alphabetically, :id, :name, { prompt: "Select a merchant", label: "Merchant", class: "text-subdued" } %>
|
<%= form.collection_select :merchant_id, Current.family.available_merchants_for(Current.user).alphabetically, :id, :name, { prompt: "Select a merchant", label: "Merchant", class: "text-subdued" } %>
|
||||||
<%= form.select :tag_ids, Current.family.tags.alphabetically.pluck(:name, :id), { include_blank: "None", multiple: true, label: "Tags", include_hidden: false } %>
|
<%= form.select :tag_ids, Current.family.tags.alphabetically.pluck(:name, :id), { include_blank: "None", multiple: true, label: "Tags", include_hidden: false } %>
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
---
|
---
|
||||||
en:
|
en:
|
||||||
transactions:
|
transactions:
|
||||||
|
bulk_updates:
|
||||||
|
new:
|
||||||
|
name_label: Name
|
||||||
|
name_placeholder: Enter a name that will be applied to selected transactions
|
||||||
unknown_name: Unknown transaction
|
unknown_name: Unknown transaction
|
||||||
selection_bar:
|
selection_bar:
|
||||||
duplicate: Duplicate
|
duplicate: Duplicate
|
||||||
|
|||||||
Reference in New Issue
Block a user