Link dashboard Storage card to connected apps when present
CI / Test (push) Successful in 44s

Users with stored remoteStorage authorizations now jump straight to the connected apps dashboard from the services dashboard, instead of the storage info page.
This commit is contained in:
raucao committed 2026-11-04 16:08:22 +04:00
1 parent 939f447eae
commit 455bf93c81
3 files changed
+33 -1

No files matched your search

+6
View File
@@ -3,5 +3,11 @@ class DashboardController < ApplicationController
def index
@current_section = :services
@storage_path =
if Setting.remotestorage_enabled? && current_user.remote_storage_authorizations.exists?
apps_services_storage_path
else
services_storage_path
end
end
end
+1 -1
View File
@@ -47,7 +47,7 @@
<div class="border border-gray-300 rounded-md hover:border-gray-400
bg-[length:80%] bg-[center_top_-156px] bg-no-repeat
bg-[url(/img/logos/icon_remotestorage.svg)]">
<%= link_to services_storage_path,
<%= link_to @storage_path,
class: "block h-full px-6 py-6 rounded-md btn-text-dark" do %>
<h3 class="mb-3.5">Storage</h3>
<p class="text-gray-600">
+26
View File
@@ -11,4 +11,30 @@ RSpec.describe 'Account dashboard', type: :feature do
visit root_path
expect(page).to have_content('Services')
end
context 'with connected remoteStorage apps' do
before do
allow_any_instance_of(AppCatalog::WebApp).to receive(:update_metadata).and_return(true)
allow_any_instance_of(RemoteStorageAuthorization).to receive(:remove_token_expiry_job).and_return(nil)
user.remote_storage_authorizations.create!(
permissions: ["documents:rw"],
client_id: "app.example.com",
redirect_uri: "https://app.example.com",
expire_at: 1.month.from_now
)
end
scenario 'links the Storage card to the connected apps dashboard' do
visit root_path
expect(page).to have_link('Storage', href: apps_services_storage_path)
end
end
context 'without connected remoteStorage apps' do
scenario 'links the Storage card to the storage info page' do
visit root_path
expect(page).to have_link('Storage', href: services_storage_path)
end
end
end