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:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user