mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-23 13:23:04 +00:00
d6850756c6
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.
33 lines
1.6 KiB
TypeScript
33 lines
1.6 KiB
TypeScript
import MPhotoProvidersSection from './MPhotoProvidersSection'
|
|
import MAirTrailConnectionSection from './MAirTrailConnectionSection'
|
|
import MDawarichConnectionSection from './MDawarichConnectionSection'
|
|
import MLlmConnectionSection from './MLlmConnectionSection'
|
|
import MSettingsMcp from './MSettingsMcp'
|
|
import { useIntegrationGates } from '../../../components/Settings/useIntegrationGates'
|
|
|
|
/**
|
|
* "Integrations" section. The photo-provider / AirTrail / LLM connection forms
|
|
* are the existing (responsive) desktop sections rendered as-is — they carry
|
|
* their own cards and addon gating — while the MCP configuration named in the
|
|
* function audit is rebuilt natively in the mobile design language.
|
|
*/
|
|
export default function MSettingsIntegrations() {
|
|
const { mcpEnabled, airtrailEnabled, llmEnabled, dawarichEnabled, managed } = useIntegrationGates({ reloadAddons: true })
|
|
|
|
return (
|
|
<>
|
|
{/* 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
|
|
own key, and there nobody does. */}
|
|
{llmEnabled && !managed && <MLlmConnectionSection />}
|
|
{mcpEnabled && <MSettingsMcp />}
|
|
</>
|
|
)
|
|
}
|