mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-23 21:33:19 +00:00
fix(help): leave the guides a managed install cannot follow out of its help
A managed install offers no connection to a server the reader runs (photo libraries, AirTrail, Dawarich, wanderer) and no assistant or AI setup of its own, so the help no longer shows their guides there.
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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. */
|
||||
|
||||
Reference in New Issue
Block a user