1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-05 13:35:21 +02:00

Preference to set default_period (#1941)
Some checks are pending
Publish Docker image / ci (push) Waiting to run
Publish Docker image / Build docker image (push) Blocked by required conditions

This commit is contained in:
Nikhil Badyal 2025-03-07 20:35:54 +05:30 committed by GitHub
parent 372b64ffea
commit 26762477a3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 35 additions and 8 deletions

View file

@ -1,5 +1,4 @@
<% period = params[:period] ? Period.from_key(params[:period]) : Period.last_30_days %>
<% series = @account.balance_series(period: period) %>
<% series = @account.balance_series(period: @period) %>
<% trend = series.trend %>
<%= turbo_frame_tag dom_id(@account, :chart_details) do %>
@ -13,7 +12,7 @@
<% end %>
<% end %>
<%= tag.span period.comparison_label, class: "text-secondary" %>
<%= tag.span @period.comparison_label, class: "text-secondary" %>
</div>
<div class="h-64 pb-4">

View file

@ -1,6 +1,6 @@
<%# locals: (account:, title: nil, tooltip: nil, **args) %>
<% period = params[:period] ? Period.from_key(params[:period]) : Period.last_30_days %>
<% period = @period || Period.last_30_days %>
<% default_value_title = account.asset? ? t(".balance") : t(".owed") %>
<div id="<%= dom_id(account, :chart) %>" class="bg-white shadow-xs rounded-xl border border-alpha-black-25 rounded-lg space-y-2">

View file

@ -25,6 +25,11 @@
{ label: t(".date_format") },
{ data: { auto_submit_form_target: "auto" } } %>
<%= form.select :default_period,
Period.all.map { |period| [ period.label, period.key ] },
{ label: t(".default_period") },
{ data: { auto_submit_form_target: "auto" } } %>
<%= family_form.select :country,
country_options,
{ label: t(".country") },