Settings overview: drop the category cards #57
No files matched your search
@@ -6,20 +6,18 @@
|
||||
|
||||
/**
|
||||
* inbuxa: Settings › Overview, the landing page for Settings (settings-reorg).
|
||||
* A card per category explaining what that menu item covers, the guided setups, and, only
|
||||
* when there are any, the pages whose values differ from the defaults.
|
||||
* The guided setups and, only when there are any, the pages whose values
|
||||
* differ from the defaults. The menu bar above does the navigating.
|
||||
*/
|
||||
|
||||
import { useEffect, useMemo, useState, type ReactNode } from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Check, ListChecks } from 'lucide-react';
|
||||
import { IconTile } from '@/components/common/IconTile';
|
||||
import { useSchemaStore } from '@/stores/schemaStore';
|
||||
import { useAccountStore } from '@/stores/accountStore';
|
||||
import { getAccountId, jmapRequest } from '@/services/jmap/client';
|
||||
import { checkLinkVisible, resolveViewPath, topItemVisible } from '@/lib/navTree';
|
||||
import { SETTINGS_CATEGORIES, SETTINGS_LAYOUT_NAME } from '@/lib/settingsLayout';
|
||||
import { checkLinkVisible, resolveViewPath } from '@/lib/navTree';
|
||||
import { SETTINGS_LAYOUT_NAME } from '@/lib/settingsLayout';
|
||||
import { resolveObject } from '@/lib/schemaResolver';
|
||||
import { countChanged, singletonPages, type SettingsPageRef } from './changedFromDefault';
|
||||
import { SENDING_WIZARD_VIEW, SendingLaunchChoice } from '@/features/sending/SendingSetupCard';
|
||||
@@ -204,19 +202,9 @@ function SetupCard({ setup }: { setup: GuidedSetup }) {
|
||||
export function SettingsOverviewPage() {
|
||||
const { t } = useTranslation();
|
||||
const schema = useSchemaStore((s) => s.schema);
|
||||
const edition = useAccountStore((s) => s.edition);
|
||||
|
||||
const layout = useMemo(() => schema?.layouts.find((l) => l.name === SETTINGS_LAYOUT_NAME), [schema]);
|
||||
|
||||
// What each item in the menu bar covers: explainers only, the bar does the navigating.
|
||||
const cards = useMemo(() => {
|
||||
if (!layout) return [];
|
||||
return SETTINGS_CATEGORIES.filter((cat) => {
|
||||
const item = layout.items.find((it) => 'container' in it && it.container.name === cat.name);
|
||||
return item !== undefined && topItemVisible(item, edition);
|
||||
});
|
||||
}, [layout, edition]);
|
||||
|
||||
const pages = useMemo(
|
||||
() => (schema && layout ? singletonPages(schema, layout.items).filter((pg) => checkLinkVisible(pg.viewName)) : []),
|
||||
[schema, layout],
|
||||
@@ -231,7 +219,7 @@ export function SettingsOverviewPage() {
|
||||
<p className="text-muted-foreground">
|
||||
{t(
|
||||
'settingsOverview.subtitle',
|
||||
'The menu above groups everything the server does by job. Here is what each part covers. Anything you change is marked against its default.',
|
||||
'The menu above groups everything the server does by job. Anything you change is marked against its default.',
|
||||
)}
|
||||
</p>
|
||||
</header>
|
||||
@@ -250,18 +238,6 @@ export function SettingsOverviewPage() {
|
||||
</section>
|
||||
)}
|
||||
|
||||
<section className="grid gap-4 sm:grid-cols-2 xl:grid-cols-4">
|
||||
{cards.map((cat) => (
|
||||
<div key={cat.name} className="flex flex-col gap-3 rounded-xl border bg-card p-5">
|
||||
<div className="flex items-center gap-3">
|
||||
<IconTile name={cat.icon} size="lg" />
|
||||
<h2 className="text-lg font-semibold">{cat.name}</h2>
|
||||
</div>
|
||||
<p className="text-sm text-muted-foreground">{cat.blurb}</p>
|
||||
</div>
|
||||
))}
|
||||
</section>
|
||||
|
||||
{changed.length > 0 && (
|
||||
<section className="space-y-3">
|
||||
<h2 className="text-sm font-semibold uppercase tracking-wider text-muted-foreground">
|
||||
|
||||
@@ -38,8 +38,6 @@ export interface SettingsGroup {
|
||||
export interface SettingsCategory {
|
||||
name: string;
|
||||
icon: string;
|
||||
/** One sentence for the Overview card. */
|
||||
blurb: string;
|
||||
groups: SettingsGroup[];
|
||||
}
|
||||
|
||||
@@ -49,7 +47,6 @@ export const SETTINGS_CATEGORIES: SettingsCategory[] = [
|
||||
{
|
||||
name: 'Mail flow',
|
||||
icon: 'route',
|
||||
blurb: 'How mail comes in and goes out: checks on senders, relays, limits and the reports sent to other servers.',
|
||||
groups: [
|
||||
{
|
||||
name: 'Receiving',
|
||||
@@ -117,7 +114,6 @@ export const SETTINGS_CATEGORIES: SettingsCategory[] = [
|
||||
{
|
||||
name: 'Spam filter',
|
||||
icon: 'shield-alert',
|
||||
blurb: 'How strict the filter is, what it learns from, and the lists of senders and domains it trusts or blocks.',
|
||||
groups: [
|
||||
{
|
||||
name: 'Protection',
|
||||
@@ -151,7 +147,6 @@ export const SETTINGS_CATEGORIES: SettingsCategory[] = [
|
||||
{
|
||||
name: 'Security',
|
||||
icon: 'lock',
|
||||
blurb: 'Who can sign in and how, the certificates that encrypt connections, and which addresses are blocked.',
|
||||
groups: [
|
||||
{
|
||||
name: 'Sign-in',
|
||||
@@ -180,7 +175,6 @@ export const SETTINGS_CATEGORIES: SettingsCategory[] = [
|
||||
{
|
||||
name: 'Network',
|
||||
icon: 'cable',
|
||||
blurb: 'The ports the server listens on, its web server, and how it looks up and publishes DNS.',
|
||||
groups: [
|
||||
{
|
||||
name: 'Connections',
|
||||
@@ -203,7 +197,6 @@ export const SETTINGS_CATEGORIES: SettingsCategory[] = [
|
||||
{
|
||||
name: 'Mail & apps',
|
||||
icon: 'mail',
|
||||
blurb: 'What people get: mailbox defaults and limits, IMAP and JMAP, calendars, contacts, files and web apps.',
|
||||
groups: [
|
||||
{
|
||||
name: 'Email',
|
||||
@@ -250,7 +243,6 @@ export const SETTINGS_CATEGORIES: SettingsCategory[] = [
|
||||
{
|
||||
name: 'Storage',
|
||||
icon: 'database',
|
||||
blurb: 'Where mail, files and indexes are kept, how long deleted and old data stays, and caching.',
|
||||
groups: [
|
||||
{
|
||||
name: 'Stores',
|
||||
@@ -281,8 +273,6 @@ export const SETTINGS_CATEGORIES: SettingsCategory[] = [
|
||||
{
|
||||
name: 'Monitoring',
|
||||
icon: 'chart-line',
|
||||
blurb:
|
||||
'Logs and traces, metrics for Prometheus or OpenTelemetry, and the alerts and webhooks that tell you things.',
|
||||
groups: [
|
||||
{
|
||||
name: 'Logs & traces',
|
||||
@@ -305,7 +295,6 @@ export const SETTINGS_CATEGORIES: SettingsCategory[] = [
|
||||
{
|
||||
name: 'System',
|
||||
icon: 'boxes',
|
||||
blurb: 'Running more than one node, background tasks, lookup tables, AI models and branding.',
|
||||
groups: [
|
||||
{
|
||||
name: 'Cluster',
|
||||
|
||||
Reference in new issue
Block a user