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 new file mode 100644 index 00000000..2021ff6c --- /dev/null +++ b/api/src/Sozsoft.Platform.DbMigrator/Seeds/SqlData/Pro_D_Gantt.sql @@ -0,0 +1,17 @@ +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_T_Approval.sql b/api/src/Sozsoft.Platform.DbMigrator/Seeds/SqlData/Pro_T_Approval.sql index 94c4b87c..3331aac1 100644 --- a/api/src/Sozsoft.Platform.DbMigrator/Seeds/SqlData/Pro_T_Approval.sql +++ b/api/src/Sozsoft.Platform.DbMigrator/Seeds/SqlData/Pro_T_Approval.sql @@ -2,13 +2,14 @@ IF OBJECT_ID(N'[dbo].[Pro_T_Approval]', 'U') IS NULL BEGIN CREATE TABLE [dbo].[Pro_T_Approval] ( - [Id] uniqueidentifier NOT NULL DEFAULT NEWID(), - [ApprovalUserName] nvarchar(256) NULL, - [ApprovalStatus] nvarchar(50) NULL, + [Id] uniqueidentifier NOT NULL, + [ApprovalUserName] nvarchar(512) NULL, + [ApprovalStatus] nvarchar(100) NULL, [ApprovalDate] datetime NULL, - [ApprovalDescription] nvarchar(200) NULL, + [ApprovalDescription] nvarchar(400) NULL, [TenantId] uniqueidentifier NULL, - [Title] nvarchar(100) NULL, + [Title] nvarchar(200) NULL, + [ParentTitle] nvarchar(200) NULL, CONSTRAINT [PK_Pro_T_Approval] PRIMARY KEY NONCLUSTERED ( [Id] ASC diff --git a/api/src/Sozsoft.Platform.DbMigrator/Seeds/WizardData/202607171806_Approval.json b/api/src/Sozsoft.Platform.DbMigrator/Seeds/WizardData/202607281621_Approval.json similarity index 90% rename from api/src/Sozsoft.Platform.DbMigrator/Seeds/WizardData/202607171806_Approval.json rename to api/src/Sozsoft.Platform.DbMigrator/Seeds/WizardData/202607281621_Approval.json index 2ba2cde4..870bed9c 100644 --- a/api/src/Sozsoft.Platform.DbMigrator/Seeds/WizardData/202607171806_Approval.json +++ b/api/src/Sozsoft.Platform.DbMigrator/Seeds/WizardData/202607281621_Approval.json @@ -11,7 +11,7 @@ "AllowDeleting": true, "AllowDetail": false, "ConfirmDelete": true, - "DefaultLayout": "grid", + "DefaultLayout": "tree", "Grid": true, "Card": true, "Pivot": true, @@ -39,9 +39,9 @@ "SelectCommand": "Pro_T_Approval", "KeyFieldName": "Id", "KeyFieldDbSourceType": 9, - "TreeKeyExpr": "", - "TreeParentIdExpr": "", - "TreeAutoExpandAll": false, + "TreeKeyExpr": "Title", + "TreeParentIdExpr": "ParentTitle", + "TreeAutoExpandAll": true, "GanttKeyExpr": "", "GanttParentIdExpr": "", "GanttAutoExpandAll": false, @@ -248,6 +248,23 @@ "ValueExpr": "Key", "DisplayExpr": "Name", "LookupQuery": "" + }, + { + "FieldName": "ParentTitle", + "CaptionName": "App.Listform.ListformField.ParentTitle", + "EditorType": "dxSelectBox", + "EditorOptions": "", + "EditorScript": "", + "ColSpan": 1, + "IsRequired": false, + "IncludeInEditingForm": true, + "DbSourceType": 16, + "TurkishCaption": "Parent Title", + "EnglishCaption": "Parent Title", + "LookupDataSourceType": 2, + "ValueExpr": "Key", + "DisplayExpr": "Name", + "LookupQuery": "SELECT \u0022Title\u0022 AS \u0022Key\u0022, \u0022Title\u0022 AS \u0022Name\u0022 FROM \u0022Pro_T_Approval\u0022 ORDER BY \u0022Title\u0022;" } ] } @@ -261,7 +278,8 @@ "LanguageKeys": [ "App.Wizard.Approval", "App.Wizard.Approval.Title", - "App.Wizard.Approval.Desc" + "App.Wizard.Approval.Desc", + "App.Listform.ListformField.ParentTitle" ], "PermissionGroupNames": [], "PermissionNames": [ diff --git a/api/src/Sozsoft.Platform.DbMigrator/Seeds/WizardData/202607281645_Gantt.json b/api/src/Sozsoft.Platform.DbMigrator/Seeds/WizardData/202607281645_Gantt.json new file mode 100644 index 00000000..81213534 --- /dev/null +++ b/api/src/Sozsoft.Platform.DbMigrator/Seeds/WizardData/202607281645_Gantt.json @@ -0,0 +1,208 @@ +{ + "Wizard": { + "WizardName": "Gantt", + "ListFormCode": "App.Wizard.Gantt", + "MenuCode": "App.Wizard.Gantt", + "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": true, + "Chart": true, + "Gantt": true, + "Scheduler": true, + "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, + "TreeKeyExpr": "", + "TreeParentIdExpr": "", + "TreeAutoExpandAll": false, + "GanttKeyExpr": "Id", + "GanttParentIdExpr": "ParentId", + "GanttAutoExpandAll": true, + "GanttTitleExpr": "Title", + "GanttStartExpr": "StartDate", + "GanttEndExpr": "EndDate", + "GanttProgressExpr": "Progress", + "SchedulerTextExpr": "", + "SchedulerStartDateExpr": "", + "SchedulerEndDateExpr": "", + "TodoTitleExpr": "", + "TodoStatusExpr": "", + "TodoDescriptionExpr": "", + "TodoDueDateExpr": "", + "TodoTagExpr": "", + "TodoAssigneeExpr": "", + "TodoPriorityExpr": "", + "TodoCompletedExpr": "", + "TodoOrderExpr": "", + "TodoStatusOrder": "Backlog, Ready to Start, In Progress, Code Review, Testing, Staging", + "TodoAllowDragging": true, + "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": "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": "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": "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/ui/src/views/developerKit/SqlTableDesignerDialog.tsx b/ui/src/views/developerKit/SqlTableDesignerDialog.tsx index 7bbd40b9..a04a1c75 100644 --- a/ui/src/views/developerKit/SqlTableDesignerDialog.tsx +++ b/ui/src/views/developerKit/SqlTableDesignerDialog.tsx @@ -372,6 +372,129 @@ const TODO_COLUMNS: ColumnDefinition[] = [ }, ] +const GANTT_COLUMNS: ColumnDefinition[] = [ + { + id: '__GanttId', + columnName: 'Id', + dataType: 'uniqueidentifier', + maxLength: '', + isNullable: false, + defaultValue: 'NEWID()', + description: 'Gantt task primary key', + }, + { + id: '__GanttParentId', + columnName: 'ParentId', + dataType: 'uniqueidentifier', + maxLength: '', + isNullable: true, + defaultValue: '', + description: 'Parent Gantt task ID', + }, + { + id: '__GanttTitle', + columnName: 'Title', + dataType: 'nvarchar', + maxLength: '300', + isNullable: false, + defaultValue: '', + description: 'Gantt task title', + }, + { + id: '__GanttStartDate', + columnName: 'StartDate', + dataType: 'datetime2', + maxLength: '', + isNullable: false, + defaultValue: '', + description: 'Gantt task start date', + }, + { + id: '__GanttEndDate', + columnName: 'EndDate', + dataType: 'datetime2', + maxLength: '', + isNullable: false, + defaultValue: '', + description: 'Gantt task end date', + }, + { + id: '__GanttProgress', + columnName: 'Progress', + dataType: 'int', + maxLength: '', + isNullable: false, + defaultValue: '0', + description: 'Gantt task completion percentage', + }, +] + +const SCHEDULER_COLUMNS: ColumnDefinition[] = [ + { + id: '__SchedulerId', + columnName: 'Id', + dataType: 'uniqueidentifier', + maxLength: '', + isNullable: false, + defaultValue: 'NEWID()', + description: 'Scheduler appointment primary key', + }, + { + id: '__SchedulerText', + columnName: 'Text', + dataType: 'nvarchar', + maxLength: '300', + isNullable: false, + defaultValue: '', + description: 'Scheduler appointment text', + }, + { + id: '__SchedulerStartDate', + columnName: 'StartDate', + dataType: 'datetime2', + maxLength: '', + isNullable: false, + defaultValue: '', + description: 'Scheduler appointment start date', + }, + { + id: '__SchedulerEndDate', + columnName: 'EndDate', + dataType: 'datetime2', + maxLength: '', + isNullable: false, + defaultValue: '', + description: 'Scheduler appointment end date', + }, + { + id: '__SchedulerAllDay', + columnName: 'AllDay', + dataType: 'bit', + maxLength: '', + isNullable: false, + defaultValue: '0', + description: 'Scheduler all-day appointment flag', + }, + { + id: '__SchedulerRecurrenceRule', + columnName: 'RecurrenceRule', + dataType: 'nvarchar', + maxLength: '500', + isNullable: true, + defaultValue: '', + description: 'Scheduler recurrence rule', + }, + { + id: '__SchedulerRecurrenceException', + columnName: 'RecurrenceException', + dataType: 'nvarchar(MAX)', + maxLength: '', + isNullable: true, + defaultValue: '', + description: 'Scheduler recurrence exceptions', + }, +] + // ─── T-SQL Generator ────────────────────────────────────────────────────────── function colToSqlLine(col: ColumnDefinition, addComma = true): string { @@ -1402,6 +1525,34 @@ const SqlTableDesignerDialog = ({ addAutomaticPrimaryKey('todo', 'Todo primary key (auto)') } + const addGanttColumns = () => { + const existingNames = new Set(columns.map((c) => c.columnName.trim().toLowerCase())) + const toAdd = GANTT_COLUMNS.filter((c) => !existingNames.has(c.columnName.toLowerCase())) + + if (toAdd.length > 0) { + setColumns((prev) => { + const nonEmpty = prev.filter((c) => c.columnName.trim() !== '') + return [...nonEmpty, ...toAdd.map((c) => ({ ...c })), createEmptyColumn()] + }) + } + + addAutomaticPrimaryKey('gantt', 'Gantt primary key (auto)') + } + + const addSchedulerColumns = () => { + const existingNames = new Set(columns.map((c) => c.columnName.trim().toLowerCase())) + const toAdd = SCHEDULER_COLUMNS.filter((c) => !existingNames.has(c.columnName.toLowerCase())) + + if (toAdd.length > 0) { + setColumns((prev) => { + const nonEmpty = prev.filter((c) => c.columnName.trim() !== '') + return [...nonEmpty, ...toAdd.map((c) => ({ ...c })), createEmptyColumn()] + }) + } + + addAutomaticPrimaryKey('scheduler', 'Scheduler primary key (auto)') + } + const importColumnsFromRememberedCreateTable = async () => { let script = '' @@ -1858,31 +2009,41 @@ const SqlTableDesignerDialog = ({ )} {!colsLoading && ( <> -
-
- - - - - +
+
+
+ + + +
+
+ + + + +
-
+