chore(sync): KI-AGENT: Aktuellen Entwicklungsstand für TestFlight übernehmen
This commit is contained in:
@@ -39,6 +39,8 @@ function getStateLabel(state: string): string {
|
||||
}
|
||||
|
||||
function getTypeLabel(type: string): string {
|
||||
if (type === 'pause') return 'Pause';
|
||||
if (type === 'overtime_compensation') return 'Freizeitausgleich';
|
||||
if (type === 'vacation') return 'Urlaub';
|
||||
if (type === 'sick') return 'Krankheit';
|
||||
if (type === 'holiday') return 'Feiertag';
|
||||
@@ -133,6 +135,17 @@ export default function TimeTrackingScreen() {
|
||||
}
|
||||
}, [active, currentUserId, token, load]);
|
||||
|
||||
async function onPause() {
|
||||
if (!token || !currentUserId || !active) return;
|
||||
setActionLoading(true); setError(null);
|
||||
try {
|
||||
await createStaffTimeEvent(token, { eventtype: active.paused ? 'pause_end' : 'pause_start',
|
||||
eventtime: new Date().toISOString(), user_id: currentUserId });
|
||||
await load(false);
|
||||
} catch (err) { setError(err instanceof Error ? err.message : 'Pause konnte nicht gespeichert werden.'); }
|
||||
finally { setActionLoading(false); }
|
||||
}
|
||||
|
||||
async function onSubmit(entry: StaffTimeSpan) {
|
||||
if (!token || !entry.eventIds?.length) return;
|
||||
setActionLoading(true);
|
||||
@@ -206,10 +219,15 @@ export default function TimeTrackingScreen() {
|
||||
<View style={styles.statusCard}>
|
||||
<Text style={styles.statusLabel}>Aktive Zeit</Text>
|
||||
<Text style={styles.statusValue}>
|
||||
{active ? `Läuft seit ${formatDateTime(active.started_at)}` : 'Keine aktive Zeit'}
|
||||
{active ? `${active.paused ? 'In Pause' : 'Läuft'} seit ${formatDateTime(active.started_at)}` : 'Keine aktive Zeit'}
|
||||
</Text>
|
||||
|
||||
<View style={styles.statusActions}>
|
||||
{active?.model === 'spans-v2' && active.type === 'work' ? (
|
||||
<Pressable style={[styles.startButton, actionLoading ? styles.buttonDisabled : null]} onPress={onPause} disabled={actionLoading}>
|
||||
<Text style={styles.startButtonText}>{active.paused ? 'Pause beenden' : 'Pause beginnen'}</Text>
|
||||
</Pressable>
|
||||
) : null}
|
||||
{active ? (
|
||||
<Pressable
|
||||
style={[styles.stopButton, actionLoading ? styles.buttonDisabled : null]}
|
||||
|
||||
@@ -15,6 +15,8 @@ import {
|
||||
} from '@/src/lib/server-config';
|
||||
import { useAuth } from '@/src/providers/auth-provider';
|
||||
|
||||
import { NotificationPreferences } from '@/src/components/NotificationPreferences';
|
||||
|
||||
const PRIMARY = '#69c350';
|
||||
|
||||
function isValidServerUrl(value: string): boolean {
|
||||
@@ -153,6 +155,7 @@ export default function SettingsScreen() {
|
||||
|
||||
return (
|
||||
<ScrollView contentContainerStyle={styles.container}>
|
||||
{token && <NotificationPreferences key={String(activeTenantId)} token={token} />}
|
||||
<View style={styles.card}>
|
||||
<Text style={styles.title}>Server-Instanz</Text>
|
||||
<Text style={styles.hint}>
|
||||
|
||||
Reference in New Issue
Block a user