The Access area mixed organisation, instance and personal settings under one name. Split them: /org is the organisation's own area (members, identities, connections, models, schedules, playbooks), /settings is instance administration only, and personal security stays in the account menu. Setup checklist steps now link to the page that fixes them.
34 lines
1.0 KiB
TypeScript
34 lines
1.0 KiB
TypeScript
/** One setup step as the daemon reports it. */
|
|
export interface SetupStep {
|
|
title: string;
|
|
detail?: string;
|
|
done: boolean;
|
|
/** The page that fixes an unfinished step, so the checklist is a set of
|
|
* links rather than a description of work with nowhere to go. */
|
|
path?: string;
|
|
}
|
|
|
|
export interface Setup {
|
|
steps: SetupStep[];
|
|
operator?: string;
|
|
}
|
|
|
|
export interface SetupPanelState {
|
|
/** omit: nothing to show — no setup data, or setup fully done. */
|
|
kind: "omit" | "incomplete";
|
|
remaining: SetupStep[];
|
|
}
|
|
|
|
// setupPanelState distinguishes the only two states worth rendering: there is
|
|
// setup work left (the checklist), or there is not (nothing — a configured
|
|
// daemon is the absence of a problem, not a card announcing it).
|
|
export function setupPanelState(
|
|
setup: Setup | null | undefined,
|
|
): SetupPanelState {
|
|
const remaining = (setup?.steps ?? []).filter((step) => !step.done);
|
|
if (!setup?.steps?.length || !remaining.length) {
|
|
return { kind: "omit", remaining: [] };
|
|
}
|
|
return { kind: "incomplete", remaining };
|
|
}
|