mirror of
https://github.com/we-promise/sure.git
synced 2026-04-18 19:44:09 +00:00
* Fix cashflow and outflows widgets to respect user's default period preference Resolves issue #118 where the Cashflow and Outflows widgets on the dashboard were hardcoded to use a 30-day period instead of respecting the user's default period preference setting. Changes: - Updated @cashflow_period to use Current.user&.default_period as fallback - Updated @outflows_period to use Current.user&.default_period as fallback - Both now follow the same pattern as the Periodable concern's set_period method This ensures consistency across all dashboard widgets - Net Worth, Cashflow, and Outflows now all respect the user's preference. * Synchronize period selection across all dashboard widgets All three dashboard widgets (Net Worth, Cashflow, and Outflows) now use a single shared period parameter, ensuring consistent data magnitudes across the dashboard. Changes: - Simplified controller to use single @period for all three widgets - Removed widget-specific period parameters (cashflow_period, outflows_period) - All widgets now use the shared 'period' parameter - All period dropdowns use turbo_frame: "_top" to reload entire page - Removed turbo_frame_tags from dashboard view for cleaner implementation User experience improvement: - Changing the period in any widget now updates all three widgets - Ensures data consistency and easier comparison across widgets - Maintains respect for user's default period preference * Make Net Worth widget title styling consistent with Cashflow and Outflows Changed Net Worth title from <p> with text-sm/text-secondary to <h2> with text-lg to match the consistent styling used by Cashflow and Outflows widgets. This provides a more unified visual appearance across all dashboard widgets. --------- Co-authored-by: Claude <noreply@anthropic.com>
64 lines
1.9 KiB
Plaintext
64 lines
1.9 KiB
Plaintext
<% content_for :page_header do %>
|
|
<div class="space-y-1 mb-6 flex gap-4 justify-between items-center lg:items-start">
|
|
<div class="space-y-1">
|
|
<h1 class="text-xl lg:text-3xl font-medium text-primary">
|
|
<%= t("pages.dashboard.welcome", name: Current.user.first_name) %>
|
|
</h1>
|
|
<p class="text-sm lg:text-base text-secondary">
|
|
<%= t("pages.dashboard.subtitle") %>
|
|
</p>
|
|
</div>
|
|
|
|
<%= render DS::Link.new(
|
|
icon: "plus",
|
|
text: t("pages.dashboard.new"),
|
|
href: new_account_path,
|
|
frame: :modal,
|
|
class: "hidden lg:inline-flex"
|
|
) %>
|
|
|
|
<%= render DS::Link.new(
|
|
variant: "icon-inverse",
|
|
icon: "plus",
|
|
href: new_account_path,
|
|
frame: :modal,
|
|
class: "rounded-full lg:hidden"
|
|
) %>
|
|
</div>
|
|
<% end %>
|
|
|
|
<div class="w-full space-y-6 pb-24">
|
|
<% if Current.family.accounts.any? %>
|
|
<section class="bg-container py-4 rounded-xl shadow-border-xs mb-6">
|
|
<%= render partial: "pages/dashboard/cashflow_sankey", locals: {
|
|
sankey_data: @cashflow_sankey_data,
|
|
period: @period
|
|
} %>
|
|
</section>
|
|
|
|
<% if @outflows_data[:categories].present? %>
|
|
<section class="bg-container py-4 rounded-xl shadow-border-xs mb-6">
|
|
<%= render partial: "pages/dashboard/outflows_donut", locals: {
|
|
outflows_data: @outflows_data,
|
|
period: @period
|
|
} %>
|
|
</section>
|
|
<% end %>
|
|
|
|
<section class="bg-container py-4 rounded-xl shadow-border-xs">
|
|
<%= render partial: "pages/dashboard/net_worth_chart", locals: {
|
|
balance_sheet: @balance_sheet,
|
|
period: @period
|
|
} %>
|
|
</section>
|
|
|
|
<section>
|
|
<%= render "pages/dashboard/balance_sheet", balance_sheet: @balance_sheet %>
|
|
</section>
|
|
<% else %>
|
|
<section>
|
|
<%= render "pages/dashboard/no_accounts_graph_placeholder" %>
|
|
</section>
|
|
<% end %>
|
|
</div>
|