Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

fix(help): leave the guides a managed install cannot follow out of its help

Maurice429a2fb01765
diff --git a/client/src/help/registry.test.ts b/client/src/help/registry.test.ts
index 552976ff5..c401606ee 100644
--- a/client/src/help/registry.test.ts
+++ b/client/src/help/registry.test.ts
@@ -245,11 +245,15 @@ describe('help on a managed install', () => {
expect(reg.getHelpContext('admin-backup')).toBeNull()
expect(reg.allHelpGuides().some(g => g.context === 'admin-storage')).toBe(false)
expect(reg.getHelpGuide('files-sync')).toBeNull()
- // Integrations follow whether the instance has them on.
+ // Integrations the operator offers follow whether the instance has them on.
useAddonStore.setState({ addons: [] })
- expect(reg.getHelpGuide('connect-dawarich')).toBeNull()
- useAddonStore.setState({ addons: [{ id: 'dawarich', enabled: true } as never] })
- expect(reg.getHelpGuide('connect-dawarich')).not.toBeNull()
+ expect(reg.getHelpGuide('mcp-oauth')).toBeNull()
+ useAddonStore.setState({ addons: [{ id: 'mcp', enabled: true } as never] })
+ expect(reg.getHelpGuide('mcp-oauth')).not.toBeNull()
+ // A server the reader would run themselves, and the AI the operator picks, are never offered there.
+ useAddonStore.setState({ addons: [{ id: 'dawarich', enabled: true }, { id: 'memories', enabled: true }] as never })
+ for (const id of ['connect-dawarich', 'album-date-range', 'photo-providers', 'ai-setup', 'trip-assistant', 'connect-ai'])
+ expect(reg.getHelpGuide(id), id).toBeNull()
// What a hosted admin can still do keeps its guide.
expect(reg.getHelpGuide('create-user')).not.toBeNull()
} finally {
diff --git a/client/src/help/registry.ts b/client/src/help/registry.ts
index 44bf288b9..8aa168f60 100644
--- a/client/src/help/registry.ts
+++ b/client/src/help/registry.ts
@@ -91,8 +91,14 @@ const MANAGED_HIDDEN_GUIDES: ReadonlySet<string> = new Set([
'plugin-settings', 'files-sync', 'files-sync-settings', 'document-providers',
// The operator runs the booking mail relay on a managed install; the admin has no setup row.
'mail-import-setup',
- // The operator picks the model a managed install talks to; Settings shows no AI connection card there.
- 'connect-ai',
+ // The operator picks the model a managed install talks to, and the server refuses the
+ // assistant and its setup there: Settings shows no AI connection card.
+ 'connect-ai', 'ai-setup', 'trip-assistant',
+ // Immich, Synology Photos, AirTrail, Dawarich and wanderer connect to a server the reader
+ // runs; Settings offers none of these connections on a managed install, so neither do these.
+ 'photo-providers', 'album-date-range', 'connect-airtrail', 'airtrail-import',
+ 'connect-dawarich', 'dawarich-countries', 'dawarich-wishes', 'dawarich-stays', 'journey-day-stays', 'map-dawarich-trail',
+ 'tour-connect-wanderer', 'tour-wanderer-watch', 'tour-import-wanderer',
])
/**
@@ -102,23 +108,10 @@ const MANAGED_HIDDEN_GUIDES: ReadonlySet<string> = new Set([
*/
const addonOn = (id: string) => (): boolean => useAddonStore.getState().isEnabled(id)
const MANAGED_FEATURE_GUIDES: Readonly<Record<string, () => boolean>> = {
- 'connect-dawarich': addonOn('dawarich'),
- 'dawarich-countries': addonOn('dawarich'),
- 'dawarich-wishes': addonOn('dawarich'),
- 'dawarich-stays': addonOn('dawarich'),
- 'journey-day-stays': addonOn('dawarich'),
- 'map-dawarich-trail': addonOn('dawarich'),
- 'connect-airtrail': addonOn('airtrail'),
- 'airtrail-import': addonOn('airtrail'),
- 'photo-providers': addonOn('memories'),
- 'album-date-range': addonOn('memories'),
'mcp-oauth': addonOn('mcp'),
'api-keys': addonOn('mcp'),
'mcp-tokens-admin': addonOn('mcp'),
'paddle-water-data': addonOn('tours'),
- 'tour-connect-wanderer': () => useAddonStore.getState().toursWanderer,
- 'tour-wanderer-watch': () => useAddonStore.getState().toursWanderer,
- 'tour-import-wanderer': () => useAddonStore.getState().toursWanderer,
}
/** Read at call time: `managed` arrives with app-config, after the registry loaded. */