From d81ca4cd2f908c0a6227d7530a9b91efc53caf5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sedat=20=C3=96zt=C3=BCrk?= Date: Wed, 6 May 2026 22:07:30 +0300 Subject: [PATCH] =?UTF-8?q?Event=20Widget=20d=C3=BCzeltmesi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Intranet/EventCommentDto.cs | 14 -- .../Intranet/EventDto.cs | 11 +- .../Identity/IdentityAutoMapperProfile.cs | 3 +- .../Identity/PlatformIdentityAppService.cs | 30 +-- .../UserInfoViewModelMappingExtensions.cs | 82 +++++++ .../Intranet/IntranetAppService.cs | 228 ++++++++---------- .../Seeds/ListFormSeeder_Administration.cs | 57 +++-- .../Entities/Tenant/Intranet/Event.cs | 5 - .../Entities/Tenant/Intranet/EventComment.cs | 19 -- .../Entities/Tenant/Intranet/EventPhoto.cs | 17 -- .../EntityFrameworkCore/PlatformDbContext.cs | 31 --- .../Seeds/TenantData.json | 20 +- .../Seeds/TenantDataSeeder.cs | 43 ---- ui/public/version.json | 24 +- ui/src/proxy/intranet/models.ts | 9 +- .../admin/activityLog/components/Event.tsx | 21 -- .../views/intranet/widgets/UpcomingEvents.tsx | 14 +- ui/tsconfig.json | 21 +- ui/tsconfig.node.json | 3 +- 19 files changed, 278 insertions(+), 374 deletions(-) delete mode 100644 api/src/Sozsoft.Platform.Application.Contracts/Intranet/EventCommentDto.cs create mode 100644 api/src/Sozsoft.Platform.Application/Identity/UserInfoViewModelMappingExtensions.cs delete mode 100644 api/src/Sozsoft.Platform.Domain/Entities/Tenant/Intranet/EventComment.cs delete mode 100644 api/src/Sozsoft.Platform.Domain/Entities/Tenant/Intranet/EventPhoto.cs diff --git a/api/src/Sozsoft.Platform.Application.Contracts/Intranet/EventCommentDto.cs b/api/src/Sozsoft.Platform.Application.Contracts/Intranet/EventCommentDto.cs deleted file mode 100644 index af0fbf1..0000000 --- a/api/src/Sozsoft.Platform.Application.Contracts/Intranet/EventCommentDto.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; -using Sozsoft.Platform.Identity.Dto; - -namespace Sozsoft.Platform.Intranet; - -public class EventCommentDto -{ - public string Id { get; set; } - public UserInfoViewModel User { get; set; } - public string Content { get; set; } - public DateTime CreationTime { get; set; } - public int Likes { get; set; } -} - diff --git a/api/src/Sozsoft.Platform.Application.Contracts/Intranet/EventDto.cs b/api/src/Sozsoft.Platform.Application.Contracts/Intranet/EventDto.cs index 50ac5ba..d39ba95 100644 --- a/api/src/Sozsoft.Platform.Application.Contracts/Intranet/EventDto.cs +++ b/api/src/Sozsoft.Platform.Application.Contracts/Intranet/EventDto.cs @@ -1,22 +1,21 @@ using System; -using System.Collections.Generic; using Sozsoft.Platform.Identity.Dto; namespace Sozsoft.Platform.Intranet; public class EventDto { - public string Id { get; set; } + public Guid? TenantId { get; set; } + public Guid Id { get; set; } public string CategoryName { get; set; } public string TypeName { get; set; } public DateTime Date { get; set; } public string Name { get; set; } public string Description { get; set; } public string Place { get; set; } - public UserInfoViewModel Organizer { get; set; } - public int Participants { get; set; } - public List Photos { get; set; } = new(); - public List Comments { get; set; } = new(); + + public UserInfoViewModel User { get; set; } + public int ParticipantsCount { get; set; } public int Likes { get; set; } public bool IsPublished { get; set; } } diff --git a/api/src/Sozsoft.Platform.Application/Identity/IdentityAutoMapperProfile.cs b/api/src/Sozsoft.Platform.Application/Identity/IdentityAutoMapperProfile.cs index 6c3dfd1..4a9c20d 100644 --- a/api/src/Sozsoft.Platform.Application/Identity/IdentityAutoMapperProfile.cs +++ b/api/src/Sozsoft.Platform.Application/Identity/IdentityAutoMapperProfile.cs @@ -18,7 +18,8 @@ public class IdentityAutoMapperProfile : Profile .ForMember(dest => dest.WorkHours, opt => opt.Ignore()) .ForMember(dest => dest.Departments, opt => opt.Ignore()) .ForMember(dest => dest.JobPositions, opt => opt.Ignore()) - .ForMember(dest => dest.userRoleNames, opt => opt.Ignore()); + .ForMember(dest => dest.userRoleNames, opt => opt.Ignore()) + .AfterMap((source, destination) => destination.MapIdentityExtraProperties(source)); CreateMap(); CreateMap(); CreateMap(); diff --git a/api/src/Sozsoft.Platform.Application/Identity/PlatformIdentityAppService.cs b/api/src/Sozsoft.Platform.Application/Identity/PlatformIdentityAppService.cs index e555cbd..3751490 100644 --- a/api/src/Sozsoft.Platform.Application/Identity/PlatformIdentityAppService.cs +++ b/api/src/Sozsoft.Platform.Application/Identity/PlatformIdentityAppService.cs @@ -159,38 +159,10 @@ public class PlatformIdentityAppService : ApplicationService PhoneNumberConfirmed = user.PhoneNumberConfirmed, AccessFailedCount = user.AccessFailedCount, ShouldChangePasswordOnNextLogin = user.ShouldChangePasswordOnNextLogin, - RocketUsername = user.GetRocketUsername(), - WorkHour = user.GetWorkHour(), - DepartmentId = user.GetDepartmentId(), - JobPositionId = user.GetJobPositionId(), CreationTime = user.CreationTime, LastModificationTime = user.LastModificationTime, - IdentityNumber = user.GetIdentityNumber(), - Nationality = user.GetNationality(), - SskNo = user.GetSskNo(), - HireDate = user.GetHireDate(), - TerminationDate = user.GetTerminationDate(), - SerialNo = user.GetSerialNo(), - Province = user.GetProvince(), - District = user.GetDistrict(), - Village = user.GetVillage(), - VolumeNo = user.GetVolumeNo(), - FamilySequenceNo = user.GetFamilySequenceNo(), - SequenceNo = user.GetSequenceNo(), - IssuedPlace = user.GetIssuedPlace(), - IssuedDate = user.GetIssuedDate(), - BirthPlace = user.GetBirthPlace(), - BirthDate = user.GetBirthDate(), - FatherName = user.GetFatherName(), - MotherName = user.GetMotherName(), - MaritalStatus = user.GetMaritalStatus(), - MarriageDate = user.GetMarriageDate(), - HomeAddress = user.GetHomeAddress(), - EducationLevel = user.GetEducationLevel(), - GraduationSchool = user.GetGraduationSchool(), - BloodType = user.GetBloodType(), - }; + }.MapIdentityExtraProperties(user); } public async Task UpdatePermissionAsync(UserInfoViewModel UserInfo) diff --git a/api/src/Sozsoft.Platform.Application/Identity/UserInfoViewModelMappingExtensions.cs b/api/src/Sozsoft.Platform.Application/Identity/UserInfoViewModelMappingExtensions.cs new file mode 100644 index 0000000..f73b750 --- /dev/null +++ b/api/src/Sozsoft.Platform.Application/Identity/UserInfoViewModelMappingExtensions.cs @@ -0,0 +1,82 @@ +using System; +using System.Collections.Generic; +using Sozsoft.Platform.Entities; +using Sozsoft.Platform.Extensions; +using Sozsoft.Platform.Identity.Dto; +using Volo.Abp.Identity; + +namespace Sozsoft.Platform.Identity; + +public static class UserInfoViewModelMappingExtensions +{ + public static UserInfoViewModel MapIdentityExtraProperties(this UserInfoViewModel userInfoViewModel, IdentityUser user) + { + userInfoViewModel.IsVerified = user.GetIsVerified(); + userInfoViewModel.LoginEndDate = user.GetLoginEndDate(); + userInfoViewModel.RocketUsername = user.GetRocketUsername(); + userInfoViewModel.WorkHour = user.GetWorkHour(); + userInfoViewModel.DepartmentId = user.GetDepartmentId(); + userInfoViewModel.JobPositionId = user.GetJobPositionId(); + userInfoViewModel.Nationality = user.GetNationality(); + userInfoViewModel.SskNo = user.GetSskNo(); + userInfoViewModel.HireDate = user.GetHireDate(); + userInfoViewModel.TerminationDate = user.GetTerminationDate(); + userInfoViewModel.IdentityNumber = user.GetIdentityNumber(); + userInfoViewModel.SerialNo = user.GetSerialNo(); + userInfoViewModel.Province = user.GetProvince(); + userInfoViewModel.District = user.GetDistrict(); + userInfoViewModel.Village = user.GetVillage(); + userInfoViewModel.VolumeNo = user.GetVolumeNo(); + userInfoViewModel.FamilySequenceNo = user.GetFamilySequenceNo(); + userInfoViewModel.SequenceNo = user.GetSequenceNo(); + userInfoViewModel.IssuedPlace = user.GetIssuedPlace(); + userInfoViewModel.IssuedDate = user.GetIssuedDate(); + userInfoViewModel.BirthPlace = user.GetBirthPlace(); + userInfoViewModel.BirthDate = user.GetBirthDate(); + userInfoViewModel.FatherName = user.GetFatherName(); + userInfoViewModel.MotherName = user.GetMotherName(); + userInfoViewModel.MaritalStatus = user.GetMaritalStatus(); + userInfoViewModel.MarriageDate = user.GetMarriageDate(); + userInfoViewModel.HomeAddress = user.GetHomeAddress(); + userInfoViewModel.EducationLevel = user.GetEducationLevel(); + userInfoViewModel.GraduationSchool = user.GetGraduationSchool(); + userInfoViewModel.BloodType = user.GetBloodType(); + + return userInfoViewModel; + } + + public static UserInfoViewModel MapDepartmentAndJobPositionAssignments( + this UserInfoViewModel userInfoViewModel, + IReadOnlyDictionary departmentDict, + IReadOnlyDictionary jobPositionDict) + { + if (userInfoViewModel.DepartmentId != Guid.Empty && departmentDict.TryGetValue(userInfoViewModel.DepartmentId, out var departmentName)) + { + userInfoViewModel.Departments = + [ + new AssignedDepartmentViewModel + { + Id = userInfoViewModel.DepartmentId, + Name = departmentName, + IsAssigned = true + } + ]; + } + + if (userInfoViewModel.JobPositionId != Guid.Empty && jobPositionDict.TryGetValue(userInfoViewModel.JobPositionId, out var jobPosition)) + { + userInfoViewModel.JobPositions = + [ + new AssignedJobPoisitionViewModel + { + Id = userInfoViewModel.JobPositionId, + Name = jobPosition.Name, + DepartmentId = jobPosition.DepartmentId, + IsAssigned = true + } + ]; + } + + return userInfoViewModel; + } +} \ No newline at end of file diff --git a/api/src/Sozsoft.Platform.Application/Intranet/IntranetAppService.cs b/api/src/Sozsoft.Platform.Application/Intranet/IntranetAppService.cs index 014e8b6..7e4b36a 100644 --- a/api/src/Sozsoft.Platform.Application/Intranet/IntranetAppService.cs +++ b/api/src/Sozsoft.Platform.Application/Intranet/IntranetAppService.cs @@ -10,6 +10,7 @@ using Microsoft.Extensions.Logging; using Sozsoft.Platform.BlobStoring; using Sozsoft.Platform.Entities; using Sozsoft.Platform.FileManagement; +using Sozsoft.Platform.Identity; using Sozsoft.Platform.Identity.Dto; using Sozsoft.Platform.Extensions; using Volo.Abp.Domain.Repositories; @@ -27,6 +28,7 @@ public class IntranetAppService : PlatformAppService, IIntranetAppService private readonly BlobManager _blobContainer; private readonly IConfiguration _configuration; + private readonly IRepository _eventRepository; private readonly IIdentityUserAppService _identityUserAppService; private readonly IIdentityUserRepository _identityUserRepository; private readonly IRepository _departmentRepository; @@ -46,6 +48,7 @@ public class IntranetAppService : PlatformAppService, IIntranetAppService BlobManager blobContainer, IConfiguration configuration, + IRepository eventRepository, IIdentityUserAppService identityUserAppService, IIdentityUserRepository identityUserRepository, IRepository departmentRepository, @@ -64,6 +67,7 @@ public class IntranetAppService : PlatformAppService, IIntranetAppService _currentTenant = currentTenant; _blobContainer = blobContainer; _configuration = configuration; + _eventRepository = eventRepository; _identityUserAppService = identityUserAppService; _identityUserRepository = identityUserRepository; _departmentRepository = departmentRepository; @@ -89,9 +93,87 @@ public class IntranetAppService : PlatformAppService, IIntranetAppService Announcements = await GetAnnouncementsAsync(), //3 Surveys = await GetSurveysAsync(), //4 SocialPosts = await GetSocialPostsAsync(), //5 + Events = await GetUpcomingEventsAsync(), //6 }; } + private async Task<(Dictionary DepartmentDict, Dictionary JobPositionDict)> GetUserLookupDictionariesAsync() + { + var departments = await _departmentRepository.GetListAsync(); + var jobPositions = await _jobPositionRepository.GetListAsync(); + + return ( + departments.ToDictionary(d => d.Id, d => d.Name), + jobPositions.ToDictionary(j => j.Id, j => j) + ); + } + + private UserInfoViewModel MapUserInfoViewModel( + IdentityUser user, + IReadOnlyDictionary departmentDict, + IReadOnlyDictionary jobPositionDict) + { + return ObjectMapper + .Map(user) + .MapDepartmentAndJobPositionAssignments(departmentDict, jobPositionDict); + } + + private async Task> GetUpcomingEventsAsync() + { + var queryable = await _eventRepository + .WithDetailsAsync(e => e.Category, e => e.Type); + + var events = await AsyncExecuter.ToListAsync( + queryable.Where(e => e.isPublished).OrderByDescending(e => e.CreationTime) + ); + + if (events.Count == 0) + return []; + + // Tüm unique user ID'lerini topla (event'ler ve comment'ler için) + var userIds = new HashSet(); + foreach (var evt in events) + { + if (evt.UserId.HasValue) + { + userIds.Add(evt.UserId.Value); + } + } + + var (departmentDict, jobPositionDict) = await GetUserLookupDictionariesAsync(); + + var users = await _identityUserRepository.GetListAsync(); + var userDict = users + .Where(u => userIds.Contains(u.Id)) + .ToDictionary(u => u.Id, u => MapUserInfoViewModel(u, departmentDict, jobPositionDict)); + + var result = new List(); + foreach (var evt in events) + { + if (!evt.UserId.HasValue || !userDict.TryGetValue(evt.UserId.Value, out var user)) + continue; + + var calendarEvent = new EventDto + { + Id = evt.Id, + Name = evt.Name, + Description = evt.Description, + TypeName = evt.Type?.Name, + CategoryName = evt.Category?.Name, + Date = evt.Date, + Place = evt.Place, + User = user, + ParticipantsCount = evt.ParticipantsCount, + Likes = evt.Likes, + IsPublished = evt.isPublished + }; + + result.Add(calendarEvent); + } + + return result; + } + private async Task> GetBirthdaysAsync() { var today = DateTime.Now; @@ -108,44 +190,11 @@ public class IntranetAppService : PlatformAppService, IIntranetAppService }) .ToList(); - var allDepartments = await _departmentRepository.GetListAsync(); - var departmentDict = allDepartments.ToDictionary(d => d.Id, d => d.Name); + var (departmentDict, jobPositionDict) = await GetUserLookupDictionariesAsync(); - var allJobPositions = await _jobPositionRepository.GetListAsync(); - var jobPositionDict = allJobPositions.ToDictionary(j => j.Id, j => j); - - var result = ObjectMapper.Map, List>(userList); - - for (var i = 0; i < userList.Count; i++) - { - var user = userList[i]; - - result[i].BirthDate = user.GetBirthDate(); - result[i].WorkHour = user.GetWorkHour(); - result[i].Nationality = user.GetNationality(); - - var deptId = user.GetDepartmentId(); - if (deptId != Guid.Empty && departmentDict.TryGetValue(deptId, out var deptName)) - { - result[i].DepartmentId = deptId; - result[i].Departments = - [ - new AssignedDepartmentViewModel { Id = deptId, Name = deptName, IsAssigned = true } - ]; - } - - var jobPosId = user.GetJobPositionId(); - if (jobPosId != Guid.Empty && jobPositionDict.TryGetValue(jobPosId, out var jobPosition)) - { - result[i].JobPositionId = jobPosId; - result[i].JobPositions = - [ - new AssignedJobPoisitionViewModel { Id = jobPosId, Name = jobPosition.Name, DepartmentId = jobPosition.DepartmentId, IsAssigned = true } - ]; - } - } - - return result; + return userList + .Select(user => MapUserInfoViewModel(user, departmentDict, jobPositionDict)) + .ToList(); } private async Task> GetAnnouncementsAsync() @@ -153,11 +202,7 @@ public class IntranetAppService : PlatformAppService, IIntranetAppService var announcements = await _announcementRepository.GetListAsync(); var announcementDtos = new List(); - var allDepartments = await _departmentRepository.GetListAsync(); - var departmentDict = allDepartments.ToDictionary(d => d.Id, d => d.Name); - - var allJobPositions = await _jobPositionRepository.GetListAsync(); - var jobPositionDict = allJobPositions.ToDictionary(j => j.Id, j => j); + var (departmentDict, jobPositionDict) = await GetUserLookupDictionariesAsync(); foreach (var announcement in announcements) { @@ -166,33 +211,7 @@ public class IntranetAppService : PlatformAppService, IIntranetAppService var user = await _identityUserRepository.FindAsync(announcement.UserId ?? Guid.Empty); if (user != null) { - var userVm = ObjectMapper.Map(user); - - userVm.BirthDate = user.GetBirthDate(); - userVm.WorkHour = user.GetWorkHour(); - userVm.Nationality = user.GetNationality(); - - var deptId = user.GetDepartmentId(); - if (deptId != Guid.Empty && departmentDict.TryGetValue(deptId, out var deptName)) - { - userVm.DepartmentId = deptId; - userVm.Departments = - [ - new AssignedDepartmentViewModel { Id = deptId, Name = deptName, IsAssigned = true } - ]; - } - - var jobPosId = user.GetJobPositionId(); - if (jobPosId != Guid.Empty && jobPositionDict.TryGetValue(jobPosId, out var jobPosition)) - { - userVm.JobPositionId = jobPosId; - userVm.JobPositions = - [ - new AssignedJobPoisitionViewModel { Id = jobPosId, Name = jobPosition.Name, DepartmentId = jobPosition.DepartmentId, IsAssigned = true } - ]; - } - - dto.User = userVm; + dto.User = MapUserInfoViewModel(user, departmentDict, jobPositionDict); } announcementDtos.Add(dto); @@ -264,44 +283,12 @@ public class IntranetAppService : PlatformAppService, IIntranetAppService if (userIds.Count > 0) { - var allDepartments = await _departmentRepository.GetListAsync(); - var departmentDict = allDepartments.ToDictionary(d => d.Id, d => d.Name); - - var allJobPositions = await _jobPositionRepository.GetListAsync(); - var jobPositionDict = allJobPositions.ToDictionary(j => j.Id, j => j); + var (departmentDict, jobPositionDict) = await GetUserLookupDictionariesAsync(); var users = await _identityUserRepository.GetListAsync(); var userMap = users .Where(u => userIds.Contains(u.Id)) - .ToDictionary(u => u.Id, u => - { - var vm = ObjectMapper.Map(u); - vm.BirthDate = u.GetBirthDate(); - vm.WorkHour = u.GetWorkHour(); - vm.Nationality = u.GetNationality(); - - var deptId = u.GetDepartmentId(); - if (deptId != Guid.Empty && departmentDict.TryGetValue(deptId, out var deptName)) - { - vm.DepartmentId = deptId; - vm.Departments = - [ - new AssignedDepartmentViewModel { Id = deptId, Name = deptName, IsAssigned = true } - ]; - } - - var jobPosId = u.GetJobPositionId(); - if (jobPosId != Guid.Empty && jobPositionDict.TryGetValue(jobPosId, out var jobPosition)) - { - vm.JobPositionId = jobPosId; - vm.JobPositions = - [ - new AssignedJobPoisitionViewModel { Id = jobPosId, Name = jobPosition.Name, DepartmentId = jobPosition.DepartmentId, IsAssigned = true } - ]; - } - - return vm; - }); + .ToDictionary(u => u.Id, u => MapUserInfoViewModel(u, departmentDict, jobPositionDict)); foreach (var dto in dtos) { @@ -560,7 +547,10 @@ public class IntranetAppService : PlatformAppService, IIntranetAppService { var user = await _identityUserRepository.FindAsync(CurrentUser.Id.Value); if (user != null) - dto.User = ObjectMapper.Map(user); + { + var (departmentDict, jobPositionDict) = await GetUserLookupDictionariesAsync(); + dto.User = MapUserInfoViewModel(user, departmentDict, jobPositionDict); + } } await EnrichPollOptionsAsync([dto]); @@ -623,28 +613,11 @@ public class IntranetAppService : PlatformAppService, IIntranetAppService if (userIds.Count > 0) { - var allDepartments = await _departmentRepository.GetListAsync(); - var departmentDict = allDepartments.ToDictionary(d => d.Id, d => d.Name); - var allJobPositions = await _jobPositionRepository.GetListAsync(); - var jobPositionDict = allJobPositions.ToDictionary(j => j.Id, j => j); + var (departmentDict, jobPositionDict) = await GetUserLookupDictionariesAsync(); var users = await _identityUserRepository.GetListAsync(); - var userMap = users.Where(u => userIds.Contains(u.Id)).ToDictionary(u => u.Id, u => - { - var vm = ObjectMapper.Map(u); - var deptId = u.GetDepartmentId(); - if (deptId != Guid.Empty && departmentDict.TryGetValue(deptId, out var deptName)) - { - vm.DepartmentId = deptId; - vm.Departments = [new AssignedDepartmentViewModel { Id = deptId, Name = deptName, IsAssigned = true }]; - } - var jobPosId = u.GetJobPositionId(); - if (jobPosId != Guid.Empty && jobPositionDict.TryGetValue(jobPosId, out var jobPosition)) - { - vm.JobPositionId = jobPosId; - vm.JobPositions = [new AssignedJobPoisitionViewModel { Id = jobPosId, Name = jobPosition.Name, DepartmentId = jobPosition.DepartmentId, IsAssigned = true }]; - } - return vm; - }); + var userMap = users + .Where(u => userIds.Contains(u.Id)) + .ToDictionary(u => u.Id, u => MapUserInfoViewModel(u, departmentDict, jobPositionDict)); if (dto.UserId.HasValue && userMap.TryGetValue(dto.UserId.Value, out var postUser)) dto.User = postUser; @@ -681,7 +654,10 @@ public class IntranetAppService : PlatformAppService, IIntranetAppService { var user = await _identityUserRepository.FindAsync(CurrentUser.Id.Value); if (user != null) - dto.User = ObjectMapper.Map(user); + { + var (departmentDict, jobPositionDict) = await GetUserLookupDictionariesAsync(); + dto.User = MapUserInfoViewModel(user, departmentDict, jobPositionDict); + } } return dto; diff --git a/api/src/Sozsoft.Platform.DbMigrator/Seeds/ListFormSeeder_Administration.cs b/api/src/Sozsoft.Platform.DbMigrator/Seeds/ListFormSeeder_Administration.cs index 7baf592..627f581 100644 --- a/api/src/Sozsoft.Platform.DbMigrator/Seeds/ListFormSeeder_Administration.cs +++ b/api/src/Sozsoft.Platform.DbMigrator/Seeds/ListFormSeeder_Administration.cs @@ -4162,7 +4162,7 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.Event)), DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson(), PagerOptionJson = DefaultPagerOptionJson, - EditingOptionJson = DefaultEditingOptionJson(listFormName, 750, 400, true, true, true, true, false), + EditingOptionJson = DefaultEditingOptionJson(listFormName, 750, 500, true, true, true, true, false), EditingFormJson = JsonSerializer.Serialize(new List() { new() { @@ -4170,18 +4170,17 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep [ new EditingFormItemDto { Order = 1, DataField = "CategoryId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, new EditingFormItemDto { Order = 2, DataField = "TypeId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, - new EditingFormItemDto { Order = 3, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 4, DataField = "Place", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 5, DataField = "UserId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, - new EditingFormItemDto { Order = 7, DataField = "Status", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, - new EditingFormItemDto { Order = 6, DataField = "Description", ColSpan = 2, EditorType2 = EditorTypes.dxTextArea }, - new EditingFormItemDto { Order = 8, DataField = "ParticipantsCount", ColSpan = 1, EditorType2 = EditorTypes.dxNumberBox }, - new EditingFormItemDto { Order = 9, DataField = "Likes", ColSpan = 1, EditorType2 = EditorTypes.dxNumberBox }, + new EditingFormItemDto { Order = 3, DataField = "Date", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxDateBox }, + new EditingFormItemDto { Order = 4, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 5, DataField = "Place", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 6, DataField = "UserId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, + new EditingFormItemDto { Order = 7, DataField = "Description", ColSpan = 2, EditorType2 = EditorTypes.dxTextArea }, + new EditingFormItemDto { Order = 8, DataField = "Status", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, ]} }), InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson(), FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { - new() { FieldName = "Status", FieldDbType = DbType.String, Value = "Aktif", CustomValueType = FieldCustomValueTypeEnum.Value }, + new() { FieldName = "Status", FieldDbType = DbType.String, Value = "draft", CustomValueType = FieldCustomValueTypeEnum.Value }, }), } ); @@ -4243,6 +4242,24 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep PermissionJson = DefaultFieldPermissionJson(listForm.Name), PivotSettingsJson = DefaultPivotSettingsJson }, + //Date + new() + { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Date, + FieldName = "Date", + CaptionName = "App.Listform.ListformField.Date", + Width = 100, + ListOrderNo = 4, + Visible = true, + IsActive = true, + AllowSearch = true, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, // Name new() { @@ -4252,7 +4269,7 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep FieldName = "Name", CaptionName = "App.Listform.ListformField.Name", Width = 200, - ListOrderNo = 4, + ListOrderNo = 5, Visible = true, IsActive = true, SortIndex = 1, @@ -4272,7 +4289,7 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep FieldName = "Place", CaptionName = "App.Listform.ListformField.Place", Width = 200, - ListOrderNo = 5, + ListOrderNo = 6, Visible = true, IsActive = true, ColumnCustomizationJson = DefaultColumnCustomizationJson, @@ -4288,7 +4305,7 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep FieldName = "Description", CaptionName = "App.Listform.ListformField.Description", Width = 500, - ListOrderNo = 6, + ListOrderNo = 7, Visible = true, IsActive = true, ColumnCustomizationJson = DefaultColumnCustomizationJson, @@ -4304,7 +4321,7 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep FieldName = "UserId", CaptionName = "App.Listform.ListformField.UserId", Width = 150, - ListOrderNo = 7, + ListOrderNo = 8, Visible = true, IsActive = true, LookupJson = JsonSerializer.Serialize(new LookupDto { @@ -4326,7 +4343,8 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep FieldName = "ParticipantsCount", CaptionName = "App.Listform.ListformField.ParticipantsCount", Width = 80, - ListOrderNo = 8, + Alignment = "right", + ListOrderNo = 9, Visible = true, IsActive = true, ColumnCustomizationJson = DefaultColumnCustomizationJson, @@ -4342,7 +4360,8 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep FieldName = "Likes", CaptionName = "App.Listform.ListformField.Likes", Width = 80, - ListOrderNo = 9, + Alignment = "right", + ListOrderNo = 10, Visible = true, IsActive = true, ColumnCustomizationJson = DefaultColumnCustomizationJson, @@ -4358,7 +4377,7 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep FieldName = "Status", CaptionName = "App.Listform.ListformField.Status", Width = 120, - ListOrderNo = 10, + ListOrderNo = 11, Visible = true, IsActive = true, LookupJson = JsonSerializer.Serialize(new LookupDto { @@ -4366,9 +4385,9 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep DisplayExpr = "name", ValueExpr = "key", LookupQuery = JsonSerializer.Serialize(new LookupDataDto[] { - new () { Key="Published",Name="Yayımlandı" }, - new () { Key="Draft",Name="Taslak" }, - new () { Key="Cancelled",Name="İptal" }, + new () { Key="published",Name="Yayımlandı" }, + new () { Key="draft",Name="Taslak" }, + new () { Key="cancelled",Name="İptal" }, }), }), ColumnCustomizationJson = DefaultColumnCustomizationJson, diff --git a/api/src/Sozsoft.Platform.Domain/Entities/Tenant/Intranet/Event.cs b/api/src/Sozsoft.Platform.Domain/Entities/Tenant/Intranet/Event.cs index bdffc56..3a3550f 100644 --- a/api/src/Sozsoft.Platform.Domain/Entities/Tenant/Intranet/Event.cs +++ b/api/src/Sozsoft.Platform.Domain/Entities/Tenant/Intranet/Event.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using Volo.Abp.Domain.Entities.Auditing; using Volo.Abp.MultiTenancy; @@ -27,10 +26,6 @@ public class Event : FullAuditedEntity, IMultiTenant public int Likes { get; set; } public bool isPublished { get; set; } = false; - // public ICollection Participants { get; set; } = []; - public ICollection Photos { get; set; } = []; - public ICollection Comments { get; set; } = []; - Guid? IMultiTenant.TenantId => TenantId; } diff --git a/api/src/Sozsoft.Platform.Domain/Entities/Tenant/Intranet/EventComment.cs b/api/src/Sozsoft.Platform.Domain/Entities/Tenant/Intranet/EventComment.cs deleted file mode 100644 index c7f22dc..0000000 --- a/api/src/Sozsoft.Platform.Domain/Entities/Tenant/Intranet/EventComment.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using Volo.Abp.Domain.Entities.Auditing; -using Volo.Abp.MultiTenancy; - -namespace Sozsoft.Platform.Entities; - -public class EventComment : FullAuditedEntity, IMultiTenant -{ - public Guid? TenantId { get; set; } - - public Guid EventId { get; set; } - public Guid? UserId { get; set; } - public string Content { get; set; } - public int Likes { get; set; } - - public Event Event { get; set; } - - Guid? IMultiTenant.TenantId => TenantId; -} diff --git a/api/src/Sozsoft.Platform.Domain/Entities/Tenant/Intranet/EventPhoto.cs b/api/src/Sozsoft.Platform.Domain/Entities/Tenant/Intranet/EventPhoto.cs deleted file mode 100644 index 5d0924f..0000000 --- a/api/src/Sozsoft.Platform.Domain/Entities/Tenant/Intranet/EventPhoto.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using Volo.Abp.Domain.Entities.Auditing; -using Volo.Abp.MultiTenancy; - -namespace Sozsoft.Platform.Entities; - -public class EventPhoto : FullAuditedEntity, IMultiTenant -{ - public Guid? TenantId { get; set; } - - public Guid EventId { get; set; } - public string Url { get; set; } - - public Event Event { get; set; } - - Guid? IMultiTenant.TenantId => TenantId; -} diff --git a/api/src/Sozsoft.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs b/api/src/Sozsoft.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs index d6fece3..f6ec41f 100644 --- a/api/src/Sozsoft.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs +++ b/api/src/Sozsoft.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs @@ -113,8 +113,6 @@ public class PlatformDbContext : public DbSet Events { get; set; } public DbSet EventCategories { get; set; } public DbSet EventTypes { get; set; } - public DbSet EventPhotos { get; set; } - public DbSet EventComments { get; set; } public DbSet Announcements { get; set; } @@ -1251,34 +1249,5 @@ public class PlatformDbContext : .HasForeignKey(x => x.TypeId) .OnDelete(DeleteBehavior.Restrict); }); - - builder.Entity(b => - { - b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.EventPhoto)), Prefix.DbSchema); - b.ConfigureByConvention(); - - b.Property(x => x.Url).HasMaxLength(512); - - // Event -> EventPhoto (1 - N) - b.HasOne(x => x.Event) - .WithMany(x => x.Photos) - .HasForeignKey(x => x.EventId) - .OnDelete(DeleteBehavior.Cascade); - }); - - builder.Entity(b => - { - b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.EventComment)), Prefix.DbSchema); - b.ConfigureByConvention(); - - b.Property(x => x.Content).HasMaxLength(512); - b.Property(x => x.Likes).HasDefaultValue(0); - - // Event -> EventComment (1 - N) - b.HasOne(x => x.Event) - .WithMany(x => x.Comments) - .HasForeignKey(x => x.EventId) - .OnDelete(DeleteBehavior.Cascade); - }); } } diff --git a/api/src/Sozsoft.Platform.EntityFrameworkCore/Seeds/TenantData.json b/api/src/Sozsoft.Platform.EntityFrameworkCore/Seeds/TenantData.json index 717556a..3c4d3ef 100644 --- a/api/src/Sozsoft.Platform.EntityFrameworkCore/Seeds/TenantData.json +++ b/api/src/Sozsoft.Platform.EntityFrameworkCore/Seeds/TenantData.json @@ -1857,45 +1857,45 @@ { "CategoryName": "Spor", "TypeName": "Futbol Turnuvası", - "Date": "2025-11-05T10:00:00", - "Name": "Yaz Futbol Turnuvası 2025", + "Date": "2026-11-05T10:00:00", + "Name": "Yaz Futbol Turnuvası 2026", "Description": "Tüm departmanların katılımıyla düzenlenen geleneksel yaz futbol turnuvası.", "Place": "Şirket Kampüsü Spor Alanı", - "Status": "Published", + "Status": "published", "UserName": "system@sozsoft.com", "ParticipantsCount": 64, "IsPublished": true, - "Likes": 120, + "Likes": 0, "Photos": [], "Comments": [] }, { "CategoryName": "Kültür", "TypeName": "Kültürel Sanat Günü", - "Date": "2025-11-01T10:00:00", + "Date": "2026-11-01T10:00:00", "Name": "Kültür Gezisi: Kapadokya", "Description": "Çalışanlarımıza özel, rehber eşliğinde 2 günlük kültürel gezi.", "Place": "Kapadokya, Nevşehir", - "Status": "Published", + "Status": "published", "UserName": "system@sozsoft.com", "ParticipantsCount": 25, "IsPublished": true, - "Likes": 45, + "Likes": 0, "Photos": [], "Comments": [] }, { "CategoryName": "Müzik", "TypeName": "Caz Akşamı", - "Date": "2025-11-09T10:00:00", + "Date": "2026-11-09T10:00:00", "Name": "Müzik Dinletisi: Jazz Akşamı", "Description": "Caz müziğinin en güzel örneklerinin canlı performanslarla sunulacağı özel akşam.", "Place": "Şirket Konferans Salonu", - "Status": "Published", + "Status": "published", "UserName": "system@sozsoft.com", "ParticipantsCount": 40, "IsPublished": true, - "Likes": 85, + "Likes": 0, "Photos": [], "Comments": [] } diff --git a/api/src/Sozsoft.Platform.EntityFrameworkCore/Seeds/TenantDataSeeder.cs b/api/src/Sozsoft.Platform.EntityFrameworkCore/Seeds/TenantDataSeeder.cs index c4c6904..96b095e 100644 --- a/api/src/Sozsoft.Platform.EntityFrameworkCore/Seeds/TenantDataSeeder.cs +++ b/api/src/Sozsoft.Platform.EntityFrameworkCore/Seeds/TenantDataSeeder.cs @@ -459,8 +459,6 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency private readonly IRepository _eventTypeRepository; private readonly IRepository _eventCategoryRepository; private readonly IRepository _eventRepository; - private readonly IRepository _eventCommentRepository; - private readonly IRepository _eventPhotoRepository; private readonly ICurrentTenant _currentTenant; @@ -507,8 +505,6 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency IRepository eventTypeRepository, IRepository eventCategoryRepository, IRepository eventRepository, - IRepository eventPhotoRepository, - IRepository eventCommentRepository, OrganizationUnitManager organizationUnitManager, ICurrentTenant currentTenant @@ -555,8 +551,6 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency _eventTypeRepository = eventTypeRepository; _eventCategoryRepository = eventCategoryRepository; _eventRepository = eventRepository; - _eventCommentRepository = eventCommentRepository; - _eventPhotoRepository = eventPhotoRepository; _organizationUnitManager = organizationUnitManager; _currentTenant = currentTenant; } @@ -1226,43 +1220,6 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency } } - foreach (var item in items.EventPhotos) - { - var exists = await _eventPhotoRepository.AnyAsync(x => x.Url == item.Url); - if (!exists) - { - var eventEntity = await _eventRepository.FirstOrDefaultAsync(x => x.Name == item.EventName); - - await _eventPhotoRepository.InsertAsync(new EventPhoto - { - EventId = eventEntity.Id, - Url = item.Url - }); - } - } - - foreach (var item in items.EventComments) - { - var eventEntity = await _eventRepository.FirstOrDefaultAsync(x => x.Name == item.EventName); - - if (eventEntity == null) - continue; - - var exists = await _eventCommentRepository.AnyAsync(x => x.Content == item.Content); - if (!exists) - { - var user = await _repositoryUser.FindByNormalizedUserNameAsync(item.UserName); - - await _eventCommentRepository.InsertAsync(new EventComment - { - EventId = eventEntity.Id, - Content = item.Content, - UserId = user != null ? user.Id : null, - Likes = item.Likes - }); - } - } - //admin kullanının departmen ve pozisyonunu default olarak belirliyoruz var adminUser = await _repositoryUser.FindByNormalizedEmailAsync(PlatformConsts.AbpIdentity.User.AdminEmailDefaultValue); if (adminUser != null) diff --git a/ui/public/version.json b/ui/public/version.json index 161aecb..864fa9e 100644 --- a/ui/public/version.json +++ b/ui/public/version.json @@ -1,6 +1,28 @@ { - "commit": "ea3e847", + "commit": "ab656ba", "releases": [ + { + "version": "1.0.7", + "buildDate": "2026-05-04", + "commit": "4444fce93b4f62ad6698099fefe7da1614d2859c", + "changeLog": [ + "- Departman tanımlama", + "- Job Position tanımlama", + "- Wizard ve SQl Data güncellemeleri", + "- Organizasyon Şemanı eklendi" + ] + }, + { + "version": "1.0.6", + "buildDate": "2026-05-03", + "commit": "b2dfb04879a93709b04f8f0fc3bd4f5af1f7c01b", + "changeLog": [ + "- SalesOrder ve SalesOrderItem listFormu tanımlandı.", + "- Sql Backup dosyalarını File Manager içerisinde görüntülenebiliyor.", + "- Wizard File Manager komponenti oluşturuldu.", + "- Wizard komponentini Edit özelliği eklendi." + ] + }, { "version": "1.0.5", "buildDate": "2026-04-28", diff --git a/ui/src/proxy/intranet/models.ts b/ui/src/proxy/intranet/models.ts index 09ca10e..776fefc 100644 --- a/ui/src/proxy/intranet/models.ts +++ b/ui/src/proxy/intranet/models.ts @@ -11,6 +11,7 @@ export interface IntranetDashboardDto { // Etkinlik export interface EventDto { + tenantId?: string | null id: string categoryName: string typeName: string @@ -18,12 +19,12 @@ export interface EventDto { name: string description: string place: string - organizer: UserInfoViewModel - participants: number - photos: string[] - comments: EventCommentDto[] + user: UserInfoViewModel + participantsCount: number likes: number isPublished: boolean + photos: string[] + comments: EventCommentDto[] } export interface EventCommentDto { diff --git a/ui/src/views/admin/activityLog/components/Event.tsx b/ui/src/views/admin/activityLog/components/Event.tsx index 5129cbe..f271ed0 100644 --- a/ui/src/views/admin/activityLog/components/Event.tsx +++ b/ui/src/views/admin/activityLog/components/Event.tsx @@ -10,27 +10,6 @@ type EventProps = { compact?: boolean } -const ticketStatus: Record< - number, - { - label: string - bgClass: string - textClass: string - } -> = { - 0: { - label: 'Completed', - bgClass: 'bg-emerald-500', - textClass: 'text-emerald-500', - }, - 1: { label: 'In Dev', bgClass: 'bg-blue-500', textClass: 'text-blue-500' }, - 2: { - label: 'Ready to test', - bgClass: 'bg-amber-500', - textClass: 'text-amber-500', - }, -} - const HighlightedText = ({ children, className }: CommonProps) => { return ( diff --git a/ui/src/views/intranet/widgets/UpcomingEvents.tsx b/ui/src/views/intranet/widgets/UpcomingEvents.tsx index 88ab055..b63e065 100644 --- a/ui/src/views/intranet/widgets/UpcomingEvents.tsx +++ b/ui/src/views/intranet/widgets/UpcomingEvents.tsx @@ -8,14 +8,12 @@ import { useLocalization } from '@/utils/hooks/useLocalization' const UpcomingEvents: React.FC<{ events: EventDto[] }> = ({ events }) => { const currentLocale = useLocale() - const { translate } = useLocalization(); - - const upcomingEvents = events.filter( - (event) => - event.isPublished && - dayjs(event.date).isAfter(dayjs()) && - dayjs(event.date).isBefore(dayjs().add(7, 'day')), - ) + const { translate } = useLocalization() + + const now = dayjs() + const upcomingEvents = events + .filter((event) => event.isPublished && !dayjs(event.date).isBefore(now, 'day')) + .sort((left, right) => dayjs(left.date).valueOf() - dayjs(right.date).valueOf()) return (
diff --git a/ui/tsconfig.json b/ui/tsconfig.json index 4b9ebcb..d3ab6d0 100644 --- a/ui/tsconfig.json +++ b/ui/tsconfig.json @@ -6,11 +6,12 @@ "allowJs": false, "skipLibCheck": true, "esModuleInterop": false, + "ignoreDeprecations": "6.0", "allowSyntheticDefaultImports": true, "strict": true, "forceConsistentCasingInFileNames": false, "module": "ESNext", - "moduleResolution": "Node", + "moduleResolution": "Bundler", "resolveJsonModule": true, "isolatedModules": true, "noEmit": true, @@ -23,21 +24,3 @@ "exclude": ["node_modules"], "references": [{ "path": "./tsconfig.node.json" }] } - -// { -// "compilerOptions": { -// /* Bundler mode */ -// "moduleResolution": "bundler", -// "allowImportingTsExtensions": true, -// "resolveJsonModule": true, -// "isolatedModules": true, -// "noEmit": true, -// "jsx": "react-jsx", - -// /* Linting */ -// "strict": true, -// "noUnusedLocals": true, -// "noUnusedParameters": true, -// "noFallthroughCasesInSwitch": true -// }, -// } diff --git a/ui/tsconfig.node.json b/ui/tsconfig.node.json index 8ab962c..a75bba1 100644 --- a/ui/tsconfig.node.json +++ b/ui/tsconfig.node.json @@ -3,7 +3,8 @@ "composite": true, "skipLibCheck": true, "module": "ESNext", - "moduleResolution": "Node", + "moduleResolution": "Bundler", + "ignoreDeprecations": "6.0", "allowSyntheticDefaultImports": true }, "include": ["vite.config.ts", "./src/services/tenants.ts"]