fix(settings): managed installs no longer offer photo providers or AirTrail on the phone

On a managed install the phone's Integrations section still showed the
Immich and Synology Photos cards and, with the addon on, the AirTrail
connection form. Each asks for the address of a server the reader runs at
home, which a managed install cannot reach, so saving or testing could only
time out. The desktop has hidden both since the managed mode landed
(#1946, 3a0604b3f), whose message says these "connect to a server the
reader runs at home, and there is no route from here to one".

That change gated the phone's AI section but missed these two, and the
user facing addon list still carries a photo provider that was enabled
before the switch, so the cards did render. The phone now applies the same
!managed gate as the desktop IntegrationsTab.

Regression test FE-MOB-SETINT-008 (MSettingsIntegrations.test.tsx) was red
on the old code: "expected document not to contain element, found <div
data-testid="photo-providers"> instead".

No existing assertion changed.
This commit is contained in:
Maurice
2026-10-09 17:44:29 +02:00
parent 76b1e67be8
commit d6850756c6
2 changed files with 16 additions and 4 deletions
@@ -16,10 +16,11 @@ export default function MSettingsIntegrations() {
return (
<>
<MPhotoProvidersSection />
{airtrailEnabled && <MAirTrailConnectionSection />}
{/* Reaches a server the reader runs themselves, which a managed install has
no route to — the same gate the desktop shell puts on AirTrail. */}
{/* Immich, Synology Photos, AirTrail and Dawarich all reach a server the reader
runs themselves, which a managed install has no route to: the same gate the
desktop shell puts on them. */}
{!managed && <MPhotoProvidersSection />}
{airtrailEnabled && !managed && <MAirTrailConnectionSection />}
{dawarichEnabled && !managed && <MDawarichConnectionSection />}
{/* Which model reads a booking, and what that costs, comes with the instance on
a managed install. The per-user fallback exists for people who supply their
@@ -3,6 +3,7 @@ import { describe, it, expect, vi, beforeEach } from 'vitest';
import { render, screen } from '../../../helpers/render';
import { resetAllStores, seedStore } from '../../../helpers/store';
import { useAddonStore } from '../../../../src/store/addonStore';
import { useAuthStore } from '../../../../src/store/authStore';
import MSettingsIntegrations from '../../../../src/mobile/screens/settings/MSettingsIntegrations';
// The four sections are covered by their own suites — stub them so this file
@@ -94,4 +95,14 @@ describe('MSettingsIntegrations', () => {
expect(loadAddons).toHaveBeenCalledTimes(1);
});
it('FE-MOB-SETINT-008: a managed install hides the photo providers and AirTrail, as the desktop does', () => {
seedAddons(['airtrail', 'mcp']);
seedStore(useAuthStore, { managed: true });
render(<MSettingsIntegrations />);
expect(screen.queryByTestId('photo-providers')).not.toBeInTheDocument();
expect(screen.queryByTestId('airtrail')).not.toBeInTheDocument();
expect(screen.getByTestId('mcp')).toBeInTheDocument();
});
});