feat: Add SMTP settings and collapsible email configuration UI
- Add SMTP fields to TicketEmailSettings model (host, port, TLS/SSL, credentials, from email/name) - Update serializers with SMTP fields and is_smtp_configured flag - Add TicketEmailTestSmtpView for testing SMTP connections - Update frontend API types and hooks for SMTP settings - Add collapsible IMAP and SMTP configuration sections with "Configured" badges - Fix TypeScript errors in mockData.ts (missing required fields, type mismatches) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -58,7 +58,15 @@ export const SandboxProvider: React.FC<SandboxProviderProps> = ({ children }) =>
|
||||
export const useSandbox = (): SandboxContextType => {
|
||||
const context = useContext(SandboxContext);
|
||||
if (context === undefined) {
|
||||
throw new Error('useSandbox must be used within a SandboxProvider');
|
||||
// Return default values when used outside SandboxProvider
|
||||
// This happens for platform admins who don't have sandbox mode
|
||||
return {
|
||||
isSandbox: false,
|
||||
sandboxEnabled: false,
|
||||
isLoading: false,
|
||||
toggleSandbox: async () => {},
|
||||
isToggling: false,
|
||||
};
|
||||
}
|
||||
return context;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user