From 76091c0518598e21b7d8d2faa57095d6954a7411 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sedat=20=C3=96ZT=C3=9CRK?= <76204082+iamsedatozturk@users.noreply.github.com> Date: Fri, 4 Sep 2026 17:27:55 +0300 Subject: [PATCH] seed/data Seeder SocialPost --- .../lowcode-reference.instructions.md | 2 +- .../Migrations/LanguagesData.json | 94 +++- .../ListFormSeeder_Administration.cs | 430 ++++++++++++++++++ .../Migrations/PermissionsData.json | 108 +++++ .../Migrations/WizardDataSeeder.cs | 2 +- .../Data/SeedConsts.cs | 2 + .../Seeds/TenantData.json | 297 +++--------- .../Seeds/TenantDataSeeder.cs | 168 +------ .../host/data/App.Intranet.SocialComment.json | 56 +++ .../host/data/App.Intranet.SocialLike.json | 18 + .../host/data/App.Intranet.SocialMedia.json | 48 ++ .../data/App.Intranet.SocialPollOption.json | 32 ++ .../host/data/App.Intranet.SocialPost.json | 56 +++ ui/src/utils/validation.ts | 10 + .../edit/form-fields/FormFieldTabOptions.tsx | 21 +- 15 files changed, 931 insertions(+), 413 deletions(-) create mode 100644 configs/seeds/host/data/App.Intranet.SocialComment.json create mode 100644 configs/seeds/host/data/App.Intranet.SocialLike.json create mode 100644 configs/seeds/host/data/App.Intranet.SocialMedia.json create mode 100644 configs/seeds/host/data/App.Intranet.SocialPollOption.json create mode 100644 configs/seeds/host/data/App.Intranet.SocialPost.json create mode 100644 ui/src/utils/validation.ts diff --git a/.github/instructions/lowcode-reference.instructions.md b/.github/instructions/lowcode-reference.instructions.md index 33a515e4..5084239d 100644 --- a/.github/instructions/lowcode-reference.instructions.md +++ b/.github/instructions/lowcode-reference.instructions.md @@ -1210,7 +1210,7 @@ Kök menü `App.Administration`. Bu menünün tabloları `Adm_T_*` — yani **ki | **Settings** | `App.Setting` · `/admin/settings` | — | `SettingDefinition` kayıtlarından üretilen ayar ekranı; değerler burada girilir. | | **Intranet › Announcement (+Like/Comment)** | `App.Intranet.Announcement` | `Adm_T_Announcement` · `Adm_T_AnnouncementLike` · `Adm_T_AnnouncementComment` | Duyuru + beğeni + yorum: **ana kayıt / alt etkileşim** kalıbının hazır örneği. | | **Intranet › Survey (+Question/Option/Response/Answer)** | `App.Intranet.Survey` | `Adm_T_Survey` · `Adm_T_SurveyQuestion` · `Adm_T_SurveyQuestionOption` · `Adm_T_SurveyResponse` · `Adm_T_SurveyAnswer` | Anket motoru; soru–seçenek–yanıt zinciri **iki seviyeli alt form** ihtiyacının referansıdır. | -| **Intranet › Social Post (+Comment/Like)** | `App.Intranet.SocialPost` | `Adm_T_SocialPost` · `Adm_T_SocialComment` · `Adm_T_SocialLike` (+ `SocialPollOption`, `SocialMedia`, `SocialLocation`) | Kurum içi akış; `IsLiked`, `IsOwnPost` gibi hesaplanmış kolonların view içinde üretilmesine örnek. | +| **Intranet › Social Post (+Comment/Like)** | `App.Intranet.SocialPost` | `Adm_T_SocialPost` · `Adm_T_SocialComment` · `Adm_T_SocialLike` (+ `SocialPollOption`, `SocialMedia`, `SocialLocation`) | Kurum içi akış; `IsLiked`, `IsOwnPost` gibi hesaplanmış kolonların view içinde üretilmesine örnek. Alt formlar: `App.Intranet.SocialMedia`, `SocialComment`, `SocialLike` (`Id` → `SocialPostId`); anket seçenekleri (`App.Intranet.SocialPollOption`) medyaya bağlı olduğu için `SocialMedia` ekranının alt formudur (`Id` → `SocialMediaId`). | | **Intranet › Event Type / Category / Event (+Like/Comment)** | `App.Intranet.Events.*` | `Adm_T_EventType` · `Adm_T_EventCategory` · `Adm_T_Event` · `Adm_T_EventPhoto` · `Adm_T_EventLike` · `Adm_T_EventComment` | Etkinlik yönetimi; foto ve katılımcı sayacı olan kayıt kalıbı. `EventComment` menüde Intranet altında (Documents'ın üstünde), `EventPhoto` menüde yer almaz; ikisinin yetkisi de `App.Intranet.Events.Event` altındadır. `Adm_T_EventPhoto` tablosu `configs/seeds/host/sql/object/Adm_T_EventPhoto.sql` ile oluşturulur. | | **Restrictions › Work Hour** | `App.Restrictions.WorkHour` | `Adm_T_WorkHour` | Gün bazlı çalışma saati (`Monday`…`Sunday`, `StartTime`, `EndTime`); kullanıcıya `AbpUsers.WorkHour` ile bağlanır. "Sadece mesai saatinde girilebilsin" burada çözülür. | | **Restrictions › IP Restrictions** | `App.Restrictions.IpRestrictions` | `Adm_T_IpRestriction` | `ResourceType` + `ResourceId` + `IP` — kullanıcı/rol bazlı IP kısıtı. | diff --git a/api/src/Sozsoft.Platform.DbMigrator/Migrations/LanguagesData.json b/api/src/Sozsoft.Platform.DbMigrator/Migrations/LanguagesData.json index 88518e32..75bd8f44 100644 --- a/api/src/Sozsoft.Platform.DbMigrator/Migrations/LanguagesData.json +++ b/api/src/Sozsoft.Platform.DbMigrator/Migrations/LanguagesData.json @@ -6606,6 +6606,96 @@ "tr": "Yorumlar", "en": "Comments" }, + { + "resourceName": "Platform", + "key": "App.Intranet.SocialMedia", + "en": "Medias", + "tr": "Medyalar" + }, + { + "resourceName": "Platform", + "key": "App.Intranet.SocialMedia.Description", + "en": "Social post media", + "tr": "Gönderi medyası" + }, + { + "resourceName": "Platform", + "key": "App.Intranet.SocialPollOption", + "en": "Poll Options", + "tr": "Anket Seçenekleri" + }, + { + "resourceName": "Platform", + "key": "App.Intranet.SocialPollOption.Description", + "en": "Social post poll options", + "tr": "Gönderi anket seçenekleri" + }, + { + "resourceName": "Platform", + "key": "App.Listform.ListformField.SocialPost", + "en": "Post", + "tr": "Gönderi" + }, + { + "resourceName": "Platform", + "key": "App.Listform.ListformField.SocialMedia", + "en": "Media", + "tr": "Medya" + }, + { + "resourceName": "Platform", + "key": "App.Listform.ListformField.Urls", + "en": "Urls", + "tr": "Bağlantılar" + }, + { + "resourceName": "Platform", + "key": "App.Listform.ListformField.PollQuestion", + "en": "Poll Question", + "tr": "Anket Sorusu" + }, + { + "resourceName": "Platform", + "key": "App.Listform.ListformField.PollTotalVotes", + "en": "Total Votes", + "tr": "Toplam Oy" + }, + { + "resourceName": "Platform", + "key": "App.Listform.ListformField.PollEndsAt", + "en": "Poll Ends At", + "tr": "Anket Bitişi" + }, + { + "resourceName": "Platform", + "key": "App.Listform.ListformField.PollUserVoteId", + "en": "User Vote", + "tr": "Kullanıcı Oyu" + }, + { + "resourceName": "Platform", + "key": "App.Listform.ListformField.Votes", + "en": "Votes", + "tr": "Oy" + }, + { + "resourceName": "Platform", + "key": "App.StaticLookup.Image", + "en": "Image", + "tr": "Görsel" + }, + { + "resourceName": "Platform", + "key": "App.StaticLookup.Video", + "en": "Video", + "tr": "Video" + }, + { + "resourceName": "Platform", + "key": "App.StaticLookup.Poll", + "en": "Poll", + "tr": "Anket" + }, { "resourceName": "Platform", "key": "App.Intranet.SurveyQuestion", @@ -6645,8 +6735,8 @@ { "resourceName": "Platform", "key": "App.Events.Comments", - "tr": "Yorumlar", - "en": "Comments" + "tr": "Etkinlik Yorumları", + "en": "Event Comments" }, { "resourceName": "Platform", diff --git a/api/src/Sozsoft.Platform.DbMigrator/Migrations/ListFormSeeder_Administration.cs b/api/src/Sozsoft.Platform.DbMigrator/Migrations/ListFormSeeder_Administration.cs index 98387c0c..4c36a869 100644 --- a/api/src/Sozsoft.Platform.DbMigrator/Migrations/ListFormSeeder_Administration.cs +++ b/api/src/Sozsoft.Platform.DbMigrator/Migrations/ListFormSeeder_Administration.cs @@ -4323,6 +4323,10 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep Description = $"{listFormName}.Description", SelectCommandType = SelectCommandTypeEnum.Table, SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.SocialPost)), + SeedFilePath = SeedPathResolver.GetDataFilePath(listFormName), + SeedSyncInsert = false, + SeedSyncUpdate = false, + SeedSyncDelete = false, KeyFieldName = "Id", KeyFieldDbSourceType = DbType.Guid, DefaultFilter = DefaultFilterJson, @@ -4363,6 +4367,18 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep } } }, + new { + TabType = ListFormTabTypeEnum.List, + TabTitle = AppCodes.Intranet.SocialMedia, + Code = AppCodes.Intranet.SocialMedia, + Relation = new List() { + new { + ParentFieldName = "Id", + DbType = DbType.Guid, + ChildFieldName = "SocialPostId" + } + } + }, new { TabType = ListFormTabTypeEnum.List, TabTitle = AppCodes.Intranet.SocialLike, @@ -4507,6 +4523,387 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep } #endregion + #region SocialMedia + listFormName = AppCodes.Intranet.SocialMedia; + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName)) + { + var listForm = await _listFormRepository.InsertAsync( + new ListForm + { + ListFormType = ListFormTypeEnum.List, + PageSize = 10, + ExportJson = DefaultExportJson, + IsSubForm = true, + ShowNote = false, + LayoutJson = DefaultLayoutJson(), + CultureName = LanguageCodes.En, + ListFormCode = listFormName, + Name = listFormName, + Title = listFormName, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = true, + IsBranch = false, + IsOrganizationUnit = false, + Description = $"{listFormName}.Description", + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.SocialMedia)), + SeedFilePath = SeedPathResolver.GetDataFilePath(listFormName), + SeedSyncInsert = false, + SeedSyncUpdate = false, + SeedSyncDelete = false, + KeyFieldName = "Id", + KeyFieldDbSourceType = DbType.Guid, + DefaultFilter = DefaultFilterJson, + SortMode = GridOptions.SortModeSingle, + FilterRowJson = DefaultFilterRowJson(), + HeaderFilterJson = DefaultHeaderFilterJson(), + SearchPanelJson = DefaultSearchPanelJson(), + GroupPanelJson = DefaultGroupPanelJson(), + SelectionJson = DefaultSelectionSingleJson, + ColumnOptionJson = DefaultColumnOptionJson(), + PermissionJson = DefaultPermissionJson(listFormName), + DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.SocialMedia)), + DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson(), + PagerOptionJson = DefaultPagerOptionJson, + EditingOptionJson = DefaultEditingOptionJson(listFormName, 700, 550, true, true, true, true, false, true), + EditingFormJson = JsonSerializer.Serialize(new List + { + new() { Order = 1, ColCount = 2, ColSpan = 1, ItemType = "group" }, + }), + InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson(), + FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + new() { FieldName = "Type", FieldDbType = DbType.String, Value = "image", CustomValueType = FieldCustomValueTypeEnum.Value }, + new() { FieldName = "PollTotalVotes", FieldDbType = DbType.Int32, Value = "0", CustomValueType = FieldCustomValueTypeEnum.Value } + }), + SubFormsJson = JsonSerializer.Serialize(new List() { + new { + TabType = ListFormTabTypeEnum.List, + TabTitle = AppCodes.Intranet.SocialPollOption, + Code = AppCodes.Intranet.SocialPollOption, + Relation = new List() { + new { + ParentFieldName = "Id", + DbType = DbType.Guid, + ChildFieldName = "SocialMediaId" + } + } + } + }) + }); + + #region SocialMedia Fields + await _listFormFieldRepository.InsertManyAsync([ + new() + { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + CaptionName = "App.Listform.ListformField.Id", + Width = 0, + ListOrderNo = 1, + Visible = false, + IsActive = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson, + }, + new() + { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "SocialPostId", + EditGroupOrderNo = 1, + EditOrderNo = 1, + EditorType2 = EditorTypes.dxSelectBox, + ColSpan = 1, + EditorOptions = EditorOptions.ShowClearButton(), + CaptionName = "App.Listform.ListformField.SocialPost", + Width = 0, + ListOrderNo = 2, + Visible = false, + IsActive = true, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.SocialPost), "Id", "Content"), + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson, + }, + new() + { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Type", + EditGroupOrderNo = 1, + EditOrderNo = 2, + EditorType2 = EditorTypes.dxSelectBox, + ColSpan = 1, + EditorOptions = EditorOptions.ShowClearButton(), + CaptionName = "App.Listform.ListformField.Type", + Width = 0, + ListOrderNo = 3, + Visible = true, + IsActive = true, + AllowSearch = true, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + LookupJson = JsonSerializer.Serialize(new LookupDto + { + DataSourceType = UiLookupDataSourceTypeEnum.StaticData, + DisplayExpr = "name", + ValueExpr = "key", + LookupQuery = JsonSerializer.Serialize(new LookupDataDto[] { + new () { Key = "image", Name = "App.StaticLookup.Image" }, + new () { Key = "video", Name = "App.StaticLookup.Video" }, + new () { Key = "poll", Name = "App.StaticLookup.Poll" }, + }), + }), + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson, + }, + new() + { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "PollQuestion", + EditGroupOrderNo = 1, + EditOrderNo = 3, + EditorType2 = EditorTypes.dxTextBox, + ColSpan = 1, + CaptionName = "App.Listform.ListformField.PollQuestion", + Width = 0, + ListOrderNo = 4, + Visible = true, + IsActive = true, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson, + }, + new() + { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Int32, + FieldName = "PollTotalVotes", + EditGroupOrderNo = 1, + EditOrderNo = 4, + EditorType2 = EditorTypes.dxNumberBox, + ColSpan = 1, + CaptionName = "App.Listform.ListformField.PollTotalVotes", + Alignment = "right", + Width = 0, + ListOrderNo = 5, + Visible = true, + IsActive = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson, + }, + new() + { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.DateTime, + FieldName = "PollEndsAt", + EditGroupOrderNo = 1, + EditOrderNo = 5, + EditorType2 = EditorTypes.dxDateBox, + ColSpan = 1, + CaptionName = "App.Listform.ListformField.PollEndsAt", + Width = 0, + ListOrderNo = 6, + Visible = true, + IsActive = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson, + }, + new() + { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "PollUserVoteId", + EditGroupOrderNo = 1, + EditOrderNo = 6, + EditorType2 = EditorTypes.dxTextBox, + ColSpan = 1, + CaptionName = "App.Listform.ListformField.PollUserVoteId", + Width = 0, + ListOrderNo = 7, + Visible = false, + IsActive = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson, + }, + new() + { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Urls", + EditGroupOrderNo = 1, + EditOrderNo = 7, + EditorType2 = EditorTypes.dxTextArea, + ColSpan = 2, + CaptionName = "App.Listform.ListformField.Urls", + Width = 0, + ListOrderNo = 8, + Visible = true, + IsActive = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson, + }, + ]); + #endregion + } + #endregion + + #region SocialPollOption + listFormName = AppCodes.Intranet.SocialPollOption; + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName)) + { + var listForm = await _listFormRepository.InsertAsync( + new ListForm + { + ListFormType = ListFormTypeEnum.List, + PageSize = 10, + ExportJson = DefaultExportJson, + IsSubForm = true, + ShowNote = false, + LayoutJson = DefaultLayoutJson(), + CultureName = LanguageCodes.En, + ListFormCode = listFormName, + Name = listFormName, + Title = listFormName, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = true, + IsBranch = false, + IsOrganizationUnit = false, + Description = $"{listFormName}.Description", + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.SocialPollOption)), + SeedFilePath = SeedPathResolver.GetDataFilePath(listFormName), + SeedSyncInsert = false, + SeedSyncUpdate = false, + SeedSyncDelete = false, + KeyFieldName = "Id", + KeyFieldDbSourceType = DbType.Guid, + DefaultFilter = DefaultFilterJson, + SortMode = GridOptions.SortModeSingle, + FilterRowJson = DefaultFilterRowJson(), + HeaderFilterJson = DefaultHeaderFilterJson(), + SearchPanelJson = DefaultSearchPanelJson(), + GroupPanelJson = DefaultGroupPanelJson(), + SelectionJson = DefaultSelectionSingleJson, + ColumnOptionJson = DefaultColumnOptionJson(), + PermissionJson = DefaultPermissionJson(listFormName), + DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.SocialPollOption)), + DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson(), + PagerOptionJson = DefaultPagerOptionJson, + EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 320, true, true, true, true, false), + EditingFormJson = JsonSerializer.Serialize(new List + { + new() { Order = 1, ColCount = 1, ColSpan = 1, ItemType = "group" }, + }), + InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + new() { FieldName = "CreationTime", FieldDbType = DbType.DateTimeOffset, Value = "@NOW", CustomValueType = FieldCustomValueTypeEnum.CustomKey }, + new() { FieldName = "CreatorId", FieldDbType = DbType.Guid, Value = "@USERID", CustomValueType = FieldCustomValueTypeEnum.CustomKey }, + new() { FieldName = "Id", FieldDbType = DbType.Guid, Value = "@NEWID", CustomValueType = FieldCustomValueTypeEnum.CustomKey }, + new() { FieldName = "Votes", FieldDbType = DbType.Int32, Value = "0", CustomValueType = FieldCustomValueTypeEnum.Value } + }), + UpdateFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + new() { FieldName = "LastModifierId", FieldDbType = DbType.Guid, Value = "@USERID", CustomValueType = FieldCustomValueTypeEnum.CustomKey }, + new() { FieldName = "Id", FieldDbType = DbType.Guid, Value = "@ID", CustomValueType = FieldCustomValueTypeEnum.CustomKey } + }) + }); + + #region SocialPollOption Fields + await _listFormFieldRepository.InsertManyAsync([ + new() + { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + CaptionName = "App.Listform.ListformField.Id", + Width = 0, + ListOrderNo = 1, + Visible = false, + IsActive = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson, + }, + new() + { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "SocialMediaId", + CaptionName = "App.Listform.ListformField.SocialMedia", + Width = 0, + ListOrderNo = 2, + Visible = false, + IsActive = true, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.SocialMedia), "Id", "PollQuestion"), + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson, + }, + new() + { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Text", + EditGroupOrderNo = 1, + EditOrderNo = 2, + EditorType2 = EditorTypes.dxTextBox, + ColSpan = 1, + CaptionName = "App.Listform.ListformField.Text", + Width = 0, + ListOrderNo = 4, + Visible = true, + IsActive = true, + AllowSearch = true, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson, + }, + new() + { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Int32, + FieldName = "Votes", + EditGroupOrderNo = 1, + EditOrderNo = 3, + EditorType2 = EditorTypes.dxNumberBox, + ColSpan = 1, + CaptionName = "App.Listform.ListformField.Votes", + Alignment = "right", + Width = 0, + ListOrderNo = 5, + Visible = true, + IsActive = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson, + }, + ]); + #endregion + } + #endregion + #region Social Comment listFormName = AppCodes.Intranet.SocialComment; if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName)) @@ -4531,6 +4928,10 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep Description = $"{listFormName}.Description", SelectCommandType = SelectCommandTypeEnum.Table, SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.SocialComment)), + SeedFilePath = SeedPathResolver.GetDataFilePath(listFormName), + SeedSyncInsert = false, + SeedSyncUpdate = false, + SeedSyncDelete = false, KeyFieldName = "Id", KeyFieldDbSourceType = DbType.Guid, DefaultFilter = DefaultFilterJson, @@ -4592,6 +4993,31 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep PermissionJson = DefaultFieldPermissionJson(listForm.Name), PivotSettingsJson = DefaultPivotSettingsJson }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "UserId", + EditGroupOrderNo = 1, + EditOrderNo = 2, + EditorType2 = EditorTypes.dxSelectBox, + ColSpan = 1, + CaptionName = "Abp.Mailing.Smtp.UserName", + Width = 0, + ListOrderNo = 4, + Visible = true, + IsActive = true, + AllowSearch = true, + LookupJson = JsonSerializer.Serialize(new LookupDto { + DataSourceType = UiLookupDataSourceTypeEnum.Query, + DisplayExpr = "Name", + ValueExpr = "Key", + LookupQuery = LookupQueryValues.UserValues + }), + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, new() { ListFormCode = listForm.ListFormCode, CultureName = LanguageCodes.En, @@ -4642,6 +5068,10 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep Description = $"{listFormName}.Description", SelectCommandType = SelectCommandTypeEnum.Table, SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.SocialLike)), + SeedFilePath = SeedPathResolver.GetDataFilePath(listFormName), + SeedSyncInsert = false, + SeedSyncUpdate = false, + SeedSyncDelete = false, KeyFieldName = "Id", KeyFieldDbSourceType = DbType.Guid, DefaultFilter = DefaultFilterJson, diff --git a/api/src/Sozsoft.Platform.DbMigrator/Migrations/PermissionsData.json b/api/src/Sozsoft.Platform.DbMigrator/Migrations/PermissionsData.json index 6f30d800..dc9d4fac 100644 --- a/api/src/Sozsoft.Platform.DbMigrator/Migrations/PermissionsData.json +++ b/api/src/Sozsoft.Platform.DbMigrator/Migrations/PermissionsData.json @@ -4107,6 +4107,114 @@ "MultiTenancySide": 3, "Modules": "Sas|Adm" }, + { + "GroupName": "App.Administration", + "Name": "App.Intranet.SocialMedia", + "ParentName": "App.Intranet.SocialPost", + "DisplayName": "App.Intranet.SocialMedia", + "IsEnabled": true, + "MultiTenancySide": 3, + "Modules": "Sas|Adm" + }, + { + "GroupName": "App.Administration", + "Name": "App.Intranet.SocialMedia.Create", + "ParentName": "App.Intranet.SocialMedia", + "DisplayName": "App.Platform.Create", + "IsEnabled": true, + "MultiTenancySide": 3, + "Modules": "Sas|Adm" + }, + { + "GroupName": "App.Administration", + "Name": "App.Intranet.SocialMedia.Update", + "ParentName": "App.Intranet.SocialMedia", + "DisplayName": "App.Platform.Update", + "IsEnabled": true, + "MultiTenancySide": 3, + "Modules": "Sas|Adm" + }, + { + "GroupName": "App.Administration", + "Name": "App.Intranet.SocialMedia.Delete", + "ParentName": "App.Intranet.SocialMedia", + "DisplayName": "App.Platform.Delete", + "IsEnabled": true, + "MultiTenancySide": 3, + "Modules": "Sas|Adm" + }, + { + "GroupName": "App.Administration", + "Name": "App.Intranet.SocialMedia.Export", + "ParentName": "App.Intranet.SocialMedia", + "DisplayName": "Export", + "IsEnabled": true, + "MultiTenancySide": 3, + "Modules": "Sas|Adm" + }, + { + "GroupName": "App.Administration", + "Name": "App.Intranet.SocialMedia.Import", + "ParentName": "App.Intranet.SocialMedia", + "DisplayName": "Import", + "IsEnabled": true, + "MultiTenancySide": 3, + "Modules": "Sas|Adm" + }, + { + "GroupName": "App.Administration", + "Name": "App.Intranet.SocialPollOption", + "ParentName": "App.Intranet.SocialPost", + "DisplayName": "App.Intranet.SocialPollOption", + "IsEnabled": true, + "MultiTenancySide": 3, + "Modules": "Sas|Adm" + }, + { + "GroupName": "App.Administration", + "Name": "App.Intranet.SocialPollOption.Create", + "ParentName": "App.Intranet.SocialPollOption", + "DisplayName": "App.Platform.Create", + "IsEnabled": true, + "MultiTenancySide": 3, + "Modules": "Sas|Adm" + }, + { + "GroupName": "App.Administration", + "Name": "App.Intranet.SocialPollOption.Update", + "ParentName": "App.Intranet.SocialPollOption", + "DisplayName": "App.Platform.Update", + "IsEnabled": true, + "MultiTenancySide": 3, + "Modules": "Sas|Adm" + }, + { + "GroupName": "App.Administration", + "Name": "App.Intranet.SocialPollOption.Delete", + "ParentName": "App.Intranet.SocialPollOption", + "DisplayName": "App.Platform.Delete", + "IsEnabled": true, + "MultiTenancySide": 3, + "Modules": "Sas|Adm" + }, + { + "GroupName": "App.Administration", + "Name": "App.Intranet.SocialPollOption.Export", + "ParentName": "App.Intranet.SocialPollOption", + "DisplayName": "Export", + "IsEnabled": true, + "MultiTenancySide": 3, + "Modules": "Sas|Adm" + }, + { + "GroupName": "App.Administration", + "Name": "App.Intranet.SocialPollOption.Import", + "ParentName": "App.Intranet.SocialPollOption", + "DisplayName": "Import", + "IsEnabled": true, + "MultiTenancySide": 3, + "Modules": "Sas|Adm" + }, { "GroupName": "App.Administration", "Name": "App.Intranet.SocialComment", diff --git a/api/src/Sozsoft.Platform.DbMigrator/Migrations/WizardDataSeeder.cs b/api/src/Sozsoft.Platform.DbMigrator/Migrations/WizardDataSeeder.cs index e9bc2d03..d2355112 100644 --- a/api/src/Sozsoft.Platform.DbMigrator/Migrations/WizardDataSeeder.cs +++ b/api/src/Sozsoft.Platform.DbMigrator/Migrations/WizardDataSeeder.cs @@ -431,7 +431,7 @@ public class WizardDataSeeder : IDataSeedContributor, ITransientDependency return; await _repoModule.InsertAsync(new Module(cleaned) { Name = cleaned }, autoSave: true); - _logger.LogInformation("Module '{ModuleId}' seed sirasinda olusturuldu.", cleaned); + _logger.LogInformation("Module '{ModuleId}' created.", cleaned); } private async Task InsertPermissionAsync( diff --git a/api/src/Sozsoft.Platform.Domain/Data/SeedConsts.cs b/api/src/Sozsoft.Platform.Domain/Data/SeedConsts.cs index 0ebece38..19fbeeb7 100644 --- a/api/src/Sozsoft.Platform.Domain/Data/SeedConsts.cs +++ b/api/src/Sozsoft.Platform.Domain/Data/SeedConsts.cs @@ -340,6 +340,8 @@ public static class SeedConsts public const string SocialPost = Default + ".SocialPost"; public const string SocialComment = Default + ".SocialComment"; public const string SocialLike = Default + ".SocialLike"; + public const string SocialMedia = Default + ".SocialMedia"; + public const string SocialPollOption = Default + ".SocialPollOption"; public const string Events = Default + ".Events"; public const string EventType = Events + ".EventType"; diff --git a/api/src/Sozsoft.Platform.EntityFrameworkCore/Seeds/TenantData.json b/api/src/Sozsoft.Platform.EntityFrameworkCore/Seeds/TenantData.json index ff5504b0..44968c73 100644 --- a/api/src/Sozsoft.Platform.EntityFrameworkCore/Seeds/TenantData.json +++ b/api/src/Sozsoft.Platform.EntityFrameworkCore/Seeds/TenantData.json @@ -1,67 +1,4 @@ { - "Abouts": [ - { - "stats": [ - { - "Icon": "FaUser", - "Value": "740\u002B", - "LabelKey": "App.AboutStats.Users", - "UseCounter": true, - "CounterEnd": "740\u002B", - "CounterSuffix": "\u002B", - "CounterDuration": 3000 - }, - { - "icon": "FaUsers", - "value": "310+", - "labelKey": "App.AboutStats.Clients", - "useCounter": true, - "counterEnd": "310+", - "counterSuffix": "+", - "counterDuration": 2500 - }, - { - "icon": "FaAward", - "value": "25", - "labelKey": "App.AboutStats.Experience", - "useCounter": true, - "counterEnd": "20", - "counterSuffix": "+", - "counterDuration": 2000 - }, - { - "icon": "FaClock", - "value": "7/24", - "labelKey": "App.AboutStats.Support", - "useCounter": false - }, - { - "icon": "FaGlobe", - "value": "3", - "labelKey": "App.Definitions.Country", - "useCounter": true, - "counterEnd": "3", - "counterDuration": 1500 - } - ], - "descriptions": [ - "App.AboutDescription.Part1", - "App.AboutDescription.Motto", - "App.AboutDescription.Part2", - "App.AboutDescription.Closing" - ], - "sections": [ - { - "key": "App.PublicAbout.Mission", - "descKey": "App.AboutMission.MissionDesc" - }, - { - "key": "App.PublicAbout.Vision", - "descKey": "App.AboutVision.VisionDesc" - } - ] - } - ], "Homes": [ { "heroBackgroundImageKey": "Public.home.hero.backgroundImage", @@ -209,6 +146,69 @@ ] } ], + "Abouts": [ + { + "stats": [ + { + "Icon": "FaUser", + "Value": "740\u002B", + "LabelKey": "App.AboutStats.Users", + "UseCounter": true, + "CounterEnd": "740\u002B", + "CounterSuffix": "\u002B", + "CounterDuration": 3000 + }, + { + "icon": "FaUsers", + "value": "310+", + "labelKey": "App.AboutStats.Clients", + "useCounter": true, + "counterEnd": "310+", + "counterSuffix": "+", + "counterDuration": 2500 + }, + { + "icon": "FaAward", + "value": "25", + "labelKey": "App.AboutStats.Experience", + "useCounter": true, + "counterEnd": "20", + "counterSuffix": "+", + "counterDuration": 2000 + }, + { + "icon": "FaClock", + "value": "7/24", + "labelKey": "App.AboutStats.Support", + "useCounter": false + }, + { + "icon": "FaGlobe", + "value": "3", + "labelKey": "App.Definitions.Country", + "useCounter": true, + "counterEnd": "3", + "counterDuration": 1500 + } + ], + "descriptions": [ + "App.AboutDescription.Part1", + "App.AboutDescription.Motto", + "App.AboutDescription.Part2", + "App.AboutDescription.Closing" + ], + "sections": [ + { + "key": "App.PublicAbout.Mission", + "descKey": "App.AboutMission.MissionDesc" + }, + { + "key": "App.PublicAbout.Vision", + "descKey": "App.AboutVision.VisionDesc" + } + ] + } + ], "Services": [ { "icon": "FaCode", @@ -356,176 +356,5 @@ "referrerPolicy": "no-referrer-when-downgrade" } } - ], - "SocialPosts": [ - { - "content": "Yeni proje üzerinde çalışıyoruz! React ve TypeScript ile harika bir deneyim oluşturuyoruz. Ekip çalışması harika gidiyor! 🚀", - "userName": "system@sozsoft.com", - "likeCount": 0, - "isLiked": false, - "isOwnPost": true - }, - { - "content": "Bu hafta sprint planlamasını yaptık. Ekibimizle birlikte yeni özellikleri değerlendirdik. Heyecan verici bir hafta olacak!", - "userName": "system@sozsoft.com", - "likeCount": 0, - "isLiked": false, - "isOwnPost": true - }, - { - "content": "Yeni tasarım sistemimizin ilk prototipini hazırladık! Kullanıcı deneyimini iyileştirmek için çok çalıştık. Geri bildirimlerinizi bekliyorum! 🎨", - "userName": "system@sozsoft.com", - "likeCount": 0, - "isLiked": false, - "isOwnPost": true - }, - { - "content": "CI/CD pipeline güncellememiz tamamlandı! Deployment süremiz %40 azaldı. Otomasyonun gücü 💪", - "userName": "system@sozsoft.com", - "likeCount": 0, - "isLiked": false, - "isOwnPost": true - }, - { - "content": "Ekip üyelerimize yeni eğitim programımızı duyurmak istiyorum! 🎓 React, TypeScript ve Modern Web Geliştirme konularında kapsamlı bir program hazırladık.", - "userName": "system@sozsoft.com", - "likeCount": 0, - "isLiked": false, - "isOwnPost": true - }, - { - "content": "Bugün müşteri ile harika bir toplantı yaptık! Yeni projenin detaylarını konuştuk. 🎯", - "userName": "system@sozsoft.com", - "likeCount": 0, - "isLiked": false, - "isOwnPost": true - } - ], - "SocialLocations": [ - { - "postContent": "Yeni proje üzerinde çalışıyoruz! React ve TypeScript ile harika bir deneyim oluşturuyoruz. Ekip çalışması harika gidiyor! 🚀", - "name": "Taksim Meydanı", - "address": "Taksim, Gümüşsuyu Mahallesi, 34437 Beyoğlu/İstanbul", - "lat": 41.0369, - "lng": 28.985, - "placeId": "ChIJBQRGmL25yhQRXwqRTHAwAAQ" - }, - { - "postContent": "Bugün müşteri ile harika bir toplantı yaptık! Yeni projenin detaylarını konuştuk. 🎯", - "name": "Sultanahmet Meydanı", - "address": "Sultanahmet Mahallesi, 34122 Fatih/İstanbul", - "lat": 41.0058, - "lng": 28.9768, - "placeId": "ChIJ7fVVZiy5yhQRzsXXXXXXXXk" - } - ], - "SocialMedias": [ - { - "postContent": "Yeni proje üzerinde çalışıyoruz! React ve TypeScript ile harika bir deneyim oluşturuyoruz. Ekip çalışması harika gidiyor! 🚀", - "type": "image", - "urls": [ - "https://images.unsplash.com/photo-1633356122544-f134324a6cee?w=800&q=80" - ] - }, - { - "postContent": "Bu hafta sprint planlamasını yaptık. Ekibimizle birlikte yeni özellikleri değerlendirdik. Heyecan verici bir hafta olacak!", - "type": "poll", - "pollQuestion": "Hangi özelliği öncelikli olarak geliştirmeliyiz?", - "pollTotalVotes": 0, - "pollEndsAt": "2024-10-20T23:59:59", - "pollUserVoteId": "p3" - }, - { - "postContent": "Yeni tasarım sistemimizin ilk prototipini hazırladık! Kullanıcı deneyimini iyileştirmek için çok çalıştık. Geri bildirimlerinizi bekliyorum! 🎨", - "type": "image", - "urls": [ - "https://images.unsplash.com/photo-1561070791-2526d30994b5?w=800&q=80", - "https://images.unsplash.com/photo-1586717799252-bd134ad00e26?w=800&q=80", - "https://images.unsplash.com/photo-1609921212029-bb5a28e60960?w=800&q=80" - ] - }, - { - "postContent": "CI/CD pipeline güncellememiz tamamlandı! Deployment süremiz %40 azaldı. Otomasyonun gücü 💪", - "type": "video", - "urls": ["https://www.w3schools.com/html/mov_bbb.mp4"] - } - ], - "SocialPollOptions": [ - { - "postContent": "Bu hafta sprint planlamasını yaptık. Ekibimizle birlikte yeni özellikleri değerlendirdik. Heyecan verici bir hafta olacak!", - "pollQuestion": "Hangi özelliği öncelikli olarak geliştirmeliyiz?", - "Text": "Kullanıcı profilleri", - "Votes": 0 - }, - { - "postContent": "Bu hafta sprint planlamasını yaptık. Ekibimizle birlikte yeni özellikleri değerlendirdik. Heyecan verici bir hafta olacak!", - "pollQuestion": "Hangi özelliği öncelikli olarak geliştirmeliyiz?", - "Text": "Bildirim sistemi", - "Votes": 0 - }, - { - "postContent": "Bu hafta sprint planlamasını yaptık. Ekibimizle birlikte yeni özellikleri değerlendirdik. Heyecan verici bir hafta olacak!", - "pollQuestion": "Hangi özelliği öncelikli olarak geliştirmeliyiz?", - "Text": "Mesajlaşma", - "Votes": 0 - }, - { - "postContent": "Bu hafta sprint planlamasını yaptık. Ekibimizle birlikte yeni özellikleri değerlendirdik. Heyecan verici bir hafta olacak!", - "pollQuestion": "Hangi özelliği öncelikli olarak geliştirmeliyiz?", - "Text": "Raporlama", - "Votes": 0 - } - ], - "SocialComments": [ - { - "postContent": "Yeni proje üzerinde çalışıyoruz! React ve TypeScript ile harika bir deneyim oluşturuyoruz. Ekip çalışması harika gidiyor! 🚀", - "userName": "system@sozsoft.com", - "content": "Harika görünüyor! Başarılar 👏" - }, - { - "postContent": "Yeni proje üzerinde çalışıyoruz! React ve TypeScript ile harika bir deneyim oluşturuyoruz. Ekip çalışması harika gidiyor! 🚀", - "userName": "system@sozsoft.com", - "content": "TypeScript gerçekten fark yaratıyor!" - }, - { - "postContent": "Bu hafta sprint planlamasını yaptık. Ekibimizle birlikte yeni özellikleri değerlendirdik. Heyecan verici bir hafta olacak!", - "userName": "system@sozsoft.com", - "content": "Mesajlaşma özelliğine kesinlikle ihtiyacımız var!" - }, - { - "postContent": "Yeni tasarım sistemimizin ilk prototipini hazırladık! Kullanıcı deneyimini iyileştirmek için çok çalıştık. Geri bildirimlerinizi bekliyorum! 🎨", - "userName": "system@sozsoft.com", - "content": "Tasarımlar çok şık! Renk paleti özellikle güzel 😍" - }, - { - "postContent": "Yeni tasarım sistemimizin ilk prototipini hazırladık! Kullanıcı deneyimini iyileştirmek için çok çalıştık. Geri bildirimlerinizi bekliyorum! 🎨", - "userName": "system@sozsoft.com", - "content": "Dark mode opsiyonu da olacak mı?" - }, - { - "postContent": "CI/CD pipeline güncellememiz tamamlandı! Deployment süremiz %40 azaldı. Otomasyonun gücü 💪", - "userName": "system@sozsoft.com", - "content": "Harika iş! Detayları paylaşabilir misin?" - }, - { - "postContent": "Ekip üyelerimize yeni eğitim programımızı duyurmak istiyorum! 🎓 React, TypeScript ve Modern Web Geliştirme konularında kapsamlı bir program hazırladık.", - "userName": "system@sozsoft.com", - "content": "Ne zaman başlıyor?" - }, - { - "postContent": "Ekip üyelerimize yeni eğitim programımızı duyurmak istiyorum! 🎓 React, TypeScript ve Modern Web Geliştirme konularında kapsamlı bir program hazırladık.", - "userName": "system@sozsoft.com", - "content": "Gelecek hafta başlıyoruz! Kayıt linki mail ile paylaşılacak." - } - ], - "SocialLikes": [ - { - "postContent": "Yeni proje üzerinde çalışıyoruz! React ve TypeScript ile harika bir deneyim oluşturuyoruz. Ekip çalışması harika gidiyor! 🚀", - "userName": "system@sozsoft.com" - }, - { - "postContent": "Yeni tasarım sistemimizin ilk prototipini hazırladık! Kullanıcı deneyimini iyileştirmek için çok çalıştık. Geri bildirimlerinizi bekliyorum! 🎨", - "userName": "system@sozsoft.com" - } ] } diff --git a/api/src/Sozsoft.Platform.EntityFrameworkCore/Seeds/TenantDataSeeder.cs b/api/src/Sozsoft.Platform.EntityFrameworkCore/Seeds/TenantDataSeeder.cs index a78c31cb..8c72c1f7 100644 --- a/api/src/Sozsoft.Platform.EntityFrameworkCore/Seeds/TenantDataSeeder.cs +++ b/api/src/Sozsoft.Platform.EntityFrameworkCore/Seeds/TenantDataSeeder.cs @@ -34,55 +34,6 @@ public class TenantSeederDto //Forum //Intranet - public List SocialPosts { get; set; } - public List SocialMedias { get; set; } - public List SocialPollOptions { get; set; } - public List SocialComments { get; set; } - public List SocialLikes { get; set; } -} - -public class SocialPostSeedDto -{ - public string Content { get; set; } - public string UserName { get; set; } - public int LikeCount { get; set; } - public bool IsLiked { get; set; } - public bool IsOwnPost { get; set; } -} - -public class SocialMediaSeedDto -{ - public string PostContent { get; set; } - public string Type { get; set; } - public string[] Urls { get; set; } - - public string PollQuestion { get; set; } - public int? PollTotalVotes { get; set; } - public DateTime? PollEndsAt { get; set; } - public string PollUserVoteId { get; set; } - - public List PollOptions { get; set; } -} - -public class SocialPollOptionSeedDto -{ - public string PostContent { get; set; } - public string PollQuestion { get; set; } - public string Text { get; set; } - public int Votes { get; set; } -} - -public class SocialCommentSeedDto -{ - public string PostContent { get; set; } - public string UserName { get; set; } - public string Content { get; set; } -} - -public class SocialLikeSeedDto -{ - public string PostContent { get; set; } - public string UserName { get; set; } } public class ServiceSeedDto @@ -172,11 +123,6 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency private readonly IRepository _servicesRepository; private readonly IRepository _contactRepository; private readonly IIdentityUserRepository _repositoryUser; - private readonly IRepository _socialPostRepository; - private readonly IRepository _socialMediaRepository; - private readonly IRepository _socialPollOptionRepository; - private readonly IRepository _socialCommentRepository; - private readonly IRepository _socialLikeRepository; @@ -187,13 +133,8 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency IRepository homeRepository, IRepository aboutRepository, IRepository servicesRepository, - IRepository contactRepository, + IRepository contactRepository - IRepository socialPostRepository, - IRepository socialMediaRepository, - IRepository socialPollOptionRepository, - IRepository socialCommentRepository, - IRepository socialLikeRepository ) { _lookupNormalizer = lookupNormalizer; @@ -203,11 +144,6 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency _servicesRepository = servicesRepository; _aboutRepository = aboutRepository; _contactRepository = contactRepository; - _socialPostRepository = socialPostRepository; - _socialMediaRepository = socialMediaRepository; - _socialPollOptionRepository = socialPollOptionRepository; - _socialCommentRepository = socialCommentRepository; - _socialLikeRepository = socialLikeRepository; } public async Task SeedAsync(DataSeedContext context) @@ -298,107 +234,5 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency } } - foreach (var item in items.SocialPosts) - { - var exists = await _socialPostRepository.AnyAsync(x => x.Content == item.Content); - if (exists) - continue; - - var user = await _repositoryUser.FindByNormalizedUserNameAsync(_lookupNormalizer.NormalizeName(item.UserName)); - - await _socialPostRepository.InsertAsync(new SocialPost(Guid.NewGuid()) - { - UserId = user != null ? user.Id : null, - Content = item.Content, - LikeCount = item.LikeCount, - IsLiked = item.IsLiked, - IsOwnPost = item.IsOwnPost - }, autoSave: true); - } - - foreach (var item in items.SocialMedias) - { - var post = await _socialPostRepository.FirstOrDefaultAsync(x => x.Content == item.PostContent); - - if (post == null) - continue; - - var exists = await _socialMediaRepository.AnyAsync(x => x.SocialPostId == post.Id); - if (exists) - continue; - - await _socialMediaRepository.InsertAsync(new SocialMedia(Guid.NewGuid()) - { - SocialPostId = post != null ? post.Id : Guid.Empty, - Type = item.Type, - Urls = item.Urls, - PollQuestion = item.PollQuestion, - PollTotalVotes = item.PollTotalVotes, - PollEndsAt = item.PollEndsAt, - PollUserVoteId = item.PollUserVoteId - }, autoSave: true); - } - - foreach (var item in items.SocialPollOptions) - { - var post = await _socialPostRepository.FirstOrDefaultAsync(x => x.Content == item.PostContent); - if (post == null) - continue; - - var media = await _socialMediaRepository.FirstOrDefaultAsync(x => x.SocialPostId == post.Id && x.PollQuestion == item.PollQuestion); - if (media == null) - continue; - - var exists = await _socialPollOptionRepository.AnyAsync(x => x.SocialMediaId == media.Id && x.Text == item.Text); - if (exists) - continue; - - await _socialPollOptionRepository.InsertAsync(new SocialPollOption(Guid.NewGuid()) - { - SocialMediaId = media != null ? media.Id : Guid.Empty, - Text = item.Text, - Votes = item.Votes - }, autoSave: true); - } - - foreach (var item in items.SocialComments) - { - var post = await _socialPostRepository.FirstOrDefaultAsync(x => x.Content == item.PostContent); - - if (post == null) - continue; - - var exists = await _socialCommentRepository.AnyAsync(x => x.SocialPostId == post.Id && x.Content == item.Content); - if (exists) - continue; - - var user = await _repositoryUser.FindByNormalizedUserNameAsync(_lookupNormalizer.NormalizeName(item.UserName)); - await _socialCommentRepository.InsertAsync(new SocialComment(Guid.NewGuid()) - { - UserId = user != null ? user.Id : null, - SocialPostId = post != null ? post.Id : Guid.Empty, - Content = item.Content - }, autoSave: true); - } - - foreach (var item in items.SocialLikes) - { - var post = await _socialPostRepository.FirstOrDefaultAsync(x => x.Content == item.PostContent); - - if (post == null) - continue; - - var exists = await _socialLikeRepository.AnyAsync(x => x.SocialPostId == post.Id); - if (exists) - continue; - - var user = await _repositoryUser.FindByNormalizedUserNameAsync(_lookupNormalizer.NormalizeName(item.UserName)); - await _socialLikeRepository.InsertAsync(new SocialLike(Guid.NewGuid()) - { - SocialPostId = post != null ? post.Id : Guid.Empty, - UserId = user != null ? user.Id : null - }, autoSave: true); - } - } } diff --git a/configs/seeds/host/data/App.Intranet.SocialComment.json b/configs/seeds/host/data/App.Intranet.SocialComment.json new file mode 100644 index 00000000..455cebbd --- /dev/null +++ b/configs/seeds/host/data/App.Intranet.SocialComment.json @@ -0,0 +1,56 @@ +{ + "ListFormCode": "App.Intranet.SocialComment", + "KeyFieldName": "Id", + "GeneratedAt": "2026-09-04T00:00:00Z", + "Order": 20, + "Rows": [ + { + "Id": "9cc62f3f-a139-5614-bd61-73b916fd17e7", + "SocialPostId": "372da38a-5a7e-5437-b816-15d015e47310", + "UserId": "@USER:system@sozsoft.com", + "Content": "Harika görünüyor! Başarılar 👏" + }, + { + "Id": "c6717cac-eee1-502d-838f-fed9f9923331", + "SocialPostId": "372da38a-5a7e-5437-b816-15d015e47310", + "UserId": "@USER:system@sozsoft.com", + "Content": "TypeScript gerçekten fark yaratıyor!" + }, + { + "Id": "23189c70-ba21-5d19-b183-0d304cc78170", + "SocialPostId": "5ed8facb-e24e-573d-86dc-4450bfd201fc", + "UserId": "@USER:system@sozsoft.com", + "Content": "Mesajlaşma özelliğine kesinlikle ihtiyacımız var!" + }, + { + "Id": "9c86c8d9-d2a7-5316-a97a-4852a470ca11", + "SocialPostId": "8a396162-94bf-570e-9085-1a6078900f18", + "UserId": "@USER:system@sozsoft.com", + "Content": "Tasarımlar çok şık! Renk paleti özellikle güzel 😍" + }, + { + "Id": "c0f2d671-54e1-5aa2-87f8-a36b83568464", + "SocialPostId": "8a396162-94bf-570e-9085-1a6078900f18", + "UserId": "@USER:system@sozsoft.com", + "Content": "Dark mode opsiyonu da olacak mı?" + }, + { + "Id": "11b92683-2a57-56f1-978e-d9f963b436c7", + "SocialPostId": "5ce6f463-48e8-51d7-8ce2-62a321383f8d", + "UserId": "@USER:system@sozsoft.com", + "Content": "Harika iş! Detayları paylaşabilir misin?" + }, + { + "Id": "a848cede-f479-51b5-a03a-8329ffffd65d", + "SocialPostId": "f5dab744-d837-5756-904e-24ff8c199367", + "UserId": "@USER:system@sozsoft.com", + "Content": "Ne zaman başlıyor?" + }, + { + "Id": "fca04aab-a0cb-509f-846e-70577e72d085", + "SocialPostId": "f5dab744-d837-5756-904e-24ff8c199367", + "UserId": "@USER:system@sozsoft.com", + "Content": "Gelecek hafta başlıyoruz! Kayıt linki mail ile paylaşılacak." + } + ] +} diff --git a/configs/seeds/host/data/App.Intranet.SocialLike.json b/configs/seeds/host/data/App.Intranet.SocialLike.json new file mode 100644 index 00000000..c1c73537 --- /dev/null +++ b/configs/seeds/host/data/App.Intranet.SocialLike.json @@ -0,0 +1,18 @@ +{ + "ListFormCode": "App.Intranet.SocialLike", + "KeyFieldName": "Id", + "GeneratedAt": "2026-09-04T00:00:00Z", + "Order": 20, + "Rows": [ + { + "Id": "d6c4f425-39f7-5817-9ea7-9fbb53ae89fe", + "SocialPostId": "372da38a-5a7e-5437-b816-15d015e47310", + "UserId": "@USER:system@sozsoft.com" + }, + { + "Id": "3e5d11fc-4a55-5313-aaab-bafff96405d2", + "SocialPostId": "8a396162-94bf-570e-9085-1a6078900f18", + "UserId": "@USER:system@sozsoft.com" + } + ] +} diff --git a/configs/seeds/host/data/App.Intranet.SocialMedia.json b/configs/seeds/host/data/App.Intranet.SocialMedia.json new file mode 100644 index 00000000..9dc8788d --- /dev/null +++ b/configs/seeds/host/data/App.Intranet.SocialMedia.json @@ -0,0 +1,48 @@ +{ + "ListFormCode": "App.Intranet.SocialMedia", + "KeyFieldName": "Id", + "GeneratedAt": "2026-09-04T00:00:00Z", + "Order": 20, + "Rows": [ + { + "Id": "ba901b98-93de-5ad7-8a92-094d3c27ea9c", + "SocialPostId": "372da38a-5a7e-5437-b816-15d015e47310", + "Type": "image", + "Urls": "[\"https://images.unsplash.com/photo-1633356122544-f134324a6cee?w=800&q=80\"]", + "PollQuestion": null, + "PollTotalVotes": null, + "PollEndsAt": null, + "PollUserVoteId": null + }, + { + "Id": "abfe92ba-bc27-5d37-b108-38962a436561", + "SocialPostId": "5ed8facb-e24e-573d-86dc-4450bfd201fc", + "Type": "poll", + "Urls": "[]", + "PollQuestion": "Hangi özelliği öncelikli olarak geliştirmeliyiz?", + "PollTotalVotes": 0, + "PollEndsAt": "2024-10-20T23:59:59", + "PollUserVoteId": "p3" + }, + { + "Id": "3a8b9883-5017-5143-afb0-9203803bf3be", + "SocialPostId": "8a396162-94bf-570e-9085-1a6078900f18", + "Type": "image", + "Urls": "[\"https://images.unsplash.com/photo-1561070791-2526d30994b5?w=800&q=80\",\"https://images.unsplash.com/photo-1586717799252-bd134ad00e26?w=800&q=80\",\"https://images.unsplash.com/photo-1609921212029-bb5a28e60960?w=800&q=80\"]", + "PollQuestion": null, + "PollTotalVotes": null, + "PollEndsAt": null, + "PollUserVoteId": null + }, + { + "Id": "efe7ae34-a1db-54e1-96e5-5003716d4227", + "SocialPostId": "5ce6f463-48e8-51d7-8ce2-62a321383f8d", + "Type": "video", + "Urls": "[\"https://www.w3schools.com/html/mov_bbb.mp4\"]", + "PollQuestion": null, + "PollTotalVotes": null, + "PollEndsAt": null, + "PollUserVoteId": null + } + ] +} diff --git a/configs/seeds/host/data/App.Intranet.SocialPollOption.json b/configs/seeds/host/data/App.Intranet.SocialPollOption.json new file mode 100644 index 00000000..e37d00bf --- /dev/null +++ b/configs/seeds/host/data/App.Intranet.SocialPollOption.json @@ -0,0 +1,32 @@ +{ + "ListFormCode": "App.Intranet.SocialPollOption", + "KeyFieldName": "Id", + "GeneratedAt": "2026-09-04T00:00:00Z", + "Order": 30, + "Rows": [ + { + "Id": "ea1900e6-3862-5e40-87b4-d40aeaac8dc5", + "SocialMediaId": "abfe92ba-bc27-5d37-b108-38962a436561", + "Text": "Kullanıcı profilleri", + "Votes": 0 + }, + { + "Id": "91c0447d-7c75-5160-931d-73ce1fcc46e2", + "SocialMediaId": "abfe92ba-bc27-5d37-b108-38962a436561", + "Text": "Bildirim sistemi", + "Votes": 0 + }, + { + "Id": "aab8c13d-0199-5580-b36a-6f2e5c0c4376", + "SocialMediaId": "abfe92ba-bc27-5d37-b108-38962a436561", + "Text": "Mesajlaşma", + "Votes": 0 + }, + { + "Id": "da639632-d29b-5033-8fd8-9ef7409d69d8", + "SocialMediaId": "abfe92ba-bc27-5d37-b108-38962a436561", + "Text": "Raporlama", + "Votes": 0 + } + ] +} diff --git a/configs/seeds/host/data/App.Intranet.SocialPost.json b/configs/seeds/host/data/App.Intranet.SocialPost.json new file mode 100644 index 00000000..e7e44539 --- /dev/null +++ b/configs/seeds/host/data/App.Intranet.SocialPost.json @@ -0,0 +1,56 @@ +{ + "ListFormCode": "App.Intranet.SocialPost", + "KeyFieldName": "Id", + "GeneratedAt": "2026-09-04T00:00:00Z", + "Order": 10, + "Rows": [ + { + "Id": "372da38a-5a7e-5437-b816-15d015e47310", + "UserId": "@USER:system@sozsoft.com", + "Content": "Yeni proje üzerinde çalışıyoruz! React ve TypeScript ile harika bir deneyim oluşturuyoruz. Ekip çalışması harika gidiyor! 🚀", + "LikeCount": 0, + "IsLiked": false, + "IsOwnPost": true + }, + { + "Id": "5ed8facb-e24e-573d-86dc-4450bfd201fc", + "UserId": "@USER:system@sozsoft.com", + "Content": "Bu hafta sprint planlamasını yaptık. Ekibimizle birlikte yeni özellikleri değerlendirdik. Heyecan verici bir hafta olacak!", + "LikeCount": 0, + "IsLiked": false, + "IsOwnPost": true + }, + { + "Id": "8a396162-94bf-570e-9085-1a6078900f18", + "UserId": "@USER:system@sozsoft.com", + "Content": "Yeni tasarım sistemimizin ilk prototipini hazırladık! Kullanıcı deneyimini iyileştirmek için çok çalıştık. Geri bildirimlerinizi bekliyorum! 🎨", + "LikeCount": 0, + "IsLiked": false, + "IsOwnPost": true + }, + { + "Id": "5ce6f463-48e8-51d7-8ce2-62a321383f8d", + "UserId": "@USER:system@sozsoft.com", + "Content": "CI/CD pipeline güncellememiz tamamlandı! Deployment süremiz %40 azaldı. Otomasyonun gücü 💪", + "LikeCount": 0, + "IsLiked": false, + "IsOwnPost": true + }, + { + "Id": "f5dab744-d837-5756-904e-24ff8c199367", + "UserId": "@USER:system@sozsoft.com", + "Content": "Ekip üyelerimize yeni eğitim programımızı duyurmak istiyorum! 🎓 React, TypeScript ve Modern Web Geliştirme konularında kapsamlı bir program hazırladık.", + "LikeCount": 0, + "IsLiked": false, + "IsOwnPost": true + }, + { + "Id": "183ddf97-ebcd-5e6c-97a9-d146636fc600", + "UserId": "@USER:system@sozsoft.com", + "Content": "Bugün müşteri ile harika bir toplantı yaptık! Yeni projenin detaylarını konuştuk. 🎯", + "LikeCount": 0, + "IsLiked": false, + "IsOwnPost": true + } + ] +} diff --git a/ui/src/utils/validation.ts b/ui/src/utils/validation.ts new file mode 100644 index 00000000..d477d6f5 --- /dev/null +++ b/ui/src/utils/validation.ts @@ -0,0 +1,10 @@ +import { number } from 'yup' + +/** + * Boş bırakılan number input'u NaN yerine null'a çevirir; aksi hâlde hem doğrulama + * "must be a number" ile düşer hem de sunucuya boş string gider. + */ +export const nullableNumber = () => + number() + .transform((value, original) => (original === '' || original === null ? null : value)) + .nullable() diff --git a/ui/src/views/admin/listForm/edit/form-fields/FormFieldTabOptions.tsx b/ui/src/views/admin/listForm/edit/form-fields/FormFieldTabOptions.tsx index 107b722c..b113288c 100644 --- a/ui/src/views/admin/listForm/edit/form-fields/FormFieldTabOptions.tsx +++ b/ui/src/views/admin/listForm/edit/form-fields/FormFieldTabOptions.tsx @@ -3,7 +3,7 @@ import { ColumnFormatEditDto, ListFormFieldEditTabs } from '@/proxy/admin/list-f import { SelectBoxOption } from '@/types/shared' import { useLocalization } from '@/utils/hooks/useLocalization' import { Field, FieldProps, Form, Formik } from 'formik' -import { bool, number, object, string } from 'yup' +import { bool, object, string } from 'yup' import { columnEditorTypeListOptions, sortDirectionOptions } from '../options' import { FormFieldEditProps } from './FormFields' import { EditingFormDto, SortDirectionEnum } from '@/proxy/form/models' @@ -12,15 +12,16 @@ import { useState } from 'react' import EditorScriptBuilderDialog from '../json-row-operations/EditorScriptBuilderDialog' import SelectField from '../shared/SelectField' import { useFieldPermission } from './useFieldPermission' +import { nullableNumber } from '@/utils/validation' const schema = object().shape({ - listOrderNo: number(), - width: number(), + listOrderNo: nullableNumber(), + width: nullableNumber(), sortDirection: string().oneOf(Object.values(SortDirectionEnum) as string[]), - sortIndex: number(), - editGroupOrderNo: number().nullable(), - editOrderNo: number().nullable(), - colSpan: number().nullable(), + sortIndex: nullableNumber(), + editGroupOrderNo: nullableNumber(), + editOrderNo: nullableNumber(), + colSpan: nullableNumber(), allowEditing: bool().required(), allowAdding: bool().required(), editorScript: string(), @@ -58,7 +59,11 @@ function FormFieldTabOptions({ initialValues={initialValues} validationSchema={schema} onSubmit={async (values, formikHelpers) => { - await onSubmit(ListFormFieldEditTabs.OptionsForm, values, formikHelpers) + await onSubmit( + ListFormFieldEditTabs.OptionsForm, + schema.cast(values) as ColumnFormatEditDto, + formikHelpers, + ) }} > {({ touched, errors, isSubmitting, values, setFieldValue }) => (