Skip to content

admin settings tabs#84

Merged
MarshallAsch merged 20 commits intomainfrom
admin-settings-tabs
Mar 21, 2026
Merged

admin settings tabs#84
MarshallAsch merged 20 commits intomainfrom
admin-settings-tabs

Conversation

@MarshallAsch
Copy link
Copy Markdown
Owner

  • live reload the code when running using the included the compose file instead of needing to rebuild the image
  • docs: add admin settings tabs design spec
  • docs: add admin settings tabs implementation plan
  • feat: add Setting model and AppSettings type
  • feat: add getSettings/updateSettings helpers
  • feat: add settings API routes (GET, PATCH, test-email)
  • fix: add userId guard and validate pressure against persisted settings
  • feat: add settings sidebar layout with tab navigation
  • feat: add notifications tab with SMTP status and test email
  • feat: add inspection & maintenance settings tab
  • feat: add cylinder defaults settings tab
  • feat: rewrite settings page with tabbed layout
  • feat: use configurable cron schedule from settings
  • feat: use configurable service pressures from settings
  • fix: settings tab switching and migration sync issues
  • chore: remove the commented out db sync calls
  • feat: add preview pages for the email notification templates
  • feat: add email template previews and notification preferences link

Copy link
Copy Markdown
Collaborator

@kellenwiltshire kellenwiltshire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, couple small things

theme: u.theme,
role: u.role,
clientId: u.clientId ?? null,
clientName: (u as any).client?.name ?? null,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should define the u type on line 67, which would be Profile

Comment on lines +156 to +172
<input
type='number'
min={1}
step={1}
value={newPressure}
onChange={(e) => setNewPressure(e.target.value)}
placeholder='e.g. 3442'
className='border-border bg-background text-text w-32 rounded-md border px-3 py-1 text-sm outline-none focus:outline-none'
onKeyDown={(e) => {
if (e.key === 'Enter') handleAddPressure()
if (e.key === 'Escape') {
setShowAddInput(false)
setNewPressure('')
}
}}
autoFocus
/>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use the NumberInput component here?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup i forgot to ask it to re-use components where possible

MarshallAsch and others added 18 commits March 21, 2026 11:06
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Replace double non-null assertion with explicit userId guard in PATCH
- validateSettings now checks defaultServicePressure against the
  persisted allowedServicePressures list instead of SETTINGS_DEFAULTS

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace hardcoded '0 8 * * *' schedule with a per-minute check
against cronHour/cronMinute from the settings table.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove hardcoded defaultValue and isIn validator from cylinder model
- Add servicePressureOptions helper to FormConstants
- CylinderModal accepts optional allowedServicePressures prop

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Move SETTINGS_TAB enum to shared tabs.ts (server component can't
  import from 'use client' module)
- Remove incorrect 'use server' directive from page.tsx (it's a page
  component, not a Server Action)
- Disable SequelizeAdapter auto-sync to prevent duplicate column errors
  during migrations

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add email preview API route with sample data for all 4 templates
- Add preview links section to Notifications settings tab
- Add "Manage notification preferences" footer link to welcome,
  hydro reminder, and visual reminder email templates

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@MarshallAsch MarshallAsch merged commit 07bf036 into main Mar 21, 2026
1 check passed
@MarshallAsch MarshallAsch deleted the admin-settings-tabs branch March 21, 2026 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants