Gantt, Scheduler kolonları ve Tree keyfieldName çağrısı
This commit is contained in:
parent
ab6a33c340
commit
3e50a28176
6 changed files with 483 additions and 38 deletions
|
|
@ -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
|
||||||
|
|
@ -2,13 +2,14 @@ IF OBJECT_ID(N'[dbo].[Pro_T_Approval]', 'U') IS NULL
|
||||||
BEGIN
|
BEGIN
|
||||||
CREATE TABLE [dbo].[Pro_T_Approval]
|
CREATE TABLE [dbo].[Pro_T_Approval]
|
||||||
(
|
(
|
||||||
[Id] uniqueidentifier NOT NULL DEFAULT NEWID(),
|
[Id] uniqueidentifier NOT NULL,
|
||||||
[ApprovalUserName] nvarchar(256) NULL,
|
[ApprovalUserName] nvarchar(512) NULL,
|
||||||
[ApprovalStatus] nvarchar(50) NULL,
|
[ApprovalStatus] nvarchar(100) NULL,
|
||||||
[ApprovalDate] datetime NULL,
|
[ApprovalDate] datetime NULL,
|
||||||
[ApprovalDescription] nvarchar(200) NULL,
|
[ApprovalDescription] nvarchar(400) NULL,
|
||||||
[TenantId] uniqueidentifier NULL,
|
[TenantId] uniqueidentifier NULL,
|
||||||
[Title] nvarchar(100) NULL,
|
[Title] nvarchar(200) NULL,
|
||||||
|
[ParentTitle] nvarchar(200) NULL,
|
||||||
CONSTRAINT [PK_Pro_T_Approval] PRIMARY KEY NONCLUSTERED
|
CONSTRAINT [PK_Pro_T_Approval] PRIMARY KEY NONCLUSTERED
|
||||||
(
|
(
|
||||||
[Id] ASC
|
[Id] ASC
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
"AllowDeleting": true,
|
"AllowDeleting": true,
|
||||||
"AllowDetail": false,
|
"AllowDetail": false,
|
||||||
"ConfirmDelete": true,
|
"ConfirmDelete": true,
|
||||||
"DefaultLayout": "grid",
|
"DefaultLayout": "tree",
|
||||||
"Grid": true,
|
"Grid": true,
|
||||||
"Card": true,
|
"Card": true,
|
||||||
"Pivot": true,
|
"Pivot": true,
|
||||||
|
|
@ -39,9 +39,9 @@
|
||||||
"SelectCommand": "Pro_T_Approval",
|
"SelectCommand": "Pro_T_Approval",
|
||||||
"KeyFieldName": "Id",
|
"KeyFieldName": "Id",
|
||||||
"KeyFieldDbSourceType": 9,
|
"KeyFieldDbSourceType": 9,
|
||||||
"TreeKeyExpr": "",
|
"TreeKeyExpr": "Title",
|
||||||
"TreeParentIdExpr": "",
|
"TreeParentIdExpr": "ParentTitle",
|
||||||
"TreeAutoExpandAll": false,
|
"TreeAutoExpandAll": true,
|
||||||
"GanttKeyExpr": "",
|
"GanttKeyExpr": "",
|
||||||
"GanttParentIdExpr": "",
|
"GanttParentIdExpr": "",
|
||||||
"GanttAutoExpandAll": false,
|
"GanttAutoExpandAll": false,
|
||||||
|
|
@ -248,6 +248,23 @@
|
||||||
"ValueExpr": "Key",
|
"ValueExpr": "Key",
|
||||||
"DisplayExpr": "Name",
|
"DisplayExpr": "Name",
|
||||||
"LookupQuery": ""
|
"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": [
|
"LanguageKeys": [
|
||||||
"App.Wizard.Approval",
|
"App.Wizard.Approval",
|
||||||
"App.Wizard.Approval.Title",
|
"App.Wizard.Approval.Title",
|
||||||
"App.Wizard.Approval.Desc"
|
"App.Wizard.Approval.Desc",
|
||||||
|
"App.Listform.ListformField.ParentTitle"
|
||||||
],
|
],
|
||||||
"PermissionGroupNames": [],
|
"PermissionGroupNames": [],
|
||||||
"PermissionNames": [
|
"PermissionNames": [
|
||||||
|
|
@ -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": []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -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 ──────────────────────────────────────────────────────────
|
// ─── T-SQL Generator ──────────────────────────────────────────────────────────
|
||||||
|
|
||||||
function colToSqlLine(col: ColumnDefinition, addComma = true): string {
|
function colToSqlLine(col: ColumnDefinition, addComma = true): string {
|
||||||
|
|
@ -1402,6 +1525,34 @@ const SqlTableDesignerDialog = ({
|
||||||
addAutomaticPrimaryKey('todo', 'Todo primary key (auto)')
|
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 () => {
|
const importColumnsFromRememberedCreateTable = async () => {
|
||||||
let script = ''
|
let script = ''
|
||||||
|
|
||||||
|
|
@ -1858,31 +2009,41 @@ const SqlTableDesignerDialog = ({
|
||||||
)}
|
)}
|
||||||
{!colsLoading && (
|
{!colsLoading && (
|
||||||
<>
|
<>
|
||||||
<div className="flex items-center justify-between py-2">
|
<div className="flex items-start justify-between gap-2 py-2">
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex flex-col gap-2">
|
||||||
<Button size="xs" variant="solid" color="green-600" onClick={addMultiTenantColumns}>
|
<div className="flex flex-wrap items-center gap-2">
|
||||||
{translate('::App.SqlQueryManager.AddMultiTenantColumns')}
|
<Button size="xs" variant="solid" color="green-600" onClick={addMultiTenantColumns}>
|
||||||
</Button>
|
{translate('::App.SqlQueryManager.AddMultiTenantColumns')}
|
||||||
<Button size="xs" variant="solid" color="blue-600" onClick={addFullAuditedColumns}>
|
</Button>
|
||||||
{translate('::App.SqlQueryManager.AddFullAuditedColumns')}
|
<Button size="xs" variant="solid" color="blue-600" onClick={addFullAuditedColumns}>
|
||||||
</Button>
|
{translate('::App.SqlQueryManager.AddFullAuditedColumns')}
|
||||||
<Button size="xs" variant="solid" color="indigo-600" onClick={addWorkflowColumns}>
|
</Button>
|
||||||
{translate('::App.SqlQueryManager.AddWorkflowColumns')}
|
<Button
|
||||||
</Button>
|
size="xs"
|
||||||
<Button size="xs" variant="solid" color="cyan-600" onClick={addTodoColumns}>
|
variant="solid"
|
||||||
Add Todo Columns
|
color="amber-600"
|
||||||
</Button>
|
onClick={importColumnsFromRememberedCreateTable}
|
||||||
<Button
|
disabled={isEditMode}
|
||||||
size="xs"
|
>
|
||||||
variant="solid"
|
CREATE TABLE Kolonları Yapıştır
|
||||||
color="amber-600"
|
</Button>
|
||||||
onClick={importColumnsFromRememberedCreateTable}
|
</div>
|
||||||
disabled={isEditMode}
|
<div className="flex flex-wrap items-center gap-2">
|
||||||
>
|
<Button size="xs" variant="solid" color="indigo-600" onClick={addWorkflowColumns}>
|
||||||
CREATE TABLE Kolonları Yapıştır
|
{translate('::App.SqlQueryManager.AddWorkflowColumns')}
|
||||||
</Button>
|
</Button>
|
||||||
|
<Button size="xs" variant="solid" color="cyan-600" onClick={addTodoColumns}>
|
||||||
|
Add Todo Columns
|
||||||
|
</Button>
|
||||||
|
<Button size="xs" variant="solid" color="violet-600" onClick={addGanttColumns}>
|
||||||
|
Add Gantt Columns
|
||||||
|
</Button>
|
||||||
|
<Button size="xs" variant="solid" color="teal-600" onClick={addSchedulerColumns}>
|
||||||
|
Add Scheduler Columns
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex flex-col items-stretch gap-2">
|
||||||
<Button
|
<Button
|
||||||
size="xs"
|
size="xs"
|
||||||
variant="solid"
|
variant="solid"
|
||||||
|
|
|
||||||
|
|
@ -167,8 +167,10 @@ const useToolbar = ({
|
||||||
visible: true,
|
visible: true,
|
||||||
disabled: true,
|
disabled: true,
|
||||||
onClick: async () => {
|
onClick: async () => {
|
||||||
const keys = (await Promise.resolve(getSelectedRowKeys() as any)) as unknown[]
|
const selectedRowKeys = (await Promise.resolve(
|
||||||
if (!keys?.length) {
|
getSelectedRowKeys() as any,
|
||||||
|
)) as unknown[]
|
||||||
|
if (!selectedRowKeys?.length) {
|
||||||
toast.push(
|
toast.push(
|
||||||
<Notification type="warning" duration={2000}>
|
<Notification type="warning" duration={2000}>
|
||||||
{translate('::ListForms.ListForm.SelectRecord')}
|
{translate('::ListForms.ListForm.SelectRecord')}
|
||||||
|
|
@ -193,6 +195,24 @@ const useToolbar = ({
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
!grdOpt.keyFieldName ||
|
||||||
|
selectedRows.some(
|
||||||
|
(row) =>
|
||||||
|
row[grdOpt.keyFieldName!] === undefined || row[grdOpt.keyFieldName!] === null,
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
toast.push(
|
||||||
|
<Notification type="danger" duration={3000}>
|
||||||
|
Liste formu anahtar alanı seçili kayıtlarda bulunamadı.
|
||||||
|
</Notification>,
|
||||||
|
{ placement: 'bottom-end' },
|
||||||
|
)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const keys = selectedRows.map((row) => row[grdOpt.keyFieldName!])
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const result = await workflowService.startWorkflow(listFormCode, keys)
|
const result = await workflowService.startWorkflow(listFormCode, keys)
|
||||||
showWorkflowToastMessages(result)
|
showWorkflowToastMessages(result)
|
||||||
|
|
@ -226,8 +246,10 @@ const useToolbar = ({
|
||||||
visible: true,
|
visible: true,
|
||||||
disabled: true,
|
disabled: true,
|
||||||
onClick: async () => {
|
onClick: async () => {
|
||||||
const keys = (await Promise.resolve(getSelectedRowKeys() as any)) as unknown[]
|
const selectedRowKeys = (await Promise.resolve(
|
||||||
if (!keys?.length) {
|
getSelectedRowKeys() as any,
|
||||||
|
)) as unknown[]
|
||||||
|
if (!selectedRowKeys?.length) {
|
||||||
toast.push(
|
toast.push(
|
||||||
<Notification type="warning" duration={2000}>
|
<Notification type="warning" duration={2000}>
|
||||||
{translate('::ListForms.ListForm.SelectRecord')}
|
{translate('::ListForms.ListForm.SelectRecord')}
|
||||||
|
|
@ -258,6 +280,24 @@ const useToolbar = ({
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
!grdOpt.keyFieldName ||
|
||||||
|
selectedRows.some(
|
||||||
|
(row) =>
|
||||||
|
row[grdOpt.keyFieldName!] === undefined || row[grdOpt.keyFieldName!] === null,
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
toast.push(
|
||||||
|
<Notification type="danger" duration={3000}>
|
||||||
|
Liste formu anahtar alanı seçili kayıtlarda bulunamadı.
|
||||||
|
</Notification>,
|
||||||
|
{ placement: 'bottom-end' },
|
||||||
|
)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const keys = selectedRows.map((row) => row[grdOpt.keyFieldName!])
|
||||||
|
|
||||||
setToolbarModalData({
|
setToolbarModalData({
|
||||||
open: true,
|
open: true,
|
||||||
content: (
|
content: (
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue