From 6dfe8d22a8047dd73e86636964bdd94fdedb599c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sedat=20=C3=96zt=C3=BCrk?= Date: Thu, 30 Jul 2026 22:38:27 +0300 Subject: [PATCH] =?UTF-8?q?Agenda=20ve=20SchedulerView=20d=C3=BCzenlemesi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../GridOptionsDto/SchedulerOptionDto.cs | 8 + .../Seeds/LanguagesData.json | 28 +- .../Seeds/ListFormSeeder_Administration.cs | 224 ++++++++ .../Seeds/ListFormSeeder_DefaultJsons.cs | 23 + .../Seeds/MenusData.json | 16 +- .../Seeds/PermissionsData.json | 56 +- .../Seeds/SqlData/Pro_D_Gantt.sql | 17 - .../Seeds/SqlData/Pro_D_Scheduler.sql | 18 - .../Seeds/WizardData/202607281645_Gantt.json | 214 -------- .../WizardData/202607291133_Scheduler.json | 230 --------- .../Enums/TableNameEnum.cs | 3 +- .../PlatformConsts.cs | 1 + .../TableNameResolver.cs | 1 + .../Data/SeedConsts.cs | 1 + .../Entities/Tenant/Administration/Agenda.cs | 26 + .../EntityFrameworkCore/PlatformDbContext.cs | 29 +- ....cs => 20260730174943_Initial.Designer.cs} | 105 +++- ...4_Initial.cs => 20260730174943_Initial.cs} | 44 +- .../PlatformDbContextModelSnapshot.cs | 103 +++- ui/src/proxy/form/models.ts | 2 + .../admin/listForm/edit/FormTabScheduler.tsx | 63 ++- .../developerKit/SqlTableDesignerDialog.tsx | 22 +- ui/src/views/list/SchedulerView.tsx | 488 ++++++++++++++---- 23 files changed, 1078 insertions(+), 644 deletions(-) delete mode 100644 api/src/Sozsoft.Platform.DbMigrator/Seeds/SqlData/Pro_D_Gantt.sql delete mode 100644 api/src/Sozsoft.Platform.DbMigrator/Seeds/SqlData/Pro_D_Scheduler.sql delete mode 100644 api/src/Sozsoft.Platform.DbMigrator/Seeds/WizardData/202607281645_Gantt.json delete mode 100644 api/src/Sozsoft.Platform.DbMigrator/Seeds/WizardData/202607291133_Scheduler.json create mode 100644 api/src/Sozsoft.Platform.Domain/Entities/Tenant/Administration/Agenda.cs rename api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/{20260730083424_Initial.Designer.cs => 20260730174943_Initial.Designer.cs} (99%) rename api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/{20260730083424_Initial.cs => 20260730174943_Initial.cs} (99%) diff --git a/api/src/Sozsoft.Platform.Application.Contracts/ListForms/GridOptionsDto/SchedulerOptionDto.cs b/api/src/Sozsoft.Platform.Application.Contracts/ListForms/GridOptionsDto/SchedulerOptionDto.cs index b24cc9db..6508f46c 100644 --- a/api/src/Sozsoft.Platform.Application.Contracts/ListForms/GridOptionsDto/SchedulerOptionDto.cs +++ b/api/src/Sozsoft.Platform.Application.Contracts/ListForms/GridOptionsDto/SchedulerOptionDto.cs @@ -10,6 +10,14 @@ public class SchedulerOptionDto /// public string TextExpr { get; set; } /// + /// Kullanıcı adı olarak gösterilecek field adı (örn: "userName") + /// + public string UserNameExpr { get; set; } + /// + /// Açıklama olarak gösterilecek field adı (örn: "description") + /// + public string DescriptionExpr { get; set; } + /// /// Başlangıç tarihinin tutulduğu field adı (örn: "startDate") /// public string StartDateExpr { get; set; } diff --git a/api/src/Sozsoft.Platform.DbMigrator/Seeds/LanguagesData.json b/api/src/Sozsoft.Platform.DbMigrator/Seeds/LanguagesData.json index 1a84b3f0..ddc9bec0 100644 --- a/api/src/Sozsoft.Platform.DbMigrator/Seeds/LanguagesData.json +++ b/api/src/Sozsoft.Platform.DbMigrator/Seeds/LanguagesData.json @@ -1530,6 +1530,12 @@ "en": "Development Requests", "tr": "Geliştirme Talepleri" }, + { + "resourceName": "Platform", + "key": "App.Agenda", + "en": "Agenda", + "tr": "Ajanda" + }, { "resourceName": "Platform", "key": "App.Settings", @@ -4212,6 +4218,24 @@ "en": "Camera Off", "tr": "Kamera Kapalı" }, + { + "resourceName": "Platform", + "key": "App.Listform.ListformField.AllDay", + "en": "All Day", + "tr": "Tüm Gün" + }, + { + "resourceName": "Platform", + "key": "App.Listform.ListformField.RecurrenceRule", + "en": "Recurrence Rule", + "tr": "Tekrarlama Kuralı" + }, + { + "resourceName": "Platform", + "key": "App.Listform.ListformField.RecurrenceException", + "en": "Recurrence Exception", + "tr": "Tekrarlama İstisnası" + }, { "resourceName": "Platform", "key": "App.Listform.ListformField.Avatar", @@ -19485,8 +19509,8 @@ { "resourceName": "Platform", "key": "ListForms.ListFormFieldEdit.TodoStatusExpr", - "en": "Column / Status Field", - "tr": "Kolon / durum alanı" + "en": "Status Field", + "tr": "Durum alanı" }, { "resourceName": "Platform", diff --git a/api/src/Sozsoft.Platform.DbMigrator/Seeds/ListFormSeeder_Administration.cs b/api/src/Sozsoft.Platform.DbMigrator/Seeds/ListFormSeeder_Administration.cs index 5d38b0eb..1bb15e0f 100644 --- a/api/src/Sozsoft.Platform.DbMigrator/Seeds/ListFormSeeder_Administration.cs +++ b/api/src/Sozsoft.Platform.DbMigrator/Seeds/ListFormSeeder_Administration.cs @@ -6222,5 +6222,229 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep #endregion } #endregion + + #region Agenda + listFormName = AppCodes.Agenda; + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName)) + { + var listForm = await _listFormRepository.InsertAsync( + new ListForm() + { + ListFormType = ListFormTypeEnum.List, + PageSize = 10, + ExportJson = DefaultExportJson, + IsSubForm = false, + ShowNote = false, + LayoutJson = DefaultLayoutJson("scheduler"), + CultureName = LanguageCodes.En, + ListFormCode = listFormName, + Name = listFormName, + Title = listFormName, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = true, + IsBranch = false, + IsOrganizationUnit = false, + Description = listFormName, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.Agenda)), + 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.Agenda)), + DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson(), + PagerOptionJson = DefaultPagerOptionJson, + InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson(), + EditingOptionJson = DefaultEditingOptionJson(listFormName, 800, 600, true, true, true, true, false), + EditingFormJson = JsonSerializer.Serialize(new List + { + new() { Order = 1, ColCount = 1, ColSpan = 1, ItemType = "group" }, + }), + FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + new() { FieldName = "UserName", FieldDbType = DbType.String, Value = "@USERNAME", CustomValueType = FieldCustomValueTypeEnum.CustomKey }, + new() { FieldName = "AllDay", FieldDbType = DbType.Boolean, Value = "false", CustomValueType = FieldCustomValueTypeEnum.Value }, + }), + SchedulerOptionJson = DefaultSchedulerOptionJson() + }); + + #region Agenda Fields + await _listFormFieldRepository.InsertManyAsync([ + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + CaptionName = "App.Listform.ListformField.Id", + Width = 0, + ListOrderNo = 0, + Visible = false, + IsActive = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "UserName", + EditGroupOrderNo = 1, + EditOrderNo = 1, + EditorType2 = EditorTypes.dxTextBox, + ColSpan = 1, + CaptionName = "App.Listform.ListformField.UserName", + Width = 0, + ListOrderNo = 1, + Visible = true, + IsActive = true, + AllowSearch = true, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson, + EditorOptions = EditorOptionValues.Disabled + }, + 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 = 2, + 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.String, + FieldName = "Description", + EditGroupOrderNo = 1, + EditOrderNo = 3, + EditorType2 = EditorTypes.dxTextArea, + ColSpan = 1, + CaptionName = "App.Listform.ListformField.Description", + Width = 0, + ListOrderNo = 3, + 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.DateTime, + FieldName = "StartDate", + EditGroupOrderNo = 1, + EditOrderNo = 4, + EditorType2 = EditorTypes.dxDateBox, + ColSpan = 1, + CaptionName = "App.Listform.ListformField.StartDate", + 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.DateTime, + FieldName = "EndDate", + EditGroupOrderNo = 1, + EditOrderNo = 5, + EditorType2 = EditorTypes.dxDateBox, + ColSpan = 1, + CaptionName = "App.Listform.ListformField.EndDate", + Width = 0, + ListOrderNo = 5, + 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.String, + FieldName = "AllDay", + EditGroupOrderNo = 1, + EditOrderNo = 6, + EditorType2 = EditorTypes.dxCheckBox, + ColSpan = 1, + CaptionName = "App.Listform.ListformField.AllDay", + Width = 0, + ListOrderNo = 6, + Visible = true, + IsActive = true, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "RecurrenceRule", + ColSpan = 1, + CaptionName = "App.Listform.ListformField.RecurrenceRule", + Width = 0, + ListOrderNo = 7, + Visible = true, + IsActive = true, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "RecurrenceException", + ColSpan = 1, + CaptionName = "App.Listform.ListformField.RecurrenceException", + Width = 0, + ListOrderNo = 8, + Visible = true, + IsActive = true, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + } + ]); + #endregion + } + #endregion } } diff --git a/api/src/Sozsoft.Platform.DbMigrator/Seeds/ListFormSeeder_DefaultJsons.cs b/api/src/Sozsoft.Platform.DbMigrator/Seeds/ListFormSeeder_DefaultJsons.cs index 03b66cce..434e3fd7 100644 --- a/api/src/Sozsoft.Platform.DbMigrator/Seeds/ListFormSeeder_DefaultJsons.cs +++ b/api/src/Sozsoft.Platform.DbMigrator/Seeds/ListFormSeeder_DefaultJsons.cs @@ -129,6 +129,29 @@ public static class ListFormSeeder_DefaultJsons StatusOrder = StatusOrder, AllowDragging = AllowDragging }); + public static string DefaultSchedulerOptionJson( + string TextExpr = "Text", + string StartDateExpr = "StartDate", + string EndDateExpr = "EndDate", + string AllDayExpr = "AllDay", + string RecurrenceRuleExpr = "RecurrenceRule", + string RecurrenceExceptionExpr = "RecurrenceException" + ) => JsonSerializer.Serialize(new SchedulerOptionDto + { + TextExpr = TextExpr, + StartDateExpr = StartDateExpr, + EndDateExpr = EndDateExpr, + AllDayExpr = AllDayExpr, + RecurrenceRuleExpr = RecurrenceRuleExpr, + RecurrenceExceptionExpr = RecurrenceExceptionExpr, + ShowAllDayPanel = true, + CrossScrollingEnabled = true, + AllowResizing = true, + AllowDragging = true, + AllowDeleting = true, + AllowEditing = true, + AllowAdding = true + }); public static readonly string DefaultPagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto { Visible = true, diff --git a/api/src/Sozsoft.Platform.DbMigrator/Seeds/MenusData.json b/api/src/Sozsoft.Platform.DbMigrator/Seeds/MenusData.json index f60d8e68..ce3ad019 100644 --- a/api/src/Sozsoft.Platform.DbMigrator/Seeds/MenusData.json +++ b/api/src/Sozsoft.Platform.DbMigrator/Seeds/MenusData.json @@ -1113,11 +1113,21 @@ "RequiredPermissionName": "App.DevRequest", "IsDisabled": false }, + { + "ParentCode": "App.Administration", + "Code": "App.Agenda", + "DisplayName": "App.Agenda", + "Order": 4, + "Url": "/admin/list/App.Agenda", + "Icon": "FcPlanner", + "RequiredPermissionName": "App.Agenda", + "IsDisabled": false + }, { "ParentCode": "App.Administration", "Code": "App.Setting", "DisplayName": "App.Setting", - "Order": 4, + "Order": 5, "Url": "/admin/settings", "Icon": "FcSettings", "RequiredPermissionName": "App.Setting", @@ -1127,7 +1137,7 @@ "ParentCode": "App.Administration", "Code": "App.Administration.Intranet", "DisplayName": "App.Intranet", - "Order": 5, + "Order": 6, "Url": null, "Icon": "FcConferenceCall", "RequiredPermissionName": null, @@ -1177,7 +1187,7 @@ "ParentCode": "App.Administration.Intranet", "Code": "App.Intranet.Events.EventCategory", "DisplayName": "App.Intranet.Events.EventCategory", - "Order": 6, + "Order": 5, "Url": "/admin/list/App.Intranet.Events.EventCategory", "Icon": "FcTreeStructure", "RequiredPermissionName": "App.Intranet.Events.EventCategory", diff --git a/api/src/Sozsoft.Platform.DbMigrator/Seeds/PermissionsData.json b/api/src/Sozsoft.Platform.DbMigrator/Seeds/PermissionsData.json index bffef74b..b765ebb3 100644 --- a/api/src/Sozsoft.Platform.DbMigrator/Seeds/PermissionsData.json +++ b/api/src/Sozsoft.Platform.DbMigrator/Seeds/PermissionsData.json @@ -4734,6 +4734,60 @@ "IsEnabled": true, "MultiTenancySide": 3, "MenuGroup": "Erp|Kurs" + }, + { + "GroupName": "App.Administration", + "Name": "App.Agenda", + "ParentName": null, + "DisplayName": "App.Agenda", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp|Kurs" + }, + { + "GroupName": "App.Administration", + "Name": "App.Agenda.Create", + "ParentName": "App.Agenda", + "DisplayName": "Create", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp|Kurs" + }, + { + "GroupName": "App.Administration", + "Name": "App.Agenda.Update", + "ParentName": "App.Agenda", + "DisplayName": "Update", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp|Kurs" + }, + { + "GroupName": "App.Administration", + "Name": "App.Agenda.Delete", + "ParentName": "App.Agenda", + "DisplayName": "Delete", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp|Kurs" + }, + { + "GroupName": "App.Administration", + "Name": "App.Agenda.Export", + "ParentName": "App.Agenda", + "DisplayName": "Export", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp|Kurs" + }, + { + "GroupName": "App.Administration", + "Name": "App.Agenda.Import", + "ParentName": "App.Agenda", + "DisplayName": "Import", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp|Kurs" } ] -} +} \ No newline at end of file diff --git a/api/src/Sozsoft.Platform.DbMigrator/Seeds/SqlData/Pro_D_Gantt.sql b/api/src/Sozsoft.Platform.DbMigrator/Seeds/SqlData/Pro_D_Gantt.sql deleted file mode 100644 index 2021ff6c..00000000 --- a/api/src/Sozsoft.Platform.DbMigrator/Seeds/SqlData/Pro_D_Gantt.sql +++ /dev/null @@ -1,17 +0,0 @@ -IF OBJECT_ID(N'[dbo].[Pro_D_Gantt]', 'U') IS NULL -BEGIN - CREATE TABLE [dbo].[Pro_D_Gantt] - ( - [Id] uniqueidentifier NOT NULL DEFAULT NEWID(), - [ParentId] uniqueidentifier NULL, - [Title] nvarchar(300) NOT NULL, - [StartDate] datetime2 NOT NULL, - [EndDate] datetime2 NOT NULL, - [Progress] int NOT NULL DEFAULT 0, - CONSTRAINT [PK_Pro_D_Gantt] PRIMARY KEY NONCLUSTERED - ( - [Id] ASC - )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY] - ) ON [PRIMARY] -END -GO \ No newline at end of file diff --git a/api/src/Sozsoft.Platform.DbMigrator/Seeds/SqlData/Pro_D_Scheduler.sql b/api/src/Sozsoft.Platform.DbMigrator/Seeds/SqlData/Pro_D_Scheduler.sql deleted file mode 100644 index d56b5932..00000000 --- a/api/src/Sozsoft.Platform.DbMigrator/Seeds/SqlData/Pro_D_Scheduler.sql +++ /dev/null @@ -1,18 +0,0 @@ -IF OBJECT_ID(N'[dbo].[Pro_D_Scheduler]', 'U') IS NULL -BEGIN - CREATE TABLE [dbo].[Pro_D_Scheduler] - ( - [Id] uniqueidentifier NOT NULL DEFAULT NEWID(), - [Text] nvarchar(300) NOT NULL, - [StartDate] datetime2 NOT NULL, - [EndDate] datetime2 NOT NULL, - [AllDay] bit NOT NULL DEFAULT 0, - [RecurrenceRule] nvarchar(500) NULL, - [RecurrenceException] nvarchar(MAX) NULL, - CONSTRAINT [PK_Pro_D_Scheduler] PRIMARY KEY NONCLUSTERED - ( - [Id] ASC - )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY] - ) ON [PRIMARY] -END -GO \ No newline at end of file diff --git a/api/src/Sozsoft.Platform.DbMigrator/Seeds/WizardData/202607281645_Gantt.json b/api/src/Sozsoft.Platform.DbMigrator/Seeds/WizardData/202607281645_Gantt.json deleted file mode 100644 index bfa39b00..00000000 --- a/api/src/Sozsoft.Platform.DbMigrator/Seeds/WizardData/202607281645_Gantt.json +++ /dev/null @@ -1,214 +0,0 @@ -{ - "Wizard": { - "WizardName": "Gantt", - "ListFormCode": "App.Wizard.Gantt", - "MenuCode": "App.Wizard.Gantt", - "MenuOrder": 3, - "IsTenant": false, - "IsBranch": false, - "IsOrganizationUnit": false, - "AllowAdding": true, - "AllowUpdating": true, - "AllowDeleting": true, - "AllowDetail": false, - "ConfirmDelete": true, - "DefaultLayout": "gantt", - "Grid": true, - "Card": true, - "Pivot": true, - "Tree": false, - "Chart": true, - "Gantt": true, - "Scheduler": false, - "Todo": false, - "LanguageTextMenuEn": "Gantt", - "LanguageTextMenuTr": "Gantt", - "LanguageTextTitleEn": "Gantt", - "LanguageTextTitleTr": "Gantt", - "LanguageTextDescEn": "Gantt", - "LanguageTextDescTr": "Gantt", - "LanguageTextMenuParentEn": "Project", - "LanguageTextMenuParentTr": "Project", - "PermissionGroupName": "App.Wizard.Project", - "MenuParentCode": "App.Wizard.Project", - "MenuParentShortName": "Pro", - "MenuParentIcon": "FcVideoProjector", - "MenuIcon": "FcBullish", - "DataSourceCode": "Default", - "DataSourceConnectionString": "", - "SelectCommandType": 1, - "SelectCommand": "Pro_D_Gantt", - "KeyFieldName": "Id", - "KeyFieldDbSourceType": 9, - "TreeOptionDto": {}, - "GanttOptionDto": { - "KeyExpr": "Id", - "ParentIdExpr": "ParentId", - "HasItemsExpr": null, - "RootValue": null, - "ExpandedRowKeys": [], - "AutoExpandAll": true, - "RecursiveSelection": false, - "TitleExpr": "Title", - "ScaleType": "weeks", - "StartExpr": "StartDate", - "EndExpr": "EndDate", - "ProgressExpr": "Progress", - "AllowEditing": true, - "AllowTaskAdding": true, - "AllowTaskUpdating": true, - "AllowTaskResourceUpdating": true, - "AllowTaskDeleting": true, - "AllowDependencyAdding": true, - "AllowDependencyDeleting": true, - "AllowResourceAdding": true, - "AllowResourceUpdating": true, - "AllowResourceDeleting": true - }, - "SchedulerOptionDto": {}, - "TodoOptionDto": {}, - "WorkflowDto": { - "ApprovalUserFieldName": "", - "ApprovalDateFieldName": "", - "ApprovalStatusFieldName": "", - "ApprovalDescriptionFieldName": "", - "ApprovalIsFilterUserName": false, - "Criteria": [] - }, - "Groups": [ - { - "Caption": "", - "ColCount": 1, - "Items": [ - { - "FieldName": "Id", - "CaptionName": "App.Listform.ListformField.Id", - "EditorType": "dxTextBox", - "EditorOptions": "", - "EditorScript": "", - "ColSpan": 1, - "IsRequired": true, - "IncludeInEditingForm": true, - "DbSourceType": 9, - "TurkishCaption": "Id", - "EnglishCaption": "Id", - "LookupDataSourceType": 1, - "ValueExpr": "Key", - "DisplayExpr": "Name", - "LookupQuery": "" - }, - { - "FieldName": "Title", - "CaptionName": "App.Listform.ListformField.Title", - "EditorType": "dxTextBox", - "EditorOptions": "", - "EditorScript": "", - "ColSpan": 1, - "IsRequired": true, - "IncludeInEditingForm": true, - "DbSourceType": 16, - "TurkishCaption": "Title", - "EnglishCaption": "Title", - "LookupDataSourceType": 1, - "ValueExpr": "Key", - "DisplayExpr": "Name", - "LookupQuery": "" - }, - { - "FieldName": "ParentId", - "CaptionName": "App.Listform.ListformField.ParentId", - "EditorType": "dxSelectBox", - "EditorOptions": "", - "EditorScript": "", - "ColSpan": 1, - "IsRequired": false, - "IncludeInEditingForm": true, - "DbSourceType": 9, - "TurkishCaption": "Parent Id", - "EnglishCaption": "Parent Id", - "LookupDataSourceType": 2, - "ValueExpr": "Key", - "DisplayExpr": "Name", - "LookupQuery": "SELECT \u0022Id\u0022 AS \u0022Key\u0022, \u0022Title\u0022 AS \u0022Name\u0022 FROM \u0022Pro_D_Gantt\u0022 ORDER BY \u0022Title\u0022;" - }, - { - "FieldName": "StartDate", - "CaptionName": "App.Listform.ListformField.StartDate", - "EditorType": "dxDateBox", - "EditorOptions": "", - "EditorScript": "", - "ColSpan": 1, - "IsRequired": true, - "IncludeInEditingForm": true, - "DbSourceType": 6, - "TurkishCaption": "Start Date", - "EnglishCaption": "Start Date", - "LookupDataSourceType": 1, - "ValueExpr": "Key", - "DisplayExpr": "Name", - "LookupQuery": "" - }, - { - "FieldName": "EndDate", - "CaptionName": "App.Listform.ListformField.EndDate", - "EditorType": "dxDateBox", - "EditorOptions": "", - "EditorScript": "", - "ColSpan": 1, - "IsRequired": true, - "IncludeInEditingForm": true, - "DbSourceType": 6, - "TurkishCaption": "End Date", - "EnglishCaption": "End Date", - "LookupDataSourceType": 1, - "ValueExpr": "Key", - "DisplayExpr": "Name", - "LookupQuery": "" - }, - { - "FieldName": "Progress", - "CaptionName": "App.Listform.ListformField.Progress", - "EditorType": "dxNumberBox", - "EditorOptions": "", - "EditorScript": "", - "ColSpan": 1, - "IsRequired": true, - "IncludeInEditingForm": true, - "DbSourceType": 11, - "TurkishCaption": "Progress", - "EnglishCaption": "Progress", - "LookupDataSourceType": 1, - "ValueExpr": "Key", - "DisplayExpr": "Name", - "LookupQuery": "" - } - ] - } - ], - "SubForms": [], - "Widgets": [] - }, - "IsDeletedField": false, - "IsCreatedField": false, - "InsertedRecords": { - "LanguageKeys": [ - "App.Wizard.Gantt", - "App.Wizard.Gantt.Title", - "App.Wizard.Gantt.Desc" - ], - "PermissionGroupNames": [], - "PermissionNames": [ - "App.Wizard.Gantt", - "App.Wizard.Gantt.Create", - "App.Wizard.Gantt.Update", - "App.Wizard.Gantt.Delete", - "App.Wizard.Gantt.Export", - "App.Wizard.Gantt.Import", - "App.Wizard.Gantt.Note" - ], - "MenuCodes": [ - "App.Wizard.Gantt" - ], - "DataSourceCodes": [] - } -} \ No newline at end of file diff --git a/api/src/Sozsoft.Platform.DbMigrator/Seeds/WizardData/202607291133_Scheduler.json b/api/src/Sozsoft.Platform.DbMigrator/Seeds/WizardData/202607291133_Scheduler.json deleted file mode 100644 index 232e2609..00000000 --- a/api/src/Sozsoft.Platform.DbMigrator/Seeds/WizardData/202607291133_Scheduler.json +++ /dev/null @@ -1,230 +0,0 @@ -{ - "Wizard": { - "WizardName": "Scheduler", - "ListFormCode": "App.Wizard.Scheduler", - "MenuCode": "App.Wizard.Scheduler", - "MenuOrder": 4, - "IsTenant": false, - "IsBranch": false, - "IsOrganizationUnit": false, - "AllowAdding": true, - "AllowUpdating": true, - "AllowDeleting": true, - "AllowDetail": false, - "ConfirmDelete": true, - "DefaultLayout": "scheduler", - "Grid": true, - "Card": true, - "Pivot": true, - "Tree": false, - "Chart": true, - "Gantt": false, - "Scheduler": true, - "Todo": false, - "LanguageTextMenuEn": "Scheduler", - "LanguageTextMenuTr": "Scheduler", - "LanguageTextTitleEn": "Scheduler", - "LanguageTextTitleTr": "Scheduler", - "LanguageTextDescEn": "Scheduler", - "LanguageTextDescTr": "Scheduler", - "LanguageTextMenuParentEn": "Project", - "LanguageTextMenuParentTr": "Project", - "PermissionGroupName": "App.Wizard.Project", - "MenuParentCode": "App.Wizard.Project", - "MenuParentShortName": "Pro", - "MenuParentIcon": "FcVideoProjector", - "MenuIcon": "FaGlassCheers", - "DataSourceCode": "Default", - "DataSourceConnectionString": "", - "SelectCommandType": 1, - "SelectCommand": "Pro_D_Scheduler", - "KeyFieldName": "Id", - "KeyFieldDbSourceType": 9, - "TreeOptionDto": {}, - "GanttOptionDto": {}, - "SchedulerOptionDto": { - "TextExpr": "Text", - "StartDateExpr": "StartDate", - "EndDateExpr": "EndDate", - "AllDayExpr": "AllDay", - "RecurrenceRuleExpr": "RecurrenceRule", - "RecurrenceExceptionExpr": "RecurrenceException", - "StartDayHour": 8, - "EndDayHour": 20, - "DefaultView": "week", - "ShowAllDayPanel": true, - "CellDuration": 30, - "FirstDayOfWeek": 1, - "CrossScrollingEnabled": true, - "AllowResizing": true, - "AllowDragging": true, - "AllowDeleting": true, - "AllowEditing": true, - "AllowAdding": true - }, - "TodoOptionDto": {}, - "WorkflowDto": { - "ApprovalUserFieldName": "", - "ApprovalDateFieldName": "", - "ApprovalStatusFieldName": "", - "ApprovalDescriptionFieldName": "", - "ApprovalIsFilterUserName": false, - "Criteria": [] - }, - "Groups": [ - { - "Caption": "", - "ColCount": 1, - "Items": [ - { - "FieldName": "Id", - "CaptionName": "App.Listform.ListformField.Id", - "EditorType": "dxTextBox", - "EditorOptions": "", - "EditorScript": "", - "ColSpan": 1, - "IsRequired": true, - "IncludeInEditingForm": true, - "DbSourceType": 9, - "TurkishCaption": "Id", - "EnglishCaption": "Id", - "LookupDataSourceType": 1, - "ValueExpr": "Key", - "DisplayExpr": "Name", - "LookupQuery": "" - }, - { - "FieldName": "Text", - "CaptionName": "App.Listform.ListformField.Text", - "EditorType": "dxTextBox", - "EditorOptions": "", - "EditorScript": "", - "ColSpan": 1, - "IsRequired": true, - "IncludeInEditingForm": true, - "DbSourceType": 16, - "TurkishCaption": "Text", - "EnglishCaption": "Text", - "LookupDataSourceType": 1, - "ValueExpr": "Key", - "DisplayExpr": "Name", - "LookupQuery": "" - }, - { - "FieldName": "StartDate", - "CaptionName": "App.Listform.ListformField.StartDate", - "EditorType": "dxDateBox", - "EditorOptions": "", - "EditorScript": "", - "ColSpan": 1, - "IsRequired": true, - "IncludeInEditingForm": true, - "DbSourceType": 6, - "TurkishCaption": "Start Date", - "EnglishCaption": "Start Date", - "LookupDataSourceType": 1, - "ValueExpr": "Key", - "DisplayExpr": "Name", - "LookupQuery": "" - }, - { - "FieldName": "EndDate", - "CaptionName": "App.Listform.ListformField.EndDate", - "EditorType": "dxDateBox", - "EditorOptions": "", - "EditorScript": "", - "ColSpan": 1, - "IsRequired": true, - "IncludeInEditingForm": true, - "DbSourceType": 6, - "TurkishCaption": "End Date", - "EnglishCaption": "End Date", - "LookupDataSourceType": 1, - "ValueExpr": "Key", - "DisplayExpr": "Name", - "LookupQuery": "" - }, - { - "FieldName": "AllDay", - "CaptionName": "App.Listform.ListformField.AllDay", - "EditorType": "dxCheckBox", - "EditorOptions": "", - "EditorScript": "", - "ColSpan": 1, - "IsRequired": true, - "IncludeInEditingForm": true, - "DbSourceType": 3, - "TurkishCaption": "All Day", - "EnglishCaption": "All Day", - "LookupDataSourceType": 1, - "ValueExpr": "Key", - "DisplayExpr": "Name", - "LookupQuery": "" - }, - { - "FieldName": "RecurrenceRule", - "CaptionName": "App.Listform.ListformField.RecurrenceRule", - "EditorType": "dxTextBox", - "EditorOptions": "", - "EditorScript": "", - "ColSpan": 1, - "IsRequired": false, - "IncludeInEditingForm": true, - "DbSourceType": 16, - "TurkishCaption": "Recurrence Rule", - "EnglishCaption": "Recurrence Rule", - "LookupDataSourceType": 1, - "ValueExpr": "Key", - "DisplayExpr": "Name", - "LookupQuery": "" - }, - { - "FieldName": "RecurrenceException", - "CaptionName": "App.Listform.ListformField.RecurrenceException", - "EditorType": "dxTextBox", - "EditorOptions": "", - "EditorScript": "", - "ColSpan": 1, - "IsRequired": false, - "IncludeInEditingForm": true, - "DbSourceType": 16, - "TurkishCaption": "Recurrence Exception", - "EnglishCaption": "Recurrence Exception", - "LookupDataSourceType": 1, - "ValueExpr": "Key", - "DisplayExpr": "Name", - "LookupQuery": "" - } - ] - } - ], - "SubForms": [], - "Widgets": [] - }, - "IsDeletedField": false, - "IsCreatedField": false, - "InsertedRecords": { - "LanguageKeys": [ - "App.Wizard.Scheduler", - "App.Wizard.Scheduler.Title", - "App.Wizard.Scheduler.Desc", - "App.Listform.ListformField.AllDay", - "App.Listform.ListformField.RecurrenceRule", - "App.Listform.ListformField.RecurrenceException" - ], - "PermissionGroupNames": [], - "PermissionNames": [ - "App.Wizard.Scheduler", - "App.Wizard.Scheduler.Create", - "App.Wizard.Scheduler.Update", - "App.Wizard.Scheduler.Delete", - "App.Wizard.Scheduler.Export", - "App.Wizard.Scheduler.Import", - "App.Wizard.Scheduler.Note" - ], - "MenuCodes": [ - "App.Wizard.Scheduler" - ], - "DataSourceCodes": [] - } -} \ No newline at end of file diff --git a/api/src/Sozsoft.Platform.Domain.Shared/Enums/TableNameEnum.cs b/api/src/Sozsoft.Platform.Domain.Shared/Enums/TableNameEnum.cs index 83a1350f..d8dacd21 100644 --- a/api/src/Sozsoft.Platform.Domain.Shared/Enums/TableNameEnum.cs +++ b/api/src/Sozsoft.Platform.Domain.Shared/Enums/TableNameEnum.cs @@ -96,5 +96,6 @@ public enum TableNameEnum VideoroomChat, Sequence, DbTableColumn, - DevRequest + DevRequest, + Agenda } diff --git a/api/src/Sozsoft.Platform.Domain.Shared/PlatformConsts.cs b/api/src/Sozsoft.Platform.Domain.Shared/PlatformConsts.cs index 60cae39f..657c4297 100644 --- a/api/src/Sozsoft.Platform.Domain.Shared/PlatformConsts.cs +++ b/api/src/Sozsoft.Platform.Domain.Shared/PlatformConsts.cs @@ -531,6 +531,7 @@ public static class PlatformConsts } public const string DevRequest = Prefix.App + ".DevRequest"; public const string DevRequests = Prefix.App + ".DevRequests"; + public const string Agenda = Prefix.App + ".Agenda"; } public static class AppErrorCodes diff --git a/api/src/Sozsoft.Platform.Domain.Shared/TableNameResolver.cs b/api/src/Sozsoft.Platform.Domain.Shared/TableNameResolver.cs index 2c4c712d..80b5aa96 100644 --- a/api/src/Sozsoft.Platform.Domain.Shared/TableNameResolver.cs +++ b/api/src/Sozsoft.Platform.Domain.Shared/TableNameResolver.cs @@ -87,6 +87,7 @@ public static class TableNameResolver { nameof(TableNameEnum.VideoroomAttandance), (TablePrefix.TenantByName, MenuPrefix.Administration) }, { nameof(TableNameEnum.VideoroomChat), (TablePrefix.TenantByName, MenuPrefix.Administration) }, { nameof(TableNameEnum.Sequence), (TablePrefix.TenantByName, MenuPrefix.Administration) }, + { nameof(TableNameEnum.Agenda), (TablePrefix.TenantByName, MenuPrefix.Administration) }, // 🔹 INTRANET TABLOLARI { nameof(TableNameEnum.Announcement), (TablePrefix.TenantByName, MenuPrefix.Administration) }, diff --git a/api/src/Sozsoft.Platform.Domain/Data/SeedConsts.cs b/api/src/Sozsoft.Platform.Domain/Data/SeedConsts.cs index 1faf3dff..de05f9e5 100644 --- a/api/src/Sozsoft.Platform.Domain/Data/SeedConsts.cs +++ b/api/src/Sozsoft.Platform.Domain/Data/SeedConsts.cs @@ -485,6 +485,7 @@ public static class SeedConsts } public const string DevRequest = Prefix.App + ".DevRequest"; public const string DevRequests = Prefix.App + ".DevRequests"; + public const string Agenda = Prefix.App + ".Agenda"; } public static class DataSources diff --git a/api/src/Sozsoft.Platform.Domain/Entities/Tenant/Administration/Agenda.cs b/api/src/Sozsoft.Platform.Domain/Entities/Tenant/Administration/Agenda.cs new file mode 100644 index 00000000..c9286065 --- /dev/null +++ b/api/src/Sozsoft.Platform.Domain/Entities/Tenant/Administration/Agenda.cs @@ -0,0 +1,26 @@ +using System; +using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.MultiTenancy; + +namespace Sozsoft.Platform.Entities; + +public class Agenda : FullAuditedEntity, IMultiTenant +{ + public Guid? TenantId { get; set; } + + public string UserName { get; set; } + public string Text { get; set; } + public string Description { get; set; } + + public DateTime StartDate { get; set; } + public DateTime EndDate { get; set; } + public bool? AllDay { get; set; } + public string RecurrenceRule { get; set; } + public string RecurrenceException { get; set; } + + public Agenda(Guid id) + { + Id = id; + } +} + diff --git a/api/src/Sozsoft.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs b/api/src/Sozsoft.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs index ffa5836c..900e2f8b 100644 --- a/api/src/Sozsoft.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs +++ b/api/src/Sozsoft.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs @@ -104,6 +104,7 @@ public class PlatformDbContext : public DbSet Sectors { get; set; } public DbSet SkillTypes { get; set; } public DbSet DevRequests { get; set; } + public DbSet Agendas { get; set; } // Dynamic Services public DbSet Skills { get; set; } @@ -1581,7 +1582,7 @@ public class PlatformDbContext : b.Property(x => x.IsActive).HasDefaultValue(true); b.Property(x => x.RefreshedAt).HasDefaultValueSql("SYSDATETIME()"); b.Property(x => x.SourceProcedure).HasMaxLength(128); - b.Property(x => x.Note).HasMaxLength(4000); + b.Property(x => x.Note).HasMaxLength(4096); }); builder.Entity(b => @@ -1589,18 +1590,32 @@ public class PlatformDbContext : b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.DevRequest)), Prefix.DbSchema); b.ConfigureByConvention(); - b.Property(e => e.UserName).HasMaxLength(50).IsRequired(); + b.Property(e => e.UserName).HasMaxLength(256).IsRequired(); - b.Property(e => e.Title).HasMaxLength(300).IsRequired(); - b.Property(e => e.Status).HasMaxLength(50).IsRequired(); + b.Property(e => e.Title).HasMaxLength(512).IsRequired(); + b.Property(e => e.Status).HasMaxLength(64).IsRequired(); b.Property(e => e.Description).HasColumnType("text"); - b.Property(e => e.Tags).HasMaxLength(300); - b.Property(e => e.Assignees).HasMaxLength(300); - b.Property(e => e.Priority).HasMaxLength(50); + b.Property(e => e.Tags).HasMaxLength(256); + b.Property(e => e.Assignees).HasMaxLength(512); + b.Property(e => e.Priority).HasMaxLength(64); b.Property(e => e.Completed).HasDefaultValue(false); b.Property(e => e.SortOrder).HasDefaultValue(0); }); + builder.Entity(b => + { + b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Agenda)), Prefix.DbSchema); + b.ConfigureByConvention(); + + b.Property(e => e.UserName).HasMaxLength(256).IsRequired(); + + b.Property(e => e.Text).HasMaxLength(512).IsRequired(); + b.Property(e => e.Description).HasColumnType("text"); + b.Property(e => e.AllDay).HasDefaultValue(false); + b.Property(e => e.RecurrenceRule).HasMaxLength(512); + b.Property(e => e.RecurrenceException).HasColumnType("text"); + }); + ConfigureProviderSpecificModel(builder); } diff --git a/api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/20260730083424_Initial.Designer.cs b/api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/20260730174943_Initial.Designer.cs similarity index 99% rename from api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/20260730083424_Initial.Designer.cs rename to api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/20260730174943_Initial.Designer.cs index f56f5532..d40e3059 100644 --- a/api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/20260730083424_Initial.Designer.cs +++ b/api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/20260730174943_Initial.Designer.cs @@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore; namespace Sozsoft.Platform.Migrations { [DbContext(typeof(PlatformDbContext))] - [Migration("20260730083424_Initial")] + [Migration("20260730174943_Initial")] partial class Initial { /// @@ -679,6 +679,81 @@ namespace Sozsoft.Platform.Migrations b.ToTable("Sas_H_About", (string)null); }); + modelBuilder.Entity("Sozsoft.Platform.Entities.Agenda", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AllDay") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("EndDate") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("RecurrenceException") + .HasColumnType("text"); + + b.Property("RecurrenceRule") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); + + b.Property("StartDate") + .HasColumnType("datetime2"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Text") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); + + b.Property("UserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.ToTable("Adm_T_Agenda", (string)null); + }); + modelBuilder.Entity("Sozsoft.Platform.Entities.AiBot", b => { b.Property("Id") @@ -2045,8 +2120,8 @@ namespace Sozsoft.Platform.Migrations .HasDefaultValue(500); b.Property("Note") - .HasMaxLength(4000) - .HasColumnType("nvarchar(4000)"); + .HasMaxLength(4096) + .HasColumnType("nvarchar(max)"); b.Property("OnlyBaseDefinitions") .ValueGeneratedOnAdd() @@ -2223,8 +2298,8 @@ namespace Sozsoft.Platform.Migrations .HasColumnType("uniqueidentifier"); b.Property("Assignees") - .HasMaxLength(300) - .HasColumnType("nvarchar(300)"); + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); b.Property("Completed") .ValueGeneratedOnAdd() @@ -2268,8 +2343,8 @@ namespace Sozsoft.Platform.Migrations .HasColumnName("LastModifierId"); b.Property("Priority") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); b.Property("RequestDate") .HasColumnType("datetime2"); @@ -2281,25 +2356,25 @@ namespace Sozsoft.Platform.Migrations b.Property("Status") .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); b.Property("Tags") - .HasMaxLength(300) - .HasColumnType("nvarchar(300)"); + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); b.Property("TenantId") .HasColumnType("uniqueidentifier"); b.Property("Title") .IsRequired() - .HasMaxLength(300) - .HasColumnType("nvarchar(300)"); + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); b.Property("UserName") .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); b.HasKey("Id"); diff --git a/api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/20260730083424_Initial.cs b/api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/20260730174943_Initial.cs similarity index 99% rename from api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/20260730083424_Initial.cs rename to api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/20260730174943_Initial.cs index 2d0b0056..d25e75f5 100644 --- a/api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/20260730083424_Initial.cs +++ b/api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/20260730174943_Initial.cs @@ -480,6 +480,33 @@ namespace Sozsoft.Platform.Migrations table.PrimaryKey("PK_AbpUsers", x => x.Id); }); + migrationBuilder.CreateTable( + name: "Adm_T_Agenda", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + UserName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), + Text = table.Column(type: "nvarchar(512)", maxLength: 512, nullable: false), + Description = table.Column(type: "text", nullable: true), + StartDate = table.Column(type: "datetime2", nullable: false), + EndDate = table.Column(type: "datetime2", nullable: false), + AllDay = table.Column(type: "bit", nullable: true, defaultValue: false), + RecurrenceRule = table.Column(type: "nvarchar(512)", maxLength: 512, nullable: true), + RecurrenceException = table.Column(type: "text", nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Adm_T_Agenda", x => x.Id); + }); + migrationBuilder.CreateTable( name: "Adm_T_Announcement", columns: table => new @@ -1216,7 +1243,7 @@ namespace Sozsoft.Platform.Migrations IsActive = table.Column(type: "bit", nullable: false, defaultValue: true), RefreshedAt = table.Column(type: "datetime2", nullable: false, defaultValueSql: "SYSDATETIME()"), SourceProcedure = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), - Note = table.Column(type: "nvarchar(4000)", maxLength: 4000, nullable: true) + Note = table.Column(type: "nvarchar(max)", maxLength: 4096, nullable: true) }, constraints: table => { @@ -1255,15 +1282,15 @@ namespace Sozsoft.Platform.Migrations { Id = table.Column(type: "uniqueidentifier", nullable: false), TenantId = table.Column(type: "uniqueidentifier", nullable: true), - UserName = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + UserName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), RequestDate = table.Column(type: "datetime2", nullable: true), - Title = table.Column(type: "nvarchar(300)", maxLength: 300, nullable: false), - Status = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + Title = table.Column(type: "nvarchar(512)", maxLength: 512, nullable: false), + Status = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), Description = table.Column(type: "text", nullable: true), DueDate = table.Column(type: "datetime2", nullable: true), - Tags = table.Column(type: "nvarchar(300)", maxLength: 300, nullable: true), - Assignees = table.Column(type: "nvarchar(300)", maxLength: 300, nullable: true), - Priority = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Tags = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), + Assignees = table.Column(type: "nvarchar(512)", maxLength: 512, nullable: true), + Priority = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), Completed = table.Column(type: "bit", nullable: true, defaultValue: false), SortOrder = table.Column(type: "int", nullable: true, defaultValue: 0), CreationTime = table.Column(type: "datetime2", nullable: false), @@ -4381,6 +4408,9 @@ namespace Sozsoft.Platform.Migrations migrationBuilder.DropTable( name: "AbpUserTokens"); + migrationBuilder.DropTable( + name: "Adm_T_Agenda"); + migrationBuilder.DropTable( name: "Adm_T_AnnouncementComment"); diff --git a/api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs b/api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs index b787d82d..f9a10b2a 100644 --- a/api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs +++ b/api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs @@ -676,6 +676,81 @@ namespace Sozsoft.Platform.Migrations b.ToTable("Sas_H_About", (string)null); }); + modelBuilder.Entity("Sozsoft.Platform.Entities.Agenda", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AllDay") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("EndDate") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("RecurrenceException") + .HasColumnType("text"); + + b.Property("RecurrenceRule") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); + + b.Property("StartDate") + .HasColumnType("datetime2"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Text") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); + + b.Property("UserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.ToTable("Adm_T_Agenda", (string)null); + }); + modelBuilder.Entity("Sozsoft.Platform.Entities.AiBot", b => { b.Property("Id") @@ -2042,8 +2117,8 @@ namespace Sozsoft.Platform.Migrations .HasDefaultValue(500); b.Property("Note") - .HasMaxLength(4000) - .HasColumnType("nvarchar(4000)"); + .HasMaxLength(4096) + .HasColumnType("nvarchar(max)"); b.Property("OnlyBaseDefinitions") .ValueGeneratedOnAdd() @@ -2220,8 +2295,8 @@ namespace Sozsoft.Platform.Migrations .HasColumnType("uniqueidentifier"); b.Property("Assignees") - .HasMaxLength(300) - .HasColumnType("nvarchar(300)"); + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); b.Property("Completed") .ValueGeneratedOnAdd() @@ -2265,8 +2340,8 @@ namespace Sozsoft.Platform.Migrations .HasColumnName("LastModifierId"); b.Property("Priority") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); b.Property("RequestDate") .HasColumnType("datetime2"); @@ -2278,25 +2353,25 @@ namespace Sozsoft.Platform.Migrations b.Property("Status") .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); b.Property("Tags") - .HasMaxLength(300) - .HasColumnType("nvarchar(300)"); + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); b.Property("TenantId") .HasColumnType("uniqueidentifier"); b.Property("Title") .IsRequired() - .HasMaxLength(300) - .HasColumnType("nvarchar(300)"); + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); b.Property("UserName") .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); b.HasKey("Id"); diff --git a/ui/src/proxy/form/models.ts b/ui/src/proxy/form/models.ts index b0db7af8..f4e8aaac 100644 --- a/ui/src/proxy/form/models.ts +++ b/ui/src/proxy/form/models.ts @@ -431,6 +431,8 @@ export interface GanttOptionDto { export interface SchedulerOptionDto { textExpr?: string + userNameExpr?: string + descriptionExpr?: string startDateExpr?: string endDateExpr?: string allDayExpr?: string diff --git a/ui/src/views/admin/listForm/edit/FormTabScheduler.tsx b/ui/src/views/admin/listForm/edit/FormTabScheduler.tsx index be611e9e..7b6e157d 100644 --- a/ui/src/views/admin/listForm/edit/FormTabScheduler.tsx +++ b/ui/src/views/admin/listForm/edit/FormTabScheduler.tsx @@ -71,12 +71,26 @@ function FormTabScheduler(props: FormEditProps) { return null } + const userNameField = fieldList.find((field) => String(field.value).toLowerCase() === 'username') + const descriptionField = fieldList.find( + (field) => String(field.value).toLowerCase() === 'description', + ) + return ( { - await props.onSubmit(ListFormEditTabs.SchedulerForm, values, formikHelpers) + const submittedValues = { + ...values, + schedulerOptionDto: { + ...values.schedulerOptionDto, + userNameExpr: values.schedulerOptionDto.userNameExpr ?? userNameField?.value, + descriptionExpr: values.schedulerOptionDto.descriptionExpr ?? descriptionField?.value, + }, + } + + await props.onSubmit(ListFormEditTabs.SchedulerForm, submittedValues, formikHelpers) }} > {({ touched, errors, isSubmitting, values }) => ( @@ -110,6 +124,44 @@ function FormTabScheduler(props: FormEditProps) { + + + {({ field, form }: FieldProps) => ( + + option.value === + (values.schedulerOptionDto.descriptionExpr ?? descriptionField?.value), + )} + onChange={(option) => form.setFieldValue(field.name, option?.value)} + /> + )} + + + - {' '} diff --git a/ui/src/views/developerKit/SqlTableDesignerDialog.tsx b/ui/src/views/developerKit/SqlTableDesignerDialog.tsx index 43836c77..6709929a 100644 --- a/ui/src/views/developerKit/SqlTableDesignerDialog.tsx +++ b/ui/src/views/developerKit/SqlTableDesignerDialog.tsx @@ -439,15 +439,33 @@ const SCHEDULER_COLUMNS: ColumnDefinition[] = [ defaultValue: 'NEWID()', description: 'Scheduler appointment primary key', }, + { + id: '__SchedulerUserName', + columnName: 'UserName', + dataType: 'nvarchar', + maxLength: '256', + isNullable: false, + defaultValue: '', + description: 'Scheduler appointment userName', + }, { id: '__SchedulerText', columnName: 'Text', dataType: 'nvarchar', - maxLength: '300', + maxLength: '512', isNullable: false, defaultValue: '', description: 'Scheduler appointment text', }, + { + id: '__SchedulerDescription', + columnName: 'Description', + dataType: 'nvarchar(MAX)', + maxLength: '', + isNullable: false, + defaultValue: '', + description: 'Scheduler appointment description', + }, { id: '__SchedulerStartDate', columnName: 'StartDate', @@ -479,7 +497,7 @@ const SCHEDULER_COLUMNS: ColumnDefinition[] = [ id: '__SchedulerRecurrenceRule', columnName: 'RecurrenceRule', dataType: 'nvarchar', - maxLength: '500', + maxLength: '512', isNullable: true, defaultValue: '', description: 'Scheduler recurrence rule', diff --git a/ui/src/views/list/SchedulerView.tsx b/ui/src/views/list/SchedulerView.tsx index 87acb22f..1a8ebe33 100644 --- a/ui/src/views/list/SchedulerView.tsx +++ b/ui/src/views/list/SchedulerView.tsx @@ -1,9 +1,10 @@ import Container from '@/components/shared/Container' import '@/utils/registerDevExtremeEditors' -import { APP_NAME, DX_CLASSNAMES } from '@/constants/app.constant' +import { APP_NAME, AVATAR_URL, DX_CLASSNAMES } from '@/constants/app.constant' import { ColumnFormatDto, DbTypeEnum, + FieldCustomValueTypeEnum, GridDto, PlatformEditorTypes, UiLookupDataSourceTypeEnum, @@ -17,9 +18,9 @@ import Scheduler, { Toolbar, View, } from 'devextreme-react/scheduler' -import { useCallback, useEffect, useRef, useState } from 'react' +import { useCallback, useEffect, useMemo, useRef, useState } from 'react' import { Helmet } from 'react-helmet' -import { getList } from '@/services/form.service' +import { getList, getNextSequenceValue } from '@/services/form.service' import { useListFormCustomDataSource } from './useListFormCustomDataSource' import { addCss, addJs, autoNumber, getEditingFormGroups } from './Utils' import { layoutTypes } from '../admin/listForm/edit/types' @@ -29,10 +30,14 @@ import { usePWA } from '@/utils/hooks/usePWA' import CustomStore from 'devextreme/data/custom_store' import { Loading } from '@/components/shared' import { usePermission } from '@/utils/hooks/usePermission' -import { RowMode, SimpleItemWithColData } from '../form/types' +import { SimpleItemWithColData } from '../form/types' import { captionize } from 'devextreme/core/utils/inflector' import { formatDate } from 'devextreme/localization' import type { AppointmentFormOpeningEvent } from 'devextreme/ui/scheduler' +import type { ValidationRule } from 'devextreme/common' +import { FaAlignLeft, FaClock, FaHeading } from 'react-icons/fa' +import { Avatar } from '@/components/ui' +import { getUsers } from '@/services/identity.service' interface SchedulerViewProps { listFormCode: string @@ -43,12 +48,45 @@ interface SchedulerViewProps { gridDto?: GridDto } +const isTouchLikeDevice = () => + typeof window !== 'undefined' && + (window.matchMedia?.('(pointer: coarse)').matches || window.matchMedia?.('(hover: none)').matches) + +const isMobileViewport = () => + typeof window !== 'undefined' && window.matchMedia?.('(max-width: 767px)').matches + +const getEditPopupHeight = (useMobileEditPopup: boolean, isPopupFullScreen: boolean) => + useMobileEditPopup && isPopupFullScreen ? '100%' : 'auto' + +const getEditPopupMaxHeight = ( + useMobileEditPopup: boolean, + isPopupFullScreen: boolean, + configuredHeight?: number, +) => { + if (useMobileEditPopup && isPopupFullScreen) { + return '100%' + } + + return configuredHeight && configuredHeight > 0 ? configuredHeight : '90vh' +} + +const getValueByField = (data: Record, field?: string) => { + if (!field) { + return undefined + } + + const resolvedField = Object.keys(data).find( + (dataField) => dataField.toLowerCase() === field.toLowerCase(), + ) + + return resolvedField ? data[resolvedField] : undefined +} + const SchedulerView = (props: SchedulerViewProps) => { const { listFormCode, searchParams, isSubForm, level, gridDto: extGridDto } = props const { translate } = useLocalization() const isPwaMode = usePWA() - const [mode, setMode] = useState('view') - + const useMobileEditPopup = isMobileViewport() || isTouchLikeDevice() const schedulerRef = useRef() const refListFormCode = useRef('') const widgetGroupRef = useRef(null) @@ -59,8 +97,38 @@ const SchedulerView = (props: SchedulerViewProps) => { const [widgetGroupHeight, setWidgetGroupHeight] = useState(0) const [currentView, setCurrentView] = useState('week') const [isPopupFullScreen, setIsPopupFullScreen] = useState(false) + const [userAvatarUrls, setUserAvatarUrls] = useState>({}) const layout = layoutTypes.scheduler || 'scheduler' + useEffect(() => { + let cancelled = false + + getUsers(0, 1000) + .then((response) => { + if (cancelled) { + return + } + + const avatarUrls = (response.data?.items ?? []).reduce>( + (result, user) => { + if (user.userName) { + result[user.userName.toLowerCase()] = AVATAR_URL(user.id, user.tenantId) + } + + return result + }, + {}, + ) + + setUserAvatarUrls(avatarUrls) + }) + .catch((error) => console.error('Scheduler user avatars load error:', error)) + + return () => { + cancelled = true + } + }, []) + useEffect(() => { const initializeScheduler = async () => { const response = await getList({ listFormCode }) @@ -196,37 +264,155 @@ const SchedulerView = (props: SchedulerViewProps) => { [gridDto], ) + const getAppointmentPreviewDetails = useCallback( + (appointmentData: Record) => { + const schedulerOptions = gridDto?.gridOptions.schedulerOptionDto + const userNameField = + schedulerOptions?.userNameExpr ?? + gridDto?.columnFormats?.find((column) => column.fieldName?.toLowerCase() === 'username') + ?.fieldName + const descriptionField = + schedulerOptions?.descriptionExpr ?? + gridDto?.columnFormats?.find((column) => column.fieldName?.toLowerCase() === 'description') + ?.fieldName + const userName = getValueByField(appointmentData, userNameField) + const description = getValueByField(appointmentData, descriptionField) + + if ( + (userName === null || userName === undefined) && + (description === null || description === undefined) + ) { + return undefined + } + + return { + userName: userName === null || userName === undefined ? undefined : String(userName), + avatarUrl: + userName === null || userName === undefined + ? undefined + : userAvatarUrls[String(userName).toLowerCase()], + description: + description === null || description === undefined ? undefined : String(description), + } + }, + [gridDto, userAvatarUrls], + ) + const renderAppointment = useCallback( (data: any) => { const appointmentData = data.targetedAppointmentData || data.appointmentData || {} + const previewDetails = getAppointmentPreviewDetails(appointmentData) return ( - <> -
-
- {getAppointmentTimeText(appointmentData)} +
+ {previewDetails?.userName && ( +
+ + User: + {previewDetails.userName} +
+ )} + +
+
+ + Text +
+
- + + {previewDetails?.description && ( +
+
+ + Description +
+
+ {previewDetails.description} +
+
+ )} + +
+ + {getAppointmentTimeText(appointmentData)} +
+
) }, - [getAppointmentHtml, getAppointmentTimeText], + [getAppointmentHtml, getAppointmentPreviewDetails, getAppointmentTimeText], ) const renderAppointmentTooltip = useCallback( (data: any) => { const appointmentData = data.targetedAppointmentData || data.appointmentData || {} + const previewDetails = getAppointmentPreviewDetails(appointmentData) return ( -
-
-
-
{getAppointmentTimeText(appointmentData)}
+
+
+ {previewDetails?.userName && ( +
+ +
+
+ User Name +
+
+ {previewDetails.userName} +
+
+
+ )} + +
+
+ + Text +
+
+
+ + {previewDetails?.description && ( +
+
+ + Description +
+
+ {previewDetails.description} +
+
+ )} + +
+ + {getAppointmentTimeText(appointmentData)} +
{gridDto?.gridOptions.schedulerOptionDto?.allowDeleting && (
) }, - [getAppointmentHtml, getAppointmentTimeText, gridDto], + [getAppointmentHtml, getAppointmentPreviewDetails, getAppointmentTimeText, gridDto], ) const onAppointmentFormOpening = useCallback( @@ -258,23 +444,88 @@ const SchedulerView = (props: SchedulerViewProps) => { (!e.appointmentData.id && !e.appointmentData[gridDto.gridOptions.keyFieldName || 'id']) const currentMode = isNewAppointment ? 'new' : 'edit' - setMode(currentMode) - // Popup ayarlarını her açılışta yeniden yapılandır - e.popup.option( - 'title', - (currentMode === 'new' ? '✚ ' : '🖊️ ') + - translate('::' + gridDto.gridOptions.editingOptionDto?.popup?.title), - ) - e.popup.option('showTitle', gridDto.gridOptions.editingOptionDto?.popup?.showTitle) - e.popup.option('width', gridDto.gridOptions.editingOptionDto?.popup?.width) - e.popup.option('height', isPopupFullScreen ? '100%' : 'auto') - e.popup.option( - 'maxHeight', - isPopupFullScreen ? '100%' : gridDto.gridOptions.editingOptionDto?.popup?.height || '90vh', - ) - e.popup.option('resizeEnabled', gridDto.gridOptions.editingOptionDto?.popup?.resizeEnabled) - e.popup.option('fullScreen', isPopupFullScreen) + if (isNewAppointment) { + const appointmentData = (e.appointmentData ?? {}) as Record + const defaultValues: Record = {} + const sequenceDefaults: Promise[] = [] + + for (const colFormat of gridDto.columnFormats ?? []) { + const fieldName = colFormat.fieldName + + if ( + !fieldName || + colFormat.defaultValue === null || + colFormat.defaultValue === undefined + ) { + continue + } + + if ( + typeof colFormat.defaultValue === 'string' && + colFormat.defaultValue === '@AUTONUMBER' + ) { + defaultValues[fieldName] = autoNumber() + } else if (colFormat.defaultValueType === FieldCustomValueTypeEnum.Sequence) { + sequenceDefaults.push( + getNextSequenceValue(String(colFormat.defaultValue)) + .then((response) => { + const value = response.data + appointmentData[fieldName] = value + e.form.updateData(fieldName, value) + }) + .catch((error) => { + console.error('Sequence default value alınamadı:', { + fieldName, + defaultValue: colFormat.defaultValue, + error, + }) + }), + ) + } else { + defaultValues[fieldName] = colFormat.defaultValue + } + } + + Object.assign(appointmentData, defaultValues) + e.form.option('formData', { + ...(e.form.option('formData') ?? {}), + ...appointmentData, + }) + + void Promise.all(sequenceDefaults) + } + + const popupOptions = gridDto.gridOptions.editingOptionDto?.popup + const popupFullScreen = + useMobileEditPopup || isPopupFullScreen || (popupOptions?.fullScreen ?? false) + + // Popup ayarlarını Grid ile aynı ölçü ve cihaz kurallarıyla yapılandır. + e.popup.option({ + animation: {}, + deferRendering: true, + dragEnabled: popupOptions?.dragEnabled, + fullScreen: popupFullScreen, + height: getEditPopupHeight(useMobileEditPopup, popupFullScreen), + hideOnOutsideClick: popupOptions?.hideOnOutsideClick, + maxHeight: getEditPopupMaxHeight(useMobileEditPopup, popupFullScreen, popupOptions?.height), + maxWidth: useMobileEditPopup ? '100%' : popupOptions?.width, + position: useMobileEditPopup + ? { + my: 'top center', + at: 'top center', + of: typeof window !== 'undefined' ? window : undefined, + } + : popupOptions?.position, + resizeEnabled: popupOptions?.resizeEnabled, + restorePosition: popupOptions?.restorePosition, + showTitle: popupOptions?.showTitle, + title: (currentMode === 'new' ? '✚ ' : '🖊️ ') + translate('::' + popupOptions?.title), + width: useMobileEditPopup ? '100%' : popupOptions?.width, + wrapperAttr: useMobileEditPopup + ? { class: 'dx-scheduler-appointment-popup mobile-edit-popup' } + : undefined, + }) // Toolbar butonlarını ekle e.popup.option('toolbarItems', [ @@ -342,8 +593,8 @@ const SchedulerView = (props: SchedulerViewProps) => { toolbar: 'top', location: 'after', options: { - icon: 'fullscreen', - hint: translate('::Tam Ekran'), + icon: popupFullScreen ? 'collapse' : 'fullscreen', + hint: popupFullScreen ? translate('::Normal Boyut') : translate('::Tam Ekran'), stylingMode: 'text', onClick: () => { // Popup'tan mevcut fullScreen durumunu al @@ -356,19 +607,16 @@ const SchedulerView = (props: SchedulerViewProps) => { // Popup'ı güncelle e.popup.option('fullScreen', newFullScreenState) - // Width ve height'i da güncelle - if (newFullScreenState) { - e.popup.option('width', '100%') - e.popup.option('height', '100%') - e.popup.option('maxHeight', '100%') - } else { - e.popup.option('width', gridDto.gridOptions.editingOptionDto?.popup?.width || 600) - e.popup.option('height', 'auto') - e.popup.option( - 'maxHeight', - gridDto.gridOptions.editingOptionDto?.popup?.height || '90vh', - ) - } + e.popup.option({ + height: getEditPopupHeight(useMobileEditPopup, newFullScreenState), + maxHeight: getEditPopupMaxHeight( + useMobileEditPopup, + newFullScreenState, + popupOptions?.height, + ), + maxWidth: useMobileEditPopup ? '100%' : popupOptions?.width, + width: useMobileEditPopup ? '100%' : popupOptions?.width, + }) }, }, }, @@ -423,18 +671,6 @@ const SchedulerView = (props: SchedulerViewProps) => { } } - // Set defaultValue for @AUTONUMBER fields - if ( - typeof listFormField?.defaultValue === 'string' && - listFormField?.defaultValue === '@AUTONUMBER' && - currentMode === 'new' - ) { - editorOptions = { - ...editorOptions, - value: autoNumber(), - } - } - // EditorType belirleme let editorType: any = i.editorType2 if (i.editorType2 === PlatformEditorTypes.dxGridBox) { @@ -507,6 +743,9 @@ const SchedulerView = (props: SchedulerViewProps) => { colSpan: i.colSpan, editorOptions, editorScript: i.editorScript, + isRequired: + listFormField.validationRuleDto?.some((rule) => rule.type === 'required') ?? false, + validationRules: (listFormField.validationRuleDto ?? []) as ValidationRule[], } if (i.captionName) { @@ -549,21 +788,23 @@ const SchedulerView = (props: SchedulerViewProps) => { const groupItems = sortedItems.map(mapFormItem).filter(isVisibleFormItem) if (e.itemType !== 'tabbed') { - // Grup kullanmadan direkt items'ları ekle - form'un colCount'u geçerli olsun - result.push(...groupItems) + result.push({ + itemType: e.itemType, + colCount: e.colCount || 1, + colSpan: e.colSpan || 1, + caption: e.caption, + items: groupItems, + }) } else if (e.itemType === 'tabbed' && tabbedItems.length > 0 && e === tabbedItems[0]) { - // Tabbed için caption OLMAMALI - sadece tabs array içinde title kullan result.push({ itemType: 'tabbed', - // colCount tabbed item için OLMAMALI - sadece colSpan + colCount: 1, colSpan: 1, - // caption kullanma! Tabs içindeki title'lar yeterli tabs: tabbedItems.map((tabbedItem: any) => { - // Backend'den gelen colCount ve colSpan değerlerini kullan - const effectiveColCount = tabbedItem.colCount || 2 + const effectiveColCount = tabbedItem.colCount || 1 return { - title: tabbedItem.caption, // Her tab'ın title'ı + title: tabbedItem.caption, colCount: effectiveColCount, items: tabbedItem.items ?.sort((a: any, b: any) => @@ -578,46 +819,68 @@ const SchedulerView = (props: SchedulerViewProps) => { }) } - // Form'u tamamen yeniden yapılandır - const hasTabbedItems = result.some((item: any) => item.itemType === 'tabbed') - - // Form'u tamamen yeniden baştan yapılandır - e.form.option( - 'colCount', - hasTabbedItems ? 1 : getEditingFormGroups(gridDto)?.[0]?.colCount || 2, - ) - e.form.option( - 'colCount', - hasTabbedItems ? 1 : getEditingFormGroups(gridDto)?.[0]?.colCount || 2, - ) + e.form.option('colCount', 1) e.form.option('showValidationSummary', false) e.form.option('items', result) - - // Yeni versiyonlarda bu şekilde Style değiştirme işlemi yapmak zorunda olmayabiliriz. - // Yani geçici olarak eklenmiştir. - // Tabbed varsa belirli class'lara sahip elementi bul ve flex-direction'ı değiştir - if (hasTabbedItems) { - setTimeout(() => { - const targetElement = document.querySelector( - '.dx-item-content.dx-box-item-content.dx-box-flex.dx-box.dx-widget.dx-collection', - ) - if (targetElement) { - const htmlElement = targetElement as HTMLElement - - // Mevcut style'ı al ve flex-direction: row'u column'a çevir - const currentStyle = htmlElement.getAttribute('style') || '' - const updatedStyle = currentStyle.replace( - /flex-direction:\s*row/gi, - 'flex-direction: column', - ) - htmlElement.setAttribute('style', updatedStyle) - } - }, 100) - } }, - [gridDto, translate, isPopupFullScreen, listFormCode], + [gridDto, translate, isPopupFullScreen, listFormCode, useMobileEditPopup], ) + const configuredEditPopup = gridDto?.gridOptions.editingOptionDto?.popup + const schedulerPopupFullScreen = + useMobileEditPopup || isPopupFullScreen || (configuredEditPopup?.fullScreen ?? false) + const schedulerPopupWidth = useMobileEditPopup ? '100%' : configuredEditPopup?.width + const schedulerEditingPopup = useMemo( + () => + configuredEditPopup + ? { + animation: {}, + deferRendering: true, + dragEnabled: configuredEditPopup.dragEnabled, + fullScreen: schedulerPopupFullScreen, + height: getEditPopupHeight(useMobileEditPopup, schedulerPopupFullScreen), + hideOnOutsideClick: configuredEditPopup.hideOnOutsideClick, + maxHeight: getEditPopupMaxHeight( + useMobileEditPopup, + schedulerPopupFullScreen, + configuredEditPopup.height, + ), + maxWidth: schedulerPopupWidth, + position: useMobileEditPopup + ? { + my: 'top center', + at: 'top center', + of: typeof window !== 'undefined' ? window : undefined, + } + : configuredEditPopup.position, + resizeEnabled: configuredEditPopup.resizeEnabled, + restorePosition: configuredEditPopup.restorePosition, + width: schedulerPopupWidth, + wrapperAttr: useMobileEditPopup + ? { class: 'dx-scheduler-appointment-popup mobile-edit-popup' } + : undefined, + onShowing: (event: any) => { + event.component.option({ + fullScreen: schedulerPopupFullScreen, + height: getEditPopupHeight(useMobileEditPopup, schedulerPopupFullScreen), + maxHeight: getEditPopupMaxHeight( + useMobileEditPopup, + schedulerPopupFullScreen, + configuredEditPopup.height, + ), + maxWidth: schedulerPopupWidth, + width: schedulerPopupWidth, + }) + }, + } + : undefined, + [configuredEditPopup, schedulerPopupFullScreen, schedulerPopupWidth, useMobileEditPopup], + ) + const schedulerDescriptionExpr = + gridDto?.gridOptions.schedulerOptionDto?.descriptionExpr ?? + gridDto?.columnFormats?.find((column) => column.fieldName?.toLowerCase() === 'description') + ?.fieldName + return ( <>
0 ? 'mt-2' : ''}> @@ -652,6 +915,7 @@ const SchedulerView = (props: SchedulerViewProps) => { className="list-view-toolbar-host" dataSource={schedulerDataSource} dateSerializationFormat="yyyy-MM-ddTHH:mm:ss" + descriptionExpr={schedulerDescriptionExpr} textExpr={gridDto.gridOptions.schedulerOptionDto?.textExpr || 'text'} startDateExpr={gridDto.gridOptions.schedulerOptionDto?.startDateExpr || 'startDate'} endDateExpr={gridDto.gridOptions.schedulerOptionDto?.endDateExpr || 'endDate'} @@ -736,10 +1000,12 @@ const SchedulerView = (props: SchedulerViewProps) => {