diff --git a/app/controllers/settings/api_keys_controller.rb b/app/controllers/settings/api_keys_controller.rb index 4804cdf58..c7258a454 100644 --- a/app/controllers/settings/api_keys_controller.rb +++ b/app/controllers/settings/api_keys_controller.rb @@ -6,6 +6,10 @@ class Settings::ApiKeysController < ApplicationController before_action :set_api_key, only: [ :show, :destroy ] def show + @breadcrumbs = [ + [ "Home", root_path ], + [ "API Keys", nil ] + ] @current_api_key = @api_key end diff --git a/app/controllers/settings/bank_sync_controller.rb b/app/controllers/settings/bank_sync_controller.rb new file mode 100644 index 000000000..21f3cda31 --- /dev/null +++ b/app/controllers/settings/bank_sync_controller.rb @@ -0,0 +1,27 @@ +class Settings::BankSyncController < ApplicationController + layout "settings" + + def show + @providers = [ + { + name: "Lunch Flow", + description: "US, Canada, UK, EU, Brazil and Asia through multiple open banking providers.", + path: "https://lunchflow.app/features/sure-integration", + target: "_blank", + rel: "noopener noreferrer" + }, + { + name: "Plaid", + description: "US & Canada bank connections with transactions, investments, and liabilities.", + path: "https://github.com/we-promise/sure/blob/main/docs/hosting/plaid.md", + target: "_blank", + rel: "noopener noreferrer" + }, + { + name: "SimpleFin", + description: "US & Canada connections via SimpleFin protocol.", + path: simplefin_items_path + } + ] + end +end diff --git a/app/controllers/settings/hostings_controller.rb b/app/controllers/settings/hostings_controller.rb index 5fb2869b5..066e318ef 100644 --- a/app/controllers/settings/hostings_controller.rb +++ b/app/controllers/settings/hostings_controller.rb @@ -6,6 +6,10 @@ class Settings::HostingsController < ApplicationController before_action :ensure_admin, only: :clear_cache def show + @breadcrumbs = [ + [ "Home", root_path ], + [ "Self-Hosting", nil ] + ] twelve_data_provider = Provider::Registry.get_provider(:twelve_data) @twelve_data_usage = twelve_data_provider&.usage end diff --git a/app/controllers/settings/securities_controller.rb b/app/controllers/settings/securities_controller.rb index 9f8eac1c7..756accf79 100644 --- a/app/controllers/settings/securities_controller.rb +++ b/app/controllers/settings/securities_controller.rb @@ -2,5 +2,9 @@ class Settings::SecuritiesController < ApplicationController layout "settings" def show + @breadcrumbs = [ + [ "Home", root_path ], + [ "Security", nil ] + ] end end diff --git a/app/helpers/settings_helper.rb b/app/helpers/settings_helper.rb index 0f8ab4710..af237bfc9 100644 --- a/app/helpers/settings_helper.rb +++ b/app/helpers/settings_helper.rb @@ -3,7 +3,7 @@ module SettingsHelper { name: "Account", path: :settings_profile_path }, { name: "Preferences", path: :settings_preferences_path }, { name: "Security", path: :settings_security_path }, - { name: "Self hosting", path: :settings_hosting_path, condition: :self_hosted? }, + { name: "Self-Hosting", path: :settings_hosting_path, condition: :self_hosted? }, { name: "API Key", path: :settings_api_key_path }, { name: "Billing", path: :settings_billing_path, condition: :not_self_hosted? }, { name: "Accounts", path: :accounts_path }, diff --git a/app/views/settings/_settings_nav.html.erb b/app/views/settings/_settings_nav.html.erb index 7fb1b18d8..9a6e0f15d 100644 --- a/app/views/settings/_settings_nav.html.erb +++ b/app/views/settings/_settings_nav.html.erb @@ -6,10 +6,11 @@ nav_sections = [ { label: t(".profile_label"), path: settings_profile_path, icon: "circle-user" }, { label: t(".preferences_label"), path: settings_preferences_path, icon: "bolt" }, { label: t(".security_label"), path: settings_security_path, icon: "shield-check" }, - { label: "API Key", path: settings_api_key_path, icon: "key" }, + { label: t(".api_keys_label"), path: settings_api_key_path, icon: "key" }, { label: t(".self_hosting_label"), path: settings_hosting_path, icon: "database", if: self_hosted? }, { label: t(".billing_label"), path: settings_billing_path, icon: "circle-dollar-sign", if: !self_hosted? }, { label: t(".accounts_label"), path: accounts_path, icon: "layers" }, + { label: t(".bank_sync_label"), path: settings_bank_sync_path, icon: "banknote" }, { label: "SimpleFin", path: simplefin_items_path, icon: "building-2" }, { label: t(".imports_label"), path: imports_path, icon: "download" } ] diff --git a/app/views/settings/bank_sync/_provider_link.html.erb b/app/views/settings/bank_sync/_provider_link.html.erb new file mode 100644 index 000000000..8a2d524cd --- /dev/null +++ b/app/views/settings/bank_sync/_provider_link.html.erb @@ -0,0 +1,32 @@ +<%# locals: (provider_link:) %> + +<%# Assign distinct colors to each provider %> +<% provider_colors = { + "Lunch Flow" => "#6471eb", + "Plaid" => "#4da568", + "SimpleFin" => "#e99537" +} %> +<% provider_color = provider_colors[provider_link[:name]] || "#6B7280" %> + +<%= link_to provider_link[:path], + target: provider_link[:target], + rel: provider_link[:rel], + class: "flex justify-between items-center p-4 bg-container hover:bg-container-hover transition-colors" do %> +
+ <%= render partial: "shared/color_avatar", locals: { name: provider_link[:name], color: provider_color } %> + +
+

+ <%= provider_link[:name] %> +

+

+ <%= provider_link[:description] %> +

+
+
+
+ <%= icon("arrow-right", size: "sm", class: "text-secondary") %> +
+<% end %> + + diff --git a/app/views/settings/bank_sync/show.html.erb b/app/views/settings/bank_sync/show.html.erb new file mode 100644 index 000000000..56f634743 --- /dev/null +++ b/app/views/settings/bank_sync/show.html.erb @@ -0,0 +1,29 @@ +<%= content_for :page_title, "Bank Sync" %> + + +
+ <% if @providers.any? %> +
+
+

PROVIDERS

+ · +

<%= @providers.count %>

+
+ +
+
+ <%= render partial: "provider_link", collection: @providers, spacer_template: "shared/ruler" %> +
+
+
+ <% else %> +
+
+

No providers configured

+

Configure providers to link your bank accounts.

+
+
+ <% end %> +
+ + diff --git a/config/locales/views/settings/en.yml b/config/locales/views/settings/en.yml index f13a16ad1..8e7b17b8d 100644 --- a/config/locales/views/settings/en.yml +++ b/config/locales/views/settings/en.yml @@ -84,10 +84,12 @@ en: profile_label: Account rules_label: Rules security_label: Security - self_hosting_label: Self hosting + self_hosting_label: Self-Hosting tags_label: Tags transactions_section_title: Transactions whats_new_label: What's new + api_keys_label: API Keys + bank_sync_label: Bank Sync settings_nav_link_large: next: Next previous: Back diff --git a/config/routes.rb b/config/routes.rb index 9a5a66d53..d89dcdb47 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -63,6 +63,7 @@ Rails.application.routes.draw do resource :billing, only: :show resource :security, only: :show resource :api_key, only: [ :show, :new, :create, :destroy ] + resource :bank_sync, only: :show, controller: "bank_sync" end resource :subscription, only: %i[new show create] do diff --git a/docs/hosting/logos.md b/docs/hosting/logos.md index 4a8aacfb2..5e216568b 100644 --- a/docs/hosting/logos.md +++ b/docs/hosting/logos.md @@ -14,7 +14,7 @@ Logos are currently matched in the following ways: A Brand Fetch Client ID is required and to obtain a client ID, sign up for an account [here](https://brandfetch.com/developers/logo-api). -Once you enter the Client ID into the Sure settings under the `Self hosting` section, logos from Brand Fetch integration will be enabled. +Once you enter the Client ID into the Sure settings under the `Self-Hosting` section, logos from Brand Fetch integration will be enabled. Alternatively, you can provide the client id using the `BRAND_FETCH_CLIENT_ID` environment variable to the web and worker services. ![CLIENT_ID screenshot](logos-clientid.png) diff --git a/test/system/settings_test.rb b/test/system/settings_test.rb index 7da571784..c7d5efe44 100644 --- a/test/system/settings_test.rb +++ b/test/system/settings_test.rb @@ -35,8 +35,8 @@ class SettingsTest < ApplicationSystemTestCase Rails.application.config.app_mode.stubs(:self_hosted?).returns(true) Provider::Registry.stubs(:get_provider).with(:twelve_data).returns(nil) open_settings_from_sidebar - assert_selector "li", text: "Self hosting" - click_link "Self hosting" + assert_selector "li", text: "Self-Hosting" + click_link "Self-Hosting" assert_current_path settings_hosting_path assert_selector "h1", text: "Self-Hosting" check "setting[require_invite_for_signup]", allow_label_click: true