Add translations for project templates and navigation to settings
Introduce new translations for project template creation and editing, and add a button to navigate back to the settings page from the ProjectTemplate component. Replit-Commit-Author: Agent Replit-Commit-Session-Id: ceced2fc-aa46-458d-ba87-ddd4b7bb1518 Replit-Commit-Checkpoint-Type: intermediate_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/659922a9-0087-461c-90dd-6d9a58b81d4d/ceced2fc-aa46-458d-ba87-ddd4b7bb1518/LNMKOrA
This commit is contained in:
@@ -344,6 +344,7 @@ function App() {
|
||||
<ProjectTemplate
|
||||
onCreateFromTemplate={handleCreateFromTemplate}
|
||||
onCreateTasks={(newTasks) => setTasks(prev => [...prev, ...newTasks])}
|
||||
onNavigateToSettings={() => setCurrentTab('settings')}
|
||||
/>
|
||||
);
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { useState, useEffect } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Card } from '@/components/ui/card';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Input } from '@/components/ui/input';
|
||||
@@ -8,7 +9,7 @@ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@
|
||||
import { Calendar } from '@/components/ui/calendar';
|
||||
import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover';
|
||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs';
|
||||
import { Plus, Calendar as CalendarIcon, Clock, Copy, Play, Tag, Edit, Trash2, Palette, FileText } from 'lucide-react';
|
||||
import { Plus, Calendar as CalendarIcon, Clock, Copy, Play, Tag, Edit, Trash2, Palette, FileText, ArrowLeft } from 'lucide-react';
|
||||
import { Label, Task } from '@shared/schema';
|
||||
import TaskDetailsModal from '@/components/TaskDetailsModal';
|
||||
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
|
||||
@@ -73,6 +74,7 @@ interface ProjectTemplateProps {
|
||||
onCreateFromTemplate?: (templateId: string, startDate: Date, projectName: string) => void;
|
||||
onCreateTemplate?: (template: any) => void;
|
||||
onCreateTasks?: (tasks: Task[]) => void;
|
||||
onNavigateToSettings?: () => void;
|
||||
}
|
||||
|
||||
const defaultProjects: Project[] = [
|
||||
@@ -122,7 +124,8 @@ const defaultProjects: Project[] = [
|
||||
export default function ProjectTemplate({
|
||||
onCreateFromTemplate,
|
||||
onCreateTemplate,
|
||||
onCreateTasks
|
||||
onCreateTasks,
|
||||
onNavigateToSettings
|
||||
}: ProjectTemplateProps) {
|
||||
const [projects, setProjects] = useState<Project[]>(defaultProjects);
|
||||
const [selectedProject, setSelectedProject] = useState<Project | null>(null);
|
||||
@@ -519,13 +522,27 @@ export default function ProjectTemplate({
|
||||
{ id: 'finished', title: 'Finished', status: 'finished' as const, color: 'bg-green-100' }
|
||||
];
|
||||
|
||||
const { t } = useTranslation();
|
||||
|
||||
return (
|
||||
<div className="space-y-6">
|
||||
{/* Header */}
|
||||
<div className="flex items-center justify-between gap-2">
|
||||
<h2 className="text-base sm:text-lg font-semibold" data-testid="text-settings-title">
|
||||
Settings
|
||||
</h2>
|
||||
<div className="flex items-center gap-3">
|
||||
{onNavigateToSettings && (
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
onClick={onNavigateToSettings}
|
||||
data-testid="button-back-to-settings"
|
||||
>
|
||||
<ArrowLeft className="w-5 h-5" />
|
||||
</Button>
|
||||
)}
|
||||
<h2 className="text-base sm:text-lg font-semibold" data-testid="text-settings-title">
|
||||
{t('projectTemplate.title')}
|
||||
</h2>
|
||||
</div>
|
||||
<Button
|
||||
onClick={() => setIsCreateProjectOpen(true)}
|
||||
data-testid="button-create-project"
|
||||
|
||||
@@ -213,8 +213,47 @@
|
||||
"startDate": "Startdatum",
|
||||
"selectStartDate": "Startdatum wählen",
|
||||
"createProject": "Projekt erstellen",
|
||||
"newProject": "Neues Projekt",
|
||||
"weeks": "{{count}} Wochen",
|
||||
"tasks": "{{count}} Aufgaben"
|
||||
"tasks": "{{count}} Aufgaben",
|
||||
"projects": "Projekte",
|
||||
"labels": "Labels",
|
||||
"planning": "Planung",
|
||||
"active": "Aktiv",
|
||||
"finished": "Abgeschlossen",
|
||||
"cancel": "Abbrechen",
|
||||
"create": "Erstellen",
|
||||
"update": "Aktualisieren",
|
||||
"delete": "Löschen",
|
||||
"edit": "Bearbeiten",
|
||||
"save": "Speichern",
|
||||
"addTask": "Aufgabe hinzufügen",
|
||||
"taskTitle": "Aufgabentitel",
|
||||
"description": "Beschreibung",
|
||||
"priority": "Priorität",
|
||||
"status": "Status",
|
||||
"estimatedHours": "Geschätzte Stunden",
|
||||
"label": "Label",
|
||||
"selectLabel": "Label auswählen",
|
||||
"notes": "Notizen",
|
||||
"projectTasks": "Projektaufgaben",
|
||||
"enterTaskTitle": "Aufgabentitel eingeben",
|
||||
"enterTaskDescription": "Aufgabenbeschreibung eingeben",
|
||||
"taskNotes": "Aufgabennotizen (optional)",
|
||||
"createLabel": "Label erstellen",
|
||||
"editLabel": "Label bearbeiten",
|
||||
"createNewLabel": "Neues Label erstellen",
|
||||
"labelName": "Label-Name",
|
||||
"labelNamePlaceholder": "Label-Name",
|
||||
"deleteConfirm": "Sind Sie sicher, dass Sie dieses Label löschen möchten?",
|
||||
"loadingLabels": "Labels werden geladen...",
|
||||
"noLabelsYet": "Noch keine Labels",
|
||||
"noLabelsDescription": "Erstellen Sie Ihr erstes Label, um Ihre Aufgaben nach Farbe und Kategorie zu organisieren.",
|
||||
"projectDescription": "Projektbeschreibung",
|
||||
"projectDescriptionPlaceholder": "Projektbeschreibung eingeben (optional)",
|
||||
"plannedEndDate": "Geplantes Enddatum",
|
||||
"selectPlannedEndDate": "Geplantes Enddatum wählen",
|
||||
"clearDate": "Datum löschen"
|
||||
},
|
||||
"timeCompletion": {
|
||||
"title": "Aufgabe abgeschlossen!",
|
||||
|
||||
@@ -213,8 +213,47 @@
|
||||
"startDate": "Start Date",
|
||||
"selectStartDate": "Select start date",
|
||||
"createProject": "Create Project",
|
||||
"newProject": "New Project",
|
||||
"weeks": "{{count}} weeks",
|
||||
"tasks": "{{count}} tasks"
|
||||
"tasks": "{{count}} tasks",
|
||||
"projects": "Projects",
|
||||
"labels": "Labels",
|
||||
"planning": "Planning",
|
||||
"active": "Active",
|
||||
"finished": "Finished",
|
||||
"cancel": "Cancel",
|
||||
"create": "Create",
|
||||
"update": "Update",
|
||||
"delete": "Delete",
|
||||
"edit": "Edit",
|
||||
"save": "Save",
|
||||
"addTask": "Add Task",
|
||||
"taskTitle": "Task Title",
|
||||
"description": "Description",
|
||||
"priority": "Priority",
|
||||
"status": "Status",
|
||||
"estimatedHours": "Estimated Hours",
|
||||
"label": "Label",
|
||||
"selectLabel": "Select a label",
|
||||
"notes": "Notes",
|
||||
"projectTasks": "Project Tasks",
|
||||
"enterTaskTitle": "Enter task title",
|
||||
"enterTaskDescription": "Enter task description",
|
||||
"taskNotes": "Task notes (optional)",
|
||||
"createLabel": "Create Label",
|
||||
"editLabel": "Edit Label",
|
||||
"createNewLabel": "Create New Label",
|
||||
"labelName": "Label name",
|
||||
"labelNamePlaceholder": "Label name",
|
||||
"deleteConfirm": "Are you sure you want to delete this label?",
|
||||
"loadingLabels": "Loading labels...",
|
||||
"noLabelsYet": "No labels yet",
|
||||
"noLabelsDescription": "Create your first label to organize your tasks by color and category.",
|
||||
"projectDescription": "Project Description",
|
||||
"projectDescriptionPlaceholder": "Enter project description (optional)",
|
||||
"plannedEndDate": "Planned End Date",
|
||||
"selectPlannedEndDate": "Select planned end date",
|
||||
"clearDate": "Clear date"
|
||||
},
|
||||
"timeCompletion": {
|
||||
"title": "Task Completed!",
|
||||
|
||||
Reference in New Issue
Block a user