diff --git a/api/src/Kurs.Platform.Application.Contracts/Intranet/IntranetDashboardDto.cs b/api/src/Kurs.Platform.Application.Contracts/Intranet/IntranetDashboardDto.cs index bc6caaca..aa2cc484 100644 --- a/api/src/Kurs.Platform.Application.Contracts/Intranet/IntranetDashboardDto.cs +++ b/api/src/Kurs.Platform.Application.Contracts/Intranet/IntranetDashboardDto.cs @@ -13,5 +13,7 @@ public class IntranetDashboardDto public ExpensesDto Expenses { get; set; } = new ExpensesDto(); public List Documents { get; set; } = []; public List Announcements { get; set; } = []; + public List ShuttleRoutes { get; set; } = []; + public List Meals { get; set; } = []; } diff --git a/api/src/Kurs.Platform.Application.Contracts/Intranet/MealDto.cs b/api/src/Kurs.Platform.Application.Contracts/Intranet/MealDto.cs new file mode 100644 index 00000000..61aa92c4 --- /dev/null +++ b/api/src/Kurs.Platform.Application.Contracts/Intranet/MealDto.cs @@ -0,0 +1,15 @@ +using System; +using Volo.Abp.Application.Dtos; + +namespace Kurs.Platform.Intranet; + +public class MealDto : FullAuditedEntityDto +{ + public Guid? TenantId { get; set; } + public Guid? BranchId { get; set; } + + public DateTime Date { get; set; } + public string Type { get; set; } + public decimal TotalCalorie { get; set; } + public string[] Materials { get; set; } +} \ No newline at end of file diff --git a/api/src/Kurs.Platform.Application.Contracts/Intranet/ShuttleRouteDto.cs b/api/src/Kurs.Platform.Application.Contracts/Intranet/ShuttleRouteDto.cs new file mode 100644 index 00000000..8ab135c2 --- /dev/null +++ b/api/src/Kurs.Platform.Application.Contracts/Intranet/ShuttleRouteDto.cs @@ -0,0 +1,17 @@ +using System; +using Volo.Abp.Application.Dtos; + +namespace Kurs.Platform.Intranet; + +public class ShuttleRouteDto : FullAuditedEntityDto +{ + public Guid? TenantId { get; set; } + + public string Type { get; set; } // Örn: "Servis", "Transfer", "Ring" + public string Name { get; set; } // Hat adı veya açıklaması + public string DepartureTime { get; set; } // Kalkış saati + public string ArrivalTime { get; set; } // Varış saati + public int Capacity { get; set; } // Toplam kapasite + public int Available { get; set; } // Mevcut boş koltuk sayısı + public string[] Route { get; set; } // JSON veya metin formatında güzergah bilgisi +} \ No newline at end of file diff --git a/api/src/Kurs.Platform.Application/Intranet/IntranetAppService.cs b/api/src/Kurs.Platform.Application/Intranet/IntranetAppService.cs index 98fd8079..887cfcf4 100644 --- a/api/src/Kurs.Platform.Application/Intranet/IntranetAppService.cs +++ b/api/src/Kurs.Platform.Application/Intranet/IntranetAppService.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.IO; using System.Linq; using System.Threading.Tasks; +using ClosedXML; using Kurs.Platform.BlobStoring; using Kurs.Platform.Entities; using Kurs.Platform.FileManagement; @@ -30,6 +31,8 @@ public class IntranetAppService : PlatformAppService, IIntranetAppService private readonly IRepository _expenseRepository; private readonly IRepository _announcementRepository; private readonly IRepository _departmentRepository; + private readonly IRepository _shuttleRouteRepository; + private readonly IRepository _mealRepository; public IntranetAppService( ICurrentTenant currentTenant, @@ -43,7 +46,9 @@ public class IntranetAppService : PlatformAppService, IIntranetAppService IRepository trainingRepository, IRepository expenseRepository, IRepository announcementRepository, - IRepository departmentRepository + IRepository departmentRepository, + IRepository shuttleRouteRepository, + IRepository mealRepository ) { _currentTenant = currentTenant; @@ -58,6 +63,8 @@ public class IntranetAppService : PlatformAppService, IIntranetAppService _expenseRepository = expenseRepository; _announcementRepository = announcementRepository; _departmentRepository = departmentRepository; + _shuttleRouteRepository = shuttleRouteRepository; + _mealRepository = mealRepository; } public async Task GetIntranetDashboardAsync() @@ -71,10 +78,78 @@ public class IntranetAppService : PlatformAppService, IIntranetAppService Trainings = await GetTrainingsAsync(), Expenses = await GetExpensesAsync(), Documents = await GetIntranetDocumentsAsync(BlobContainerNames.Intranet), - Announcements = await GetAnnouncementsAsync() + Announcements = await GetAnnouncementsAsync(), + ShuttleRoutes = await GetShuttleRoutesAsync(), + Meals = await GetMealsAsync() }; } + private async Task> GetMealsAsync() + { + // Bu haftanın başlangıç ve bitiş tarihlerini hesapla + var today = DateTime.Now.Date; + var dayOfWeek = (int)today.DayOfWeek; + // Pazartesi'yi haftanın başı olarak kabul ediyoruz (ISO 8601) + var weekStart = today.AddDays(-(dayOfWeek == 0 ? 6 : dayOfWeek - 1)); + var weekEnd = weekStart.AddDays(6); + + // Sadece bu haftanın yemeklerini getir + var meals = await _mealRepository.GetListAsync(m => + m.Date >= weekStart && m.Date <= weekEnd); + + var mealDtos = new List(); + + foreach (var meal in meals) + { + var dto = ObjectMapper.Map(meal); + + if (!string.IsNullOrEmpty(meal.Materials)) + { + dto.Materials = meal.Materials + .Split('|', StringSplitOptions.RemoveEmptyEntries) + .Select(r => r.Trim()) + .ToArray(); + } + else + { + dto.Materials = []; + } + + mealDtos.Add(dto); + } + + return mealDtos; + } + + private async Task> GetShuttleRoutesAsync() + { + var shuttleRoutes = await _shuttleRouteRepository.GetListAsync(); + + var shuttleRouteDtos = new List(); + + foreach (var shuttleRoute in shuttleRoutes) + { + var dto = ObjectMapper.Map(shuttleRoute); + + // Route string'ini array'e çevir (pipe ile ayrılmış) + if (!string.IsNullOrEmpty(shuttleRoute.Route)) + { + dto.Route = shuttleRoute.Route + .Split('|', StringSplitOptions.RemoveEmptyEntries) + .Select(r => r.Trim()) + .ToArray(); + } + else + { + dto.Route = []; + } + + shuttleRouteDtos.Add(dto); + } + + return shuttleRouteDtos; + } + private async Task> GetAnnouncementsAsync() { var announcements = await _announcementRepository diff --git a/api/src/Kurs.Platform.Application/Intranet/IntranetAutoMapperProfile.cs b/api/src/Kurs.Platform.Application/Intranet/IntranetAutoMapperProfile.cs index 09c516e9..f6d948ef 100644 --- a/api/src/Kurs.Platform.Application/Intranet/IntranetAutoMapperProfile.cs +++ b/api/src/Kurs.Platform.Application/Intranet/IntranetAutoMapperProfile.cs @@ -16,8 +16,15 @@ public class IntranetAutoMapperProfile : Profile CreateMap(); CreateMap(); CreateMap(); - + + CreateMap() + .ForMember(dest => dest.Materials, opt => opt.Ignore()); + CreateMap() - .ForMember(dest => dest.Departments, opt => opt.Ignore()); // Manuel olarak set ediliyor + .ForMember(dest => dest.Departments, opt => opt.Ignore()); + + CreateMap() + .ForMember(dest => dest.Route, opt => opt.Ignore()); + } } diff --git a/api/src/Kurs.Platform.Domain/Branch/BranchSeedManager.cs b/api/src/Kurs.Platform.Domain/Branch/BranchSeedManager.cs index b30a7ea5..365b077f 100644 --- a/api/src/Kurs.Platform.Domain/Branch/BranchSeedManager.cs +++ b/api/src/Kurs.Platform.Domain/Branch/BranchSeedManager.cs @@ -275,7 +275,7 @@ public class BranchSeedManager : DomainService var mealLog = CreateLog(nameof(Meal)); foreach (var item in items.Meals) { - var exists = await _mealRepository.AnyAsync(x => x.Date == item.Date && x.Type == item.Type && x.BranchId == branchId); + var exists = await _mealRepository.AnyAsync(x => x.Date == item.Date && x.BranchId == branchId); if (!exists) { await _mealRepository.InsertAsync(new() @@ -283,7 +283,6 @@ public class BranchSeedManager : DomainService TenantId = tenantId, BranchId = branchId, Date = item.Date, - Type = item.Type, TotalCalorie = item.TotalCalorie, Materials = item.Materials }, autoSave: true); diff --git a/api/src/Kurs.Platform.Domain/Branch/Seeds/BranchData.json b/api/src/Kurs.Platform.Domain/Branch/Seeds/BranchData.json index e775f4ad..3eb842ea 100644 --- a/api/src/Kurs.Platform.Domain/Branch/Seeds/BranchData.json +++ b/api/src/Kurs.Platform.Domain/Branch/Seeds/BranchData.json @@ -811,29 +811,33 @@ ], "Meals": [ { - "date": "01-10-2025", + "date": "2025-10-27", "type": "lunch", "totalCalorie": 650, "materials": "Mercimek Çorbası|Tavuk Şinitzel|Bulgur Pilavı|Salata|Meyve" }, { - "date": "02-10-2025", + "date": "2025-10-28", "type": "lunch", + "totalCalorie": 450, "materials": "Domates Çorbası|Etli Kuru Fasulye|Pilav|Turşu|Komposto" }, { - "date": "03-10-2025", + "date": "2025-10-29", "type": "lunch", + "totalCalorie": 660, "materials": "Tarator|Köfte|Patates Püresi|Salata|Meyve" }, { - "date": "04-10-2025", + "date": "2025-10-30", "type": "lunch", + "totalCalorie": 350, "materials": "Yoğurtlu Kabak Salatası|Fırında Levrek|Kuskus|Roka Salatası|Meyve" }, { - "date": "05-10-2025", + "date": "2025-10-31", "type": "lunch", + "totalCalorie": 490, "materials": "Mercimek Çorbası|Tavuk Şinitzel|Bulgur Pilavı|Salata|Meyve" } ] diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/TenantDataSeeder.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/TenantDataSeeder.cs index c1364b74..943f5a05 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/TenantDataSeeder.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/TenantDataSeeder.cs @@ -90,6 +90,7 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency private readonly IRepository _socialPollOptionRepository; private readonly IRepository _socialCommentRepository; private readonly IRepository _socialLikeRepository; + private readonly IRepository _mealMenuRepository; public TenantDataSeeder( IRepository repositoryUser, @@ -163,7 +164,8 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency IRepository socialMediaRepository, IRepository socialPollOptionRepository, IRepository socialCommentRepository, - IRepository socialLikeRepository + IRepository socialLikeRepository, + IRepository mealMenuRepository ) { _repositoryUser = repositoryUser; @@ -239,6 +241,7 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency _socialPollOptionRepository = socialPollOptionRepository; _socialCommentRepository = socialCommentRepository; _socialLikeRepository = socialLikeRepository; + _mealMenuRepository = mealMenuRepository; } private static IConfigurationRoot BuildConfiguration() @@ -1574,7 +1577,7 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency if (eventEntity == null) continue; - + var exists = await _eventCommentRepository.AnyAsync(x => x.Content == item.Content); if (!exists) { diff --git a/ui/src/mocks/mockIntranet.ts b/ui/src/mocks/mockIntranet.ts index 22258198..789dc02e 100644 --- a/ui/src/mocks/mockIntranet.ts +++ b/ui/src/mocks/mockIntranet.ts @@ -1,118 +1,16 @@ -import { AnnouncementDto, DocumentDto, EventDto, ExpenseDto, ReservationDto, TrainingDto, VisitorDto } from '@/proxy/intranet/models' -import { mockEmployees } from './mockEmployees' import { - Certificate, - MealMenu, - ShuttleRoute, - Survey, - SocialPost, -} from '@/types/intranet' - -export const mockMealMenus: MealMenu[] = [ - { - id: 'menu1', - date: new Date('2025-10-27'), - dayOfWeek: 'Pazartesi', - meals: [ - { - type: 'lunch', - items: ['Mercimek Çorbası', 'Tavuk Şinitzel', 'Bulgur Pilavı', 'Salata', 'Meyve'], - calories: 650, - }, - ], - }, - { - id: 'menu2', - date: new Date('2025-10-28'), - dayOfWeek: 'Salı', - meals: [ - { - type: 'lunch', - items: ['Yayla Çorbası', 'Köfte', 'Patates Püresi', 'Cacık', 'Ayran'], - calories: 720, - }, - ], - }, - { - id: 'menu3', - date: new Date('2025-10-29'), - dayOfWeek: 'Çarşamba', - meals: [ - { - type: 'lunch', - items: ['Domates Çorbası', 'Etli Kuru Fasulye', 'Pilav', 'Turşu', 'Komposto'], - calories: 680, - }, - ], - }, - { - id: 'menu4', - date: new Date('2025-10-30'), - dayOfWeek: 'Perşembe', - meals: [ - { - type: 'lunch', - items: ['Tarhana Çorbası', 'Fırın Tavuk', 'Makarna', 'Yeşil Salata', 'Sütlaç'], - calories: 700, - }, - ], - }, - { - id: 'menu5', - date: new Date('2025-10-31'), - dayOfWeek: 'Cuma', - meals: [ - { - type: 'lunch', - items: ['Ezogelin Çorbası', 'Balık', 'Bulgur Pilavı', 'Salata', 'Meyve'], - calories: 620, - }, - ], - }, -] - -export const mockShuttleRoutes: ShuttleRoute[] = [ - { - id: 'shuttle1', - name: 'Kadıköy - Ofis', - route: ['Kadıköy İskele', 'Bostancı', 'Acıbadem', 'Kozyatağı', 'Ofis'], - departureTime: '07:30', - arrivalTime: '08:45', - capacity: 25, - available: 3, - type: 'morning', - }, - { - id: 'shuttle2', - name: 'Üsküdar - Ofis', - route: ['Üsküdar Meydanı', 'Kısıklı', 'Bulgurlu', 'Ümraniye', 'Ofis'], - departureTime: '07:45', - arrivalTime: '08:50', - capacity: 25, - available: 8, - type: 'morning', - }, - { - id: 'shuttle3', - name: 'Ofis - Kadıköy', - route: ['Ofis', 'Kozyatağı', 'Acıbadem', 'Bostancı', 'Kadıköy İskele'], - departureTime: '18:00', - arrivalTime: '19:15', - capacity: 25, - available: 5, - type: 'evening', - }, - { - id: 'shuttle4', - name: 'Ofis - Üsküdar', - route: ['Ofis', 'Ümraniye', 'Bulgurlu', 'Kısıklı', 'Üsküdar Meydanı'], - departureTime: '18:15', - arrivalTime: '19:20', - capacity: 25, - available: 12, - type: 'evening', - }, -] + AnnouncementDto, + CertificateDto, + DocumentDto, + EventDto, + ExpenseDto, + ReservationDto, + ShuttleRouteDto, + TrainingDto, + VisitorDto, +} from '@/proxy/intranet/models' +import { mockEmployees } from './mockEmployees' +import { Survey, SocialPost } from '@/types/intranet' export const mockSurveys: Survey[] = [ { @@ -750,7 +648,7 @@ export const mockTrainings: TrainingDto[] = [ }, ] -export const mockCertificates: Certificate[] = [ +export const mockCertificates: CertificateDto[] = [ { id: 'cert1', employee: mockEmployees[0], @@ -1031,3 +929,46 @@ export const mockAnnouncements: AnnouncementDto[] = [ attachments: [{ name: 'Bilgi_Guvenligi_Politikasi_v2.pdf', url: '#', size: '2.4 MB' }], }, ] + +export const mockShuttleRoutes: ShuttleRouteDto[] = [ + { + id: 'shuttle1', + name: 'Kadıköy - Ofis', + route: ['Kadıköy İskele', 'Bostancı', 'Acıbadem', 'Kozyatağı', 'Ofis'], + departureTime: '07:30', + arrivalTime: '08:45', + capacity: 25, + available: 3, + type: 'morning', + }, + { + id: 'shuttle2', + name: 'Üsküdar - Ofis', + route: ['Üsküdar Meydanı', 'Kısıklı', 'Bulgurlu', 'Ümraniye', 'Ofis'], + departureTime: '07:45', + arrivalTime: '08:50', + capacity: 25, + available: 8, + type: 'morning', + }, + { + id: 'shuttle3', + name: 'Ofis - Kadıköy', + route: ['Ofis', 'Kozyatağı', 'Acıbadem', 'Bostancı', 'Kadıköy İskele'], + departureTime: '18:00', + arrivalTime: '19:15', + capacity: 25, + available: 5, + type: 'evening', + }, + { + id: 'shuttle4', + name: 'Ofis - Üsküdar', + route: ['Ofis', 'Ümraniye', 'Bulgurlu', 'Kısıklı', 'Üsküdar Meydanı'], + departureTime: '18:15', + arrivalTime: '19:20', + capacity: 25, + available: 12, + type: 'evening', + }, +] diff --git a/ui/src/proxy/intranet/models.ts b/ui/src/proxy/intranet/models.ts index 08542044..4d34f09a 100644 --- a/ui/src/proxy/intranet/models.ts +++ b/ui/src/proxy/intranet/models.ts @@ -23,9 +23,9 @@ export interface IntranetDashboardDto { expenses: ExpensesDto documents: DocumentDto[] announcements: AnnouncementDto[] + shuttleRoutes: ShuttleRouteDto[] + meals: MealDto[] // surveys: Survey[] - // mealMenu: MealMenu[] - // shuttleRoutes: ShuttleRoute[] // priorityTasks: TaskDto[] } @@ -230,6 +230,17 @@ export interface DocumentDto { childCount: number } +// Sertifika +export interface CertificateDto { + id: string + employee: EmployeeDto + trainingTitle: string + issueDate: Date + expiryDate?: Date + certificateUrl: string + score?: number +} + // Duyuru export interface AnnouncementDto { id: string @@ -247,3 +258,25 @@ export interface AnnouncementDto { departments?: string[] attachments?: { name: string; url: string; size: string }[] } + +// Servis +export interface ShuttleRouteDto { + id: string + name: string + route: string[] + departureTime: string + arrivalTime: string + capacity: number + available: number + type: string +} + +// Yemek Menüsü +export interface MealDto { + id: string + branchId: string + date: Date + type: 'breakfast' | 'lunch' | 'dinner' + totalCalorie?: number + materials: string[] +} diff --git a/ui/src/types/intranet.ts b/ui/src/types/intranet.ts index 30b6f063..c0657361 100644 --- a/ui/src/types/intranet.ts +++ b/ui/src/types/intranet.ts @@ -17,41 +17,6 @@ export interface Task { comments: number } -// Sertifika -export interface Certificate { - id: string - employee: EmployeeDto - trainingTitle: string - issueDate: Date - expiryDate?: Date - certificateUrl: string - score?: number -} - -// Yemek Menüsü -export interface MealMenu { - id: string - date: Date - dayOfWeek: string - meals: { - type: 'breakfast' | 'lunch' | 'dinner' - items: string[] - calories?: number - }[] -} - -// Servis -export interface ShuttleRoute { - id: string - name: string - route: string[] - departureTime: string - arrivalTime: string - capacity: number - available: number - type: 'morning' | 'evening' -} - // Anket export interface Survey { id: string diff --git a/ui/src/views/intranet/Dashboard.tsx b/ui/src/views/intranet/Dashboard.tsx index f7f0657c..3acc1428 100644 --- a/ui/src/views/intranet/Dashboard.tsx +++ b/ui/src/views/intranet/Dashboard.tsx @@ -11,7 +11,6 @@ import UpcomingEvents from './widgets/UpcomingEvents' import RecentDocuments from './widgets/RecentDocuments' import PriorityTasks from './widgets/PriorityTasks' import MealWeeklyMenu from './widgets/MealWeeklyMenu' -import ShuttleSchedule from './widgets/ShuttleSchedule' import LeaveManagement from './widgets/LeaveManagement' import OvertimeManagement from './widgets/OvertimeManagement' import ExpenseManagement from './widgets/ExpenseManagement' @@ -36,6 +35,7 @@ import { usePermission } from '@/utils/hooks/usePermission' import { AnnouncementDto, IntranetDashboardDto } from '@/proxy/intranet/models' import { intranetService } from '@/services/intranet.service' import Announcements from './widgets/Announcements' +import ShuttleRoute from './widgets/ShuttleRoute' dayjs.locale('tr') dayjs.extend(relativeTime) @@ -125,7 +125,7 @@ const IntranetDashboard: React.FC = () => { }, { id: 'priority-tasks', permission: 'App.Projects.Tasks.Widget', column: 'right' }, { id: 'meal-weekly-menu', permission: 'App.Intranet.Meal.Widget', column: 'right' }, - { id: 'shuttle-schedule', permission: 'App.Intranet.ShuttleRoute.Widget', column: 'right' }, + { id: 'shuttle-route', permission: 'App.Intranet.ShuttleRoute.Widget', column: 'right' }, { id: 'leave-management', permission: 'App.Hr.Leave.Widget', column: 'right' }, { id: 'overtime-management', permission: 'App.Hr.Overtime.Widget', column: 'right' }, ] @@ -275,17 +275,23 @@ const IntranetDashboard: React.FC = () => { case 'documents': return case 'announcements': - return + return ( + + ) + case 'shuttle-route': + return + case 'meal-weekly-menu': + return + case 'active-surveys': return case 'social-wall': return case 'priority-tasks': return - case 'meal-weekly-menu': - return - case 'shuttle-schedule': - return case 'leave-management': return setShowLeaveModal(true)} /> case 'overtime-management': diff --git a/ui/src/views/intranet/widgets/MealWeeklyMenu.tsx b/ui/src/views/intranet/widgets/MealWeeklyMenu.tsx index e970d5d6..0e6d4b4a 100644 --- a/ui/src/views/intranet/widgets/MealWeeklyMenu.tsx +++ b/ui/src/views/intranet/widgets/MealWeeklyMenu.tsx @@ -2,19 +2,19 @@ import React from 'react' import { FaUtensils } from 'react-icons/fa' import dayjs from 'dayjs' import isBetween from 'dayjs/plugin/isBetween' -import { mockMealMenus } from '../../../mocks/mockIntranet' import { Badge } from '@/components/ui' +import { MealDto } from '@/proxy/intranet/models' dayjs.extend(isBetween) -const MealWeeklyMenu: React.FC = () => { - const mealWeekMenus = mockMealMenus.filter((menu) => { - const menuDate = dayjs(menu.date) - const today = dayjs() - const weekStart = today.startOf('week') - const weekEnd = today.endOf('week') - return menuDate.isBetween(weekStart, weekEnd, null, '[]') - }) +const MealWeeklyMenu: React.FC<{ meals: MealDto[] }> = ({ meals }) => { + // const mealWeekMenus = meals.filter((menu) => { + // const menuDate = dayjs(menu.date) + // const today = dayjs() + // const weekStart = today.startOf('week') + // const weekEnd = today.endOf('week') + // return menuDate.isBetween(weekStart, weekEnd, null, '[]') + // }) return (
@@ -26,9 +26,9 @@ const MealWeeklyMenu: React.FC = () => {
- {mealWeekMenus.length > 0 ? ( + {meals.length > 0 ? (
- {mealWeekMenus.map((menu) => { + {meals.map((menu) => { const isToday = dayjs(menu.date).isSame(dayjs(), 'day') return (
{

- {dayjs(menu.date).format('DD MMMM')} {menu.dayOfWeek} + {dayjs(menu.date).format('DD MMMM')} {dayjs(menu.date).format('dddd')}

{isToday && ( @@ -48,15 +48,15 @@ const MealWeeklyMenu: React.FC = () => { )}
- {menu.meals[0]?.calories && ( + {menu.totalCalorie && (
- {menu.meals[0].calories} kcal + {menu.totalCalorie} kcal
)}
- {menu.meals[0]?.items.map((item, idx) => ( - + {menu.materials.map((item, idx) => ( + ))}
diff --git a/ui/src/views/intranet/widgets/ShuttleSchedule.tsx b/ui/src/views/intranet/widgets/ShuttleRoute.tsx similarity index 91% rename from ui/src/views/intranet/widgets/ShuttleSchedule.tsx rename to ui/src/views/intranet/widgets/ShuttleRoute.tsx index 60b20f7b..3820f923 100644 --- a/ui/src/views/intranet/widgets/ShuttleSchedule.tsx +++ b/ui/src/views/intranet/widgets/ShuttleRoute.tsx @@ -1,10 +1,10 @@ import React from 'react' import { FaTruck } from 'react-icons/fa' -import { mockShuttleRoutes } from '../../../mocks/mockIntranet' +import { ShuttleRouteDto } from '@/proxy/intranet/models' -const ShuttleSchedule: React.FC = () => { - const morningShuttles = mockShuttleRoutes.filter((s) => s.type === 'morning') - const eveningShuttles = mockShuttleRoutes.filter((s) => s.type === 'evening') +const ShuttleRoute: React.FC<{ shuttleRoutes: ShuttleRouteDto[] }> = ({ shuttleRoutes }) => { + const morningShuttles = shuttleRoutes.filter((s) => s.type === 'morning') + const eveningShuttles = shuttleRoutes.filter((s) => s.type === 'evening') return (
@@ -42,9 +42,7 @@ const ShuttleSchedule: React.FC = () => {
- - {shuttle.arrivalTime} - + {shuttle.arrivalTime} 5 @@ -89,9 +87,7 @@ const ShuttleSchedule: React.FC = () => {
- - {shuttle.arrivalTime} - + {shuttle.arrivalTime} 5 @@ -113,4 +109,4 @@ const ShuttleSchedule: React.FC = () => { ) } -export default ShuttleSchedule +export default ShuttleRoute