Feature/yahoo finance (#123)

* Implement Yahoo Finance

* Added tests

* Updated hosting controller to check for managed app_mode instead of env_override

* Suggestions from CodeRabbit and Fixes on tests

* Remove Css changes

* Fix yahoo finance impl and i18n

* Updated view to use healthy method

* remove usage

* Updated env example

* keep usage on class just to keep same format

* Ci test

* Remove some useless validations

* Remove logs

* Linter fixes

* Broke this in my conflict merge

* Wrong indentation level

---------

Signed-off-by: Juan José Mata <juanjo.mata@gmail.com>
Co-authored-by: Juan José Mata <juanjo.mata@gmail.com>
This commit is contained in:
João Felipe
2025-10-29 02:15:14 +04:00
committed by GitHub
parent 391011628a
commit 9fefe57de5
12 changed files with 913 additions and 13 deletions

View File

@@ -0,0 +1,37 @@
<div class="space-y-4">
<div>
<h2 class="font-medium mb-1"><%= t(".title") %></h2>
<p class="text-secondary text-sm mb-4"><%= t(".description") %></p>
</div>
<% if @yahoo_finance_provider&.healthy? %>
<div class="space-y-4">
<div class="flex items-center space-x-3">
<div class="w-3 h-3 bg-green-500 rounded-full"></div>
<p class="text-sm text-secondary">
<%= t(".status_active") %>
</p>
</div>
</div>
<% else %>
<div class="space-y-4">
<div class="flex items-center space-x-3">
<div class="w-3 h-3 bg-red-500 rounded-full"></div>
<p class="text-sm text-secondary">
<%= t(".status_inactive") %>
</p>
</div>
<div class="bg-red-50 border border-red-200 rounded-lg p-3">
<div class="flex">
<div class="ml-3">
<h3 class="text-sm font-medium text-red-800">
<%= t(".connection_failed") %>
</h3>
<div class="mt-2 text-sm text-red-700">
<p><%= t(".troubleshooting") %></p>
</div>
</div>
</div>
</div>
</div>
<% end %>
</div>

View File

@@ -1,17 +1,19 @@
<%= content_for :page_title, t(".title") %>
<%= settings_section title: t(".general") do %>
<div class="space-y-6">
<%= render "settings/hostings/openai_settings" %>
<%= render "settings/hostings/brand_fetch_settings" %>
</div>
<% end %>
<%= settings_section title: t(".financial_data_providers") do %>
<div class="space-y-6">
<%= render "settings/hostings/yahoo_finance_settings" %>
<%= render "settings/hostings/twelve_data_settings" %>
</div>
<% end %>
<%= settings_section title: t(".invites") do %>
<%= render "settings/hostings/invite_code_settings" %>
<% end %>
<%= settings_section title: t(".danger_zone") do %>
<%= render "settings/hostings/danger_zone_settings" %>
<% end %>