Compare commits
No commits in common. "main" and "1.1.08" have entirely different histories.
72 changed files with 2799 additions and 4010 deletions
|
|
@ -10,11 +10,6 @@ namespace Sozsoft.Platform.ListForms;
|
|||
|
||||
public class ColumnFormatDto : AuditedEntityDto<Guid>
|
||||
{
|
||||
private static readonly JsonSerializerOptions EditorOptionsSerializerOptions = new()
|
||||
{
|
||||
PropertyNameCaseInsensitive = true
|
||||
};
|
||||
|
||||
public ColumnFormatDto() { }
|
||||
|
||||
public string FieldName { get; set; }
|
||||
|
|
@ -245,41 +240,6 @@ public class ColumnFormatDto : AuditedEntityDto<Guid>
|
|||
|
||||
public string Alignment { get; set; }
|
||||
public string Format { get; set; }
|
||||
|
||||
public int? EditOrderNo { get; set; }
|
||||
public int? EditGroupOrderNo { get; set; }
|
||||
public string EditorType2 { get; set; }
|
||||
public int? ColSpan { get; set; }
|
||||
|
||||
public string EditorOptions { get; set; }
|
||||
public GridBoxOptionsDto GridBoxOptions =>
|
||||
DeserializeEditorOptions<GridBoxOptionsDto>(PlatformConsts.EditorTypes.dxGridBox);
|
||||
public TagBoxOptionsDto TagBoxOptions =>
|
||||
DeserializeEditorOptions<TagBoxOptionsDto>(PlatformConsts.EditorTypes.dxTagBox);
|
||||
public ImageUploadOptionsDto ImageUploadOptions =>
|
||||
DeserializeEditorOptions<ImageUploadOptionsDto>(
|
||||
PlatformConsts.EditorTypes.dxImageUpload,
|
||||
PlatformConsts.EditorTypes.dxImageViewer);
|
||||
public string EditorScript { get; set; }
|
||||
|
||||
private T DeserializeEditorOptions<T>(params string[] editorTypes) where T : class
|
||||
{
|
||||
if (!Array.Exists(
|
||||
editorTypes,
|
||||
editorType => string.Equals(EditorType2, editorType, StringComparison.OrdinalIgnoreCase)) ||
|
||||
string.IsNullOrWhiteSpace(EditorOptions))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
return JsonSerializer.Deserialize<T>(EditorOptions, EditorOptionsSerializerOptions);
|
||||
}
|
||||
catch (JsonException)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,5 +16,35 @@ public class EditingFormDto
|
|||
public string Caption { get; set; }
|
||||
public int ColCount { get; set; } = 2;
|
||||
public int ColSpan { get; set; } = 2;
|
||||
/// <summary> Type: Array<Simple Form Item | Group Form Item | Tabbed Form Item | Empty Form Item | Button Form Item>
|
||||
/// Bu kisma suan sadece string olarak doldurulacak
|
||||
/// items: ['FirstName', 'LastName',
|
||||
/// { dataField: 'Notes', editorType: 'dxTextArea', colSpan: 2, editorOptions: { height: 100, }, }
|
||||
/// ],
|
||||
/// </summary>
|
||||
//[TextArea]
|
||||
//public string[] Items { get; set; }
|
||||
public EditingFormItemDto[] Items { get; set; }
|
||||
}
|
||||
|
||||
public class EditingFormItemDto
|
||||
{
|
||||
/// <summary>
|
||||
/// DataField Accepted Values: 'dxAutocomplete' | 'dxCalendar' | 'dxCheckBox' | 'dxColorBox' | 'dxDateBox' | 'dxDateRangeBox' | 'dxDropDownBox' | 'dxHtmlEditor' | 'dxLookup' | 'dxNumberBox' | 'dxRadioGroup' | 'dxRangeSlider' | 'dxSelectBox' | 'dxSlider' | 'dxSwitch' | 'dxTagBox' | 'dxTextArea' | 'dxTextBox' | 'dxImageViewer' | 'dxImageUpload';
|
||||
/// </summary>
|
||||
[JsonPropertyName("order")]
|
||||
public int Order { get; set; }
|
||||
[JsonPropertyName("dataField")]
|
||||
public string DataField { get; set; }
|
||||
[JsonPropertyName("editorType2")]
|
||||
public string EditorType2 { get; set; }
|
||||
[JsonPropertyName("colSpan")]
|
||||
public int ColSpan { get; set; }
|
||||
[JsonPropertyName("editorOptions")]
|
||||
public string EditorOptions { get; set; }
|
||||
public GridBoxOptionsDto GridBoxOptions { get; set; }
|
||||
public TagBoxOptionsDto TagBoxOptions { get; set; }
|
||||
[JsonPropertyName("editorScript")]
|
||||
public string EditorScript { get; set; }
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +0,0 @@
|
|||
namespace Sozsoft.Platform.ListForms;
|
||||
|
||||
public class ImageUploadOptionsDto
|
||||
{
|
||||
public string UploadUrl { get; set; }
|
||||
public string Accept { get; set; }
|
||||
public bool? Multiple { get; set; }
|
||||
public long? MaxFileSize { get; set; }
|
||||
public int? Width { get; set; }
|
||||
public int? Height { get; set; }
|
||||
}
|
||||
|
|
@ -41,7 +41,6 @@ public class ListFormWizardDto
|
|||
|
||||
public string PermissionGroupName { get; set; }
|
||||
public string MenuParentCode { get; set; }
|
||||
public string MenuParentShortName { get; set; }
|
||||
public string MenuParentIcon { get; set; }
|
||||
public string MenuIcon { get; set; }
|
||||
public string DataSourceCode { get; set; }
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ namespace Sozsoft.Platform.ListForms;
|
|||
|
||||
public class WizardColumnItemInputDto
|
||||
{
|
||||
public string FieldName { get; set; }
|
||||
public string DataField { get; set; }
|
||||
public string CaptionName { get; set; }
|
||||
public string EditorType { get; set; }
|
||||
public string EditorOptions { get; set; }
|
||||
|
|
|
|||
|
|
@ -47,33 +47,26 @@ public class ListFormFieldsAppService : CrudAppService<
|
|||
|
||||
protected override void MapToEntity(ColumnFormatEditDto updateInput, ListFormField entity)
|
||||
{
|
||||
entity.CultureName = updateInput.CultureName;
|
||||
entity.RoleId = updateInput.RoleId;
|
||||
entity.ListFormCode = updateInput.ListFormCode;
|
||||
entity.FieldName = updateInput.FieldName;
|
||||
entity.CultureName = updateInput.CultureName;
|
||||
entity.CaptionName = updateInput.CaptionName;
|
||||
entity.PlaceHolder = updateInput.PlaceHolder;
|
||||
entity.BandName = updateInput.BandName;
|
||||
entity.IsActive = updateInput.IsActive;
|
||||
entity.Visible = updateInput.Visible;
|
||||
entity.AllowSearch = updateInput.AllowSearch;
|
||||
entity.SourceDbType = updateInput.SourceDbType;
|
||||
entity.Alignment = updateInput.Alignment;
|
||||
entity.Format = updateInput.Format;
|
||||
entity.EditorOptions = updateInput.EditorOptions;
|
||||
entity.EditorScript = updateInput.EditorScript;
|
||||
entity.AllowEditing = updateInput.AllowEditing;
|
||||
entity.AllowAdding = updateInput.AllowAdding;
|
||||
entity.ListOrderNo = updateInput.ListOrderNo;
|
||||
entity.SourceDbType = updateInput.SourceDbType;
|
||||
entity.Width = updateInput.Width;
|
||||
entity.SortDirection = updateInput.SortDirection;
|
||||
entity.SortIndex = updateInput.SortIndex;
|
||||
entity.EditOrderNo = updateInput.EditOrderNo;
|
||||
entity.EditGroupOrderNo = updateInput.EditGroupOrderNo;
|
||||
entity.ColSpan = updateInput.ColSpan;
|
||||
entity.EditorType2 = updateInput.EditorType2;
|
||||
entity.AllowEditing = updateInput.AllowEditing;
|
||||
entity.AllowAdding = updateInput.AllowAdding;
|
||||
entity.PermissionJson = JsonSerializer.Serialize(updateInput.PermissionDto);
|
||||
entity.LookupJson = JsonSerializer.Serialize(updateInput.LookupDto);
|
||||
entity.Format = updateInput.Format;
|
||||
entity.Alignment = updateInput.Alignment;
|
||||
entity.EditorOptions = updateInput.EditorOptions;
|
||||
entity.ColumnCustomizationJson = JsonSerializer.Serialize(updateInput.ColumnCustomizationDto);
|
||||
entity.ColumnFilterJson = JsonSerializer.Serialize(updateInput.ColumnFilterDto);
|
||||
entity.ColumnHeaderJson = JsonSerializer.Serialize(updateInput.ColumnHeaderDto);
|
||||
|
|
@ -81,10 +74,12 @@ public class ListFormFieldsAppService : CrudAppService<
|
|||
entity.GroupSummaryJson = updateInput.ColumnGroupSummaryDto.SummaryType.IsNullOrEmpty() ? "" : JsonSerializer.Serialize(updateInput.ColumnGroupSummaryDto);
|
||||
entity.TotalSummaryJson = updateInput.ColumnTotalSummaryDto.SummaryType.IsNullOrEmpty() ? "" : JsonSerializer.Serialize(updateInput.ColumnTotalSummaryDto);
|
||||
entity.JoinTableJson = JsonSerializer.Serialize(updateInput.ColumnJoinTableDto);
|
||||
entity.LookupJson = JsonSerializer.Serialize(updateInput.LookupDto);
|
||||
entity.ColumnCssClass = updateInput.ColumnCssClass;
|
||||
entity.ColumnCssValue = updateInput.ColumnCssValue;
|
||||
entity.ValidationRuleJson = JsonSerializer.Serialize(updateInput.ValidationRuleDto);
|
||||
entity.ColumnStylingJson = JsonSerializer.Serialize(updateInput.ColumnStylingDto);
|
||||
entity.PermissionJson = JsonSerializer.Serialize(updateInput.PermissionDto);
|
||||
entity.PivotSettingsJson = JsonSerializer.Serialize(updateInput.PivotSettingsDto);
|
||||
}
|
||||
|
||||
|
|
@ -141,9 +136,6 @@ public class ListFormFieldsAppService : CrudAppService<
|
|||
item.Alignment = input.Alignment;
|
||||
item.Format = input.Format;
|
||||
item.EditorOptions = input.EditorOptions;
|
||||
item.IsActive = input.IsActive;
|
||||
item.Visible = input.Visible;
|
||||
item.AllowSearch = input.AllowSearch;
|
||||
}
|
||||
else if (input.EditType == ListFormFieldEditTabs.PermissionsForm)
|
||||
{
|
||||
|
|
@ -160,11 +152,6 @@ public class ListFormFieldsAppService : CrudAppService<
|
|||
item.AllowSearch = input.AllowSearch;
|
||||
item.AllowEditing = input.AllowEditing;
|
||||
item.AllowAdding = input.AllowAdding;
|
||||
item.EditGroupOrderNo = input.EditGroupOrderNo;
|
||||
item.EditOrderNo = input.EditOrderNo;
|
||||
item.ColSpan = input.ColSpan;
|
||||
item.EditorType2 = input.EditorType2;
|
||||
item.EditorScript = input.EditorScript;
|
||||
}
|
||||
else if (input.EditType == ListFormFieldEditTabs.CustomizationForm)
|
||||
{
|
||||
|
|
@ -270,9 +257,6 @@ public class ListFormFieldsAppService : CrudAppService<
|
|||
field.CaptionName = sourceField.CaptionName;
|
||||
field.PlaceHolder = sourceField.PlaceHolder;
|
||||
field.SourceDbType = sourceField.SourceDbType;
|
||||
field.Alignment = sourceField.Alignment;
|
||||
field.Format = sourceField.Format;
|
||||
field.EditorOptions = sourceField.EditorOptions;
|
||||
}
|
||||
if (input.CopiedFields.All || input.CopiedFields.Options)
|
||||
{
|
||||
|
|
@ -285,40 +269,35 @@ public class ListFormFieldsAppService : CrudAppService<
|
|||
field.AllowSearch = sourceField.AllowSearch;
|
||||
field.AllowEditing = sourceField.AllowEditing;
|
||||
field.AllowAdding = sourceField.AllowAdding;
|
||||
field.EditGroupOrderNo = sourceField.EditGroupOrderNo;
|
||||
field.EditOrderNo = sourceField.EditOrderNo;
|
||||
field.ColSpan = sourceField.ColSpan;
|
||||
field.EditorType2 = sourceField.EditorType2;
|
||||
field.EditorScript = sourceField.EditorScript;
|
||||
}
|
||||
if (input.CopiedFields.All || input.CopiedFields.Permission)
|
||||
else if (input.CopiedFields.All || input.CopiedFields.Permission)
|
||||
{
|
||||
field.PermissionJson = sourceField.PermissionJson;
|
||||
}
|
||||
if (input.CopiedFields.All || input.CopiedFields.Customization)
|
||||
else if (input.CopiedFields.All || input.CopiedFields.Customization)
|
||||
field.ColumnCustomizationJson = sourceField.ColumnCustomizationJson;
|
||||
if (input.CopiedFields.All || input.CopiedFields.Filtering)
|
||||
else if (input.CopiedFields.All || input.CopiedFields.Filtering)
|
||||
field.ColumnFilterJson = sourceField.ColumnFilterJson;
|
||||
if (input.CopiedFields.All || input.CopiedFields.Headering)
|
||||
else if (input.CopiedFields.All || input.CopiedFields.Headering)
|
||||
field.ColumnHeaderJson = sourceField.ColumnHeaderJson;
|
||||
if (input.CopiedFields.All || input.CopiedFields.Grouping)
|
||||
else if (input.CopiedFields.All || input.CopiedFields.Grouping)
|
||||
field.GroupingJson = sourceField.GroupingJson;
|
||||
if (input.CopiedFields.All || input.CopiedFields.GroupSummary)
|
||||
else if (input.CopiedFields.All || input.CopiedFields.GroupSummary)
|
||||
field.GroupSummaryJson = sourceField.GroupSummaryJson;
|
||||
if (input.CopiedFields.All || input.CopiedFields.TotalSummary)
|
||||
else if (input.CopiedFields.All || input.CopiedFields.TotalSummary)
|
||||
field.TotalSummaryJson = sourceField.TotalSummaryJson;
|
||||
if (input.CopiedFields.All || input.CopiedFields.JoinOptions)
|
||||
else if (input.CopiedFields.All || input.CopiedFields.JoinOptions)
|
||||
field.JoinTableJson = sourceField.JoinTableJson;
|
||||
if (input.CopiedFields.All || input.CopiedFields.CssOptions)
|
||||
else if (input.CopiedFields.All || input.CopiedFields.CssOptions)
|
||||
{
|
||||
field.ColumnCssClass = sourceField.ColumnCssClass;
|
||||
field.ColumnCssValue = sourceField.ColumnCssValue;
|
||||
}
|
||||
if (input.CopiedFields.All || input.CopiedFields.ValidationRules)
|
||||
else if (input.CopiedFields.All || input.CopiedFields.ValidationRules)
|
||||
field.ValidationRuleJson = sourceField.ValidationRuleJson;
|
||||
if (input.CopiedFields.All || input.CopiedFields.Formatting)
|
||||
else if (input.CopiedFields.All || input.CopiedFields.Formatting)
|
||||
field.ColumnStylingJson = sourceField.ColumnStylingJson;
|
||||
if (input.CopiedFields.All || input.CopiedFields.PivotSetting)
|
||||
else if (input.CopiedFields.All || input.CopiedFields.PivotSetting)
|
||||
field.PivotSettingsJson = sourceField.PivotSettingsJson;
|
||||
|
||||
await Repository.InsertAsync(field);
|
||||
|
|
|
|||
|
|
@ -180,18 +180,11 @@ public class ListFormWizardAppService(
|
|||
Code = input.MenuParentCode,
|
||||
DisplayName = input.MenuParentCode,
|
||||
IsDisabled = false,
|
||||
ShortName = input.MenuParentShortName?.Trim(),
|
||||
Icon = menuParentIcon,
|
||||
Order = maxRootOrder + 1,
|
||||
}, autoSave: false);
|
||||
inserted.MenuCodes.Add(input.MenuParentCode);
|
||||
}
|
||||
else if (string.IsNullOrWhiteSpace(menuParent.ShortName) &&
|
||||
!string.IsNullOrWhiteSpace(input.MenuParentShortName))
|
||||
{
|
||||
menuParent.ShortName = input.MenuParentShortName.Trim();
|
||||
await repoMenu.UpdateAsync(menuParent, autoSave: false);
|
||||
}
|
||||
|
||||
//Menu
|
||||
var maxChildOrder = menuQueryable.Where(a => a.ParentCode == menuParent.Code).Select(a => (int?)a.Order).Max() ?? 0;
|
||||
|
|
@ -237,9 +230,21 @@ public class ListFormWizardAppService(
|
|||
Caption = g.Caption,
|
||||
ColCount = g.ColCount,
|
||||
ColSpan = g.ColCount,
|
||||
ItemType = "group"
|
||||
ItemType = "group",
|
||||
Items = g.Items
|
||||
.Where(i => i.IncludeInEditingForm && i.DataField != input.KeyFieldName)
|
||||
.Select((it, ii) => new EditingFormItemDto
|
||||
{
|
||||
Order = ii + 1,
|
||||
DataField = it.DataField,
|
||||
EditorType2 = it.EditorType,
|
||||
ColSpan = it.ColSpan,
|
||||
EditorOptions = string.IsNullOrWhiteSpace(it.EditorOptions) ? null : it.EditorOptions,
|
||||
EditorScript = string.IsNullOrWhiteSpace(it.EditorScript) ? null : it.EditorScript,
|
||||
})
|
||||
.ToArray()
|
||||
})
|
||||
.Where((_, index) => input.Groups[index].Items.Any(i => i.IncludeInEditingForm && i.FieldName != input.KeyFieldName))
|
||||
.Where(g => g.Items.Length > 0)
|
||||
.ToList();
|
||||
|
||||
//ListForm - varsa sil, yeniden ekle
|
||||
|
|
@ -308,8 +313,8 @@ public class ListFormWizardAppService(
|
|||
ColumnOptionJson = WizardConsts.DefaultColumnOptionJson(),
|
||||
PermissionJson = WizardConsts.DefaultPermissionJson(code),
|
||||
DeleteCommand = isDeleted ? WizardConsts.DefaultDeleteCommand(input.SelectCommand) : null,
|
||||
DeleteFieldsDefaultValueJson = isDeleted ? WizardConsts.DefaultDeleteFieldsDefaultValueJson(input.KeyFieldDbSourceType) : WizardConsts.DefaultDeleteFieldsJsonOnlyId(input.KeyFieldDbSourceType),
|
||||
InsertFieldsDefaultValueJson = isCreated ? WizardConsts.DefaultInsertFieldsDefaultValueJson(input.KeyFieldDbSourceType) : WizardConsts.DefaultInsertFieldsJsonOnlyId(input.KeyFieldDbSourceType),
|
||||
DeleteFieldsDefaultValueJson = isDeleted ? WizardConsts.DefaultDeleteFieldsDefaultValueJson(input.KeyFieldDbSourceType) : WizardConsts.DefaultFieldsJsonOnlyId(input.KeyFieldDbSourceType),
|
||||
InsertFieldsDefaultValueJson = isCreated ? WizardConsts.DefaultInsertFieldsDefaultValueJson(input.KeyFieldDbSourceType) : WizardConsts.DefaultFieldsJsonOnlyId(input.KeyFieldDbSourceType),
|
||||
PagerOptionJson = WizardConsts.DefaultPagerOptionJson,
|
||||
EditingOptionJson = WizardConsts.DefaultEditingOptionJson(titleLangKey, 600, 500, input.AllowDeleting, input.AllowAdding, input.AllowUpdating, input.ConfirmDelete, false, input.AllowDetail),
|
||||
EditingFormJson = editingFormDtos.Count > 0 ? JsonSerializer.Serialize(editingFormDtos) : null,
|
||||
|
|
@ -366,36 +371,21 @@ public class ListFormWizardAppService(
|
|||
|
||||
// ListFormField - each item in each group becomes a visible field record
|
||||
var fieldOrder = 0;
|
||||
var editGroupOrder = 0;
|
||||
foreach (var group in input.Groups)
|
||||
{
|
||||
editGroupOrder++;
|
||||
var editOrder = 0;
|
||||
foreach (var item in group.Items)
|
||||
{
|
||||
fieldOrder++;
|
||||
if (item.IncludeInEditingForm && item.FieldName != input.KeyFieldName)
|
||||
{
|
||||
editOrder++;
|
||||
}
|
||||
await repoListFormField.InsertAsync(new ListFormField
|
||||
{
|
||||
ListFormCode = input.ListFormCode,
|
||||
FieldName = item.FieldName,
|
||||
FieldName = item.DataField,
|
||||
CaptionName = item.CaptionName,
|
||||
Visible = item.FieldName != input.KeyFieldName,
|
||||
Visible = item.DataField != input.KeyFieldName,
|
||||
IsActive = true,
|
||||
AllowSearch = true,
|
||||
Width = 0,
|
||||
ListOrderNo = fieldOrder,
|
||||
EditGroupOrderNo = item.IncludeInEditingForm ? editGroupOrder : null,
|
||||
EditOrderNo = item.IncludeInEditingForm && item.FieldName != input.KeyFieldName
|
||||
? editOrder
|
||||
: null,
|
||||
EditorType2 = item.EditorType,
|
||||
ColSpan = item.ColSpan,
|
||||
EditorOptions = string.IsNullOrWhiteSpace(item.EditorOptions) ? null : item.EditorOptions,
|
||||
EditorScript = string.IsNullOrWhiteSpace(item.EditorScript) ? null : item.EditorScript,
|
||||
SourceDbType = item.DbSourceType,
|
||||
CultureName = PlatformConsts.DefaultLanguage,
|
||||
PermissionJson = WizardConsts.DefaultFieldPermissionJson(code),
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ using Volo.Abp.PermissionManagement;
|
|||
using Volo.Abp.TenantManagement;
|
||||
using static Sozsoft.Platform.Data.Seeds.SeedConsts;
|
||||
using Sozsoft.Languages;
|
||||
using Sozsoft.Languages.Languages;
|
||||
using Sozsoft.Platform.ListForms;
|
||||
|
||||
namespace Sozsoft.Platform.Menus;
|
||||
|
|
@ -132,30 +131,6 @@ public class MenuAppService : CrudAppService<
|
|||
.ToList();
|
||||
|
||||
entityDtos = await base.MapToGetListOutputDtosAsync(entities);
|
||||
|
||||
var languageKeys = entityDtos
|
||||
.Select(item => string.IsNullOrWhiteSpace(item.DisplayName) ? item.Code : item.DisplayName)
|
||||
.Where(key => !string.IsNullOrWhiteSpace(key))
|
||||
.Distinct()
|
||||
.ToList();
|
||||
var languageTexts = await _repositoryText.GetListAsync(text =>
|
||||
text.ResourceName == PlatformConsts.AppName &&
|
||||
languageKeys.Contains(text.Key) &&
|
||||
(text.CultureName == PlatformConsts.DefaultLanguage ||
|
||||
text.CultureName == LanguageCodes.Tr));
|
||||
|
||||
foreach (var menu in entityDtos)
|
||||
{
|
||||
var languageKey = string.IsNullOrWhiteSpace(menu.DisplayName)
|
||||
? menu.Code
|
||||
: menu.DisplayName;
|
||||
menu.MenuTextEn = languageTexts.FirstOrDefault(text =>
|
||||
text.Key == languageKey &&
|
||||
text.CultureName == PlatformConsts.DefaultLanguage)?.Value;
|
||||
menu.MenuTextTr = languageTexts.FirstOrDefault(text =>
|
||||
text.Key == languageKey &&
|
||||
text.CultureName == LanguageCodes.Tr)?.Value;
|
||||
}
|
||||
}
|
||||
|
||||
return new PagedResultDto<MenuDto>(
|
||||
|
|
|
|||
|
|
@ -1443,8 +1443,8 @@
|
|||
{
|
||||
"resourceName": "Platform",
|
||||
"key": "App.Reports.List",
|
||||
"en": "Grid Report",
|
||||
"tr": "Tablo Raporu"
|
||||
"en": "List Report",
|
||||
"tr": "Liste Raporu"
|
||||
},
|
||||
{
|
||||
"resourceName": "Platform",
|
||||
|
|
@ -4440,24 +4440,6 @@
|
|||
"en": "Tree",
|
||||
"tr": "Ağaç"
|
||||
},
|
||||
{
|
||||
"resourceName": "Platform",
|
||||
"key": "ListForms.ListFormEdit.TabCard",
|
||||
"en": "Card",
|
||||
"tr": "Kart"
|
||||
},
|
||||
{
|
||||
"resourceName": "Platform",
|
||||
"key": "ListForms.ListFormEdit.TabChart",
|
||||
"en": "Chart",
|
||||
"tr": "Grafik"
|
||||
},
|
||||
{
|
||||
"resourceName": "Platform",
|
||||
"key": "ListForms.ListFormEdit.TabGrid",
|
||||
"en": "Grid",
|
||||
"tr": "Tablo"
|
||||
},
|
||||
{
|
||||
"resourceName": "Platform",
|
||||
"key": "ListForms.ListFormEdit.TabGantt",
|
||||
|
|
@ -4686,12 +4668,6 @@
|
|||
"en": "Scheduler Layout",
|
||||
"tr": "Zamanlayıcı Düzeni"
|
||||
},
|
||||
{
|
||||
"resourceName": "Platform",
|
||||
"key": "ListForms.ListFormEdit.DetailsLayoutDto.TodoLayout",
|
||||
"en": "Todo Layout",
|
||||
"tr": "İşler Düzeni"
|
||||
},
|
||||
{
|
||||
"resourceName": "Platform",
|
||||
"key": "ListForms.ListFormEdit.DetailsLayoutDto.GanttLayout",
|
||||
|
|
@ -5192,15 +5168,15 @@
|
|||
},
|
||||
{
|
||||
"resourceName": "Platform",
|
||||
"key": "ListForms.ListFormEdit.EditingFormFormGroups",
|
||||
"en": "Editing Form Groups",
|
||||
"tr": "Düzenleme Form Grupları"
|
||||
"key": "ListForms.ListFormEdit.EditingFormFormFields",
|
||||
"en": "Editing Form Fields",
|
||||
"tr": "Düzenleme Form Alanları"
|
||||
},
|
||||
{
|
||||
"resourceName": "Platform",
|
||||
"key": "ListForms.ListFormEdit.EditingFormFormGroupsDescription",
|
||||
"en": "Groups that will appear in Edit form",
|
||||
"tr": "Düzenleme formunda çıkacak gruplar"
|
||||
"key": "ListForms.ListFormEdit.EditingFormFormFieldsDescription",
|
||||
"en": "Edit formunda çıkacak field'lar",
|
||||
"tr": "Form Sütunları"
|
||||
},
|
||||
{
|
||||
"resourceName": "Platform",
|
||||
|
|
@ -5922,30 +5898,6 @@
|
|||
"en": "Field Name",
|
||||
"tr": "Alan Adı"
|
||||
},
|
||||
{
|
||||
"resourceName": "Platform",
|
||||
"key": "ListForms.ListFormFieldEdit.EditorType",
|
||||
"en": "Editor Type",
|
||||
"tr": "Editör Tipi"
|
||||
},
|
||||
{
|
||||
"resourceName": "Platform",
|
||||
"key": "ListForms.ListFormFieldEdit.EditFormGroup",
|
||||
"en": "Edit Form Group",
|
||||
"tr": "Düzenleme Form Grubu"
|
||||
},
|
||||
{
|
||||
"resourceName": "Platform",
|
||||
"key": "ListForms.ListFormFieldEdit.EditFormOrderNo",
|
||||
"en": "Edit Order No",
|
||||
"tr": "Düzenleme Sıra No"
|
||||
},
|
||||
{
|
||||
"resourceName": "Platform",
|
||||
"key": "ListForms.ListFormFieldEdit.EditFormColSpan",
|
||||
"en": "Edit Col Span",
|
||||
"tr": "Düzenleme Col Span"
|
||||
},
|
||||
{
|
||||
"resourceName": "Platform",
|
||||
"key": "ListForms.ListFormFieldEdit.PlaceHolder",
|
||||
|
|
@ -19467,7 +19419,7 @@
|
|||
{
|
||||
"resourceName": "Platform",
|
||||
"key": "ListForms.ListFormFieldEdit.TodoStatusOrderPlaceholder",
|
||||
"en": "Backlog, Ready to Start, In Progress, Code Review, Testing, Staging",
|
||||
"en": "Inbox, Today, This Week, This Month, Later, Done",
|
||||
"tr": "Gelen Kutusu, Bugün, Bu Hafta, Bu Ay, Daha Sonra, Tamamlandı"
|
||||
},
|
||||
{
|
||||
|
|
@ -19476,18 +19428,6 @@
|
|||
"en": "Allow cards to be dragged between columns",
|
||||
"tr": "Kartları kolonlar arasında sürüklemeye izin ver"
|
||||
},
|
||||
{
|
||||
"resourceName": "Platform",
|
||||
"key": "ListForms.ListFormFieldEdit.TodoRequiredFields",
|
||||
"en": "Title field and column / status field are required.",
|
||||
"tr": "Başlık alanı ve kolon / durum alanı zorunludur."
|
||||
},
|
||||
{
|
||||
"resourceName": "Platform",
|
||||
"key": "ListForms.ListFormFieldEdit.TodoDisabledInListSettings",
|
||||
"en": "Todo view is disabled in the list settings. You can skip this step or enable the Todo view in the previous steps.",
|
||||
"tr": "Todo görünümü liste ayarlarında kapalı. Bu adımı atlayabilir veya önceki adımlardan Todo görünümünü etkinleştirebilirsiniz."
|
||||
},
|
||||
{
|
||||
"resourceName": "Platform",
|
||||
"key": "ListForms.TodoBoard.Uncategorized",
|
||||
|
|
@ -19755,13 +19695,13 @@
|
|||
{
|
||||
"resourceName": "Platform",
|
||||
"key": "ListForms.TodoBoard.NewColumn",
|
||||
"en": "New Kanban",
|
||||
"en": "New Kanban column",
|
||||
"tr": "Yeni kanban"
|
||||
},
|
||||
{
|
||||
"resourceName": "Platform",
|
||||
"key": "ListForms.TodoBoard.AddNewColumn",
|
||||
"en": "Add a new Kanban",
|
||||
"en": "Add a new Kanban column",
|
||||
"tr": "Yeni kanban ekle"
|
||||
},
|
||||
{
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -984,22 +984,22 @@
|
|||
},
|
||||
{
|
||||
"ParentCode": "App.DeveloperKit",
|
||||
"Code": "App.DeveloperKit.DynamicServices",
|
||||
"DisplayName": "App.DeveloperKit.DynamicServices",
|
||||
"Code": "App.DeveloperKit.Components",
|
||||
"DisplayName": "App.DeveloperKit.Components",
|
||||
"Order": 4,
|
||||
"Url": "/admin/developerkit/dynamic-services",
|
||||
"Icon": "FcCommandLine",
|
||||
"RequiredPermissionName": "App.DeveloperKit.DynamicServices",
|
||||
"Url": "/admin/developerkit/components",
|
||||
"Icon": "FcBiohazard",
|
||||
"RequiredPermissionName": "App.DeveloperKit.Components",
|
||||
"IsDisabled": false
|
||||
},
|
||||
{
|
||||
"ParentCode": "App.DeveloperKit",
|
||||
"Code": "App.DeveloperKit.Components",
|
||||
"DisplayName": "App.DeveloperKit.Components",
|
||||
"Code": "App.DeveloperKit.DynamicServices",
|
||||
"DisplayName": "App.DeveloperKit.DynamicServices",
|
||||
"Order": 5,
|
||||
"Url": "/admin/developerkit/components",
|
||||
"Icon": "FcBiohazard",
|
||||
"RequiredPermissionName": "App.DeveloperKit.Components",
|
||||
"Url": "/admin/developerkit/dynamic-services",
|
||||
"Icon": "FcCommandLine",
|
||||
"RequiredPermissionName": "App.DeveloperKit.DynamicServices",
|
||||
"IsDisabled": false
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
IF OBJECT_ID(N'[dbo].[Pro_T_Todo]', 'U') IS NULL
|
||||
IF OBJECT_ID(N'[dbo].[Adm_D_Todos]', 'U') IS NULL
|
||||
BEGIN
|
||||
CREATE TABLE [dbo].[Pro_T_Todo]
|
||||
CREATE TABLE [dbo].[Adm_D_Todos]
|
||||
(
|
||||
[Id] uniqueidentifier NOT NULL DEFAULT NEWID(),
|
||||
[Title] nvarchar(300) NOT NULL,
|
||||
|
|
@ -12,7 +12,6 @@ BEGIN
|
|||
[Priority] nvarchar(50) NULL,
|
||||
[Completed] bit NOT NULL DEFAULT 0,
|
||||
[SortOrder] int NOT NULL DEFAULT 0,
|
||||
[TenantId] uniqueidentifier NULL,
|
||||
CONSTRAINT [PK_Table] PRIMARY KEY NONCLUSTERED
|
||||
(
|
||||
[Id] ASC
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
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,
|
||||
[ApprovalDate] datetime NULL,
|
||||
[ApprovalDescription] nvarchar(200) NULL,
|
||||
[TenantId] uniqueidentifier NULL,
|
||||
[Title] nvarchar(100) NULL,
|
||||
CONSTRAINT [PK_Pro_T_Approval] 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
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
{
|
||||
"Wizard": {
|
||||
"WizardName": "Todo",
|
||||
"ListFormCode": "App.Wizard.Todo",
|
||||
"MenuCode": "App.Wizard.Todo",
|
||||
"IsTenant": true,
|
||||
"WizardName": "Todos",
|
||||
"ListFormCode": "App.Wizard.Todos",
|
||||
"MenuCode": "App.Wizard.Todos",
|
||||
"IsTenant": false,
|
||||
"IsBranch": false,
|
||||
"IsOrganizationUnit": false,
|
||||
"AllowAdding": true,
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
"AllowDeleting": true,
|
||||
"AllowDetail": false,
|
||||
"ConfirmDelete": true,
|
||||
"DefaultLayout": "todo",
|
||||
"DefaultLayout": "grid",
|
||||
"Grid": true,
|
||||
"Card": true,
|
||||
"Pivot": true,
|
||||
|
|
@ -20,23 +20,22 @@
|
|||
"Gantt": true,
|
||||
"Scheduler": true,
|
||||
"Todo": true,
|
||||
"LanguageTextMenuEn": "Todo",
|
||||
"LanguageTextMenuTr": "\u0130\u015Fler",
|
||||
"LanguageTextTitleEn": "Todo",
|
||||
"LanguageTextTitleTr": "\u0130\u015Fler",
|
||||
"LanguageTextDescEn": "Todo",
|
||||
"LanguageTextDescTr": "\u0130\u015Fler",
|
||||
"LanguageTextMenuParentEn": "Project",
|
||||
"LanguageTextMenuParentTr": "Project",
|
||||
"PermissionGroupName": "App.Wizard.Project",
|
||||
"MenuParentCode": "App.Wizard.Project",
|
||||
"MenuParentShortName": "Pro",
|
||||
"MenuParentIcon": "FcVideoProjector",
|
||||
"MenuIcon": "FcTodoList",
|
||||
"LanguageTextMenuEn": "Todos",
|
||||
"LanguageTextMenuTr": "Todos",
|
||||
"LanguageTextTitleEn": "Todos",
|
||||
"LanguageTextTitleTr": "Todos",
|
||||
"LanguageTextDescEn": "Todos",
|
||||
"LanguageTextDescTr": "Todos",
|
||||
"LanguageTextMenuParentEn": "",
|
||||
"LanguageTextMenuParentTr": "",
|
||||
"PermissionGroupName": "App.Administration",
|
||||
"MenuParentCode": "App.Administration",
|
||||
"MenuParentIcon": "FcOrganization",
|
||||
"MenuIcon": "FcAndroidOs",
|
||||
"DataSourceCode": "Default",
|
||||
"DataSourceConnectionString": "",
|
||||
"SelectCommandType": 1,
|
||||
"SelectCommand": "Pro_T_Todo",
|
||||
"SelectCommand": "Adm_D_Todos",
|
||||
"KeyFieldName": "Id",
|
||||
"KeyFieldDbSourceType": 9,
|
||||
"TreeKeyExpr": "",
|
||||
|
|
@ -61,7 +60,7 @@
|
|||
"TodoPriorityExpr": "Priority",
|
||||
"TodoCompletedExpr": "Completed",
|
||||
"TodoOrderExpr": "SortOrder",
|
||||
"TodoStatusOrder": "Backlog, Ready to Start, In Progress, Code Review, Testing, Staging",
|
||||
"TodoStatusOrder": "Inbox, Today, This Week, This Month, Later, Done",
|
||||
"TodoAllowDragging": true,
|
||||
"ApprovalUserFieldName": "",
|
||||
"ApprovalDateFieldName": "",
|
||||
|
|
@ -75,7 +74,7 @@
|
|||
"ColCount": 1,
|
||||
"Items": [
|
||||
{
|
||||
"FieldName": "Id",
|
||||
"DataField": "Id",
|
||||
"CaptionName": "App.Listform.ListformField.Id",
|
||||
"EditorType": "dxTextBox",
|
||||
"EditorOptions": "",
|
||||
|
|
@ -92,7 +91,7 @@
|
|||
"LookupQuery": ""
|
||||
},
|
||||
{
|
||||
"FieldName": "Title",
|
||||
"DataField": "Title",
|
||||
"CaptionName": "App.Listform.ListformField.Title",
|
||||
"EditorType": "dxTextBox",
|
||||
"EditorOptions": "",
|
||||
|
|
@ -109,7 +108,7 @@
|
|||
"LookupQuery": ""
|
||||
},
|
||||
{
|
||||
"FieldName": "Status",
|
||||
"DataField": "Status",
|
||||
"CaptionName": "App.Listform.ListformField.Status",
|
||||
"EditorType": "dxTextBox",
|
||||
"EditorOptions": "",
|
||||
|
|
@ -126,10 +125,10 @@
|
|||
"LookupQuery": ""
|
||||
},
|
||||
{
|
||||
"FieldName": "Description",
|
||||
"DataField": "Description",
|
||||
"CaptionName": "App.Listform.ListformField.Description",
|
||||
"EditorType": "dxHtmlEditor",
|
||||
"EditorOptions": "{\u0022mediaResizing\u0022:{\u0022enabled\u0022:true},\u0022imageUpload\u0022:{\u0022tabs\u0022:[\u0022file\u0022,\u0022url\u0022],\u0022fileUploadMode\u0022:\u0022base64\u0022},\u0022toolbar\u0022:{\u0022multiline\u0022:true,\u0022items\u0022:[{\u0022name\u0022:\u0022undo\u0022},{\u0022name\u0022:\u0022redo\u0022},{\u0022name\u0022:\u0022separator\u0022},{\u0022name\u0022:\u0022size\u0022,\u0022acceptedValues\u0022:[\u00228pt\u0022,\u002210pt\u0022,\u002212pt\u0022,\u002214pt\u0022,\u002218pt\u0022,\u002224pt\u0022,\u002236pt\u0022],\u0022options\u0022:{\u0022inputAttr\u0022:{\u0022aria-label\u0022:\u0022Font size\u0022}}},{\u0022name\u0022:\u0022font\u0022,\u0022acceptedValues\u0022:[\u0022Arial\u0022,\u0022Courier New\u0022,\u0022Georgia\u0022,\u0022Impact\u0022,\u0022Lucida Console\u0022,\u0022Tahoma\u0022,\u0022Times New Roman\u0022,\u0022Verdana\u0022],\u0022options\u0022:{\u0022inputAttr\u0022:{\u0022aria-label\u0022:\u0022Font family\u0022}}},{\u0022name\u0022:\u0022separator\u0022},{\u0022name\u0022:\u0022bold\u0022},{\u0022name\u0022:\u0022italic\u0022},{\u0022name\u0022:\u0022strike\u0022},{\u0022name\u0022:\u0022underline\u0022},{\u0022name\u0022:\u0022separator\u0022},{\u0022name\u0022:\u0022alignLeft\u0022},{\u0022name\u0022:\u0022alignCenter\u0022},{\u0022name\u0022:\u0022alignRight\u0022},{\u0022name\u0022:\u0022alignJustify\u0022},{\u0022name\u0022:\u0022separator\u0022},{\u0022name\u0022:\u0022orderedList\u0022},{\u0022name\u0022:\u0022bulletList\u0022},{\u0022name\u0022:\u0022separator\u0022},{\u0022name\u0022:\u0022header\u0022,\u0022acceptedValues\u0022:[false,1,2,3,4,5]},{\u0022name\u0022:\u0022separator\u0022},{\u0022name\u0022:\u0022color\u0022},{\u0022name\u0022:\u0022background\u0022},{\u0022name\u0022:\u0022separator\u0022},{\u0022name\u0022:\u0022link\u0022},{\u0022name\u0022:\u0022image\u0022},{\u0022name\u0022:\u0022separator\u0022},{\u0022name\u0022:\u0022clear\u0022},{\u0022name\u0022:\u0022codeBlock\u0022},{\u0022name\u0022:\u0022blockquote\u0022},{\u0022name\u0022:\u0022separator\u0022},{\u0022name\u0022:\u0022insertTable\u0022},{\u0022name\u0022:\u0022deleteTable\u0022},{\u0022name\u0022:\u0022insertRowAbove\u0022},{\u0022name\u0022:\u0022insertRowBelow\u0022},{\u0022name\u0022:\u0022deleteRow\u0022},{\u0022name\u0022:\u0022insertColumnLeft\u0022},{\u0022name\u0022:\u0022insertColumnRight\u0022},{\u0022name\u0022:\u0022deleteColumn\u0022},{\u0022name\u0022:\u0022cellProperties\u0022},{\u0022name\u0022:\u0022tableProperties\u0022}]}}",
|
||||
"EditorType": "dxTextBox",
|
||||
"EditorOptions": "",
|
||||
"EditorScript": "",
|
||||
"ColSpan": 1,
|
||||
"IsRequired": false,
|
||||
|
|
@ -143,7 +142,7 @@
|
|||
"LookupQuery": ""
|
||||
},
|
||||
{
|
||||
"FieldName": "DueDate",
|
||||
"DataField": "DueDate",
|
||||
"CaptionName": "App.Listform.ListformField.DueDate",
|
||||
"EditorType": "dxDateBox",
|
||||
"EditorOptions": "",
|
||||
|
|
@ -160,7 +159,7 @@
|
|||
"LookupQuery": ""
|
||||
},
|
||||
{
|
||||
"FieldName": "Tags",
|
||||
"DataField": "Tags",
|
||||
"CaptionName": "App.Listform.ListformField.Tags",
|
||||
"EditorType": "dxTextBox",
|
||||
"EditorOptions": "",
|
||||
|
|
@ -177,7 +176,7 @@
|
|||
"LookupQuery": ""
|
||||
},
|
||||
{
|
||||
"FieldName": "Assignees",
|
||||
"DataField": "Assignees",
|
||||
"CaptionName": "App.Listform.ListformField.Assignees",
|
||||
"EditorType": "dxTextBox",
|
||||
"EditorOptions": "",
|
||||
|
|
@ -194,7 +193,7 @@
|
|||
"LookupQuery": ""
|
||||
},
|
||||
{
|
||||
"FieldName": "Priority",
|
||||
"DataField": "Priority",
|
||||
"CaptionName": "App.Listform.ListformField.Priority",
|
||||
"EditorType": "dxTextBox",
|
||||
"EditorOptions": "",
|
||||
|
|
@ -211,7 +210,7 @@
|
|||
"LookupQuery": ""
|
||||
},
|
||||
{
|
||||
"FieldName": "Completed",
|
||||
"DataField": "Completed",
|
||||
"CaptionName": "App.Listform.ListformField.Completed",
|
||||
"EditorType": "dxCheckBox",
|
||||
"EditorOptions": "",
|
||||
|
|
@ -228,7 +227,7 @@
|
|||
"LookupQuery": ""
|
||||
},
|
||||
{
|
||||
"FieldName": "SortOrder",
|
||||
"DataField": "SortOrder",
|
||||
"CaptionName": "App.Listform.ListformField.SortOrder",
|
||||
"EditorType": "dxNumberBox",
|
||||
"EditorOptions": "",
|
||||
|
|
@ -254,27 +253,25 @@
|
|||
"IsCreatedField": false,
|
||||
"InsertedRecords": {
|
||||
"LanguageKeys": [
|
||||
"App.Wizard.Todo",
|
||||
"App.Wizard.Todo.Title",
|
||||
"App.Wizard.Todo.Desc",
|
||||
"App.Wizard.Todos",
|
||||
"App.Wizard.Todos.Title",
|
||||
"App.Wizard.Todos.Desc",
|
||||
"App.Listform.ListformField.Assignees",
|
||||
"App.Listform.ListformField.Completed",
|
||||
"App.Listform.ListformField.SortOrder"
|
||||
],
|
||||
"PermissionGroupNames": [
|
||||
"App.Wizard.Project"
|
||||
],
|
||||
"PermissionGroupNames": [],
|
||||
"PermissionNames": [
|
||||
"App.Wizard.Todo",
|
||||
"App.Wizard.Todo.Create",
|
||||
"App.Wizard.Todo.Update",
|
||||
"App.Wizard.Todo.Delete",
|
||||
"App.Wizard.Todo.Export",
|
||||
"App.Wizard.Todo.Import",
|
||||
"App.Wizard.Todo.Note"
|
||||
"App.Wizard.Todos",
|
||||
"App.Wizard.Todos.Create",
|
||||
"App.Wizard.Todos.Update",
|
||||
"App.Wizard.Todos.Delete",
|
||||
"App.Wizard.Todos.Export",
|
||||
"App.Wizard.Todos.Import",
|
||||
"App.Wizard.Todos.Note"
|
||||
],
|
||||
"MenuCodes": [
|
||||
"App.Wizard.Todo"
|
||||
"App.Wizard.Todos"
|
||||
],
|
||||
"DataSourceCodes": []
|
||||
}
|
||||
|
|
@ -1,281 +0,0 @@
|
|||
{
|
||||
"Wizard": {
|
||||
"WizardName": "Approval",
|
||||
"ListFormCode": "App.Wizard.Approval",
|
||||
"MenuCode": "App.Wizard.Approval",
|
||||
"IsTenant": true,
|
||||
"IsBranch": false,
|
||||
"IsOrganizationUnit": false,
|
||||
"AllowAdding": true,
|
||||
"AllowUpdating": true,
|
||||
"AllowDeleting": true,
|
||||
"AllowDetail": false,
|
||||
"ConfirmDelete": true,
|
||||
"DefaultLayout": "grid",
|
||||
"Grid": true,
|
||||
"Card": true,
|
||||
"Pivot": true,
|
||||
"Tree": true,
|
||||
"Chart": true,
|
||||
"Gantt": true,
|
||||
"Scheduler": true,
|
||||
"Todo": false,
|
||||
"LanguageTextMenuEn": "Approval",
|
||||
"LanguageTextMenuTr": "Onaylama",
|
||||
"LanguageTextTitleEn": "Approval",
|
||||
"LanguageTextTitleTr": "Onaylama",
|
||||
"LanguageTextDescEn": "Approval",
|
||||
"LanguageTextDescTr": "Onaylama",
|
||||
"LanguageTextMenuParentEn": "Project",
|
||||
"LanguageTextMenuParentTr": "Project",
|
||||
"PermissionGroupName": "App.Wizard.Project",
|
||||
"MenuParentCode": "App.Wizard.Project",
|
||||
"MenuParentShortName": "Pro",
|
||||
"MenuParentIcon": "FcVideoProjector",
|
||||
"MenuIcon": "FcApproval",
|
||||
"DataSourceCode": "Default",
|
||||
"DataSourceConnectionString": "",
|
||||
"SelectCommandType": 1,
|
||||
"SelectCommand": "Pro_T_Approval",
|
||||
"KeyFieldName": "Id",
|
||||
"KeyFieldDbSourceType": 9,
|
||||
"TreeKeyExpr": "",
|
||||
"TreeParentIdExpr": "",
|
||||
"TreeAutoExpandAll": false,
|
||||
"GanttKeyExpr": "",
|
||||
"GanttParentIdExpr": "",
|
||||
"GanttAutoExpandAll": false,
|
||||
"GanttTitleExpr": "",
|
||||
"GanttStartExpr": "",
|
||||
"GanttEndExpr": "",
|
||||
"GanttProgressExpr": "",
|
||||
"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": "ApprovalUserName",
|
||||
"ApprovalDateFieldName": "ApprovalDate",
|
||||
"ApprovalStatusFieldName": "ApprovalStatus",
|
||||
"ApprovalDescriptionFieldName": "ApprovalDescription",
|
||||
"ApprovalIsFilterUserName": false,
|
||||
"Criteria": [
|
||||
{
|
||||
"ListFormCode": "App.Wizard.Approval",
|
||||
"Kind": "Start",
|
||||
"Title": "\u0130\u015F Ak\u0131\u015F\u0131 Ba\u015Flat1",
|
||||
"CompareColumn": "Price",
|
||||
"CompareOperator": "\u003E",
|
||||
"CompareValue": 5000,
|
||||
"Approver": "",
|
||||
"NextOnStart": "App.Wizard.Approval-N002",
|
||||
"NextOnTrue": "",
|
||||
"NextOnFalse": "",
|
||||
"NextOnApprove": "",
|
||||
"NextOnReject": "",
|
||||
"PositionX": 46,
|
||||
"PositionY": 46,
|
||||
"CompareOutcomes": [],
|
||||
"Id": "App.Wizard.Approval-N001"
|
||||
},
|
||||
{
|
||||
"ListFormCode": "App.Wizard.Approval",
|
||||
"Kind": "Approval",
|
||||
"Title": "Onay1",
|
||||
"CompareColumn": "Price",
|
||||
"CompareOperator": "\u003E",
|
||||
"CompareValue": 5000,
|
||||
"Approver": "system@sozsoft.com",
|
||||
"NextOnStart": "",
|
||||
"NextOnTrue": "",
|
||||
"NextOnFalse": "",
|
||||
"NextOnApprove": "App.Wizard.Approval-N003",
|
||||
"NextOnReject": "App.Wizard.Approval-N004",
|
||||
"PositionX": 337,
|
||||
"PositionY": 39,
|
||||
"CompareOutcomes": [],
|
||||
"Id": "App.Wizard.Approval-N002"
|
||||
},
|
||||
{
|
||||
"ListFormCode": "App.Wizard.Approval",
|
||||
"Kind": "Inform",
|
||||
"Title": "Bilgilendirme1",
|
||||
"CompareColumn": "Price",
|
||||
"CompareOperator": "\u003E",
|
||||
"CompareValue": 5000,
|
||||
"Approver": "system@sozsoft.com",
|
||||
"NextOnStart": "App.Wizard.Approval-N004",
|
||||
"NextOnTrue": "",
|
||||
"NextOnFalse": "",
|
||||
"NextOnApprove": "",
|
||||
"NextOnReject": "",
|
||||
"PositionX": 538,
|
||||
"PositionY": 324,
|
||||
"CompareOutcomes": [],
|
||||
"Id": "App.Wizard.Approval-N003"
|
||||
},
|
||||
{
|
||||
"ListFormCode": "App.Wizard.Approval",
|
||||
"Kind": "End",
|
||||
"Title": "\u0130\u015F Ak\u0131\u015F\u0131 Bitir1",
|
||||
"CompareColumn": "Price",
|
||||
"CompareOperator": "\u003E",
|
||||
"CompareValue": 5000,
|
||||
"Approver": "",
|
||||
"NextOnStart": "",
|
||||
"NextOnTrue": "",
|
||||
"NextOnFalse": "",
|
||||
"NextOnApprove": "",
|
||||
"NextOnReject": "",
|
||||
"PositionX": 852,
|
||||
"PositionY": 26,
|
||||
"CompareOutcomes": [],
|
||||
"Id": "App.Wizard.Approval-N004"
|
||||
}
|
||||
],
|
||||
"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": "ApprovalUserName",
|
||||
"CaptionName": "App.Listform.ListformField.ApprovalUserName",
|
||||
"EditorType": "dxTextBox",
|
||||
"EditorOptions": "",
|
||||
"EditorScript": "",
|
||||
"ColSpan": 1,
|
||||
"IsRequired": false,
|
||||
"IncludeInEditingForm": false,
|
||||
"DbSourceType": 16,
|
||||
"TurkishCaption": "Approval User Name",
|
||||
"EnglishCaption": "Approval User Name",
|
||||
"LookupDataSourceType": 1,
|
||||
"ValueExpr": "Key",
|
||||
"DisplayExpr": "Name",
|
||||
"LookupQuery": ""
|
||||
},
|
||||
{
|
||||
"FieldName": "ApprovalStatus",
|
||||
"CaptionName": "App.Listform.ListformField.ApprovalStatus",
|
||||
"EditorType": "dxTextBox",
|
||||
"EditorOptions": "",
|
||||
"EditorScript": "",
|
||||
"ColSpan": 1,
|
||||
"IsRequired": false,
|
||||
"IncludeInEditingForm": false,
|
||||
"DbSourceType": 16,
|
||||
"TurkishCaption": "Approval Status",
|
||||
"EnglishCaption": "Approval Status",
|
||||
"LookupDataSourceType": 1,
|
||||
"ValueExpr": "Key",
|
||||
"DisplayExpr": "Name",
|
||||
"LookupQuery": ""
|
||||
},
|
||||
{
|
||||
"FieldName": "ApprovalDate",
|
||||
"CaptionName": "App.Listform.ListformField.ApprovalDate",
|
||||
"EditorType": "dxDateBox",
|
||||
"EditorOptions": "",
|
||||
"EditorScript": "",
|
||||
"ColSpan": 1,
|
||||
"IsRequired": false,
|
||||
"IncludeInEditingForm": false,
|
||||
"DbSourceType": 6,
|
||||
"TurkishCaption": "Approval Date",
|
||||
"EnglishCaption": "Approval Date",
|
||||
"LookupDataSourceType": 1,
|
||||
"ValueExpr": "Key",
|
||||
"DisplayExpr": "Name",
|
||||
"LookupQuery": ""
|
||||
},
|
||||
{
|
||||
"FieldName": "ApprovalDescription",
|
||||
"CaptionName": "App.Listform.ListformField.ApprovalDescription",
|
||||
"EditorType": "dxTextBox",
|
||||
"EditorOptions": "",
|
||||
"EditorScript": "",
|
||||
"ColSpan": 1,
|
||||
"IsRequired": false,
|
||||
"IncludeInEditingForm": false,
|
||||
"DbSourceType": 16,
|
||||
"TurkishCaption": "Approval Description",
|
||||
"EnglishCaption": "Approval Description",
|
||||
"LookupDataSourceType": 1,
|
||||
"ValueExpr": "Key",
|
||||
"DisplayExpr": "Name",
|
||||
"LookupQuery": ""
|
||||
},
|
||||
{
|
||||
"FieldName": "Title",
|
||||
"CaptionName": "App.Listform.ListformField.Title",
|
||||
"EditorType": "dxTextBox",
|
||||
"EditorOptions": "",
|
||||
"EditorScript": "",
|
||||
"ColSpan": 1,
|
||||
"IsRequired": false,
|
||||
"IncludeInEditingForm": true,
|
||||
"DbSourceType": 16,
|
||||
"TurkishCaption": "Title",
|
||||
"EnglishCaption": "Title",
|
||||
"LookupDataSourceType": 1,
|
||||
"ValueExpr": "Key",
|
||||
"DisplayExpr": "Name",
|
||||
"LookupQuery": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"SubForms": [],
|
||||
"Widgets": []
|
||||
},
|
||||
"IsDeletedField": false,
|
||||
"IsCreatedField": false,
|
||||
"InsertedRecords": {
|
||||
"LanguageKeys": [
|
||||
"App.Wizard.Approval",
|
||||
"App.Wizard.Approval.Title",
|
||||
"App.Wizard.Approval.Desc"
|
||||
],
|
||||
"PermissionGroupNames": [],
|
||||
"PermissionNames": [
|
||||
"App.Wizard.Approval",
|
||||
"App.Wizard.Approval.Create",
|
||||
"App.Wizard.Approval.Update",
|
||||
"App.Wizard.Approval.Delete",
|
||||
"App.Wizard.Approval.Export",
|
||||
"App.Wizard.Approval.Import",
|
||||
"App.Wizard.Approval.Note"
|
||||
],
|
||||
"MenuCodes": [
|
||||
"App.Wizard.Approval"
|
||||
],
|
||||
"DataSourceCodes": []
|
||||
}
|
||||
}
|
||||
|
|
@ -107,8 +107,6 @@ public class WizardDataSeeder : IDataSeedContributor, ITransientDependency
|
|||
|
||||
var fileName = Path.GetFileName(filePath);
|
||||
|
||||
await BackfillMenuParentShortNameAsync(seedFile.Wizard);
|
||||
|
||||
// Zaten seeded mi kontrol et (ListForm var mı?)
|
||||
if (await _repoListForm.AnyAsync(a => a.ListFormCode == seedFile.Wizard.ListFormCode))
|
||||
{
|
||||
|
|
@ -255,7 +253,6 @@ public class WizardDataSeeder : IDataSeedContributor, ITransientDependency
|
|||
Code = input.MenuParentCode,
|
||||
DisplayName = input.MenuParentCode,
|
||||
IsDisabled = false,
|
||||
ShortName = input.MenuParentShortName,
|
||||
Icon = menuParentIcon,
|
||||
Order = maxRootOrder + 1,
|
||||
}, autoSave: true);
|
||||
|
|
@ -305,9 +302,21 @@ public class WizardDataSeeder : IDataSeedContributor, ITransientDependency
|
|||
Caption = g.Caption,
|
||||
ColCount = g.ColCount,
|
||||
ColSpan = g.ColCount,
|
||||
ItemType = "group"
|
||||
ItemType = "group",
|
||||
Items = g.Items
|
||||
.Where(i => i.IncludeInEditingForm && i.DataField != input.KeyFieldName)
|
||||
.Select((it, ii) => new EditingFormItemDto
|
||||
{
|
||||
Order = ii + 1,
|
||||
DataField = it.DataField,
|
||||
EditorType2 = it.EditorType,
|
||||
ColSpan = it.ColSpan,
|
||||
EditorOptions = string.IsNullOrWhiteSpace(it.EditorOptions) ? null : it.EditorOptions,
|
||||
EditorScript = string.IsNullOrWhiteSpace(it.EditorScript) ? null : it.EditorScript,
|
||||
})
|
||||
.ToArray()
|
||||
})
|
||||
.Where((_, index) => input.Groups[index].Items.Any(i => i.IncludeInEditingForm && i.FieldName != input.KeyFieldName))
|
||||
.Where(g => g.Items.Length > 0)
|
||||
.ToList();
|
||||
|
||||
// ListForm - varsa sil, yeniden ekle
|
||||
|
|
@ -332,8 +341,8 @@ public class WizardDataSeeder : IDataSeedContributor, ITransientDependency
|
|||
// EditingForm'da required olan alanları tespit et, ValidationRuleJson eklemek için
|
||||
var editingFormFieldNames = input.Groups
|
||||
.SelectMany(g => g.Items)
|
||||
.Where(i => i.IncludeInEditingForm && i.FieldName != input.KeyFieldName)
|
||||
.Select(i => new { FieldName = i.FieldName, Isrequired = i.IsRequired })
|
||||
.Where(i => i.IncludeInEditingForm && i.DataField != input.KeyFieldName)
|
||||
.Select(i => new { FieldName = i.DataField, Isrequired = i.IsRequired })
|
||||
.ToList();
|
||||
|
||||
// Heigth ve Width hesaplama
|
||||
|
|
@ -341,7 +350,7 @@ public class WizardDataSeeder : IDataSeedContributor, ITransientDependency
|
|||
.Select(g =>
|
||||
{
|
||||
var items = g.Items
|
||||
.Where(i => i.IncludeInEditingForm && i.FieldName != input.KeyFieldName)
|
||||
.Where(i => i.IncludeInEditingForm && i.DataField != input.KeyFieldName)
|
||||
.ToList();
|
||||
|
||||
var columnCount = g.ColCount;
|
||||
|
|
@ -413,10 +422,10 @@ public class WizardDataSeeder : IDataSeedContributor, ITransientDependency
|
|||
DeleteCommand = isDeleted ? WizardConsts.DefaultDeleteCommand(input.SelectCommand) : null,
|
||||
DeleteFieldsDefaultValueJson = isDeleted
|
||||
? WizardConsts.DefaultDeleteFieldsDefaultValueJson(input.KeyFieldDbSourceType)
|
||||
: WizardConsts.DefaultDeleteFieldsJsonOnlyId(input.KeyFieldDbSourceType),
|
||||
: WizardConsts.DefaultFieldsJsonOnlyId(input.KeyFieldDbSourceType),
|
||||
InsertFieldsDefaultValueJson = isCreated
|
||||
? WizardConsts.DefaultInsertFieldsDefaultValueJson(input.KeyFieldDbSourceType)
|
||||
: WizardConsts.DefaultInsertFieldsJsonOnlyId(input.KeyFieldDbSourceType),
|
||||
: WizardConsts.DefaultFieldsJsonOnlyId(input.KeyFieldDbSourceType),
|
||||
PagerOptionJson = WizardConsts.DefaultPagerOptionJson,
|
||||
EditingOptionJson = WizardConsts.DefaultEditingOptionJson(titleLangKey, formWidth, formHeight, input.AllowDeleting, input.AllowAdding, input.AllowUpdating, input.ConfirmDelete, false, input.AllowDetail),
|
||||
EditingFormJson = editingFormDtos.Count > 0 ? JsonSerializer.Serialize(editingFormDtos) : null,
|
||||
|
|
@ -445,36 +454,21 @@ public class WizardDataSeeder : IDataSeedContributor, ITransientDependency
|
|||
|
||||
// ListFormFields
|
||||
var fieldOrder = 0;
|
||||
var editGroupOrder = 0;
|
||||
foreach (var group in input.Groups)
|
||||
{
|
||||
editGroupOrder++;
|
||||
var editOrder = 0;
|
||||
foreach (var item in group.Items)
|
||||
{
|
||||
fieldOrder++;
|
||||
if (item.IncludeInEditingForm && item.FieldName != input.KeyFieldName)
|
||||
{
|
||||
editOrder++;
|
||||
}
|
||||
await _repoListFormField.InsertAsync(new ListFormField
|
||||
{
|
||||
ListFormCode = input.ListFormCode,
|
||||
FieldName = item.FieldName,
|
||||
FieldName = item.DataField,
|
||||
CaptionName = item.CaptionName,
|
||||
Visible = item.FieldName != input.KeyFieldName,
|
||||
Visible = item.DataField != input.KeyFieldName,
|
||||
IsActive = true,
|
||||
Width = 0, //Fit columns için hepsine sıfır veriyorum.
|
||||
AllowSearch = true,
|
||||
ListOrderNo = fieldOrder,
|
||||
EditGroupOrderNo = item.IncludeInEditingForm ? editGroupOrder : null,
|
||||
EditOrderNo = item.IncludeInEditingForm && item.FieldName != input.KeyFieldName
|
||||
? editOrder
|
||||
: null,
|
||||
EditorType2 = item.EditorType,
|
||||
ColSpan = item.ColSpan,
|
||||
EditorOptions = string.IsNullOrWhiteSpace(item.EditorOptions) ? null : item.EditorOptions,
|
||||
EditorScript = string.IsNullOrWhiteSpace(item.EditorScript) ? null : item.EditorScript,
|
||||
SourceDbType = item.DbSourceType,
|
||||
CultureName = PlatformConsts.DefaultLanguage,
|
||||
PermissionJson = WizardConsts.DefaultFieldPermissionJson(code),
|
||||
|
|
@ -484,7 +478,7 @@ public class WizardDataSeeder : IDataSeedContributor, ITransientDependency
|
|||
LookupJson = !string.IsNullOrWhiteSpace(item.LookupQuery)
|
||||
? WizardConsts.DefaultLookupJson(item.LookupDataSourceType, item.DisplayExpr, item.ValueExpr, item.LookupQuery)
|
||||
: null,
|
||||
ValidationRuleJson = editingFormFieldNames.Any(f => f.FieldName == item.FieldName && f.Isrequired)
|
||||
ValidationRuleJson = editingFormFieldNames.Any(f => f.FieldName == item.DataField && f.Isrequired)
|
||||
? WizardConsts.DefaultValidationRuleRequiredJson
|
||||
: null
|
||||
}, autoSave: true);
|
||||
|
|
@ -522,24 +516,6 @@ public class WizardDataSeeder : IDataSeedContributor, ITransientDependency
|
|||
}
|
||||
}
|
||||
|
||||
private async Task BackfillMenuParentShortNameAsync(ListFormWizardDto input)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(input.MenuParentCode) ||
|
||||
string.IsNullOrWhiteSpace(input.MenuParentShortName))
|
||||
return;
|
||||
|
||||
var menuParent = await _repoMenu.FirstOrDefaultAsync(a => a.Code == input.MenuParentCode);
|
||||
if (menuParent == null || !string.IsNullOrWhiteSpace(menuParent.ShortName))
|
||||
return;
|
||||
|
||||
menuParent.ShortName = input.MenuParentShortName.Trim();
|
||||
await _repoMenu.UpdateAsync(menuParent, autoSave: true);
|
||||
_logger.LogInformation(
|
||||
"Menu parent '{MenuParentCode}' ShortName backfilled as '{ShortName}'.",
|
||||
input.MenuParentCode,
|
||||
menuParent.ShortName);
|
||||
}
|
||||
|
||||
private static bool HasWorkflow(WorkflowDto workflow, List<ListFormWorkflowCriteriaDto> criteria)
|
||||
{
|
||||
return workflow != null && (
|
||||
|
|
|
|||
|
|
@ -758,7 +758,6 @@ public static class PlatformConsts
|
|||
public const string dxDateBox = "dxDateBox";
|
||||
public const string dxDateRangeBox = "dxDateRangeBox";
|
||||
public const string dxDropDownBox = "dxDropDownBox";
|
||||
public const string dxGridBox = "dxGridBox";
|
||||
public const string dxHtmlEditor = "dxHtmlEditor";
|
||||
public const string dxLookup = "dxHtmlEdidxLookuptor";
|
||||
public const string dxNumberBox = "dxNumberBox";
|
||||
|
|
|
|||
|
|
@ -198,14 +198,6 @@ public static class WizardConsts
|
|||
});
|
||||
}
|
||||
|
||||
public static string DefaultInsertFieldsJsonOnlyId(DbType dbType = DbType.Guid)
|
||||
{
|
||||
return JsonSerializer.Serialize(new[]
|
||||
{
|
||||
new { FieldName = "Id", FieldDbType = dbType, Value = "@NEWID", CustomValueType = FieldCustomValueTypeEnum.CustomKey }
|
||||
});
|
||||
}
|
||||
|
||||
public static string DefaultDeleteFieldsDefaultValueJson(DbType dbType = DbType.Guid)
|
||||
{
|
||||
return JsonSerializer.Serialize(new[]
|
||||
|
|
@ -215,11 +207,11 @@ public static class WizardConsts
|
|||
});
|
||||
}
|
||||
|
||||
public static string DefaultDeleteFieldsJsonOnlyId(DbType dbType = DbType.Guid)
|
||||
public static string DefaultFieldsJsonOnlyId(DbType dbType = DbType.Guid)
|
||||
{
|
||||
return JsonSerializer.Serialize(new[]
|
||||
{
|
||||
new { FieldName = "Id", FieldDbType = dbType, Value = "@ID", CustomValueType = FieldCustomValueTypeEnum.CustomKey }
|
||||
new { FieldName = "Id", FieldDbType = dbType, Value = "@NEWID", CustomValueType = FieldCustomValueTypeEnum.CustomKey }
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -53,12 +53,6 @@ public class ListFormField : Entity<Guid>
|
|||
|
||||
public string Alignment { get; set; } = "left"; // Sütunun Sağa, sola veya ortalama gösterimi
|
||||
public string Format { get; set; } // Cell bazında sütunun formatlanması
|
||||
|
||||
public int? EditOrderNo { get; set; }
|
||||
public int? EditGroupOrderNo { get; set; }
|
||||
public string EditorType2 { get; set; }
|
||||
public int? ColSpan { get; set; }
|
||||
public string EditorScript { get; set; } //Sütunun ekstra javascript ile yönetilmesi
|
||||
public string EditorOptions { get; set; } //Sütunun ekstra özellikleri yönetilmesi
|
||||
}
|
||||
|
||||
|
|
|
|||
58
api/src/Sozsoft.Platform.Domain/Queries/EditingForm.cs
Normal file
58
api/src/Sozsoft.Platform.Domain/Queries/EditingForm.cs
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Text.Json.Serialization;
|
||||
using Volo.Abp.Domain.Values;
|
||||
|
||||
namespace Sozsoft.Platform.Queries;
|
||||
|
||||
// public class EditingForm : ValueObject
|
||||
// {
|
||||
// public int Order { get; set; }
|
||||
// public string ItemType { get; set; }
|
||||
// public string Caption { get; set; }
|
||||
// public int ColCount { get; set; }
|
||||
// public int ColSpan { get; set; }
|
||||
// /// <summary> Type: Array<Simple Form Item | Group Form Item | Tabbed Form Item | Empty Form Item | Button Form Item>
|
||||
// /// Bu kisma suan sadece string olarak doldurulacak
|
||||
// /// items: ['FirstName', 'LastName',
|
||||
// /// { dataField: 'Notes', editorType: 'dxTextArea', colSpan: 2, editorOptions: { height: 100, }, }
|
||||
// /// ],
|
||||
// /// </summary>
|
||||
// //[TextArea]
|
||||
// //public string[] Items { get; set; }
|
||||
// public EditingFormItem[] Items { get; set; }
|
||||
|
||||
// protected override IEnumerable<object> GetAtomicValues()
|
||||
// {
|
||||
// yield return ItemType;
|
||||
// yield return Caption;
|
||||
// yield return ColCount;
|
||||
// yield return ColSpan;
|
||||
// yield return Items;
|
||||
// }
|
||||
// }
|
||||
|
||||
// public class EditingFormItem : ValueObject
|
||||
// {
|
||||
// [JsonPropertyName("order")]
|
||||
// public int Order { get; set; }
|
||||
// [JsonPropertyName("dataField")]
|
||||
// public string DataField { get; set; }
|
||||
// [JsonPropertyName("editorType2")]
|
||||
// public string EditorType2 { get; set; }
|
||||
// [JsonPropertyName("colSpan")]
|
||||
// public int ColSpan { get; set; }
|
||||
// [JsonPropertyName("editorOptions")]
|
||||
// public string EditorOptions { get; set; }
|
||||
// [JsonPropertyName("isRequired")]
|
||||
// public bool IsRequired { get; set; }
|
||||
|
||||
// protected override IEnumerable<object> GetAtomicValues()
|
||||
// {
|
||||
// yield return DataField;
|
||||
// yield return EditorType2;
|
||||
// yield return ColSpan;
|
||||
// yield return EditorOptions;
|
||||
// yield return IsRequired;
|
||||
// }
|
||||
// }
|
||||
|
||||
|
|
@ -170,8 +170,7 @@ public class QueryManager : PlatformDomainService, IQueryManager
|
|||
// oncelik Command alanindadir, dolu ise silme islemi buradaki sorguya yonlendirilir
|
||||
if (!string.IsNullOrEmpty(command))
|
||||
{
|
||||
// sql = NormalizeCollectionParameterCommand(command, parameters, dataSourceType);
|
||||
sql = command;
|
||||
sql = NormalizeCollectionParameterCommand(command, parameters, dataSourceType);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -189,6 +188,12 @@ public class QueryManager : PlatformDomainService, IQueryManager
|
|||
}
|
||||
else if (op == OperationEnum.Update)
|
||||
{
|
||||
var where = dataSourceType switch
|
||||
{
|
||||
DataSourceTypeEnum.Mssql => $"\"{listForm.KeyFieldName}\" IN @{listForm.KeyFieldName}",
|
||||
DataSourceTypeEnum.Postgresql => $"\"{listForm.KeyFieldName}\" = ANY(@{listForm.KeyFieldName})",
|
||||
_ => string.Empty,
|
||||
};
|
||||
var updateFields = parameters.Select(a => $"\"{a.Key}\" = @{a.Key}").ToList();
|
||||
var val = QueryHelper.GetFormattedValue(listForm.KeyFieldDbSourceType, keys);
|
||||
if (!parameters.ContainsKey(listForm.KeyFieldName))
|
||||
|
|
@ -197,18 +202,6 @@ public class QueryManager : PlatformDomainService, IQueryManager
|
|||
listForm.KeyFieldName,
|
||||
val.GetType().IsArray ? val : new object[] { val });
|
||||
}
|
||||
|
||||
var where = BuildWhereCondition(
|
||||
listForm.KeyFieldName,
|
||||
parameters[listForm.KeyFieldName],
|
||||
dataSourceType);
|
||||
|
||||
if (parameters.TryGetValue("TenantId", out var tenantId)
|
||||
&& !string.Equals(listForm.KeyFieldName, "TenantId", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
where += $" AND {BuildWhereCondition("TenantId", tenantId, dataSourceType)}";
|
||||
}
|
||||
|
||||
sql = $"UPDATE \"{listForm.SelectCommand}\" SET {string.Join(',', updateFields)} WHERE {where}";
|
||||
}
|
||||
else if (op == OperationEnum.Delete)
|
||||
|
|
@ -219,7 +212,12 @@ public class QueryManager : PlatformDomainService, IQueryManager
|
|||
{
|
||||
where = string.Join(
|
||||
" AND ",
|
||||
parameters.Select(a => BuildWhereCondition(a.Key, a.Value, dataSourceType)).ToList());
|
||||
parameters.Select(a => dataSourceType switch
|
||||
{
|
||||
DataSourceTypeEnum.Mssql => $"\"{a.Key}\" IN @{a.Key}",
|
||||
DataSourceTypeEnum.Postgresql => $"\"{a.Key}\" = ANY(@{a.Key})",
|
||||
_ => "1 = 0",
|
||||
}).ToList());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -242,101 +240,77 @@ public class QueryManager : PlatformDomainService, IQueryManager
|
|||
return sql;
|
||||
}
|
||||
|
||||
private static bool IsCollectionValue(object value)
|
||||
private static string NormalizeCollectionParameterCommand(
|
||||
string command,
|
||||
Dictionary<string, object> parameters,
|
||||
DataSourceTypeEnum dataSourceType)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(command) || parameters == null || parameters.Count == 0)
|
||||
{
|
||||
return command;
|
||||
}
|
||||
|
||||
var sql = command;
|
||||
foreach (var parameter in parameters)
|
||||
{
|
||||
if (!IsCollectionParameter(parameter.Value))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var escapedParameterName = Regex.Escape(parameter.Key);
|
||||
sql = dataSourceType switch
|
||||
{
|
||||
DataSourceTypeEnum.Mssql => NormalizeMssqlCollectionParameter(sql, escapedParameterName, parameter.Key),
|
||||
DataSourceTypeEnum.Postgresql => NormalizePostgresqlCollectionParameter(sql, escapedParameterName, parameter.Key),
|
||||
_ => sql
|
||||
};
|
||||
}
|
||||
|
||||
return sql;
|
||||
}
|
||||
|
||||
private static bool IsCollectionParameter(object value)
|
||||
{
|
||||
return value is System.Collections.IEnumerable
|
||||
&& value is not string
|
||||
&& value is not byte[];
|
||||
}
|
||||
|
||||
private static string BuildWhereCondition(
|
||||
string fieldName,
|
||||
object value,
|
||||
DataSourceTypeEnum dataSourceType)
|
||||
private static string NormalizeMssqlCollectionParameter(
|
||||
string sql,
|
||||
string escapedParameterName,
|
||||
string parameterName)
|
||||
{
|
||||
return dataSourceType switch
|
||||
{
|
||||
DataSourceTypeEnum.Mssql when value is null or DBNull => $"\"{fieldName}\" IS NULL",
|
||||
DataSourceTypeEnum.Postgresql when value is null or DBNull => $"\"{fieldName}\" IS NULL",
|
||||
DataSourceTypeEnum.Mssql when IsCollectionValue(value) => $"\"{fieldName}\" IN @{fieldName}",
|
||||
DataSourceTypeEnum.Postgresql when IsCollectionValue(value) => $"\"{fieldName}\" = ANY(@{fieldName})",
|
||||
DataSourceTypeEnum.Mssql => $"\"{fieldName}\" = @{fieldName}",
|
||||
DataSourceTypeEnum.Postgresql => $"\"{fieldName}\" = @{fieldName}",
|
||||
_ => "1 = 0",
|
||||
};
|
||||
sql = Regex.Replace(
|
||||
sql,
|
||||
$@"IN\s*\(\s*@{escapedParameterName}\s*\)",
|
||||
$"IN @{parameterName}",
|
||||
RegexOptions.IgnoreCase);
|
||||
|
||||
return Regex.Replace(
|
||||
sql,
|
||||
$@"(?<column>(""[^""]+""|\[[^\]]+\]|`[^`]+`|\w+))\s*=\s*@{escapedParameterName}\b",
|
||||
match => $"{match.Groups["column"].Value} IN @{parameterName}",
|
||||
RegexOptions.IgnoreCase);
|
||||
}
|
||||
|
||||
// private static string NormalizeCollectionParameterCommand(
|
||||
// string command,
|
||||
// Dictionary<string, object> parameters,
|
||||
// DataSourceTypeEnum dataSourceType)
|
||||
// {
|
||||
// if (string.IsNullOrWhiteSpace(command) || parameters == null || parameters.Count == 0)
|
||||
// {
|
||||
// return command;
|
||||
// }
|
||||
private static string NormalizePostgresqlCollectionParameter(
|
||||
string sql,
|
||||
string escapedParameterName,
|
||||
string parameterName)
|
||||
{
|
||||
sql = Regex.Replace(
|
||||
sql,
|
||||
$@"IN\s*\(\s*@{escapedParameterName}\s*\)",
|
||||
$"= ANY(@{parameterName})",
|
||||
RegexOptions.IgnoreCase);
|
||||
|
||||
// var sql = command;
|
||||
// foreach (var parameter in parameters)
|
||||
// {
|
||||
// if (!IsCollectionParameter(parameter.Value))
|
||||
// {
|
||||
// continue;
|
||||
// }
|
||||
|
||||
// var escapedParameterName = Regex.Escape(parameter.Key);
|
||||
// sql = dataSourceType switch
|
||||
// {
|
||||
// DataSourceTypeEnum.Mssql => NormalizeMssqlCollectionParameter(sql, escapedParameterName, parameter.Key),
|
||||
// DataSourceTypeEnum.Postgresql => NormalizePostgresqlCollectionParameter(sql, escapedParameterName, parameter.Key),
|
||||
// _ => sql
|
||||
// };
|
||||
// }
|
||||
|
||||
// return sql;
|
||||
// }
|
||||
|
||||
// private static bool IsCollectionParameter(object value)
|
||||
// {
|
||||
// return value is System.Collections.IEnumerable
|
||||
// && value is not string
|
||||
// && value is not byte[];
|
||||
// }
|
||||
|
||||
// private static string NormalizeMssqlCollectionParameter(
|
||||
// string sql,
|
||||
// string escapedParameterName,
|
||||
// string parameterName)
|
||||
// {
|
||||
// sql = Regex.Replace(
|
||||
// sql,
|
||||
// $@"IN\s*\(\s*@{escapedParameterName}\s*\)",
|
||||
// $"IN @{parameterName}",
|
||||
// RegexOptions.IgnoreCase);
|
||||
|
||||
// return Regex.Replace(
|
||||
// sql,
|
||||
// $@"(?<column>(""[^""]+""|\[[^\]]+\]|`[^`]+`|\w+))\s*=\s*@{escapedParameterName}\b",
|
||||
// match => $"{match.Groups["column"].Value} IN @{parameterName}",
|
||||
// RegexOptions.IgnoreCase);
|
||||
// }
|
||||
|
||||
// private static string NormalizePostgresqlCollectionParameter(
|
||||
// string sql,
|
||||
// string escapedParameterName,
|
||||
// string parameterName)
|
||||
// {
|
||||
// sql = Regex.Replace(
|
||||
// sql,
|
||||
// $@"IN\s*\(\s*@{escapedParameterName}\s*\)",
|
||||
// $"= ANY(@{parameterName})",
|
||||
// RegexOptions.IgnoreCase);
|
||||
|
||||
// return Regex.Replace(
|
||||
// sql,
|
||||
// $@"(?<column>(""[^""]+""|\[[^\]]+\]|`[^`]+`|\w+))\s*=\s*@{escapedParameterName}\b",
|
||||
// match => $"{match.Groups["column"].Value} = ANY(@{parameterName})",
|
||||
// RegexOptions.IgnoreCase);
|
||||
// }
|
||||
return Regex.Replace(
|
||||
sql,
|
||||
$@"(?<column>(""[^""]+""|\[[^\]]+\]|`[^`]+`|\w+))\s*=\s*@{escapedParameterName}\b",
|
||||
match => $"{match.Groups["column"].Value} = ANY(@{parameterName})",
|
||||
RegexOptions.IgnoreCase);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -455,8 +455,6 @@ public class PlatformDbContext :
|
|||
b.Property(a => a.Alignment).HasMaxLength(20).HasDefaultValue("left");
|
||||
b.Property(a => a.Format).HasMaxLength(128);
|
||||
b.Property(a => a.EditorOptions).HasColumnType("text");
|
||||
b.Property(a => a.EditorType2).HasMaxLength(64);
|
||||
b.Property(a => a.EditorScript).HasColumnType("text");
|
||||
|
||||
b.HasIndex(x => new { x.ListFormCode, x.UserId, x.RoleId, x.CultureName, x.FieldName }).IsUnique().HasFilter(null);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore;
|
|||
namespace Sozsoft.Platform.Migrations
|
||||
{
|
||||
[DbContext(typeof(PlatformDbContext))]
|
||||
[Migration("20260717065637_Initial")]
|
||||
[Migration("20260716120523_Initial")]
|
||||
partial class Initial
|
||||
{
|
||||
/// <inheritdoc />
|
||||
|
|
@ -3415,9 +3415,6 @@ namespace Sozsoft.Platform.Migrations
|
|||
.HasMaxLength(256)
|
||||
.HasColumnType("nvarchar(256)");
|
||||
|
||||
b.Property<int?>("ColSpan")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("ColumnCssClass")
|
||||
.HasMaxLength(128)
|
||||
.HasColumnType("nvarchar(128)");
|
||||
|
|
@ -3443,22 +3440,9 @@ namespace Sozsoft.Platform.Migrations
|
|||
.HasMaxLength(10)
|
||||
.HasColumnType("nvarchar(10)");
|
||||
|
||||
b.Property<int?>("EditGroupOrderNo")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int?>("EditOrderNo")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("EditorOptions")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("EditorScript")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("EditorType2")
|
||||
.HasMaxLength(64)
|
||||
.HasColumnType("nvarchar(64)");
|
||||
|
||||
b.Property<string>("FieldName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(128)
|
||||
|
|
@ -2791,11 +2791,6 @@ namespace Sozsoft.Platform.Migrations
|
|||
PivotSettingsJson = table.Column<string>(type: "text", nullable: true),
|
||||
Alignment = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true, defaultValue: "left"),
|
||||
Format = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
|
||||
EditOrderNo = table.Column<int>(type: "int", nullable: true),
|
||||
EditGroupOrderNo = table.Column<int>(type: "int", nullable: true),
|
||||
EditorType2 = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
|
||||
ColSpan = table.Column<int>(type: "int", nullable: true),
|
||||
EditorScript = table.Column<string>(type: "text", nullable: true),
|
||||
EditorOptions = table.Column<string>(type: "text", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
|
|
@ -3412,9 +3412,6 @@ namespace Sozsoft.Platform.Migrations
|
|||
.HasMaxLength(256)
|
||||
.HasColumnType("nvarchar(256)");
|
||||
|
||||
b.Property<int?>("ColSpan")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("ColumnCssClass")
|
||||
.HasMaxLength(128)
|
||||
.HasColumnType("nvarchar(128)");
|
||||
|
|
@ -3440,22 +3437,9 @@ namespace Sozsoft.Platform.Migrations
|
|||
.HasMaxLength(10)
|
||||
.HasColumnType("nvarchar(10)");
|
||||
|
||||
b.Property<int?>("EditGroupOrderNo")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int?>("EditOrderNo")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("EditorOptions")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("EditorScript")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("EditorType2")
|
||||
.HasMaxLength(64)
|
||||
.HasColumnType("nvarchar(64)");
|
||||
|
||||
b.Property<string>("FieldName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(128)
|
||||
|
|
|
|||
|
|
@ -542,16 +542,14 @@ public class DynamicFormReport : XtraReport
|
|||
.Where(x => x.IsActive != false)
|
||||
.ToDictionary(x => x.FieldName, StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
var editFields = fields
|
||||
.Where(x => x.EditOrderNo.HasValue)
|
||||
.OrderBy(x => x.EditGroupOrderNo ?? 1)
|
||||
.ThenBy(x => x.EditOrderNo)
|
||||
var formItems = GetEditingFormItems(listForm)
|
||||
.Where(x => !string.IsNullOrWhiteSpace(x.DataField))
|
||||
.ToList();
|
||||
|
||||
var orderedFields = editFields.Count > 0
|
||||
? editFields
|
||||
.Where(x => fieldsByName.ContainsKey(x.FieldName))
|
||||
.Select(x => new FieldWithEditor(x, x.EditorType2, x.ColSpan ?? 1))
|
||||
var orderedFields = formItems.Count > 0
|
||||
? formItems
|
||||
.Where(x => fieldsByName.ContainsKey(x.DataField))
|
||||
.Select(x => new FieldWithEditor(fieldsByName[x.DataField], x.EditorType2, x.ColSpan))
|
||||
.ToList()
|
||||
: fields
|
||||
.Where(x => !string.IsNullOrWhiteSpace(x.FieldName) && x.FieldName != "undefined")
|
||||
|
|
@ -584,9 +582,10 @@ public class DynamicFormReport : XtraReport
|
|||
var usedFields = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
|
||||
foreach (var group in groups)
|
||||
{
|
||||
var groupFields = fields
|
||||
.Where(x => (x.Field.EditGroupOrderNo ?? 1) == group.Order)
|
||||
.OrderBy(x => x.Field.EditOrderNo ?? int.MaxValue)
|
||||
var groupFields = (group.Items ?? [])
|
||||
.OrderBy(x => x.Order)
|
||||
.Where(x => !string.IsNullOrWhiteSpace(x.DataField) && fieldsByName.ContainsKey(x.DataField))
|
||||
.Select(x => fieldsByName[x.DataField])
|
||||
.ToList();
|
||||
|
||||
foreach (var field in groupFields)
|
||||
|
|
@ -626,6 +625,13 @@ public class DynamicFormReport : XtraReport
|
|||
}
|
||||
}
|
||||
|
||||
private static IEnumerable<EditingFormItemDto> GetEditingFormItems(ListForm listForm)
|
||||
{
|
||||
return GetEditingFormGroups(listForm)
|
||||
.OrderBy(x => x.Order)
|
||||
.SelectMany(x => (x.Items ?? []).OrderBy(i => i.Order));
|
||||
}
|
||||
|
||||
private static IEnumerable<(SubFormDto Form, string Filter)> GetListSubForms(
|
||||
ListForm listForm,
|
||||
IDictionary<string, object> row)
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ public class DynamicGridReport : XtraReport
|
|||
|
||||
await selectQueryManager.PrepareQueriesAsync(listForm, fields, dataSourceType, customizations, queryParams);
|
||||
var selectFieldsByName = DynamicReportImageHelper.CreateSelectFieldMap(selectQueryManager.SelectFields);
|
||||
var editorTypesByField = DynamicReportImageHelper.CreateEditorTypeMap(fields);
|
||||
var editorTypesByField = DynamicReportImageHelper.CreateEditorTypeMap(listForm);
|
||||
|
||||
var availableFields = fields
|
||||
.Where(x => !string.IsNullOrWhiteSpace(x.FieldName) && x.FieldName != "undefined")
|
||||
|
|
|
|||
|
|
@ -73,16 +73,28 @@ internal static class DynamicReportImageHelper
|
|||
return map;
|
||||
}
|
||||
|
||||
public static Dictionary<string, string> CreateEditorTypeMap(IEnumerable<ListFormField> fields)
|
||||
public static Dictionary<string, string> CreateEditorTypeMap(ListForm listForm)
|
||||
{
|
||||
var map = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
|
||||
foreach (var field in fields ?? [])
|
||||
if (string.IsNullOrWhiteSpace(listForm?.EditingFormJson))
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(field.FieldName) && !string.IsNullOrWhiteSpace(field.EditorType2))
|
||||
return map;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
var groups = JsonSerializer.Deserialize<List<EditingFormDto>>(listForm.EditingFormJson) ?? [];
|
||||
foreach (var item in groups.SelectMany(x => x.Items ?? []))
|
||||
{
|
||||
map[field.FieldName] = field.EditorType2;
|
||||
if (!string.IsNullOrWhiteSpace(item.DataField))
|
||||
{
|
||||
map[item.DataField] = item.EditorType2;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (JsonException)
|
||||
{
|
||||
}
|
||||
|
||||
return map;
|
||||
}
|
||||
|
|
@ -440,16 +452,25 @@ internal static class DynamicReportImageHelper
|
|||
return editorType is PlatformConsts.EditorTypes.dxImageUpload or PlatformConsts.EditorTypes.dxImageViewer;
|
||||
}
|
||||
|
||||
public static bool HasImageEditor(IEnumerable<ListFormField> fields, string fieldName)
|
||||
public static bool HasImageEditor(ListForm listForm, string fieldName)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(fieldName))
|
||||
if (string.IsNullOrWhiteSpace(listForm?.EditingFormJson) || string.IsNullOrWhiteSpace(fieldName))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return (fields ?? []).Any(x =>
|
||||
string.Equals(x.FieldName, fieldName, StringComparison.OrdinalIgnoreCase) &&
|
||||
IsImageEditor(x.EditorType2));
|
||||
try
|
||||
{
|
||||
var groups = JsonSerializer.Deserialize<List<EditingFormDto>>(listForm.EditingFormJson) ?? [];
|
||||
return groups
|
||||
.SelectMany(x => x.Items ?? [])
|
||||
.Any(x => string.Equals(x.DataField, fieldName, StringComparison.OrdinalIgnoreCase) &&
|
||||
IsImageEditor(x.EditorType2));
|
||||
}
|
||||
catch (JsonException)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static float GetGridImageHeight() => DefaultGridImageHeight;
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ public class DynamicTreeReport : XtraReport
|
|||
|
||||
await selectQueryManager.PrepareQueriesAsync(listForm, fields, dataSourceType, customizations, queryParams);
|
||||
var selectFieldsByName = DynamicReportImageHelper.CreateSelectFieldMap(selectQueryManager.SelectFields);
|
||||
var editorTypesByField = DynamicReportImageHelper.CreateEditorTypeMap(fields);
|
||||
var editorTypesByField = DynamicReportImageHelper.CreateEditorTypeMap(listForm);
|
||||
|
||||
var availableFields = fields
|
||||
.Where(x => !string.IsNullOrWhiteSpace(x.FieldName) && x.FieldName != "undefined")
|
||||
|
|
|
|||
|
|
@ -1,17 +1,6 @@
|
|||
{
|
||||
"commit": "8146adf",
|
||||
"commit": "1d05d24",
|
||||
"releases": [
|
||||
{
|
||||
"version": "1.1.08",
|
||||
"buildDate": "2026-07-16",
|
||||
"commit": "24e92fcb82eef0ee26ca5d65e08c5404f132a09e",
|
||||
"changeLog": [
|
||||
"- CardView komponenti geliştirildi.",
|
||||
"- Todo / Kanban komponenti geliştirildi.",
|
||||
"- Licence information",
|
||||
"- Check New Versiyon komponenti."
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "1.1.07",
|
||||
"buildDate": "2026-07-13",
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import Drawer from '@/components/ui/Drawer'
|
|||
import SidePanelContent, { SidePanelContentProps } from './SidePanelContent'
|
||||
import CopyButton from '../ThemeConfigurator/CopyButton'
|
||||
import withHeaderItem from '@/utils/hoc/withHeaderItem'
|
||||
import { useStoreActions, useStoreState } from '@/store'
|
||||
import { useStoreState, useStoreActions } from '@/store'
|
||||
import type { CommonProps } from '@/proxy/common'
|
||||
import { useLocalization } from '@/utils/hooks/useLocalization'
|
||||
import { FcEngineering } from 'react-icons/fc'
|
||||
|
|
|
|||
|
|
@ -16,7 +16,8 @@ import {
|
|||
import { useStoreState } from '@/store'
|
||||
import useMenuActive from '@/utils/hooks/useMenuActive'
|
||||
import isEmpty from 'lodash/isEmpty'
|
||||
import React, { useEffect } from 'react'
|
||||
import React from 'react'
|
||||
import { useEffect } from 'react'
|
||||
import { FaQuestionCircle } from 'react-icons/fa'
|
||||
import { Link, useLocation } from 'react-router-dom'
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import React, {
|
||||
import {
|
||||
Children,
|
||||
cloneElement,
|
||||
forwardRef,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import React, { createContext } from 'react'
|
||||
import { createContext } from 'react'
|
||||
|
||||
export type CheckboxValue = string | number
|
||||
export type CheckboxGroupValue = CheckboxValue[]
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import React, {
|
||||
import {
|
||||
forwardRef,
|
||||
useState,
|
||||
useRef,
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ import type { CommonProps } from '../../@types/common'
|
|||
import type { MonthBaseProps } from './components/Month'
|
||||
import type { DayKeydownPayload } from './components/types'
|
||||
import type { RefObject } from 'react'
|
||||
import React from 'react'
|
||||
|
||||
export interface DateTableProps extends CommonProps, MonthBaseProps {
|
||||
dateViewCount: number
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import React, {
|
||||
import {
|
||||
forwardRef,
|
||||
useState,
|
||||
useRef,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import React, {
|
||||
import {
|
||||
forwardRef,
|
||||
useRef,
|
||||
useState,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import React, { useState, useEffect, useCallback, useMemo } from 'react'
|
||||
import { useState, useEffect, useCallback, useMemo } from 'react'
|
||||
import classNames from 'classnames'
|
||||
import { FaChevronCircleLeft, FaEllipsisH, FaChevronCircleRight } from 'react-icons/fa';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import React, {
|
||||
import {
|
||||
forwardRef,
|
||||
useState,
|
||||
useCallback,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import React, { useState, useCallback, useRef, useEffect } from 'react'
|
||||
import { useState, useCallback, useRef, useEffect } from 'react'
|
||||
import useCallbackRef from './useCallbackRef'
|
||||
|
||||
type UseControllableStateParams<T> = {
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import {
|
|||
import { ListViewLayoutType } from '@/views/admin/listForm/edit/types'
|
||||
|
||||
export interface ListFormWizardColumnItemDto {
|
||||
fieldName: string
|
||||
dataField: string
|
||||
editorType: string
|
||||
editorOptions: string
|
||||
editorScript: string
|
||||
|
|
@ -56,7 +56,6 @@ export interface ListFormWizardDto {
|
|||
languageTextMenuParentTr: string
|
||||
permissionGroupName: string
|
||||
menuParentCode: string
|
||||
menuParentShortName?: string
|
||||
menuParentIcon?: string
|
||||
menuIcon: string
|
||||
dataSourceCode: string
|
||||
|
|
@ -130,7 +129,7 @@ export interface WizardInsertedRecordsDto {
|
|||
}
|
||||
|
||||
export interface WizardSeedFileItemDto {
|
||||
fieldName: string
|
||||
dataField: string
|
||||
editorType: string
|
||||
editorOptions: string
|
||||
editorScript: string
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ import type {
|
|||
StartEditAction,
|
||||
StateStoreType,
|
||||
} from 'devextreme/ui/data_grid_types'
|
||||
import type { FormItemComponent } from 'devextreme/ui/form'
|
||||
import { AuditedEntityDto } from '../abp'
|
||||
import { EditorType2, RowMode } from '../../views/form/types'
|
||||
import {
|
||||
|
|
@ -194,7 +195,7 @@ export interface ColumnFilterDto {
|
|||
}
|
||||
|
||||
export interface ColumnFormatDto extends AuditedEntityDto<string> {
|
||||
fieldName: string
|
||||
fieldName?: string
|
||||
captionName?: string
|
||||
placeHolder?: string
|
||||
readOnly: boolean
|
||||
|
|
@ -244,14 +245,6 @@ export interface ColumnFormatDto extends AuditedEntityDto<string> {
|
|||
alignment?: HorizontalAlignment
|
||||
format?: string
|
||||
editorOptions?: string
|
||||
editOrderNo?: number
|
||||
editGroupOrderNo?: number
|
||||
editorType2: EditorType2
|
||||
colSpan?: number
|
||||
gridBoxOptions?: GridBoxOptionsDto
|
||||
tagBoxOptions?: TagBoxOptionsDto
|
||||
imageUploadOptions?: ImageUploadOptionsDto
|
||||
editorScript?: string
|
||||
}
|
||||
|
||||
export enum AuthorizationTypeEnum {
|
||||
|
|
@ -499,6 +492,20 @@ export interface EditingFormDto {
|
|||
caption?: string
|
||||
colCount: number
|
||||
colSpan: number
|
||||
items?: EditingFormItemDto[]
|
||||
}
|
||||
|
||||
export interface EditingFormItemDto {
|
||||
order: number
|
||||
dataField: string
|
||||
editorType: FormItemComponent
|
||||
editorType2: EditorType2
|
||||
colSpan?: number
|
||||
editorOptions?: string
|
||||
gridBoxOptions?: GridBoxOptionsDto
|
||||
tagBoxOptions?: TagBoxOptionsDto
|
||||
imageUploadOptions?: ImageUploadOptionsDto
|
||||
editorScript?: string
|
||||
}
|
||||
|
||||
export interface GridEditingPopupDto {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import React, { useEffect, useState } from 'react'
|
||||
import { useEffect, useState } from 'react'
|
||||
|
||||
function useTimeOutMessage(
|
||||
interval = 3000,
|
||||
|
|
|
|||
|
|
@ -300,9 +300,6 @@ const FormEdit = () => {
|
|||
{translate('::ListForms.ListFormEdit.ExtraFilters')}
|
||||
</TabNav>
|
||||
)}
|
||||
{visibleTabs.includes('editForm') && (
|
||||
<TabNav value="editForm">{translate('::ListForms.ListFormEdit.EditingForm')}</TabNav>
|
||||
)}
|
||||
{visibleTabs.includes('fields') && (
|
||||
<TabNav value="fields">{translate('::ListForms.ListFormEdit.TabFields')}</TabNav>
|
||||
)}
|
||||
|
|
@ -311,6 +308,9 @@ const FormEdit = () => {
|
|||
{translate('::ListForms.ListFormEdit.TabCustomization')}
|
||||
</TabNav>
|
||||
)}
|
||||
{visibleTabs.includes('editForm') && (
|
||||
<TabNav value="editForm">{translate('::ListForms.ListFormEdit.EditingForm')}</TabNav>
|
||||
)}
|
||||
{visibleTabs.includes('pivots') && (
|
||||
<TabNav value="pivots">{translate('::ListForms.ListFormEdit.TabPivot')}</TabNav>
|
||||
)}
|
||||
|
|
@ -464,7 +464,6 @@ const FormEdit = () => {
|
|||
<TabContent value="fields" className="px-2">
|
||||
<FormFields
|
||||
listFormCode={listFormCode}
|
||||
editingFormGroups={listFormValues.editingFormDto ?? []}
|
||||
langOptions={langOptions}
|
||||
roleList={roleList}
|
||||
userList={userList}
|
||||
|
|
|
|||
|
|
@ -31,8 +31,6 @@ const schema = Yup.object().shape({
|
|||
chart: Yup.boolean(),
|
||||
tree: Yup.boolean(),
|
||||
gantt: Yup.boolean(),
|
||||
scheduler: Yup.boolean(),
|
||||
todo: Yup.boolean(),
|
||||
defaultLayout: Yup.string(),
|
||||
}),
|
||||
})
|
||||
|
|
@ -413,11 +411,7 @@ function FormTabDetails(
|
|||
/>
|
||||
</FormItem>
|
||||
|
||||
<FormItem
|
||||
label={translate('::ListForms.ListFormEdit.DetailsLayoutDto.TodoLayout')}
|
||||
invalid={errors.layoutDto?.todo && touched.layoutDto?.todo}
|
||||
errorMessage={errors.layoutDto?.todo}
|
||||
>
|
||||
<FormItem label="Todo Layout">
|
||||
<Field
|
||||
className="w-20"
|
||||
autoComplete="off"
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@ function FormTabEditForm(props: { listFormCode: string }) {
|
|||
<Th>{translate('::ListForms.ListFormEdit.DetailsTitle')}</Th>
|
||||
<Th>{translate('::ListForms.ListFormEdit.EditingFormColumnCount')}</Th>
|
||||
<Th>{translate('::ListForms.ListFormEdit.EditingFormColumnSpan')}</Th>
|
||||
<Th>{translate('::ListForms.ListFormEdit.EditingFormItems')}</Th>
|
||||
</Tr>
|
||||
</THead>
|
||||
<TBody>
|
||||
|
|
@ -108,6 +109,13 @@ function FormTabEditForm(props: { listFormCode: string }) {
|
|||
<Td>{row.caption}</Td>
|
||||
<Td>{row.colCount}</Td>
|
||||
<Td>{row.colSpan}</Td>
|
||||
<Td>
|
||||
<ul className="list-disc">
|
||||
{row.items?.map((i, idx) => (
|
||||
<li key={`items-${i.dataField}-${idx}`}>{i.dataField}</li>
|
||||
))}
|
||||
</ul>
|
||||
</Td>
|
||||
</Tr>
|
||||
))}
|
||||
</TBody>
|
||||
|
|
|
|||
|
|
@ -20,17 +20,14 @@ import FormFieldTabTotalSummary from './FormFieldTabTotalSummary'
|
|||
import FormFieldTabValidationRules from './FormFieldTabValidationRules'
|
||||
import { FormFieldEditProps } from './FormFields'
|
||||
import FormFieldTabPivotSetting from './FormFieldTabPivotSetting'
|
||||
import type { EditingFormDto } from '@/proxy/form/models'
|
||||
|
||||
function FormFieldEdit({
|
||||
item,
|
||||
onSubmit,
|
||||
fields,
|
||||
editingFormGroups,
|
||||
}: {
|
||||
item: ColumnFormatEditDto | null
|
||||
fields: ColumnFormatEditDto[]
|
||||
editingFormGroups: EditingFormDto[]
|
||||
} & FormFieldEditProps) {
|
||||
const { translate } = useLocalization()
|
||||
|
||||
|
|
@ -75,18 +72,13 @@ function FormFieldEdit({
|
|||
<TabNav value="pivotSetting">
|
||||
{translate('::ListForms.ListFormFieldEdit.TabPivotSettings')}
|
||||
</TabNav>
|
||||
</TabList>
|
||||
</TabList>
|
||||
<div className="pt-4">
|
||||
<TabContent value="details">
|
||||
<FormFieldTabDetails initialValues={item} onSubmit={onSubmit} />
|
||||
</TabContent>
|
||||
<TabContent value="options">
|
||||
<FormFieldTabOptions
|
||||
initialValues={item}
|
||||
editingFormGroups={editingFormGroups}
|
||||
fields={fields}
|
||||
onSubmit={onSubmit}
|
||||
/>
|
||||
<FormFieldTabOptions initialValues={item} onSubmit={onSubmit} />
|
||||
</TabContent>
|
||||
<TabContent value="permissions">
|
||||
<FormFieldTabPermissions initialValues={item} onSubmit={onSubmit} />
|
||||
|
|
@ -104,10 +96,18 @@ function FormFieldEdit({
|
|||
<FormFieldTabGrouping initialValues={item} onSubmit={onSubmit} />
|
||||
</TabContent>
|
||||
<TabContent value="groupSummary">
|
||||
<FormFieldTabGroupSummary initialValues={item} fields={fields} onSubmit={onSubmit} />
|
||||
<FormFieldTabGroupSummary
|
||||
initialValues={item}
|
||||
fields={fields}
|
||||
onSubmit={onSubmit}
|
||||
/>
|
||||
</TabContent>
|
||||
<TabContent value="totalSummary">
|
||||
<FormFieldTabTotalSummary initialValues={item} fields={fields} onSubmit={onSubmit} />
|
||||
<FormFieldTabTotalSummary
|
||||
initialValues={item}
|
||||
fields={fields}
|
||||
onSubmit={onSubmit}
|
||||
/>
|
||||
</TabContent>
|
||||
<TabContent value="joinOptions">
|
||||
<FormFieldTabJoinOptions initialValues={item} onSubmit={onSubmit} />
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
import { Button, Card, Checkbox, FormItem, Input, Select } from '@/components/ui'
|
||||
import { Button, Card, FormItem, Input, Select } from '@/components/ui'
|
||||
import { ColumnFormatEditDto, ListFormFieldEditTabs } from '@/proxy/admin/list-form-field/models'
|
||||
import { SelectBoxOption } from '@/types/shared'
|
||||
import { useLocalization } from '@/utils/hooks/useLocalization'
|
||||
import { Field, FieldProps, Form, Formik } from 'formik'
|
||||
import { useState } from 'react'
|
||||
import { FaSlidersH } from 'react-icons/fa'
|
||||
import { bool, number, object, string } from 'yup'
|
||||
import { number, object, string } from 'yup'
|
||||
import { dbSourceTypeOptions, listFormAlignmentOptions } from '../options'
|
||||
import EditorOptionsBuilderDialog from '../json-row-operations/EditorOptionsBuilderDialog'
|
||||
import { FormFieldEditProps } from './FormFields'
|
||||
|
|
@ -16,13 +16,10 @@ const schema = object().shape({
|
|||
captionName: string(),
|
||||
placeHolder: string(),
|
||||
bandName: string(),
|
||||
isActive: bool().required(),
|
||||
visible: bool().required(),
|
||||
allowSearch: bool().required(),
|
||||
sourceDbType: number().required(),
|
||||
alignment: string(),
|
||||
format: string(),
|
||||
editorOptions: string(),
|
||||
editorOptions: string().max(1000),
|
||||
})
|
||||
|
||||
function FormFieldTabDetails({
|
||||
|
|
@ -75,32 +72,6 @@ function FormFieldTabDetails({
|
|||
>
|
||||
<Field type="text" name="bandName" component={Input} />
|
||||
</FormItem>
|
||||
<div className="flex w-full gap-4">
|
||||
<FormItem
|
||||
className="flex-1"
|
||||
label={translate('::ListForms.ListFormFieldEdit.HeaderingAllowSearch')}
|
||||
>
|
||||
<Field name="allowSearch" component={Checkbox} />
|
||||
</FormItem>
|
||||
|
||||
<FormItem
|
||||
className="flex-1"
|
||||
label={translate('::ListForms.ListFormFieldEdit.OptionsIsActive')}
|
||||
invalid={errors.isActive && touched.isActive}
|
||||
errorMessage={errors.isActive}
|
||||
>
|
||||
<Field name="isActive" component={Checkbox} />
|
||||
</FormItem>
|
||||
|
||||
<FormItem
|
||||
className="flex-1"
|
||||
label={translate('::ListForms.ListFormFieldEdit.OptionsVisible')}
|
||||
invalid={errors.visible && touched.visible}
|
||||
errorMessage={errors.visible}
|
||||
>
|
||||
<Field name="visible" component={Checkbox} />
|
||||
</FormItem>
|
||||
</div>
|
||||
</Card>
|
||||
<Card>
|
||||
<FormItem label={translate('::ListForms.ListFormEdit.CustomValueType')}>
|
||||
|
|
@ -161,7 +132,7 @@ function FormFieldTabDetails({
|
|||
type="text"
|
||||
name="editorOptions"
|
||||
component={Input}
|
||||
rows={3}
|
||||
rows={4}
|
||||
textArea={true}
|
||||
/>
|
||||
<Button
|
||||
|
|
@ -183,14 +154,7 @@ function FormFieldTabDetails({
|
|||
onClose={() => setIsEditorOptionsDialogOpen(false)}
|
||||
onApply={(val) => setFieldValue('editorOptions', val)}
|
||||
/>
|
||||
<Button
|
||||
block
|
||||
size="sm"
|
||||
className="mt-1"
|
||||
variant="solid"
|
||||
loading={isSubmitting}
|
||||
type="submit"
|
||||
>
|
||||
<Button block size="sm" className="mt-1" variant="solid" loading={isSubmitting} type="submit">
|
||||
{isSubmitting ? translate('::Saving') : translate('::Save')}
|
||||
</Button>
|
||||
</Form>
|
||||
|
|
|
|||
|
|
@ -4,50 +4,29 @@ import { SelectBoxOption } from '@/types/shared'
|
|||
import { useLocalization } from '@/utils/hooks/useLocalization'
|
||||
import { Field, FieldProps, Form, Formik } from 'formik'
|
||||
import { bool, number, object, string } from 'yup'
|
||||
import { columnEditorTypeListOptions, sortDirectionOptions } from '../options'
|
||||
import { sortDirectionOptions } from '../options'
|
||||
import { FormFieldEditProps } from './FormFields'
|
||||
import { EditingFormDto, SortDirectionEnum } from '@/proxy/form/models'
|
||||
import { FaCode } from 'react-icons/fa'
|
||||
import { useState } from 'react'
|
||||
import EditorScriptBuilderDialog from '../json-row-operations/EditorScriptBuilderDialog'
|
||||
import { SortDirectionEnum } from '@/proxy/form/models'
|
||||
|
||||
const schema = object().shape({
|
||||
listOrderNo: number(),
|
||||
width: number(),
|
||||
sortDirection: string().oneOf(Object.values(SortDirectionEnum) as string[]),
|
||||
sortIndex: number(),
|
||||
editGroupOrderNo: number().nullable(),
|
||||
editOrderNo: number().nullable(),
|
||||
colSpan: number().nullable(),
|
||||
isActive: bool().required(),
|
||||
visible: bool().required(),
|
||||
allowSearch: bool().required(),
|
||||
allowEditing: bool().required(),
|
||||
allowAdding: bool().required(),
|
||||
editorScript: string(),
|
||||
})
|
||||
|
||||
function FormFieldTabOptions({
|
||||
initialValues,
|
||||
editingFormGroups,
|
||||
fields,
|
||||
onSubmit,
|
||||
}: {
|
||||
initialValues: ColumnFormatEditDto
|
||||
editingFormGroups: EditingFormDto[]
|
||||
fields: ColumnFormatEditDto[]
|
||||
} & FormFieldEditProps) {
|
||||
const { translate } = useLocalization()
|
||||
const [isEditorScriptDialogOpen, setIsEditorScriptDialogOpen] = useState(false)
|
||||
const editingFormGroupOptions: SelectBoxOption[] = [...editingFormGroups]
|
||||
.sort((left, right) => left.order - right.order)
|
||||
.map((group) => ({
|
||||
value: String(group.order),
|
||||
label: `${group.order} - ${group.caption || translate('::ListForms.ListFormFieldEdit.EditFormGroup')}`,
|
||||
}))
|
||||
const editorScriptFields: SelectBoxOption[] = fields
|
||||
.filter((field) => field.fieldName)
|
||||
.map((field) => ({
|
||||
value: field.fieldName,
|
||||
label: field.captionName || field.fieldName,
|
||||
}))
|
||||
|
||||
return (
|
||||
<Formik
|
||||
|
|
@ -58,7 +37,7 @@ function FormFieldTabOptions({
|
|||
await onSubmit(ListFormFieldEditTabs.OptionsForm, values, formikHelpers)
|
||||
}}
|
||||
>
|
||||
{({ touched, errors, isSubmitting, values, setFieldValue }) => (
|
||||
{({ touched, errors, isSubmitting, values }) => (
|
||||
<Form>
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-3">
|
||||
<Card>
|
||||
|
|
@ -103,7 +82,25 @@ function FormFieldTabOptions({
|
|||
>
|
||||
<Field type="number" name="sortIndex" component={Input} />
|
||||
</FormItem>
|
||||
|
||||
</Card>
|
||||
<Card>
|
||||
<FormItem
|
||||
label={translate('::ListForms.ListFormFieldEdit.OptionsIsActive')}
|
||||
invalid={errors.isActive && touched.isActive}
|
||||
errorMessage={errors.isActive}
|
||||
>
|
||||
<Field name="isActive" component={Checkbox} />
|
||||
</FormItem>
|
||||
<FormItem
|
||||
label={translate('::ListForms.ListFormFieldEdit.OptionsVisible')}
|
||||
invalid={errors.visible && touched.visible}
|
||||
errorMessage={errors.visible}
|
||||
>
|
||||
<Field name="visible" component={Checkbox} />
|
||||
</FormItem>
|
||||
<FormItem label={translate('::ListForms.ListFormFieldEdit.HeaderingAllowSearch')}>
|
||||
<Field name="allowSearch" component={Checkbox} />
|
||||
</FormItem>
|
||||
<FormItem label={translate('::ListForms.ListFormEdit.AllowEditing')}>
|
||||
<Field name="allowEditing" component={Checkbox} />
|
||||
</FormItem>
|
||||
|
|
@ -111,100 +108,9 @@ function FormFieldTabOptions({
|
|||
<Field name="allowAdding" component={Checkbox} />
|
||||
</FormItem>
|
||||
</Card>
|
||||
<Card>
|
||||
<FormItem
|
||||
invalid={errors.editorType2 && touched.editorType2}
|
||||
errorMessage={errors.editorType2}
|
||||
label={translate('::ListForms.ListFormFieldEdit.EditorType')}
|
||||
>
|
||||
<Field name="editorType2">
|
||||
{({ field, form }: FieldProps<SelectBoxOption>) => (
|
||||
<Select
|
||||
isClearable
|
||||
options={columnEditorTypeListOptions}
|
||||
value={columnEditorTypeListOptions.find(
|
||||
(option) => option.value === field.value,
|
||||
)}
|
||||
onChange={(option) => form.setFieldValue(field.name, option?.value)}
|
||||
/>
|
||||
)}
|
||||
</Field>
|
||||
</FormItem>
|
||||
<FormItem
|
||||
invalid={errors.editGroupOrderNo && touched.editGroupOrderNo}
|
||||
errorMessage={errors.editGroupOrderNo}
|
||||
label={translate('::ListForms.ListFormFieldEdit.EditFormGroup')}
|
||||
>
|
||||
<Field name="editGroupOrderNo">
|
||||
{({ field, form }: FieldProps<SelectBoxOption>) => (
|
||||
<Select
|
||||
isClearable
|
||||
options={editingFormGroupOptions}
|
||||
value={editingFormGroupOptions.find(
|
||||
(option) => Number(option.value) === Number(field.value),
|
||||
)}
|
||||
onChange={(option) =>
|
||||
form.setFieldValue(
|
||||
field.name,
|
||||
option?.value == null ? null : Number(option.value),
|
||||
)
|
||||
}
|
||||
/>
|
||||
)}
|
||||
</Field>
|
||||
</FormItem>
|
||||
<FormItem
|
||||
invalid={errors.editOrderNo && touched.editOrderNo}
|
||||
errorMessage={errors.editOrderNo}
|
||||
label={translate('::ListForms.ListFormFieldEdit.EditFormOrderNo')}
|
||||
>
|
||||
<Field type="number" name="editOrderNo" component={Input} />
|
||||
</FormItem>
|
||||
<FormItem
|
||||
invalid={errors.colSpan && touched.colSpan}
|
||||
errorMessage={errors.colSpan}
|
||||
label={translate('::ListForms.ListFormFieldEdit.EditFormColSpan')}
|
||||
>
|
||||
<Field type="number" name="colSpan" component={Input} />
|
||||
</FormItem>
|
||||
<FormItem label={translate('::ListForms.Wizard.Step3.EditorScript')}>
|
||||
<div className="flex gap-2 items-start">
|
||||
<Field
|
||||
type="text"
|
||||
name="editorScript"
|
||||
component={Input}
|
||||
rows={3}
|
||||
textArea={true}
|
||||
/>
|
||||
<Button
|
||||
shape="circle"
|
||||
variant="plain"
|
||||
type="button"
|
||||
size="sm"
|
||||
title="Build editor script"
|
||||
icon={<FaCode />}
|
||||
onClick={() => setIsEditorScriptDialogOpen(true)}
|
||||
/>
|
||||
</div>
|
||||
</FormItem>
|
||||
</Card>
|
||||
</div>
|
||||
<EditorScriptBuilderDialog
|
||||
isOpen={isEditorScriptDialogOpen}
|
||||
value={values.editorScript}
|
||||
currentField={values.fieldName}
|
||||
fields={editorScriptFields}
|
||||
onClose={() => setIsEditorScriptDialogOpen(false)}
|
||||
onApply={(val) => setFieldValue('editorScript', val)}
|
||||
/>
|
||||
<Button
|
||||
block
|
||||
size="sm"
|
||||
className="mt-1"
|
||||
variant="solid"
|
||||
loading={isSubmitting}
|
||||
type="submit"
|
||||
>
|
||||
|
||||
<Button block size="sm" className="mt-1" variant="solid" loading={isSubmitting} type="submit">
|
||||
{isSubmitting ? translate('::Saving') : translate('::Save')}
|
||||
</Button>
|
||||
</Form>
|
||||
|
|
|
|||
|
|
@ -43,7 +43,6 @@ import { dbSourceTypeOptions, sqlDataTypeToDbType } from '../options'
|
|||
import { IdentityRoleDto, IdentityUserDto } from '@/proxy/admin/models'
|
||||
import { sqlObjectManagerService } from '@/services/sql-query-manager.service'
|
||||
import type { DatabaseColumnDto } from '@/proxy/sql-query-manager/models'
|
||||
import type { EditingFormDto } from '@/proxy/form/models'
|
||||
|
||||
export interface FormFieldEditProps {
|
||||
onSubmit: (
|
||||
|
|
@ -72,14 +71,12 @@ const copyFieldSchema = object().shape({
|
|||
|
||||
function FormFields({
|
||||
listFormCode,
|
||||
editingFormGroups,
|
||||
langOptions,
|
||||
roleList,
|
||||
userList,
|
||||
columns,
|
||||
}: {
|
||||
listFormCode: string
|
||||
editingFormGroups: EditingFormDto[]
|
||||
langOptions: SelectBoxOption[]
|
||||
roleList: SelectBoxOption[]
|
||||
userList: SelectBoxOption[]
|
||||
|
|
@ -222,45 +219,42 @@ function FormFields({
|
|||
await getFields()
|
||||
}
|
||||
|
||||
const getFields = useCallback(
|
||||
async (cultureName?: string, roleId?: string, userId?: string) => {
|
||||
if (!listFormCode) {
|
||||
return
|
||||
}
|
||||
const getFields = useCallback(async (cultureName?: string, roleId?: string, userId?: string) => {
|
||||
if (!listFormCode) {
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
const resp = await getListFormFields({
|
||||
listFormCode,
|
||||
cultureName,
|
||||
roleId,
|
||||
userId,
|
||||
sorting: 'ListOrderNo',
|
||||
maxResultCount: 1000,
|
||||
})
|
||||
setNull(resp?.data?.items)
|
||||
setFields(resp?.data?.items)
|
||||
if (resp.data?.items) {
|
||||
setFieldList(
|
||||
resp?.data?.items.map((f: ColumnFormatEditDto) => ({
|
||||
value: f.fieldName,
|
||||
label: f.fieldName,
|
||||
})),
|
||||
)
|
||||
}
|
||||
} catch (error: any) {
|
||||
toast.push(
|
||||
<Notification type="danger" duration={2000}>
|
||||
Alanlar getirilemedi
|
||||
{error.toString()}
|
||||
</Notification>,
|
||||
{
|
||||
placement: 'bottom-end',
|
||||
},
|
||||
try {
|
||||
const resp = await getListFormFields({
|
||||
listFormCode,
|
||||
cultureName,
|
||||
roleId,
|
||||
userId,
|
||||
sorting: 'ListOrderNo',
|
||||
maxResultCount: 1000,
|
||||
})
|
||||
setNull(resp?.data?.items)
|
||||
setFields(resp?.data?.items)
|
||||
if (resp.data?.items) {
|
||||
setFieldList(
|
||||
resp?.data?.items.map((f: ColumnFormatEditDto) => ({
|
||||
value: f.fieldName,
|
||||
label: f.fieldName,
|
||||
})),
|
||||
)
|
||||
}
|
||||
},
|
||||
[listFormCode],
|
||||
)
|
||||
} catch (error: any) {
|
||||
toast.push(
|
||||
<Notification type="danger" duration={2000}>
|
||||
Alanlar getirilemedi
|
||||
{error.toString()}
|
||||
</Notification>,
|
||||
{
|
||||
placement: 'bottom-end',
|
||||
},
|
||||
)
|
||||
}
|
||||
}, [listFormCode])
|
||||
|
||||
useEffect(() => {
|
||||
getFields()
|
||||
|
|
@ -411,7 +405,7 @@ function FormFields({
|
|||
<Table compact>
|
||||
<THead>
|
||||
<Tr>
|
||||
<Th className="w-3/12">
|
||||
<Th className='w-3/12'>
|
||||
<div>
|
||||
<Button
|
||||
shape="circle"
|
||||
|
|
@ -484,19 +478,12 @@ function FormFields({
|
|||
}
|
||||
}}
|
||||
/>
|
||||
<span style={{ visibility: !field?.visible ? 'visible' : 'hidden' }}>
|
||||
<FaEyeSlash />
|
||||
</span>
|
||||
<span style={{ visibility: !field?.isActive ? 'visible' : 'hidden' }}>
|
||||
<FaTimes />
|
||||
</span>
|
||||
<span className="ml-5">
|
||||
{field.listOrderNo}
|
||||
{field.editOrderNo ? ` (${field.editOrderNo})` : ''}
|
||||
</span>
|
||||
<span>{field.listOrderNo}</span>
|
||||
<span>{!field?.visible && <FaEyeSlash />}</span>
|
||||
<span>{!field?.isActive && <FaTimes />}</span>
|
||||
</Td>
|
||||
<Td className="!p-0">{field.fieldName}</Td>
|
||||
<Td className="align-middle text-center !p-0">
|
||||
<Td className='!p-0'>{field.fieldName}</Td>
|
||||
<Td className='align-middle text-center !p-0'>
|
||||
<Avatar
|
||||
size={18}
|
||||
shape="circle"
|
||||
|
|
@ -518,12 +505,7 @@ function FormFields({
|
|||
</Table>
|
||||
</div>
|
||||
<div className="2xl:col-span-3 lg:col-span-3 xl:col-span-2">
|
||||
<FormFieldEdit
|
||||
item={row}
|
||||
fields={fields}
|
||||
editingFormGroups={editingFormGroups}
|
||||
onSubmit={onSubmit}
|
||||
/>
|
||||
<FormFieldEdit item={row} fields={fields} onSubmit={onSubmit} />
|
||||
</div>
|
||||
</div>
|
||||
</AdaptableCard>
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -64,7 +64,7 @@ const initialValues: ListFormWizardDto = {
|
|||
chart: true,
|
||||
gantt: true,
|
||||
scheduler: true,
|
||||
todo: false,
|
||||
todo: true,
|
||||
todoTitleExpr: '',
|
||||
todoStatusExpr: '',
|
||||
todoDescriptionExpr: '',
|
||||
|
|
@ -74,7 +74,7 @@ const initialValues: ListFormWizardDto = {
|
|||
todoPriorityExpr: '',
|
||||
todoCompletedExpr: '',
|
||||
todoOrderExpr: '',
|
||||
todoStatusOrder: 'Backlog, Ready to Start, In Progress, Code Review, Testing, Staging',
|
||||
todoStatusOrder: 'Inbox, Today, This Week, This Month, Later, Done',
|
||||
todoAllowDragging: true,
|
||||
languageTextMenuEn: '',
|
||||
languageTextMenuTr: '',
|
||||
|
|
@ -86,7 +86,6 @@ const initialValues: ListFormWizardDto = {
|
|||
languageTextMenuParentTr: '',
|
||||
permissionGroupName: '',
|
||||
menuParentCode: '',
|
||||
menuParentShortName: '',
|
||||
menuParentIcon: '',
|
||||
menuIcon: '',
|
||||
dataSourceCode: '',
|
||||
|
|
@ -147,26 +146,7 @@ const step2ValidationSchema = Yup.object().shape({
|
|||
confirmDelete: Yup.boolean(),
|
||||
})
|
||||
|
||||
const todoValidationSchema = Yup.object().shape({
|
||||
todoTitleExpr: Yup.string()
|
||||
.trim()
|
||||
.when('todo', {
|
||||
is: true,
|
||||
then: (schema) => schema.required(),
|
||||
otherwise: (schema) => schema.notRequired(),
|
||||
}),
|
||||
todoStatusExpr: Yup.string()
|
||||
.trim()
|
||||
.when('todo', {
|
||||
is: true,
|
||||
then: (schema) => schema.required(),
|
||||
otherwise: (schema) => schema.notRequired(),
|
||||
}),
|
||||
})
|
||||
|
||||
const listFormValidationSchema = step1ValidationSchema
|
||||
.concat(step2ValidationSchema)
|
||||
.concat(todoValidationSchema)
|
||||
const listFormValidationSchema = step1ValidationSchema.concat(step2ValidationSchema)
|
||||
|
||||
// ─── Wizard ───────────────────────────────────────────────────────────────────
|
||||
|
||||
|
|
@ -286,7 +266,7 @@ const Wizard = () => {
|
|||
const removeTenantGroupItems = (groups: WizardGroup[]) =>
|
||||
groups.map((group) => ({
|
||||
...group,
|
||||
items: group.items.filter((item) => !isTenantColumn(item.fieldName)),
|
||||
items: group.items.filter((item) => !isTenantColumn(item.dataField)),
|
||||
}))
|
||||
|
||||
const loadColumns = async (dsCode: string, schema: string, name: string) => {
|
||||
|
|
@ -453,9 +433,7 @@ const Wizard = () => {
|
|||
todoPriorityExpr: w.todoPriorityExpr ?? '',
|
||||
todoCompletedExpr: w.todoCompletedExpr ?? '',
|
||||
todoOrderExpr: w.todoOrderExpr ?? '',
|
||||
todoStatusOrder:
|
||||
w.todoStatusOrder ??
|
||||
'Backlog, Ready to Start, In Progress, Code Review, Testing, Staging',
|
||||
todoStatusOrder: w.todoStatusOrder ?? 'Inbox, Today, This Week, This Month, Later, Done',
|
||||
todoAllowDragging: w.todoAllowDragging ?? true,
|
||||
languageTextMenuEn: w.languageTextMenuEn ?? '',
|
||||
languageTextMenuTr: w.languageTextMenuTr ?? '',
|
||||
|
|
@ -467,7 +445,6 @@ const Wizard = () => {
|
|||
languageTextMenuParentTr: w.languageTextMenuParentTr ?? '',
|
||||
permissionGroupName: w.permissionGroupName ?? '',
|
||||
menuParentCode: w.menuParentCode ?? '',
|
||||
menuParentShortName: w.menuParentShortName ?? '',
|
||||
menuParentIcon: w.menuParentIcon ?? '',
|
||||
menuIcon: w.menuIcon ?? '',
|
||||
dataSourceCode: w.dataSourceCode ?? '',
|
||||
|
|
@ -520,19 +497,19 @@ const Wizard = () => {
|
|||
caption: g.caption ?? '',
|
||||
colCount: g.colCount ?? 2,
|
||||
items: (g.items ?? []).map(
|
||||
(it: WizardGroupItem, ii: number) =>
|
||||
(it: any, ii: number) =>
|
||||
({
|
||||
id: `${it.fieldName}_edit_${ii}_${Date.now()}`,
|
||||
fieldName: it.fieldName ?? '',
|
||||
id: `${it.dataField}_edit_${ii}_${Date.now()}`,
|
||||
dataField: it.dataField ?? '',
|
||||
editorType: it.editorType ?? 'dxTextBox',
|
||||
editorOptions: it.editorOptions ?? '',
|
||||
editorScript: it.editorScript ?? '',
|
||||
colSpan: it.colSpan ?? 1,
|
||||
isRequired: it.isRequired ?? false,
|
||||
includeInEditingForm: it.includeInEditingForm ?? true,
|
||||
turkishCaption: it.turkishCaption ?? it.fieldName,
|
||||
englishCaption: it.englishCaption ?? it.fieldName,
|
||||
captionName: it.captionName ?? `App.Listform.ListformField.${it.fieldName}`,
|
||||
turkishCaption: it.turkishCaption ?? it.dataField,
|
||||
englishCaption: it.englishCaption ?? it.dataField,
|
||||
captionName: it.captionName ?? `App.Listform.ListformField.${it.dataField}`,
|
||||
lookupDataSourceType:
|
||||
(it.lookupDataSourceType as UiLookupDataSourceTypeEnum) ??
|
||||
UiLookupDataSourceTypeEnum.StaticData,
|
||||
|
|
@ -545,7 +522,7 @@ const Wizard = () => {
|
|||
setEditingGroups(restoredGroups)
|
||||
|
||||
// Restore selectedColumns from all group items
|
||||
const allFields = new Set(restoredGroups.flatMap((g) => g.items.map((i) => i.fieldName)))
|
||||
const allFields = new Set(restoredGroups.flatMap((g) => g.items.map((i) => i.dataField)))
|
||||
setSelectedColumns(allFields)
|
||||
}
|
||||
|
||||
|
|
@ -661,16 +638,8 @@ const Wizard = () => {
|
|||
formikRef.current?.setFieldValue('menuParentCode', code)
|
||||
const selectedMenu = rawMenuItems.find((item) => item.code === code)
|
||||
formikRef.current?.setFieldValue('menuParentIcon', selectedMenu?.icon ?? '')
|
||||
formikRef.current?.setFieldValue('languageTextMenuParentEn', selectedMenu?.menuTextEn ?? '')
|
||||
formikRef.current?.setFieldValue('languageTextMenuParentTr', selectedMenu?.menuTextTr ?? '')
|
||||
if (!code) {
|
||||
formikRef.current?.setFieldValue('menuParentShortName', '')
|
||||
return
|
||||
}
|
||||
const rootCode = findRootCode(rawMenuItems, code)
|
||||
const rootMenu = rawMenuItems.find((item) => item.code === rootCode)
|
||||
formikRef.current?.setFieldValue('menuParentShortName', rootMenu?.shortName ?? '')
|
||||
applyPermissionGroupFromRoot(rootCode)
|
||||
if (!code) return
|
||||
applyPermissionGroupFromRoot(findRootCode(rawMenuItems, code))
|
||||
}
|
||||
|
||||
const handleMenuCreated = async (menu: {
|
||||
|
|
@ -679,7 +648,6 @@ const Wizard = () => {
|
|||
menuTextEn: string
|
||||
menuTextTr: string
|
||||
icon?: string
|
||||
shortName?: string
|
||||
}) => {
|
||||
formikRef.current?.setFieldValue('menuParentCode', menu.code)
|
||||
formikRef.current?.setFieldValue('menuParentIcon', menu.icon ?? '')
|
||||
|
|
@ -687,11 +655,6 @@ const Wizard = () => {
|
|||
formikRef.current?.setFieldValue('languageTextMenuParentTr', menu.menuTextTr)
|
||||
|
||||
const rootCode = menu.parentCode ? findRootCode(rawMenuItems, menu.parentCode) : menu.code
|
||||
const existingRoot = rawMenuItems.find((item) => item.code === rootCode)
|
||||
formikRef.current?.setFieldValue(
|
||||
'menuParentShortName',
|
||||
menu.parentCode ? (existingRoot?.shortName ?? '') : (menu.shortName ?? ''),
|
||||
)
|
||||
applyPermissionGroupFromRoot(rootCode)
|
||||
|
||||
await getMenuList()
|
||||
|
|
@ -763,10 +726,10 @@ const Wizard = () => {
|
|||
caption: g.caption,
|
||||
colCount: g.colCount,
|
||||
items: g.items.map((item) => {
|
||||
const col = selectCommandColumns.find((c) => c.columnName === item.fieldName)
|
||||
const col = selectCommandColumns.find((c) => c.columnName === item.dataField)
|
||||
|
||||
return {
|
||||
fieldName: item.fieldName,
|
||||
dataField: item.dataField,
|
||||
editorType: item.editorType,
|
||||
editorOptions: item.editorOptions ?? '',
|
||||
editorScript: item.editorScript ?? '',
|
||||
|
|
@ -873,7 +836,6 @@ const Wizard = () => {
|
|||
onMenuParentChange={handleMenuParentChange}
|
||||
onClearMenuParent={() => {
|
||||
formikRef.current?.setFieldValue('menuParentCode', '')
|
||||
formikRef.current?.setFieldValue('menuParentShortName', '')
|
||||
formikRef.current?.setFieldValue('menuParentIcon', '')
|
||||
}}
|
||||
onMenuCreated={handleMenuCreated}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@ import { ListFormWizardDto } from '@/proxy/admin/wizard/models'
|
|||
export interface MenuTreeNode {
|
||||
code: string
|
||||
displayName: string
|
||||
shortName?: string
|
||||
icon?: string
|
||||
url?: string
|
||||
order?: number
|
||||
|
|
@ -42,7 +41,6 @@ export function buildMenuTree(items: MenuItem[]): MenuTreeNode[] {
|
|||
map.set(item.code!, {
|
||||
code: item.code!,
|
||||
displayName: item.displayName ?? item.code!,
|
||||
shortName: item.shortName ?? undefined,
|
||||
icon: item.icon ?? undefined,
|
||||
url: item.url ?? undefined,
|
||||
order: item.order ?? undefined,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import { Button, Dialog } from '@/components/ui'
|
||||
import type { SelectBoxOption } from '@/types/shared'
|
||||
import { useLocalization } from '@/utils/hooks/useLocalization'
|
||||
import {
|
||||
columnEditorTypeListOptions,
|
||||
|
|
@ -29,17 +28,14 @@ import {
|
|||
FaTrash,
|
||||
FaArrowRight,
|
||||
FaCode,
|
||||
FaSlidersH,
|
||||
} from 'react-icons/fa'
|
||||
import { UiLookupDataSourceTypeEnum } from '@/proxy/form/models'
|
||||
import EditorOptionsBuilderDialog from '../edit/json-row-operations/EditorOptionsBuilderDialog'
|
||||
import EditorScriptBuilderDialog from '../edit/json-row-operations/EditorScriptBuilderDialog'
|
||||
import { buildLookupQuery } from '../lookupQuery'
|
||||
|
||||
// ─── Types ────────────────────────────────────────────────────────────────────
|
||||
export interface WizardGroupItem {
|
||||
id: string
|
||||
fieldName: string
|
||||
dataField: string
|
||||
editorType: string
|
||||
editorOptions: string
|
||||
editorScript: string
|
||||
|
|
@ -113,7 +109,7 @@ function newGroupItem(colName: string, meta?: DatabaseColumnDto): WizardGroupIte
|
|||
const sqlType = meta?.dataType ?? ''
|
||||
return {
|
||||
id: `${colName}_${Date.now()}`,
|
||||
fieldName: colName,
|
||||
dataField: colName,
|
||||
editorType: inferEditorType(sqlType),
|
||||
editorOptions: '',
|
||||
editorScript: '',
|
||||
|
|
@ -173,7 +169,6 @@ interface SortableItemProps {
|
|||
groupColCount: number
|
||||
dbObjects: SqlObjectExplorerDto | null
|
||||
dsCode: string
|
||||
editorScriptFields: SelectBoxOption[]
|
||||
onTurkishCaptionChange: (val: string) => void
|
||||
onEnglishCaptionChange: (val: string) => void
|
||||
onEditorTypeChange: (val: string) => void
|
||||
|
|
@ -195,7 +190,6 @@ function SortableItem({
|
|||
groupColCount,
|
||||
dbObjects,
|
||||
dsCode,
|
||||
editorScriptFields,
|
||||
onTurkishCaptionChange,
|
||||
onEnglishCaptionChange,
|
||||
onEditorTypeChange,
|
||||
|
|
@ -213,8 +207,6 @@ function SortableItem({
|
|||
}: SortableItemProps) {
|
||||
const { translate } = useLocalization()
|
||||
const [isTablePickerOpen, setIsTablePickerOpen] = useState(false)
|
||||
const [isEditorOptionsDialogOpen, setIsEditorOptionsDialogOpen] = useState(false)
|
||||
const [isEditorScriptDialogOpen, setIsEditorScriptDialogOpen] = useState(false)
|
||||
const [tableSearch, setTableSearch] = useState('')
|
||||
const [pickerStep, setPickerStep] = useState<'table' | 'columns'>('table')
|
||||
const [pickerTable, setPickerTable] = useState<{ schemaName: string; tableName: string } | null>(
|
||||
|
|
@ -256,7 +248,7 @@ function SortableItem({
|
|||
tabIndex={-1}
|
||||
/>
|
||||
<span className="flex-1 text-xs font-semibold text-indigo-600 dark:text-indigo-400 truncate">
|
||||
{item.fieldName}
|
||||
{item.dataField}
|
||||
</span>
|
||||
<Button
|
||||
type="button"
|
||||
|
|
@ -572,23 +564,12 @@ function SortableItem({
|
|||
<span className="text-[10px] text-gray-400 font-medium">
|
||||
{translate('::ListForms.Wizard.Step3.EditorOptions')}
|
||||
</span>
|
||||
<div className="flex items-center gap-1">
|
||||
<input
|
||||
value={item.editorOptions}
|
||||
onChange={(e) => onEditorOptionsChange(e.target.value)}
|
||||
placeholder='{"readOnly": false}'
|
||||
className="min-w-0 flex-1 text-xs px-1.5 py-1 rounded border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-gray-700 dark:text-gray-200 focus:outline-none focus:border-indigo-400 resize-none font-mono"
|
||||
/>
|
||||
<Button
|
||||
shape="circle"
|
||||
variant="plain"
|
||||
type="button"
|
||||
size="sm"
|
||||
title="Build editor options"
|
||||
icon={<FaSlidersH />}
|
||||
onClick={() => setIsEditorOptionsDialogOpen(true)}
|
||||
/>
|
||||
</div>
|
||||
<input
|
||||
value={item.editorOptions}
|
||||
onChange={(e) => onEditorOptionsChange(e.target.value)}
|
||||
placeholder='{"readOnly": false}'
|
||||
className="w-full text-xs px-1.5 py-1 rounded border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-gray-700 dark:text-gray-200 focus:outline-none focus:border-indigo-400 resize-none font-mono"
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Editor Script */}
|
||||
|
|
@ -596,41 +577,14 @@ function SortableItem({
|
|||
<span className="text-[10px] text-gray-400 font-medium">
|
||||
{translate('::ListForms.Wizard.Step3.EditorScript')}
|
||||
</span>
|
||||
<div className="flex items-center gap-1">
|
||||
<input
|
||||
value={item.editorScript}
|
||||
onChange={(e) => onEditorScriptChange(e.target.value)}
|
||||
placeholder="(e) => { /* e.component */ }"
|
||||
className="min-w-0 flex-1 text-xs px-1.5 py-1 rounded border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-gray-700 dark:text-gray-200 focus:outline-none focus:border-indigo-400 resize-none font-mono"
|
||||
/>
|
||||
<Button
|
||||
shape="circle"
|
||||
variant="plain"
|
||||
type="button"
|
||||
size="sm"
|
||||
title="Build editor script"
|
||||
icon={<FaCode />}
|
||||
onClick={() => setIsEditorScriptDialogOpen(true)}
|
||||
/>
|
||||
</div>
|
||||
<input
|
||||
value={item.editorScript}
|
||||
onChange={(e) => onEditorScriptChange(e.target.value)}
|
||||
placeholder="(e) => { /* e.component */ }"
|
||||
className="w-full text-xs px-1.5 py-1 rounded border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-gray-700 dark:text-gray-200 focus:outline-none focus:border-indigo-400 resize-none font-mono"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<EditorOptionsBuilderDialog
|
||||
isOpen={isEditorOptionsDialogOpen}
|
||||
value={item.editorOptions}
|
||||
editorType={item.editorType}
|
||||
onClose={() => setIsEditorOptionsDialogOpen(false)}
|
||||
onApply={onEditorOptionsChange}
|
||||
/>
|
||||
<EditorScriptBuilderDialog
|
||||
isOpen={isEditorScriptDialogOpen}
|
||||
value={item.editorScript}
|
||||
currentField={item.fieldName}
|
||||
fields={editorScriptFields}
|
||||
onClose={() => setIsEditorScriptDialogOpen(false)}
|
||||
onApply={onEditorScriptChange}
|
||||
/>
|
||||
|
||||
{/* Bottom row: ColSpan + Editing Form + Required */}
|
||||
<div className="flex items-center gap-2">
|
||||
<div className="flex items-center gap-1">
|
||||
|
|
@ -685,7 +639,6 @@ interface GroupCardProps {
|
|||
hasAvailable: boolean
|
||||
dbObjects: SqlObjectExplorerDto | null
|
||||
dsCode: string
|
||||
editorScriptFields: SelectBoxOption[]
|
||||
onCaptionChange: (val: string) => void
|
||||
onColCountChange: (val: number) => void
|
||||
onItemChange: (itemId: string, patch: Partial<WizardGroupItem>) => void
|
||||
|
|
@ -700,7 +653,6 @@ function GroupCard({
|
|||
hasAvailable,
|
||||
dbObjects,
|
||||
dsCode,
|
||||
editorScriptFields,
|
||||
onCaptionChange,
|
||||
onColCountChange,
|
||||
onItemChange,
|
||||
|
|
@ -807,7 +759,6 @@ function GroupCard({
|
|||
groupColCount={group.colCount}
|
||||
dbObjects={dbObjects}
|
||||
dsCode={dsCode}
|
||||
editorScriptFields={editorScriptFields}
|
||||
onCaptionNameChange={(val) => onItemChange(item.id, { captionName: val })}
|
||||
onTurkishCaptionChange={(val) => onItemChange(item.id, { turkishCaption: val })}
|
||||
onEnglishCaptionChange={(val) => onItemChange(item.id, { englishCaption: val })}
|
||||
|
|
@ -858,7 +809,7 @@ const WizardStep3 = ({
|
|||
// 1. Remove items that are no longer in selectedColumns
|
||||
const cleaned = groups.map((g) => ({
|
||||
...g,
|
||||
items: g.items.filter((i) => selectedColumns.has(i.fieldName)),
|
||||
items: g.items.filter((i) => selectedColumns.has(i.dataField)),
|
||||
}))
|
||||
|
||||
// 2. Ensure at least one empty group exists for the user to drag into
|
||||
|
|
@ -884,14 +835,8 @@ const WizardStep3 = ({
|
|||
}, [selectedColumns])
|
||||
|
||||
// ── Available columns = selected but NOT yet placed ───────────────────────
|
||||
const placedColumns = new Set(groups.flatMap((g) => g.items.map((i) => i.fieldName)))
|
||||
const placedColumns = new Set(groups.flatMap((g) => g.items.map((i) => i.dataField)))
|
||||
const availableColumns = [...selectedColumns].filter((c) => !placedColumns.has(c))
|
||||
const editorScriptFields: SelectBoxOption[] = groups.flatMap((group) =>
|
||||
group.items.map((item) => ({
|
||||
value: item.fieldName,
|
||||
label: item.captionName || item.fieldName,
|
||||
})),
|
||||
)
|
||||
|
||||
// ── Helpers ───────────────────────────────────────────────────────────────
|
||||
const colMeta = (name: string) => selectCommandColumns.find((c) => c.columnName === name)
|
||||
|
|
@ -933,7 +878,7 @@ const WizardStep3 = ({
|
|||
}
|
||||
|
||||
const addAllToGroup = (groupId: string) => {
|
||||
const placed = new Set(groups.flatMap((g) => g.items.map((i) => i.fieldName)))
|
||||
const placed = new Set(groups.flatMap((g) => g.items.map((i) => i.dataField)))
|
||||
const toAdd = [...selectedColumns].filter((c) => !placed.has(c))
|
||||
if (toAdd.length === 0) return
|
||||
onGroupsChange(
|
||||
|
|
@ -1073,7 +1018,7 @@ const WizardStep3 = ({
|
|||
<div className="flex items-center gap-2 px-3 py-2 rounded-lg border border-indigo-400 bg-indigo-50 text-sm shadow-lg cursor-grabbing">
|
||||
<FaGripVertical className="text-indigo-300 text-xs" />
|
||||
<span className="text-xs font-semibold text-indigo-600 bg-indigo-100 px-2 py-0.5 rounded">
|
||||
{item.fieldName}
|
||||
{item.dataField}
|
||||
</span>
|
||||
<span className="text-xs text-gray-500">{item.editorType}</span>
|
||||
</div>
|
||||
|
|
@ -1142,7 +1087,6 @@ const WizardStep3 = ({
|
|||
hasAvailable={availableColumns.length > 0}
|
||||
dbObjects={dbObjects}
|
||||
dsCode={dsCode}
|
||||
editorScriptFields={editorScriptFields}
|
||||
onCaptionChange={(val) => updateGroup(group.id, { caption: val })}
|
||||
onColCountChange={(val) => updateGroup(group.id, { colCount: val })}
|
||||
onItemChange={(itemId, patch) => updateItem(group.id, itemId, patch)}
|
||||
|
|
|
|||
|
|
@ -37,8 +37,6 @@ type PendingLink = {
|
|||
outcome: string
|
||||
} | null
|
||||
|
||||
type RequiredWorkflowField = 'approvalUserFieldName' | 'approvalStatusFieldName'
|
||||
|
||||
const toDesignerCriteria = (items: ListFormWorkflowCriteriaDto[]): WorkflowCriteriaDto[] =>
|
||||
items.map((item) => ({
|
||||
...item,
|
||||
|
|
@ -69,9 +67,6 @@ function WizardStep6({
|
|||
const [dragPreview, setDragPreview] = useState<any>(null)
|
||||
const [canvasZoom, setCanvasZoom] = useState(1)
|
||||
const [designerTab, setDesignerTab] = useState('flow')
|
||||
const [workflowErrors, setWorkflowErrors] = useState<
|
||||
Partial<Record<RequiredWorkflowField, string>>
|
||||
>({})
|
||||
const canvasRef = useRef<HTMLDivElement | null>(null)
|
||||
|
||||
const currentCriteria = useMemo(() => toDesignerCriteria(criteria), [criteria])
|
||||
|
|
@ -96,10 +91,6 @@ function WizardStep6({
|
|||
setCriteriaForm(selected ? toCriteriaForm(selected) : emptyCriteria('Start', listFormCode))
|
||||
}, [currentCriteria, listFormCode, selectedId])
|
||||
|
||||
useEffect(() => {
|
||||
if (criteria.length === 0) setWorkflowErrors({})
|
||||
}, [criteria.length])
|
||||
|
||||
const updateCriteria = (next: WorkflowCriteriaDto[]) => onCriteriaChange(toWizardCriteria(next))
|
||||
|
||||
const saveCriteria = (event: FormEvent<HTMLFormElement>) => {
|
||||
|
|
@ -259,26 +250,6 @@ function WizardStep6({
|
|||
])
|
||||
}
|
||||
|
||||
const continueToTodo = () => {
|
||||
if (criteria.length === 0) {
|
||||
setWorkflowErrors({})
|
||||
onNext()
|
||||
return
|
||||
}
|
||||
|
||||
const requiredMessage = translate('::ListForms.Wizard.Required')
|
||||
const nextErrors: Partial<Record<RequiredWorkflowField, string>> = {}
|
||||
if (!workflow.approvalUserFieldName?.trim()) {
|
||||
nextErrors.approvalUserFieldName = requiredMessage
|
||||
}
|
||||
if (!workflow.approvalStatusFieldName?.trim()) {
|
||||
nextErrors.approvalStatusFieldName = requiredMessage
|
||||
}
|
||||
|
||||
setWorkflowErrors(nextErrors)
|
||||
if (Object.keys(nextErrors).length === 0) onNext()
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="flex h-[calc(100vh-250px)] min-h-[500px] flex-col overflow-hidden">
|
||||
<div className="flex-1 overflow-y-auto pr-1">
|
||||
|
|
@ -309,51 +280,33 @@ function WizardStep6({
|
|||
'approvalDescriptionFieldName',
|
||||
'::ListForms.ListFormEdit.Workflow.ApprovalDescriptionFieldName',
|
||||
],
|
||||
].map(([name, label]) => {
|
||||
const requiredForCriteria =
|
||||
criteria.length > 0 &&
|
||||
(name === 'approvalUserFieldName' || name === 'approvalStatusFieldName')
|
||||
const error = workflowErrors[name as RequiredWorkflowField]
|
||||
|
||||
return (
|
||||
<FormItem
|
||||
key={name}
|
||||
errorMessage={error}
|
||||
invalid={Boolean(error)}
|
||||
label={`${translate(label)}${requiredForCriteria ? ' *' : ''}`}
|
||||
>
|
||||
<Field name={name}>
|
||||
{({ field, form }: FieldProps) => (
|
||||
<Select
|
||||
field={field}
|
||||
form={form}
|
||||
isClearable
|
||||
options={columnOptions}
|
||||
value={columnOptions.find(
|
||||
(option) => option.value === (values as any)[name],
|
||||
)}
|
||||
onChange={(option: any) => {
|
||||
form.setFieldValue(field.name, option?.value ?? '')
|
||||
setWorkflowErrors((current) => ({
|
||||
...current,
|
||||
[field.name]: undefined,
|
||||
}))
|
||||
onWorkflowChange({
|
||||
...values,
|
||||
[field.name]: option?.value ?? '',
|
||||
criteria,
|
||||
})
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</Field>
|
||||
</FormItem>
|
||||
)
|
||||
})}
|
||||
].map(([name, label]) => (
|
||||
<FormItem key={name} label={translate(label)}>
|
||||
<Field name={name}>
|
||||
{({ field, form }: FieldProps) => (
|
||||
<Select
|
||||
field={field}
|
||||
form={form}
|
||||
isClearable
|
||||
options={columnOptions}
|
||||
value={columnOptions.find(
|
||||
(option) => option.value === (values as any)[name],
|
||||
)}
|
||||
onChange={(option: any) => {
|
||||
form.setFieldValue(field.name, option?.value ?? '')
|
||||
onWorkflowChange({
|
||||
...values,
|
||||
[field.name]: option?.value ?? '',
|
||||
criteria,
|
||||
})
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</Field>
|
||||
</FormItem>
|
||||
))}
|
||||
<FormItem
|
||||
label={translate(
|
||||
'::ListForms.ListFormEdit.Workflow.ApprovalIsFilterUserName',
|
||||
)}
|
||||
label={translate('::ListForms.ListFormEdit.Workflow.ApprovalIsFilterUserName')}
|
||||
>
|
||||
<Field name="approvalIsFilterUserName">
|
||||
{({ field, form }: FieldProps<boolean>) => (
|
||||
|
|
@ -449,7 +402,7 @@ function WizardStep6({
|
|||
variant="solid"
|
||||
type="button"
|
||||
icon={<FaArrowRight />}
|
||||
onClick={continueToTodo}
|
||||
onClick={onNext}
|
||||
>
|
||||
{translate('::Next') || 'Next'}
|
||||
</Button>
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import type { DatabaseColumnDto } from '@/proxy/sql-query-manager/models'
|
|||
import type { SelectBoxOption } from '@/types/shared'
|
||||
import { Field, type FieldProps, useFormikContext } from 'formik'
|
||||
import { useMemo, useState } from 'react'
|
||||
import { FaArrowLeft, FaArrowRight } from 'react-icons/fa'
|
||||
import { FaArrowLeft, FaArrowRight, FaColumns } from 'react-icons/fa'
|
||||
|
||||
interface WizardStep7Props {
|
||||
selectedColumns: Set<string>
|
||||
|
|
@ -25,41 +25,18 @@ const mappings: Array<{
|
|||
| 'todoPriorityExpr'
|
||||
| 'todoCompletedExpr'
|
||||
| 'todoOrderExpr'
|
||||
translationKey: string
|
||||
label: string
|
||||
required?: boolean
|
||||
}> = [
|
||||
{
|
||||
name: 'todoTitleExpr',
|
||||
translationKey: '::ListForms.ListFormFieldEdit.TodoTitleExpr',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
name: 'todoStatusExpr',
|
||||
translationKey: '::ListForms.ListFormFieldEdit.TodoStatusExpr',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
name: 'todoDescriptionExpr',
|
||||
translationKey: '::ListForms.ListFormFieldEdit.TodoDescriptionExpr',
|
||||
},
|
||||
{
|
||||
name: 'todoDueDateExpr',
|
||||
translationKey: '::ListForms.ListFormFieldEdit.TodoDueDateExpr',
|
||||
},
|
||||
{ name: 'todoTagExpr', translationKey: '::ListForms.ListFormFieldEdit.TodoTagExpr' },
|
||||
{
|
||||
name: 'todoAssigneeExpr',
|
||||
translationKey: '::ListForms.ListFormFieldEdit.TodoAssigneeExpr',
|
||||
},
|
||||
{
|
||||
name: 'todoPriorityExpr',
|
||||
translationKey: '::ListForms.ListFormFieldEdit.TodoPriorityExpr',
|
||||
},
|
||||
{
|
||||
name: 'todoCompletedExpr',
|
||||
translationKey: '::ListForms.ListFormFieldEdit.TodoCompletedExpr',
|
||||
},
|
||||
{ name: 'todoOrderExpr', translationKey: '::ListForms.ListFormFieldEdit.TodoOrderExpr' },
|
||||
{ name: 'todoTitleExpr', label: 'Başlık alanı', required: true },
|
||||
{ name: 'todoStatusExpr', label: 'Kanban / durum alanı', required: true },
|
||||
{ name: 'todoDescriptionExpr', label: 'Açıklama alanı' },
|
||||
{ name: 'todoDueDateExpr', label: 'Termin tarihi alanı' },
|
||||
{ name: 'todoTagExpr', label: 'Etiket alanı' },
|
||||
{ name: 'todoAssigneeExpr', label: 'Atanan kişi alanı' },
|
||||
{ name: 'todoPriorityExpr', label: 'Öncelik alanı' },
|
||||
{ name: 'todoCompletedExpr', label: 'Tamamlandı alanı' },
|
||||
{ name: 'todoOrderExpr', label: 'Kart sıra alanı' },
|
||||
]
|
||||
|
||||
const WizardStep7 = ({
|
||||
|
|
@ -69,8 +46,7 @@ const WizardStep7 = ({
|
|||
onBack,
|
||||
onNext,
|
||||
}: WizardStep7Props) => {
|
||||
const { errors, touched, values, setFieldTouched, setFieldValue, validateForm } =
|
||||
useFormikContext<ListFormWizardDto>()
|
||||
const { values, setFieldValue } = useFormikContext<ListFormWizardDto>()
|
||||
const [validationError, setValidationError] = useState('')
|
||||
const fieldOptions = useMemo<SelectBoxOption[]>(
|
||||
() =>
|
||||
|
|
@ -80,15 +56,9 @@ const WizardStep7 = ({
|
|||
[selectCommandColumns, selectedColumns],
|
||||
)
|
||||
|
||||
const continueToDeploy = async () => {
|
||||
await Promise.all([
|
||||
setFieldTouched('todoTitleExpr', true, false),
|
||||
setFieldTouched('todoStatusExpr', true, false),
|
||||
])
|
||||
const validationErrors = await validateForm()
|
||||
|
||||
if (validationErrors.todoTitleExpr || validationErrors.todoStatusExpr) {
|
||||
setValidationError(translate('::ListForms.ListFormFieldEdit.TodoRequiredFields'))
|
||||
const continueToDeploy = () => {
|
||||
if (values.todo && (!values.todoTitleExpr || !values.todoStatusExpr)) {
|
||||
setValidationError('Başlık alanı ve Kanban / durum alanı zorunludur.')
|
||||
return
|
||||
}
|
||||
setValidationError('')
|
||||
|
|
@ -97,63 +67,75 @@ const WizardStep7 = ({
|
|||
|
||||
return (
|
||||
<div className="pb-20">
|
||||
<div className="grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-3">
|
||||
{mappings.map((mapping) => {
|
||||
const isRequired = Boolean(mapping.required && values.todo)
|
||||
<div className="mb-5 rounded-xl border border-indigo-200 bg-indigo-50/60 p-4 dark:border-indigo-900 dark:bg-indigo-950/20">
|
||||
<div className="flex items-center gap-2 font-semibold text-indigo-700 dark:text-indigo-300">
|
||||
<FaColumns /> Todo / Kanban ayrıntıları
|
||||
</div>
|
||||
<p className="mt-1 text-sm text-gray-500 dark:text-gray-400">
|
||||
Liste alanlarını Todo kartının başlık, durum ve diğer özellikleriyle eşleştirin.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
return (
|
||||
<FormItem
|
||||
key={mapping.name}
|
||||
label={`${translate(mapping.translationKey)}${isRequired ? ' *' : ''}`}
|
||||
invalid={Boolean(touched[mapping.name] && errors[mapping.name])}
|
||||
errorMessage={touched[mapping.name] ? errors[mapping.name] : undefined}
|
||||
>
|
||||
<Field name={mapping.name}>
|
||||
{({ field, form }: FieldProps) => (
|
||||
<Select
|
||||
field={field}
|
||||
form={form}
|
||||
isClearable={!isRequired}
|
||||
options={fieldOptions}
|
||||
value={fieldOptions.find((option) => option.value === values[mapping.name])}
|
||||
onChange={(option) => {
|
||||
form.setFieldValue(field.name, option?.value ?? '')
|
||||
setValidationError('')
|
||||
}}
|
||||
{!values.todo ? (
|
||||
<div className="rounded-xl border border-amber-200 bg-amber-50 p-4 text-sm text-amber-700 dark:border-amber-900 dark:bg-amber-950/30 dark:text-amber-200">
|
||||
Todo görünümü liste ayarlarında kapalı. Bu adımı atlayabilir veya önceki adımlardan Todo
|
||||
görünümünü etkinleştirebilirsiniz.
|
||||
</div>
|
||||
) : (
|
||||
<>
|
||||
<div className="grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-3">
|
||||
{mappings.map((mapping) => (
|
||||
<FormItem
|
||||
key={mapping.name}
|
||||
label={`${mapping.label}${mapping.required ? ' *' : ''}`}
|
||||
>
|
||||
<Field name={mapping.name}>
|
||||
{({ field, form }: FieldProps) => (
|
||||
<Select
|
||||
field={field}
|
||||
form={form}
|
||||
isClearable={!mapping.required}
|
||||
options={fieldOptions}
|
||||
value={fieldOptions.find((option) => option.value === values[mapping.name])}
|
||||
onChange={(option) => {
|
||||
form.setFieldValue(field.name, option?.value ?? '')
|
||||
setValidationError('')
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</Field>
|
||||
</FormItem>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<div className="mt-5 grid grid-cols-1 gap-4 md:grid-cols-2">
|
||||
<FormItem label="Durum sırası (virgülle ayırın)">
|
||||
<Field
|
||||
name="todoStatusOrder"
|
||||
component={Input}
|
||||
placeholder="Inbox, Today, This Week, This Month, Later, Done"
|
||||
/>
|
||||
</FormItem>
|
||||
<FormItem label="Kartları kolonlar arasında sürüklemeye izin ver">
|
||||
<Field name="todoAllowDragging">
|
||||
{({ field }: FieldProps<boolean>) => (
|
||||
<Checkbox
|
||||
checked={Boolean(field.value)}
|
||||
onChange={(checked) => setFieldValue(field.name, checked)}
|
||||
/>
|
||||
)}
|
||||
</Field>
|
||||
</FormItem>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
|
||||
<div className="mt-5 grid grid-cols-1 gap-4 md:grid-cols-2">
|
||||
<FormItem label={translate('::ListForms.ListFormFieldEdit.TodoStatusOrder')}>
|
||||
<Field
|
||||
name="todoStatusOrder"
|
||||
component={Input}
|
||||
placeholder={translate('::ListForms.ListFormFieldEdit.TodoStatusOrderPlaceholder')}
|
||||
/>
|
||||
</FormItem>
|
||||
<FormItem label={translate('::ListForms.ListFormFieldEdit.TodoAllowDragging')}>
|
||||
<Field name="todoAllowDragging">
|
||||
{({ field }: FieldProps<boolean>) => (
|
||||
<Checkbox
|
||||
checked={Boolean(field.value)}
|
||||
onChange={(checked) => setFieldValue(field.name, checked)}
|
||||
/>
|
||||
)}
|
||||
</Field>
|
||||
</FormItem>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
|
||||
{validationError && <p className="mt-4 text-sm text-red-500">{validationError}</p>}
|
||||
|
||||
<div className="fixed bottom-0 left-0 right-0 z-10 flex h-16 items-center border-t border-gray-200 bg-white px-6 dark:border-gray-700 dark:bg-gray-900">
|
||||
<div className="flex w-full items-center justify-between gap-3">
|
||||
<Button size="sm" variant="default" type="button" icon={<FaArrowLeft />} onClick={onBack}>
|
||||
{translate('::Back')}
|
||||
{translate('::Back') || 'Geri'}
|
||||
</Button>
|
||||
<Button
|
||||
size="sm"
|
||||
|
|
@ -162,7 +144,7 @@ const WizardStep7 = ({
|
|||
icon={<FaArrowRight />}
|
||||
onClick={continueToDeploy}
|
||||
>
|
||||
{translate('::Next')}
|
||||
{translate('::Next') || 'Deploy adımına geç'}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -218,9 +218,7 @@ const WizardStep8 = ({
|
|||
...prev,
|
||||
{
|
||||
id: 999,
|
||||
label: `${translate('::ListForms.Wizard.Step4.Error')}: ${
|
||||
err?.message ?? translate('::App.Platform.Unknown')
|
||||
}`,
|
||||
label: `Hata: ${err?.message ?? 'Bilinmeyen hata'}`,
|
||||
status: 'error',
|
||||
},
|
||||
])
|
||||
|
|
@ -233,10 +231,10 @@ const WizardStep8 = ({
|
|||
const totalFields = groups.reduce((acc, g) => acc + g.items.length, 0)
|
||||
const editingFormFields = groups.flatMap((g) =>
|
||||
g.items
|
||||
.filter((item) => item.includeInEditingForm && item.fieldName !== values.keyFieldName)
|
||||
.filter((item) => item.includeInEditingForm && item.dataField !== values.keyFieldName)
|
||||
.map((item) => ({ ...item, groupCaption: g.caption })),
|
||||
)
|
||||
const groupedFieldNames = new Set(groups.flatMap((g) => g.items.map((item) => item.fieldName)))
|
||||
const groupedFieldNames = new Set(groups.flatMap((g) => g.items.map((item) => item.dataField)))
|
||||
const ungroupedSelectedColumns = [...selectedColumns].filter((col) => !groupedFieldNames.has(col))
|
||||
const hasWorkflowFields = Boolean(
|
||||
workflow.approvalUserFieldName ||
|
||||
|
|
@ -389,8 +387,8 @@ const WizardStep8 = ({
|
|||
</span>
|
||||
) : (
|
||||
g.items.map((item) => {
|
||||
const meta = selectCommandColumns.find((c) => c.columnName === item.fieldName)
|
||||
const isKeyField = item.fieldName === values.keyFieldName
|
||||
const meta = selectCommandColumns.find((c) => c.columnName === item.dataField)
|
||||
const isKeyField = item.dataField === values.keyFieldName
|
||||
const isPopupField = item.includeInEditingForm && !isKeyField
|
||||
return (
|
||||
<div
|
||||
|
|
@ -399,7 +397,7 @@ const WizardStep8 = ({
|
|||
>
|
||||
<div className="flex min-w-0 items-center gap-2">
|
||||
<span className="text-xs font-medium text-indigo-600 dark:text-indigo-400 truncate">
|
||||
{item.fieldName}
|
||||
{item.dataField}
|
||||
</span>
|
||||
{meta?.dataType && (
|
||||
<span className="text-[10px] text-gray-400 truncate">
|
||||
|
|
@ -576,52 +574,17 @@ const WizardStep8 = ({
|
|||
{values.todo && (
|
||||
<Section title={translate('::ListForms.ListFormEdit.TabTodo') || 'Todo / Kanban'}>
|
||||
<div className="grid grid-cols-2 gap-x-4">
|
||||
<Row
|
||||
label={translate('::ListForms.ListFormFieldEdit.TodoTitleExpr')}
|
||||
value={values.todoTitleExpr}
|
||||
/>
|
||||
<Row
|
||||
label={translate('::ListForms.ListFormFieldEdit.TodoStatusExpr')}
|
||||
value={values.todoStatusExpr}
|
||||
/>
|
||||
<Row
|
||||
label={translate('::ListForms.ListFormFieldEdit.TodoDescriptionExpr')}
|
||||
value={values.todoDescriptionExpr}
|
||||
/>
|
||||
<Row
|
||||
label={translate('::ListForms.ListFormFieldEdit.TodoDueDateExpr')}
|
||||
value={values.todoDueDateExpr}
|
||||
/>
|
||||
<Row
|
||||
label={translate('::ListForms.ListFormFieldEdit.TodoTagExpr')}
|
||||
value={values.todoTagExpr}
|
||||
/>
|
||||
<Row
|
||||
label={translate('::ListForms.ListFormFieldEdit.TodoAssigneeExpr')}
|
||||
value={values.todoAssigneeExpr}
|
||||
/>
|
||||
<Row
|
||||
label={translate('::ListForms.ListFormFieldEdit.TodoPriorityExpr')}
|
||||
value={values.todoPriorityExpr}
|
||||
/>
|
||||
<Row
|
||||
label={translate('::ListForms.ListFormFieldEdit.TodoCompletedExpr')}
|
||||
value={values.todoCompletedExpr}
|
||||
/>
|
||||
<Row
|
||||
label={translate('::ListForms.ListFormFieldEdit.TodoOrderExpr')}
|
||||
value={values.todoOrderExpr}
|
||||
/>
|
||||
<Row
|
||||
label={translate('::ListForms.ListFormFieldEdit.TodoStatusOrder')}
|
||||
value={values.todoStatusOrder}
|
||||
/>
|
||||
<Row
|
||||
label={translate('::ListForms.ListFormFieldEdit.TodoAllowDragging')}
|
||||
value={translate(
|
||||
values.todoAllowDragging ? '::App.Status.Active' : '::App.Status.Inactive',
|
||||
)}
|
||||
/>
|
||||
<Row label="Başlık alanı" value={values.todoTitleExpr} />
|
||||
<Row label="Kanban / durum alanı" value={values.todoStatusExpr} />
|
||||
<Row label="Açıklama alanı" value={values.todoDescriptionExpr} />
|
||||
<Row label="Termin tarihi alanı" value={values.todoDueDateExpr} />
|
||||
<Row label="Etiket alanı" value={values.todoTagExpr} />
|
||||
<Row label="Atanan kişi alanı" value={values.todoAssigneeExpr} />
|
||||
<Row label="Öncelik alanı" value={values.todoPriorityExpr} />
|
||||
<Row label="Tamamlandı alanı" value={values.todoCompletedExpr} />
|
||||
<Row label="Kart sıra alanı" value={values.todoOrderExpr} />
|
||||
<Row label="Durum sırası" value={values.todoStatusOrder} />
|
||||
<Row label="Sürükle-bırak" value={values.todoAllowDragging ? 'Aktif' : 'Pasif'} />
|
||||
</div>
|
||||
</Section>
|
||||
)}
|
||||
|
|
@ -680,12 +643,12 @@ const WizardStep8 = ({
|
|||
</span>
|
||||
{isDone && (
|
||||
<span className="text-xs text-emerald-500 font-semibold flex items-center gap-1">
|
||||
<FaCheckCircle /> {translate('::ListForms.Wizard.Step4.Success')}
|
||||
<FaCheckCircle /> {translate('::ListForms.Wizard.Step4.Success') || 'Başarılı'}
|
||||
</span>
|
||||
)}
|
||||
{hasError && (
|
||||
<span className="text-xs text-red-500 font-semibold flex items-center gap-1">
|
||||
<FaExclamationCircle /> {translate('::ListForms.Wizard.Step4.Error')}
|
||||
<FaExclamationCircle /> {translate('::ListForms.Wizard.Step4.Error') || 'Hata'}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
|
|
@ -695,7 +658,7 @@ const WizardStep8 = ({
|
|||
<div className="flex flex-col items-center justify-center h-full gap-3 py-10 select-none">
|
||||
<FaRocket className="text-gray-700 text-3xl" />
|
||||
<span className="text-xs text-gray-600 italic text-center">
|
||||
{translate('::ListForms.Wizard.Step4.AllInfoReady')}
|
||||
{translate('::ListForms.Wizard.Step4.AllInfoReady') || 'Tüm bilgiler hazır.'}
|
||||
<br />
|
||||
{translate('::ListForms.Wizard.Step4.DeployStartHint')}
|
||||
</span>
|
||||
|
|
|
|||
|
|
@ -383,7 +383,7 @@ const OrganizationUnits = () => {
|
|||
}
|
||||
}
|
||||
|
||||
const Node = memo(function Node({ node, style, dragHandle }: NodeRendererProps<any>) {
|
||||
const Node = memo(({ node, style, dragHandle }: NodeRendererProps<any>) => {
|
||||
return (
|
||||
<div
|
||||
className={classNames(
|
||||
|
|
|
|||
|
|
@ -90,47 +90,6 @@ interface TableIndex {
|
|||
|
||||
// ─── Constants ────────────────────────────────────────────────────────────────
|
||||
|
||||
const REL_TYPES: { value: RelationshipType; label: string; desc: string }[] = [
|
||||
{ value: 'OneToMany', label: '1 → N', desc: 'Bire-çok' },
|
||||
{ value: 'OneToOne', label: '1 → 1', desc: 'Bire-bir' },
|
||||
]
|
||||
|
||||
const CASCADE_OPTIONS: { value: CascadeBehavior; label: string }[] = [
|
||||
{ value: 'NoAction', label: 'No Action' },
|
||||
{ value: 'Cascade', label: 'Cascade' },
|
||||
{ value: 'SetNull', label: 'Set Null' },
|
||||
{ value: 'Restrict', label: 'Restrict' },
|
||||
]
|
||||
|
||||
const EMPTY_FK: Omit<SqlTableRelation, 'id'> = {
|
||||
relationshipType: 'OneToMany',
|
||||
fkColumnName: '',
|
||||
referencedTable: '',
|
||||
referencedColumn: 'Id',
|
||||
cascadeDelete: 'NoAction',
|
||||
cascadeUpdate: 'Cascade',
|
||||
isRequired: false,
|
||||
description: '',
|
||||
}
|
||||
|
||||
const EMPTY_INDEX: Omit<TableIndex, 'id'> = {
|
||||
indexName: '',
|
||||
indexType: 'Index',
|
||||
isClustered: false,
|
||||
columns: [],
|
||||
description: '',
|
||||
}
|
||||
|
||||
const INDEX_TYPES: { value: IndexType; label: string; desc: string }[] = [
|
||||
{
|
||||
value: 'PrimaryKey',
|
||||
label: 'Primary Key',
|
||||
desc: 'App.SqlQueryManager.IndexType_PrimaryKey_Desc',
|
||||
},
|
||||
{ value: 'UniqueKey', label: 'Unique Key', desc: 'App.SqlQueryManager.IndexType_UniqueKey_Desc' },
|
||||
{ value: 'Index', label: 'Index', desc: 'App.SqlQueryManager.IndexType_Index_Desc' },
|
||||
]
|
||||
|
||||
const DATA_TYPES: { value: SqlDataType; label: string }[] = [
|
||||
{ value: 'nvarchar', label: 'String (nvarchar)' },
|
||||
{ value: 'nvarchar(MAX)', label: 'Text (nvarchar MAX)' },
|
||||
|
|
@ -221,6 +180,47 @@ const FULL_AUDIT_COLUMNS: ColumnDefinition[] = [
|
|||
},
|
||||
]
|
||||
|
||||
const REL_TYPES: { value: RelationshipType; label: string; desc: string }[] = [
|
||||
{ value: 'OneToMany', label: '1 → N', desc: 'Bire-çok' },
|
||||
{ value: 'OneToOne', label: '1 → 1', desc: 'Bire-bir' },
|
||||
]
|
||||
|
||||
const CASCADE_OPTIONS: { value: CascadeBehavior; label: string }[] = [
|
||||
{ value: 'NoAction', label: 'No Action' },
|
||||
{ value: 'Cascade', label: 'Cascade' },
|
||||
{ value: 'SetNull', label: 'Set Null' },
|
||||
{ value: 'Restrict', label: 'Restrict' },
|
||||
]
|
||||
|
||||
const EMPTY_FK: Omit<SqlTableRelation, 'id'> = {
|
||||
relationshipType: 'OneToMany',
|
||||
fkColumnName: '',
|
||||
referencedTable: '',
|
||||
referencedColumn: 'Id',
|
||||
cascadeDelete: 'NoAction',
|
||||
cascadeUpdate: 'Cascade',
|
||||
isRequired: false,
|
||||
description: '',
|
||||
}
|
||||
|
||||
const EMPTY_INDEX: Omit<TableIndex, 'id'> = {
|
||||
indexName: '',
|
||||
indexType: 'Index',
|
||||
isClustered: false,
|
||||
columns: [],
|
||||
description: '',
|
||||
}
|
||||
|
||||
const INDEX_TYPES: { value: IndexType; label: string; desc: string }[] = [
|
||||
{
|
||||
value: 'PrimaryKey',
|
||||
label: 'Primary Key',
|
||||
desc: 'App.SqlQueryManager.IndexType_PrimaryKey_Desc',
|
||||
},
|
||||
{ value: 'UniqueKey', label: 'Unique Key', desc: 'App.SqlQueryManager.IndexType_UniqueKey_Desc' },
|
||||
{ value: 'Index', label: 'Index', desc: 'App.SqlQueryManager.IndexType_Index_Desc' },
|
||||
]
|
||||
|
||||
const TENANT_COLUMN: ColumnDefinition = {
|
||||
id: '__TenantId',
|
||||
columnName: 'TenantId',
|
||||
|
|
@ -232,15 +232,6 @@ const TENANT_COLUMN: ColumnDefinition = {
|
|||
}
|
||||
|
||||
const WORKFLOW_COLUMNS: ColumnDefinition[] = [
|
||||
{
|
||||
id: '__WorkflowId',
|
||||
columnName: 'Id',
|
||||
dataType: 'uniqueidentifier',
|
||||
maxLength: '',
|
||||
isNullable: false,
|
||||
defaultValue: 'NEWID()',
|
||||
description: 'Workflow primary key',
|
||||
},
|
||||
{
|
||||
id: '__ApprovalUserId',
|
||||
columnName: 'ApprovalUserName',
|
||||
|
|
@ -1333,26 +1324,6 @@ const SqlTableDesignerDialog = ({
|
|||
|
||||
const clearAllColumns = () => setColumns([createEmptyColumn()])
|
||||
|
||||
const addAutomaticPrimaryKey = (preset: string, description: string) => {
|
||||
const tableName = settings.tableName || initialTableData?.tableName || 'Table'
|
||||
|
||||
setIndexes((prev) => {
|
||||
if (prev.some((index) => index.indexType === 'PrimaryKey')) return prev
|
||||
|
||||
return [
|
||||
...prev,
|
||||
{
|
||||
id: `auto-${preset}-${crypto.randomUUID()}`,
|
||||
indexName: `PK_${tableName}`,
|
||||
indexType: 'PrimaryKey',
|
||||
isClustered: false,
|
||||
columns: [{ columnName: 'Id', order: 'ASC' }],
|
||||
description,
|
||||
},
|
||||
]
|
||||
})
|
||||
}
|
||||
|
||||
const addFullAuditedColumns = () => {
|
||||
const existingNames = new Set(columns.map((c) => c.columnName.trim().toLowerCase()))
|
||||
const toAdd = FULL_AUDIT_COLUMNS.filter((c) => !existingNames.has(c.columnName.toLowerCase()))
|
||||
|
|
@ -1361,7 +1332,24 @@ const SqlTableDesignerDialog = ({
|
|||
return [...nonEmpty, ...toAdd.map((c) => ({ ...c })), createEmptyColumn()]
|
||||
})
|
||||
|
||||
addAutomaticPrimaryKey('full-audit', 'Full audited primary key (auto)')
|
||||
// FullAudited ile Id eklendiğinde PK tanımı Index/Key listesine otomatik düşsün.
|
||||
setIndexes((prev) => {
|
||||
const hasPk = prev.some((ix) => ix.indexType === 'PrimaryKey')
|
||||
if (hasPk) return prev
|
||||
|
||||
const tableName = settings.tableName || initialTableData?.tableName || 'Table'
|
||||
return [
|
||||
...prev,
|
||||
{
|
||||
id: `auto-pk-${crypto.randomUUID()}`,
|
||||
indexName: `PK_${tableName}`,
|
||||
indexType: 'PrimaryKey',
|
||||
isClustered: false,
|
||||
columns: [{ columnName: 'Id', order: 'ASC' }],
|
||||
description: 'Primary key (auto)',
|
||||
},
|
||||
]
|
||||
})
|
||||
}
|
||||
|
||||
const addMultiTenantColumns = () => {
|
||||
|
|
@ -1384,8 +1372,6 @@ const SqlTableDesignerDialog = ({
|
|||
return [...nonEmpty, ...toAdd.map((c) => ({ ...c })), createEmptyColumn()]
|
||||
})
|
||||
}
|
||||
|
||||
addAutomaticPrimaryKey('workflow', 'Workflow primary key (auto)')
|
||||
}
|
||||
|
||||
const addTodoColumns = () => {
|
||||
|
|
@ -1399,7 +1385,22 @@ const SqlTableDesignerDialog = ({
|
|||
})
|
||||
}
|
||||
|
||||
addAutomaticPrimaryKey('todo', 'Todo primary key (auto)')
|
||||
setIndexes((prev) => {
|
||||
if (prev.some((index) => index.indexType === 'PrimaryKey')) return prev
|
||||
|
||||
const tableName = settings.tableName || initialTableData?.tableName || 'Table'
|
||||
return [
|
||||
...prev,
|
||||
{
|
||||
id: `auto-todo-pk-${crypto.randomUUID()}`,
|
||||
indexName: `PK_${tableName}`,
|
||||
indexType: 'PrimaryKey',
|
||||
isClustered: false,
|
||||
columns: [{ columnName: 'Id', order: 'ASC' }],
|
||||
description: 'Todo primary key (auto)',
|
||||
},
|
||||
]
|
||||
})
|
||||
}
|
||||
|
||||
const importColumnsFromRememberedCreateTable = async () => {
|
||||
|
|
@ -1510,10 +1511,11 @@ const SqlTableDesignerDialog = ({
|
|||
const syncAutoPkName = (newTableName: string) => {
|
||||
if (!newTableName) return
|
||||
setIndexes((prev) =>
|
||||
prev.map((ix) => {
|
||||
if (!ix.id.startsWith('auto-') || ix.indexType !== 'PrimaryKey') return ix
|
||||
return { ...ix, indexName: `PK_${newTableName}` }
|
||||
}),
|
||||
prev.map((ix) =>
|
||||
ix.indexType === 'PrimaryKey' && ix.id.startsWith('auto-pk')
|
||||
? { ...ix, indexName: `PK_${newTableName}` }
|
||||
: ix,
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -1860,12 +1862,12 @@ const SqlTableDesignerDialog = ({
|
|||
<>
|
||||
<div className="flex items-center justify-between py-2">
|
||||
<div className="flex items-center gap-2">
|
||||
<Button size="xs" variant="solid" color="green-600" onClick={addMultiTenantColumns}>
|
||||
{translate('::App.SqlQueryManager.AddMultiTenantColumns')}
|
||||
</Button>
|
||||
<Button size="xs" variant="solid" color="blue-600" onClick={addFullAuditedColumns}>
|
||||
{translate('::App.SqlQueryManager.AddFullAuditedColumns')}
|
||||
</Button>
|
||||
<Button size="xs" variant="solid" color="green-600" onClick={addMultiTenantColumns}>
|
||||
{translate('::App.SqlQueryManager.AddMultiTenantColumns')}
|
||||
</Button>
|
||||
<Button size="xs" variant="solid" color="indigo-600" onClick={addWorkflowColumns}>
|
||||
{translate('::App.SqlQueryManager.AddWorkflowColumns')}
|
||||
</Button>
|
||||
|
|
|
|||
|
|
@ -9,9 +9,9 @@ import type { GroupItem } from 'devextreme/ui/form'
|
|||
import { useEffect, useRef, useState } from 'react'
|
||||
import { useLocation, useNavigate, useSearchParams } from 'react-router-dom'
|
||||
import { GridColumnData } from '../list/GridColumnData'
|
||||
import { addCss, addJs, getEditingFormGroups } from '../list/Utils'
|
||||
import { addCss, addJs } from '../list/Utils'
|
||||
import { PermissionResults, RowMode, SimpleItemWithColData } from './types'
|
||||
import { ColumnFormatDto, GridDto, PlatformEditorTypes } from '@/proxy/form/models'
|
||||
import { EditingFormItemDto, GridDto, PlatformEditorTypes } from '@/proxy/form/models'
|
||||
import { getAccessDeniedPath } from '@/utils/routing'
|
||||
import { ROUTES_ENUM } from '@/routes/route.constant'
|
||||
import { useLookupDataSource } from './useLookupDataSource'
|
||||
|
|
@ -218,7 +218,10 @@ const useGridData = (props: {
|
|||
)
|
||||
setDataSource(dataSource)
|
||||
|
||||
const items = getEditingFormGroups(gridDto)
|
||||
const items = gridDto?.gridOptions.editingFormDto
|
||||
?.sort((a: any, b: any) => {
|
||||
return a.order >= b.order ? 1 : -1
|
||||
})
|
||||
.map((e: any) => {
|
||||
return {
|
||||
itemType: e.itemType,
|
||||
|
|
@ -227,12 +230,12 @@ const useGridData = (props: {
|
|||
caption: e.caption,
|
||||
items: e.items
|
||||
?.sort((a: any, b: any) => {
|
||||
return (a.editOrderNo ?? 0) >= (b.editOrderNo ?? 0) ? 1 : -1
|
||||
return a.order >= b.order ? 1 : -1
|
||||
})
|
||||
.map((i: ColumnFormatDto) => {
|
||||
.map((i: EditingFormItemDto) => {
|
||||
let editorOptions: Record<string, any> = {}
|
||||
let parsedEditorOptions: Record<string, any> = {}
|
||||
const colData = i
|
||||
const colData = gridDto.columnFormats.find((x) => x.fieldName === i.dataField)
|
||||
|
||||
parsedEditorOptions = i.editorOptions ? JSON.parse(i.editorOptions) : {}
|
||||
const lookupEditorOptions = colData?.lookupDto?.dataSourceType
|
||||
|
|
@ -247,14 +250,26 @@ const useGridData = (props: {
|
|||
...parsedEditorOptions,
|
||||
}
|
||||
const item: SimpleItemWithColData = {
|
||||
canRead: i.canRead ?? false,
|
||||
canUpdate: i.canUpdate ?? false,
|
||||
canCreate: i.canCreate ?? false,
|
||||
canExport: i.canExport ?? false,
|
||||
allowEditing: i.allowEditing ?? true,
|
||||
allowAdding: i.allowAdding ?? true,
|
||||
dataField: i.fieldName,
|
||||
name: i.fieldName,
|
||||
canRead:
|
||||
gridDto.columnFormats.find((x: any) => x.fieldName === i.dataField)?.canRead ??
|
||||
false,
|
||||
canUpdate:
|
||||
gridDto.columnFormats.find((x: any) => x.fieldName === i.dataField)?.canUpdate ??
|
||||
false,
|
||||
canCreate:
|
||||
gridDto.columnFormats.find((x: any) => x.fieldName === i.dataField)?.canCreate ??
|
||||
false,
|
||||
canExport:
|
||||
gridDto.columnFormats.find((x: any) => x.fieldName === i.dataField)?.canExport ??
|
||||
false,
|
||||
allowEditing:
|
||||
gridDto.columnFormats.find((x: any) => x.fieldName === i.dataField)
|
||||
?.allowEditing ?? true,
|
||||
allowAdding:
|
||||
gridDto.columnFormats.find((x: any) => x.fieldName === i.dataField)
|
||||
?.allowAdding ?? true,
|
||||
dataField: i.dataField,
|
||||
name: i.dataField,
|
||||
editorType2: i.editorType2,
|
||||
editorType:
|
||||
i.editorType2 == PlatformEditorTypes.dxGridBox
|
||||
|
|
@ -271,8 +286,8 @@ const useGridData = (props: {
|
|||
imageUploadOptions: i.imageUploadOptions,
|
||||
editorScript: i.editorScript,
|
||||
}
|
||||
if (i.fieldName?.indexOf(':') >= 0) {
|
||||
item.label = { text: captionize(i.fieldName.split(':')[1]) }
|
||||
if (i.dataField.indexOf(':') >= 0) {
|
||||
item.label = { text: captionize(i.dataField.split(':')[1]) }
|
||||
}
|
||||
if ((mode == 'edit' && !item.canUpdate) || (mode == 'new' && !item.canCreate)) {
|
||||
item.editorOptions = {
|
||||
|
|
@ -333,7 +348,7 @@ const useGridData = (props: {
|
|||
|
||||
const updateItems = (items: any[] = []): any[] =>
|
||||
items.map((item) => {
|
||||
const colData = item.colData
|
||||
const colData = gridDto.columnFormats.find((x) => x.fieldName === item.dataField)
|
||||
if (colData?.lookupDto?.dataSourceType && shouldRefreshLookup(item)) {
|
||||
const currentDataSource = item.editorOptions?.dataSource
|
||||
const keepCustomDataSource =
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ import { ImportDashboard } from '@/components/importManager/ImportDashboard'
|
|||
import { Dialog, Notification, toast } from '@/components/ui'
|
||||
import { APP_NAME, DX_CLASSNAMES } from '@/constants/app.constant'
|
||||
import {
|
||||
ColumnFormatDto,
|
||||
DbTypeEnum,
|
||||
EditingFormItemDto,
|
||||
GridDto,
|
||||
PlatformEditorTypes,
|
||||
SubFormTabTypeEnum,
|
||||
|
|
@ -41,12 +41,7 @@ import GridFilterDialogs from './GridFilterDialogs'
|
|||
import { GridExtraFilterToolbar } from './GridExtraFilterToolbar'
|
||||
import { ImageUploadEditorComponent } from './editors/ImageUploadEditorComponent'
|
||||
import { ImageViewerEditorComponent } from './editors/ImageViewerEditorComponent'
|
||||
import {
|
||||
extractSearchParamsFields,
|
||||
getEditingFormGroups,
|
||||
GridExtraFilterState,
|
||||
safeJsonParse,
|
||||
} from './Utils'
|
||||
import { extractSearchParamsFields, GridExtraFilterState, safeJsonParse } from './Utils'
|
||||
import { useFilters } from './useFilters'
|
||||
import { useListFormColumns } from './useListFormColumns'
|
||||
import { useListFormCustomDataSource } from './useListFormCustomDataSource'
|
||||
|
|
@ -99,7 +94,6 @@ const toCardColumn = (
|
|||
const isImageColumn =
|
||||
typeof column.cellTemplate === 'function' &&
|
||||
Object.prototype.hasOwnProperty.call(column.extras ?? {}, 'imageUploadOptions')
|
||||
const isHtmlColumn = column.colData?.editorType2 === 'dxHtmlEditor'
|
||||
|
||||
return Object.fromEntries(
|
||||
Object.entries({
|
||||
|
|
@ -145,14 +139,7 @@ const toCardColumn = (
|
|||
})
|
||||
return container
|
||||
}
|
||||
: isHtmlColumn
|
||||
? (templateOptions: any) => {
|
||||
const templateData = templateOptions?.model ?? templateOptions
|
||||
const container = document.createElement('div')
|
||||
container.innerHTML = String(templateData.field?.value ?? '')
|
||||
return container
|
||||
}
|
||||
: undefined,
|
||||
: undefined,
|
||||
format: column.format,
|
||||
headerFilter: column.headerFilter,
|
||||
lookup: column.lookup,
|
||||
|
|
@ -801,9 +788,12 @@ const CardView = (props: CardViewProps) => {
|
|||
}, [filterToolbarData, toolbarData])
|
||||
|
||||
const mapEditingFormItem = useCallback(
|
||||
(item: ColumnFormatDto) => {
|
||||
const fieldName = item.fieldName!
|
||||
const column = item
|
||||
(item: EditingFormItemDto) => {
|
||||
const fieldName = item.dataField.split(':')[0]
|
||||
const column = gridDto?.columnFormats.find(
|
||||
(candidate) => candidate.fieldName?.toLowerCase() === fieldName.toLowerCase(),
|
||||
)
|
||||
if (!column) return undefined
|
||||
if (
|
||||
mode === 'new' &&
|
||||
fieldName.toLowerCase() === gridDto?.gridOptions.keyFieldName?.toLowerCase()
|
||||
|
|
@ -823,7 +813,7 @@ const CardView = (props: CardViewProps) => {
|
|||
try {
|
||||
editorOptions = item.editorOptions ? JSON.parse(item.editorOptions) : {}
|
||||
} catch (error) {
|
||||
console.error('EditorOptions parse error:', item.fieldName, error)
|
||||
console.error('EditorOptions parse error:', item.dataField, error)
|
||||
}
|
||||
|
||||
if (column.sourceDbType === DbTypeEnum.Date) {
|
||||
|
|
@ -872,8 +862,8 @@ const CardView = (props: CardViewProps) => {
|
|||
name: fieldName,
|
||||
colSpan: item.colSpan,
|
||||
label: {
|
||||
text: item.fieldName!.includes(':')
|
||||
? item.fieldName!.split(':')[1]
|
||||
text: item.dataField.includes(':')
|
||||
? item.dataField.split(':')[1]
|
||||
: translate('::' + (column.captionName || column.fieldName)),
|
||||
},
|
||||
editorType:
|
||||
|
|
@ -898,7 +888,7 @@ const CardView = (props: CardViewProps) => {
|
|||
const editingFormItems = useMemo(() => {
|
||||
if (!gridDto || mode === 'view') return []
|
||||
|
||||
const groups = [...(getEditingFormGroups(gridDto) ?? [])].sort(
|
||||
const groups = [...(gridDto.gridOptions.editingFormDto ?? [])].sort(
|
||||
(left, right) => left.order - right.order,
|
||||
)
|
||||
const tabbedGroups = groups.filter((group) => group.itemType === 'tabbed')
|
||||
|
|
@ -906,7 +896,7 @@ const CardView = (props: CardViewProps) => {
|
|||
|
||||
groups.forEach((group) => {
|
||||
const items = [...(group.items ?? [])]
|
||||
.sort((left, right) => (left.editOrderNo ?? 0) - (right.editOrderNo ?? 0))
|
||||
.sort((left, right) => left.order - right.order)
|
||||
.map(mapEditingFormItem)
|
||||
.filter(Boolean)
|
||||
|
||||
|
|
@ -928,7 +918,7 @@ const CardView = (props: CardViewProps) => {
|
|||
title: tab.caption,
|
||||
colCount: useMobileEditPopup ? 1 : tab.colCount || 1,
|
||||
items: [...(tab.items ?? [])]
|
||||
.sort((left, right) => (left.editOrderNo ?? 0) - (right.editOrderNo ?? 0))
|
||||
.sort((left, right) => left.order - right.order)
|
||||
.map(mapEditingFormItem)
|
||||
.filter(Boolean),
|
||||
}))
|
||||
|
|
@ -1247,6 +1237,7 @@ const CardView = (props: CardViewProps) => {
|
|||
/>
|
||||
<FilterPanel
|
||||
visible={gridDto.gridOptions.filterPanelDto.visible}
|
||||
filterEnabled={gridDto.gridOptions.filterPanelDto.filterEnabled}
|
||||
texts={gridDto.gridOptions.filterPanelDto.texts}
|
||||
/>
|
||||
<HeaderFilter
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ import '@/utils/registerDevExtremeEditors'
|
|||
import { Dialog, Notification, toast } from '@/components/ui'
|
||||
import { APP_NAME, DX_CLASSNAMES } from '@/constants/app.constant'
|
||||
import {
|
||||
ColumnFormatDto,
|
||||
DbTypeEnum,
|
||||
EditingFormItemDto,
|
||||
FieldCustomValueTypeEnum,
|
||||
GridDto,
|
||||
PlatformEditorTypes,
|
||||
|
|
@ -53,8 +53,6 @@ import {
|
|||
autoNumber,
|
||||
controlStyleCondition,
|
||||
extractSearchParamsFields,
|
||||
getEditingFormFields,
|
||||
getEditingFormGroups,
|
||||
GridExtraFilterState,
|
||||
safeJsonParse,
|
||||
setFormEditingExtraItemValues,
|
||||
|
|
@ -220,6 +218,13 @@ const getActiveEditingForm = (component: any) => {
|
|||
return editForm?.getEditor || editForm?.itemOption ? editForm : undefined
|
||||
}
|
||||
|
||||
const flattenEditingFormItems = (items: any[] = []): EditingFormItemDto[] =>
|
||||
items.flatMap((item) => [
|
||||
...(item?.dataField ? [item] : []),
|
||||
...flattenEditingFormItems(item?.items || []),
|
||||
...(item?.tabs || []).flatMap((tab: any) => flattenEditingFormItems(tab?.items || [])),
|
||||
])
|
||||
|
||||
const getValueByField = (data: Record<string, any> = {}, field?: string) => {
|
||||
if (!field) return undefined
|
||||
if (Object.prototype.hasOwnProperty.call(data, field)) return data[field]
|
||||
|
|
@ -604,7 +609,7 @@ const Grid = (props: GridProps) => {
|
|||
.map((f) => f.fieldName)
|
||||
const filteredData: any = {}
|
||||
for (const key of allowedFields) {
|
||||
if (key && Object.prototype.hasOwnProperty.call(e.data, key)) {
|
||||
if (e.data.hasOwnProperty(key) && key) {
|
||||
filteredData[key] = e.data[key]
|
||||
}
|
||||
}
|
||||
|
|
@ -720,10 +725,11 @@ const Grid = (props: GridProps) => {
|
|||
const onEditorPreparing = useCallback(
|
||||
(editor: DataGridTypes.EditorPreparingEvent<any, any>) => {
|
||||
if (editor.parentType === 'dataRow' && editor.dataField && gridDto) {
|
||||
const columnFormat = gridDto.columnFormats.find(
|
||||
(column) => column.fieldName === editor.dataField,
|
||||
)
|
||||
const formItem = columnFormat?.editOrderNo != null ? columnFormat : undefined
|
||||
const formItem = gridDto.gridOptions.editingFormDto
|
||||
.flatMap((group) => flattenEditingFormItems([group]))
|
||||
.find((i) => i.dataField === editor.dataField)
|
||||
const fieldName = editor.dataField.split(':')[0]
|
||||
const columnFormat = gridDto.columnFormats.find((column) => column.fieldName === fieldName)
|
||||
const isNewRow = Boolean((editor as any).row?.isNewRow) || mode === 'new'
|
||||
|
||||
const hasReadOnlyEditorOption = editor.editorOptions?.readOnly === true
|
||||
|
|
@ -780,9 +786,9 @@ const Grid = (props: GridProps) => {
|
|||
(pf: string) => !rowData[pf],
|
||||
)
|
||||
try {
|
||||
const childFormItem = gridDto.columnFormats.find(
|
||||
(column) => column.fieldName === childFieldName,
|
||||
)
|
||||
const childFormItem = gridDto.gridOptions.editingFormDto
|
||||
.flatMap((group) => flattenEditingFormItems([group]))
|
||||
.find((i) => i.dataField === childFieldName)
|
||||
const childEditorOptions = childFormItem?.editorOptions
|
||||
? JSON.parse(childFormItem.editorOptions)
|
||||
: {}
|
||||
|
|
@ -852,7 +858,7 @@ const Grid = (props: GridProps) => {
|
|||
setFormData,
|
||||
})
|
||||
} catch (err) {
|
||||
console.error('Script exec error', formItem.fieldName, err)
|
||||
console.error('Script exec error', formItem.dataField, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1130,7 +1136,7 @@ const Grid = (props: GridProps) => {
|
|||
|
||||
// Form items mapper'ı memoize et - popup açılışını hızlandırır
|
||||
const mapFormItem = useCallback(
|
||||
(i: ColumnFormatDto) => {
|
||||
(i: EditingFormItemDto) => {
|
||||
let editorOptions: EditorOptionsWithButtons = {}
|
||||
let parsedEditorOptions: EditorOptionsWithButtons = {}
|
||||
const forcedEditorOptions: EditorOptionsWithButtons = {}
|
||||
|
|
@ -1142,10 +1148,10 @@ const Grid = (props: GridProps) => {
|
|||
const parsed = JSON.parse(rawFilter)
|
||||
const filters = extractSearchParamsFields(parsed)
|
||||
|
||||
const hasFilter = filters.some(([field]) => field === i.fieldName)
|
||||
const hasFilter = filters.some(([field]) => field === i.dataField)
|
||||
|
||||
if (hasFilter) {
|
||||
const existsInExtra = extraFilters.some((f) => f.fieldName === i.fieldName && !!f.value)
|
||||
const existsInExtra = extraFilters.some((f) => f.fieldName === i.dataField && !!f.value)
|
||||
|
||||
if (!existsInExtra) {
|
||||
forcedEditorOptions.readOnly = true
|
||||
|
|
@ -1153,11 +1159,11 @@ const Grid = (props: GridProps) => {
|
|||
}
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('EditorOptions parse error:', i.fieldName, err)
|
||||
console.error('EditorOptions parse error:', i.dataField, err)
|
||||
}
|
||||
|
||||
const fieldName = i.fieldName!
|
||||
const listFormField = i
|
||||
const fieldName = i.dataField.split(':')[0]
|
||||
const listFormField = gridDto?.columnFormats.find((x: any) => x.fieldName === fieldName)
|
||||
|
||||
const defaultEditorOptions: EditorOptionsWithButtons = {}
|
||||
|
||||
|
|
@ -1215,8 +1221,8 @@ const Grid = (props: GridProps) => {
|
|||
canExport: listFormField?.canExport ?? false,
|
||||
allowEditing: listFormField?.allowEditing ?? true,
|
||||
allowAdding: listFormField?.allowAdding ?? true,
|
||||
dataField: i.fieldName,
|
||||
name: i.fieldName,
|
||||
dataField: i.dataField,
|
||||
name: i.dataField,
|
||||
editorType2: i.editorType2,
|
||||
editorType:
|
||||
i.editorType2 == PlatformEditorTypes.dxGridBox
|
||||
|
|
@ -1234,12 +1240,12 @@ const Grid = (props: GridProps) => {
|
|||
item.template = 'cellEditImageViewer'
|
||||
item.editorOptions = {
|
||||
...item.editorOptions,
|
||||
value: getValueByField(editingFormDataRef.current, i.fieldName),
|
||||
value: getValueByField(editingFormDataRef.current, i.dataField),
|
||||
}
|
||||
}
|
||||
|
||||
if (i.fieldName?.indexOf(':') >= 0) {
|
||||
item.label = { text: captionize(i.fieldName.split(':')[1]) }
|
||||
if (i.dataField.indexOf(':') >= 0) {
|
||||
item.label = { text: captionize(i.dataField.split(':')[1]) }
|
||||
}
|
||||
|
||||
if ((mode == 'edit' && !item.canUpdate) || (mode == 'new' && !item.canCreate)) {
|
||||
|
|
@ -1608,7 +1614,9 @@ const Grid = (props: GridProps) => {
|
|||
}
|
||||
|
||||
const runReadOnlyScripts = () => {
|
||||
const formItems = getEditingFormFields(gridDto)
|
||||
const formItems = gridDto.gridOptions.editingFormDto.flatMap((group) =>
|
||||
flattenEditingFormItems([group]),
|
||||
)
|
||||
const scriptItems = formItems.filter((formItem) =>
|
||||
shouldRunEditorScriptOnContentReady(formItem.editorScript),
|
||||
)
|
||||
|
|
@ -1619,9 +1627,9 @@ const Grid = (props: GridProps) => {
|
|||
|
||||
const editorValues = formItems.reduce<Record<string, any>>(
|
||||
(values, formItem) => {
|
||||
const editorInstance = form?.getEditor?.(formItem.fieldName)
|
||||
const editorInstance = form?.getEditor?.(formItem.dataField)
|
||||
if (editorInstance?.option) {
|
||||
values[formItem.fieldName!] = editorInstance.option('value')
|
||||
values[formItem.dataField] = editorInstance.option('value')
|
||||
}
|
||||
return values
|
||||
},
|
||||
|
|
@ -1636,17 +1644,17 @@ const Grid = (props: GridProps) => {
|
|||
|
||||
scriptItems.forEach((formItem) => {
|
||||
try {
|
||||
const editorInstance = form?.getEditor?.(formItem.fieldName)
|
||||
const editorInstance = form?.getEditor?.(formItem.dataField)
|
||||
const editorValue =
|
||||
editorInstance?.option?.('value') ??
|
||||
getValueByField(formData, formItem.fieldName)
|
||||
getValueByField(formData, formItem.dataField)
|
||||
const editor = {
|
||||
dataField: formItem.fieldName,
|
||||
dataField: formItem.dataField,
|
||||
component: grid,
|
||||
}
|
||||
const e = {
|
||||
component: form,
|
||||
dataField: formItem.fieldName,
|
||||
dataField: formItem.dataField,
|
||||
scriptEvent: 'contentReady',
|
||||
value: editorValue,
|
||||
}
|
||||
|
|
@ -1661,7 +1669,7 @@ const Grid = (props: GridProps) => {
|
|||
} catch (err) {
|
||||
console.error(
|
||||
'Script exec error on contentReady',
|
||||
formItem.fieldName!,
|
||||
formItem.dataField,
|
||||
err,
|
||||
)
|
||||
}
|
||||
|
|
@ -1677,10 +1685,11 @@ const Grid = (props: GridProps) => {
|
|||
...(e.component?.option?.('formData') || {}),
|
||||
}
|
||||
|
||||
const formItem = getEditingFormFields(gridDto)
|
||||
const formItem = gridDto.gridOptions.editingFormDto
|
||||
.flatMap((group) => flattenEditingFormItems([group]))
|
||||
.find(
|
||||
(i) =>
|
||||
String(i.fieldName || '').toLowerCase() ===
|
||||
String(i.dataField || '').toLowerCase() ===
|
||||
String(e.dataField || '').toLowerCase(),
|
||||
)
|
||||
if (formItem?.editorScript) {
|
||||
|
|
@ -1723,9 +1732,9 @@ const Grid = (props: GridProps) => {
|
|||
}
|
||||
},
|
||||
items:
|
||||
getEditingFormGroups(gridDto)?.length > 0
|
||||
gridDto.gridOptions.editingFormDto?.length > 0
|
||||
? (() => {
|
||||
const sortedFormDto = getEditingFormGroups(gridDto)
|
||||
const sortedFormDto = gridDto.gridOptions.editingFormDto
|
||||
.slice()
|
||||
.sort((a: any, b: any) => (a.order >= b.order ? 1 : -1))
|
||||
|
||||
|
|
@ -1747,9 +1756,7 @@ const Grid = (props: GridProps) => {
|
|||
colSpan: effectiveColSpan,
|
||||
caption: e.caption, // Group'larda caption olmalı
|
||||
items: e.items
|
||||
?.sort((a: any, b: any) =>
|
||||
(a.editOrderNo ?? 0) >= (b.editOrderNo ?? 0) ? 1 : -1,
|
||||
)
|
||||
?.sort((a: any, b: any) => (a.order >= b.order ? 1 : -1))
|
||||
.map(mapFormItem)
|
||||
.filter((a: any) => {
|
||||
if (mode === 'view') {
|
||||
|
|
@ -1778,9 +1785,7 @@ const Grid = (props: GridProps) => {
|
|||
title: tabbedItem.caption, // Her tab'ın title'ı
|
||||
colCount: effectiveColCount,
|
||||
items: tabbedItem.items
|
||||
?.sort((a: any, b: any) =>
|
||||
(a.editOrderNo ?? 0) >= (b.editOrderNo ?? 0) ? 1 : -1,
|
||||
)
|
||||
?.sort((a: any, b: any) => (a.order >= b.order ? 1 : -1))
|
||||
.map(mapFormItem)
|
||||
.filter((a: any) => {
|
||||
if (mode === 'view') {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ interface IGridColumnData extends DataGridTypes.Column {
|
|||
colData?: ColumnFormatDto
|
||||
extras?: {
|
||||
multiValue: boolean
|
||||
editorOptions?: Record<string, any>
|
||||
editorOptions?: string
|
||||
tagBoxOptions?: TagBoxOptionsDto
|
||||
gridBoxOptions?: GridBoxOptionsDto
|
||||
imageUploadOptions?: ImageUploadOptionsDto
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import React, { useState } from 'react'
|
||||
import { useState } from 'react'
|
||||
import { GridExtraFilterState } from './Utils'
|
||||
import { useLocalization } from '@/utils/hooks/useLocalization'
|
||||
|
||||
|
|
|
|||
|
|
@ -179,7 +179,6 @@ const List: React.FC = () => {
|
|||
variant={viewMode === 'todo' ? 'solid' : 'default'}
|
||||
onClick={() => setLayout('todo')}
|
||||
onMouseEnter={() => preload.todo()}
|
||||
title={translate('::ListForms.ListFormEdit.TabTodo')}
|
||||
/>
|
||||
)}
|
||||
{gridDto?.gridOptions?.layoutDto.scheduler &&
|
||||
|
|
@ -191,7 +190,6 @@ const List: React.FC = () => {
|
|||
variant={viewMode === 'scheduler' ? 'solid' : 'default'}
|
||||
onClick={() => setLayout('scheduler')}
|
||||
onMouseEnter={() => preload.scheduler()}
|
||||
title={translate('::ListForms.ListFormEdit.TabScheduler')}
|
||||
></Button>
|
||||
)}
|
||||
|
||||
|
|
@ -204,7 +202,6 @@ const List: React.FC = () => {
|
|||
variant={viewMode === 'gantt' ? 'solid' : 'default'}
|
||||
onClick={() => setLayout('gantt')}
|
||||
onMouseEnter={() => preload.gantt()}
|
||||
title={translate('::ListForms.ListFormEdit.TabGantt')}
|
||||
></Button>
|
||||
)}
|
||||
|
||||
|
|
@ -216,7 +213,6 @@ const List: React.FC = () => {
|
|||
variant={viewMode === 'tree' ? 'solid' : 'default'}
|
||||
onClick={() => setLayout('tree')}
|
||||
onMouseEnter={() => preload.tree()}
|
||||
title={translate('::ListForms.ListFormEdit.TabTree')}
|
||||
></Button>
|
||||
)}
|
||||
|
||||
|
|
@ -226,7 +222,6 @@ const List: React.FC = () => {
|
|||
variant={viewMode === 'grid' ? 'solid' : 'default'}
|
||||
onClick={() => setLayout('grid')}
|
||||
onMouseEnter={() => preload.grid()}
|
||||
title={translate('::ListForms.ListFormEdit.TabGrid')}
|
||||
></Button>
|
||||
|
||||
{gridDto.gridOptions.layoutDto.card && (
|
||||
|
|
@ -236,7 +231,6 @@ const List: React.FC = () => {
|
|||
variant={viewMode === 'card' ? 'solid' : 'default'}
|
||||
onClick={() => setLayout('card')}
|
||||
onMouseEnter={() => preload.card()}
|
||||
title={translate('::ListForms.ListFormEdit.TabCard')}
|
||||
></Button>
|
||||
)}
|
||||
|
||||
|
|
@ -247,7 +241,6 @@ const List: React.FC = () => {
|
|||
variant={viewMode === 'pivot' ? 'solid' : 'default'}
|
||||
onClick={() => setLayout('pivot')}
|
||||
onMouseEnter={() => preload.pivot()}
|
||||
title={translate('::ListForms.ListFormEdit.TabPivot')}
|
||||
></Button>
|
||||
)}
|
||||
|
||||
|
|
@ -258,7 +251,6 @@ const List: React.FC = () => {
|
|||
variant={viewMode === 'chart' ? 'solid' : 'default'}
|
||||
onClick={() => setLayout('chart')}
|
||||
onMouseEnter={() => preload.chart()}
|
||||
title={translate('::ListForms.ListFormEdit.TabChart')}
|
||||
></Button>
|
||||
)}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -2,11 +2,11 @@ import Container from '@/components/shared/Container'
|
|||
import '@/utils/registerDevExtremeEditors'
|
||||
import { APP_NAME, DX_CLASSNAMES } from '@/constants/app.constant'
|
||||
import {
|
||||
ColumnFormatDto,
|
||||
DbTypeEnum,
|
||||
GridDto,
|
||||
PlatformEditorTypes,
|
||||
UiLookupDataSourceTypeEnum,
|
||||
EditingFormItemDto,
|
||||
} from '@/proxy/form/models'
|
||||
import { useLocalization } from '@/utils/hooks/useLocalization'
|
||||
import Scheduler, {
|
||||
|
|
@ -21,12 +21,7 @@ import { useCallback, useEffect, useRef, useState } from 'react'
|
|||
import { Helmet } from 'react-helmet'
|
||||
import { getList } from '@/services/form.service'
|
||||
import { useListFormCustomDataSource } from './useListFormCustomDataSource'
|
||||
import {
|
||||
addCss,
|
||||
addJs,
|
||||
autoNumber,
|
||||
getEditingFormGroups,
|
||||
} from './Utils'
|
||||
import { addCss, addJs, autoNumber } from './Utils'
|
||||
import { layoutTypes } from '../admin/listForm/edit/types'
|
||||
import WidgetGroup from '@/components/ui/Widget/WidgetGroup'
|
||||
import { ROUTES_ENUM } from '@/routes/route.constant'
|
||||
|
|
@ -294,11 +289,11 @@ const SchedulerView = (props: SchedulerViewProps) => {
|
|||
},
|
||||
])
|
||||
|
||||
// Grup düzenini EditingFormDto'dan, alanları ColumnFormatDto'dan oluştur.
|
||||
// EditingFormDto'dan form items oluştur
|
||||
const result: any[] = []
|
||||
|
||||
if (getEditingFormGroups(gridDto)?.length > 0) {
|
||||
const sortedFormDto = getEditingFormGroups(gridDto)
|
||||
if (gridDto.gridOptions.editingFormDto?.length > 0) {
|
||||
const sortedFormDto = gridDto.gridOptions.editingFormDto
|
||||
.slice()
|
||||
.sort((a: any, b: any) => (a.order >= b.order ? 1 : -1))
|
||||
|
||||
|
|
@ -306,7 +301,7 @@ const SchedulerView = (props: SchedulerViewProps) => {
|
|||
const tabbedItems = sortedFormDto.filter((e: any) => e.itemType === 'tabbed')
|
||||
|
||||
// Ortak item mapper fonksiyonu - hem group hem tab için kullanılır
|
||||
const mapFormItem = (i: ColumnFormatDto) => {
|
||||
const mapFormItem = (i: EditingFormItemDto) => {
|
||||
let editorOptions: any = {}
|
||||
try {
|
||||
if (i.editorOptions) {
|
||||
|
|
@ -316,8 +311,8 @@ const SchedulerView = (props: SchedulerViewProps) => {
|
|||
console.log(err)
|
||||
}
|
||||
|
||||
const fieldName = i.fieldName!
|
||||
const listFormField = i
|
||||
const fieldName = i.dataField.split(':')[0]
|
||||
const listFormField = gridDto.columnFormats.find((x: any) => x.fieldName === fieldName)
|
||||
|
||||
if (listFormField?.sourceDbType === DbTypeEnum.Date) {
|
||||
editorOptions = {
|
||||
|
|
@ -356,7 +351,7 @@ const SchedulerView = (props: SchedulerViewProps) => {
|
|||
}
|
||||
|
||||
// EditorType belirleme
|
||||
let editorType: any = i.editorType2
|
||||
let editorType: any = i.editorType2 || i.editorType
|
||||
if (i.editorType2 === PlatformEditorTypes.dxGridBox) {
|
||||
editorType = 'dxDropDownBox'
|
||||
} else if (i.editorType2) {
|
||||
|
|
@ -414,8 +409,8 @@ const SchedulerView = (props: SchedulerViewProps) => {
|
|||
canExport: listFormField?.canExport ?? false,
|
||||
allowEditing: listFormField?.allowEditing ?? true,
|
||||
allowAdding: listFormField?.allowAdding ?? true,
|
||||
dataField: i.fieldName,
|
||||
name: i.fieldName,
|
||||
dataField: i.dataField,
|
||||
name: i.dataField,
|
||||
editorType2: i.editorType2,
|
||||
editorType:
|
||||
i.editorType2 == PlatformEditorTypes.dxGridBox
|
||||
|
|
@ -429,8 +424,8 @@ const SchedulerView = (props: SchedulerViewProps) => {
|
|||
editorScript: i.editorScript,
|
||||
}
|
||||
|
||||
if (i.fieldName?.indexOf(':') >= 0) {
|
||||
item.label = { text: captionize(i.fieldName.split(':')[1]) }
|
||||
if (i.dataField.indexOf(':') >= 0) {
|
||||
item.label = { text: captionize(i.dataField.split(':')[1]) }
|
||||
}
|
||||
|
||||
if (
|
||||
|
|
@ -450,9 +445,7 @@ const SchedulerView = (props: SchedulerViewProps) => {
|
|||
// Items'ları da order'a göre sırala
|
||||
const sortedItems = (e.items || [])
|
||||
.slice()
|
||||
.sort((a: any, b: any) =>
|
||||
(a.editOrderNo ?? 0) >= (b.editOrderNo ?? 0) ? 1 : -1,
|
||||
)
|
||||
.sort((a: any, b: any) => (a.order >= b.order ? 1 : -1))
|
||||
|
||||
const groupItems = sortedItems.map(mapFormItem)
|
||||
|
||||
|
|
@ -474,9 +467,7 @@ const SchedulerView = (props: SchedulerViewProps) => {
|
|||
title: tabbedItem.caption, // Her tab'ın title'ı
|
||||
colCount: effectiveColCount,
|
||||
items: tabbedItem.items
|
||||
?.sort((a: any, b: any) =>
|
||||
(a.editOrderNo ?? 0) >= (b.editOrderNo ?? 0) ? 1 : -1,
|
||||
)
|
||||
?.sort((a: any, b: any) => (a.order >= b.order ? 1 : -1))
|
||||
.map(mapFormItem)
|
||||
.filter((a: any) => {
|
||||
if (currentMode === 'new') {
|
||||
|
|
@ -499,11 +490,11 @@ const SchedulerView = (props: SchedulerViewProps) => {
|
|||
// Form'u tamamen yeniden baştan yapılandır
|
||||
e.form.option(
|
||||
'colCount',
|
||||
hasTabbedItems ? 1 : getEditingFormGroups(gridDto)?.[0]?.colCount || 2,
|
||||
hasTabbedItems ? 1 : gridDto.gridOptions.editingFormDto?.[0]?.colCount || 2,
|
||||
)
|
||||
e.form.option(
|
||||
'colCount',
|
||||
hasTabbedItems ? 1 : getEditingFormGroups(gridDto)?.[0]?.colCount || 2,
|
||||
hasTabbedItems ? 1 : gridDto.gridOptions.editingFormDto?.[0]?.colCount || 2,
|
||||
)
|
||||
e.form.option('showValidationSummary', false)
|
||||
e.form.option('items', result)
|
||||
|
|
|
|||
|
|
@ -2,17 +2,8 @@ import type { GridDto, TodoOptionDto } from '@/proxy/form/models'
|
|||
import type { IdentityUserDto } from '@/proxy/admin/models'
|
||||
import type { DataGridRef } from 'devextreme-react/data-grid'
|
||||
import type CustomStore from 'devextreme/data/custom_store'
|
||||
import { HtmlEditor, ImageUpload, Item, MediaResizing, Toolbar } from 'devextreme-react/html-editor'
|
||||
import TagBox from 'devextreme-react/tag-box'
|
||||
import { AVATAR_URL } from '@/constants/app.constant'
|
||||
import {
|
||||
fontFamilyOptions,
|
||||
fontSizeOptions,
|
||||
fontValues,
|
||||
headerOptions,
|
||||
headerValues,
|
||||
sizeValues,
|
||||
} from '@/proxy/reports/data'
|
||||
import dayjs from 'dayjs'
|
||||
import relativeTime from 'dayjs/plugin/relativeTime'
|
||||
import { Fragment, useCallback, useEffect, useMemo, useRef, useState } from 'react'
|
||||
|
|
@ -69,16 +60,6 @@ interface UserOption {
|
|||
|
||||
const fieldValue = (row: TodoRow, field?: string) => (field ? row[field] : undefined)
|
||||
|
||||
const htmlToPlainText = (value: unknown) => {
|
||||
const html = String(value ?? '')
|
||||
if (!html) return ''
|
||||
if (typeof document === 'undefined') return html.replace(/<[^>]*>/g, ' ')
|
||||
|
||||
const container = document.createElement('div')
|
||||
container.innerHTML = html
|
||||
return (container.textContent ?? '').replace(/\s+/g, ' ').trim()
|
||||
}
|
||||
|
||||
const textList = (value: unknown) =>
|
||||
Array.isArray(value)
|
||||
? value.map(String)
|
||||
|
|
@ -701,51 +682,18 @@ const TodoBoard = ({ listFormCode, searchParams, gridDto }: TodoBoardProps) => {
|
|||
<label className={labelClass}>
|
||||
{translate('::ListForms.TodoBoard.Description')}
|
||||
</label>
|
||||
<HtmlEditor
|
||||
height={220}
|
||||
<textarea
|
||||
className={`${inputClass} min-h-36 resize-y`}
|
||||
disabled={!canEdit}
|
||||
placeholder={translate('::ListForms.TodoBoard.DescriptionPlaceholder')}
|
||||
readOnly={!canEdit}
|
||||
value={String(draft[options.descriptionExpr] ?? '')}
|
||||
onValueChanged={(event) =>
|
||||
onChange={(event) =>
|
||||
setDraft((current) => ({
|
||||
...current,
|
||||
[options.descriptionExpr!]: event.value,
|
||||
[options.descriptionExpr!]: event.target.value,
|
||||
}))
|
||||
}
|
||||
>
|
||||
<MediaResizing enabled={true} />
|
||||
<ImageUpload fileUploadMode="base64" />
|
||||
<Toolbar multiline>
|
||||
<Item name="undo" />
|
||||
<Item name="redo" />
|
||||
<Item name="separator" />
|
||||
<Item name="size" acceptedValues={sizeValues} options={fontSizeOptions} />
|
||||
<Item name="font" acceptedValues={fontValues} options={fontFamilyOptions} />
|
||||
<Item name="separator" />
|
||||
<Item name="bold" />
|
||||
<Item name="italic" />
|
||||
<Item name="underline" />
|
||||
<Item name="strike" />
|
||||
<Item name="separator" />
|
||||
<Item name="orderedList" />
|
||||
<Item name="bulletList" />
|
||||
<Item name="separator" />
|
||||
<Item name="header" acceptedValues={headerValues} options={headerOptions} />
|
||||
<Item name="separator" />
|
||||
<Item name="color" />
|
||||
<Item name="background" />
|
||||
<Item name="separator" />
|
||||
<Item name="alignLeft" />
|
||||
<Item name="alignCenter" />
|
||||
<Item name="alignRight" />
|
||||
<Item name="alignJustify" />
|
||||
<Item name="separator" />
|
||||
<Item name="link" />
|
||||
<Item name="image" />
|
||||
<Item name="separator" />
|
||||
<Item name="clear" />
|
||||
</Toolbar>
|
||||
</HtmlEditor>
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
<div className="grid gap-4 sm:grid-cols-2">
|
||||
|
|
@ -1024,9 +972,9 @@ const TodoBoard = ({ listFormCode, searchParams, gridDto }: TodoBoardProps) => {
|
|||
</form>
|
||||
) : (
|
||||
<>
|
||||
<h4 className="min-w-0 truncate font-sm" title={status}>
|
||||
<h3 className="min-w-0 truncate font-semibold" title={status}>
|
||||
{status}
|
||||
</h4>
|
||||
</h3>
|
||||
<button
|
||||
type="button"
|
||||
className="rounded p-1 text-gray-400 opacity-0 transition hover:bg-gray-200 hover:text-blue-600 group-hover:opacity-100 dark:hover:bg-gray-700"
|
||||
|
|
@ -1204,7 +1152,7 @@ const TodoBoard = ({ listFormCode, searchParams, gridDto }: TodoBoardProps) => {
|
|||
</div>
|
||||
{fieldValue(row, options.descriptionExpr) && (
|
||||
<p className="mt-1 line-clamp-2 text-xs leading-5 text-gray-500 dark:text-gray-400">
|
||||
{htmlToPlainText(fieldValue(row, options.descriptionExpr))}
|
||||
{String(fieldValue(row, options.descriptionExpr))}
|
||||
</p>
|
||||
)}
|
||||
{due && (
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ import { Dialog, Notification, toast } from '@/components/ui'
|
|||
import { APP_NAME, DX_CLASSNAMES } from '@/constants/app.constant'
|
||||
import { executeEditorScript } from '@/utils/editorScriptRuntime'
|
||||
import {
|
||||
ColumnFormatDto,
|
||||
DbTypeEnum,
|
||||
EditingFormItemDto,
|
||||
GridDto,
|
||||
PlatformEditorTypes,
|
||||
SubFormTabTypeEnum,
|
||||
|
|
@ -44,8 +44,6 @@ import {
|
|||
addJs,
|
||||
autoNumber,
|
||||
controlStyleCondition,
|
||||
getEditingFormFields,
|
||||
getEditingFormGroups,
|
||||
GridExtraFilterState,
|
||||
safeJsonParse,
|
||||
setFormEditingExtraItemValues,
|
||||
|
|
@ -208,6 +206,13 @@ const getActiveEditingForm = (component: any) => {
|
|||
return editForm?.getEditor || editForm?.itemOption ? editForm : undefined
|
||||
}
|
||||
|
||||
const flattenEditingFormItems = (items: any[] = []): EditingFormItemDto[] =>
|
||||
items.flatMap((item) => [
|
||||
...(item?.dataField ? [item] : []),
|
||||
...flattenEditingFormItems(item?.items || []),
|
||||
...(item?.tabs || []).flatMap((tab: any) => flattenEditingFormItems(tab?.items || [])),
|
||||
])
|
||||
|
||||
const getValueByField = (data: Record<string, any> = {}, field?: string) => {
|
||||
if (!field) return undefined
|
||||
if (Object.prototype.hasOwnProperty.call(data, field)) return data[field]
|
||||
|
|
@ -659,10 +664,11 @@ const Tree = (props: TreeProps) => {
|
|||
|
||||
function onEditorPreparing(editor: TreeListTypes.EditorPreparingEvent) {
|
||||
if (editor.parentType === 'dataRow' && editor.dataField && gridDto) {
|
||||
const columnFormat = gridDto.columnFormats.find(
|
||||
(column) => column.fieldName === editor.dataField,
|
||||
)
|
||||
const formItem = columnFormat?.editOrderNo != null ? columnFormat : undefined
|
||||
const formItem = gridDto.gridOptions.editingFormDto
|
||||
.flatMap((group) => flattenEditingFormItems([group]))
|
||||
.find((i) => i.dataField === editor.dataField)
|
||||
const fieldName = editor.dataField.split(':')[0]
|
||||
const columnFormat = gridDto.columnFormats.find((column) => column.fieldName === fieldName)
|
||||
const isNewRow = Boolean((editor as any).row?.isNewRow) || mode === 'new'
|
||||
|
||||
const hasReadOnlyEditorOption = editor.editorOptions?.readOnly === true
|
||||
|
|
@ -683,7 +689,7 @@ const Tree = (props: TreeProps) => {
|
|||
}
|
||||
|
||||
// Cascade disabled mantığı
|
||||
const colFormat = columnFormat
|
||||
const colFormat = gridDto.columnFormats.find((c) => c.fieldName === editor.dataField)
|
||||
if (colFormat?.lookupDto?.cascadeParentFields) {
|
||||
const parentFields = colFormat.lookupDto.cascadeParentFields
|
||||
.split(',')
|
||||
|
|
@ -727,8 +733,11 @@ const Tree = (props: TreeProps) => {
|
|||
try {
|
||||
const editorInstance = formInstance.getEditor(col.fieldName!)
|
||||
if (editorInstance) {
|
||||
const editorOptions = col.editorOptions
|
||||
? JSON.parse(col.editorOptions)
|
||||
const formItem = gridDto.gridOptions.editingFormDto
|
||||
.flatMap((group) => flattenEditingFormItems([group]))
|
||||
.find((i) => i.dataField === col.fieldName)
|
||||
const editorOptions = formItem?.editorOptions
|
||||
? JSON.parse(formItem.editorOptions)
|
||||
: {}
|
||||
|
||||
editorInstance.option(
|
||||
|
|
@ -795,7 +804,7 @@ const Tree = (props: TreeProps) => {
|
|||
setFormData,
|
||||
})
|
||||
} catch (err) {
|
||||
console.error('Script exec error', formItem.fieldName, err)
|
||||
console.error('Script exec error', formItem.dataField, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1260,7 +1269,9 @@ const Tree = (props: TreeProps) => {
|
|||
}
|
||||
|
||||
const runReadOnlyScripts = () => {
|
||||
const formItems = getEditingFormFields(gridDto)
|
||||
const formItems = gridDto.gridOptions.editingFormDto.flatMap((group) =>
|
||||
flattenEditingFormItems([group]),
|
||||
)
|
||||
const scriptItems = formItems.filter((formItem) =>
|
||||
shouldRunEditorScriptOnContentReady(formItem.editorScript),
|
||||
)
|
||||
|
|
@ -1271,9 +1282,9 @@ const Tree = (props: TreeProps) => {
|
|||
|
||||
const editorValues = formItems.reduce<Record<string, any>>(
|
||||
(values, formItem) => {
|
||||
const editorInstance = form?.getEditor?.(formItem.fieldName)
|
||||
const editorInstance = form?.getEditor?.(formItem.dataField)
|
||||
if (editorInstance?.option) {
|
||||
values[formItem.fieldName!] = editorInstance.option('value')
|
||||
values[formItem.dataField] = editorInstance.option('value')
|
||||
}
|
||||
return values
|
||||
},
|
||||
|
|
@ -1288,17 +1299,17 @@ const Tree = (props: TreeProps) => {
|
|||
|
||||
scriptItems.forEach((formItem) => {
|
||||
try {
|
||||
const editorInstance = form?.getEditor?.(formItem.fieldName)
|
||||
const editorInstance = form?.getEditor?.(formItem.dataField)
|
||||
const editorValue =
|
||||
editorInstance?.option?.('value') ??
|
||||
getValueByField(formData, formItem.fieldName)
|
||||
getValueByField(formData, formItem.dataField)
|
||||
const editor = {
|
||||
dataField: formItem.fieldName,
|
||||
dataField: formItem.dataField,
|
||||
component: grid,
|
||||
}
|
||||
const e = {
|
||||
component: form,
|
||||
dataField: formItem.fieldName,
|
||||
dataField: formItem.dataField,
|
||||
scriptEvent: 'contentReady',
|
||||
value: editorValue,
|
||||
}
|
||||
|
|
@ -1313,7 +1324,7 @@ const Tree = (props: TreeProps) => {
|
|||
} catch (err) {
|
||||
console.error(
|
||||
'Script exec error on contentReady',
|
||||
formItem.fieldName!,
|
||||
formItem.dataField,
|
||||
err,
|
||||
)
|
||||
}
|
||||
|
|
@ -1329,10 +1340,11 @@ const Tree = (props: TreeProps) => {
|
|||
...(e.component?.option?.('formData') || {}),
|
||||
}
|
||||
|
||||
const formItem = getEditingFormFields(gridDto)
|
||||
const formItem = gridDto.gridOptions.editingFormDto
|
||||
.flatMap((group) => flattenEditingFormItems([group]))
|
||||
.find(
|
||||
(i) =>
|
||||
String(i.fieldName || '').toLowerCase() ===
|
||||
String(i.dataField || '').toLowerCase() ===
|
||||
String(e.dataField || '').toLowerCase(),
|
||||
)
|
||||
if (formItem?.editorScript) {
|
||||
|
|
@ -1375,9 +1387,9 @@ const Tree = (props: TreeProps) => {
|
|||
}
|
||||
},
|
||||
items:
|
||||
getEditingFormGroups(gridDto)?.length > 0
|
||||
gridDto.gridOptions.editingFormDto?.length > 0
|
||||
? (() => {
|
||||
const sortedFormDto = getEditingFormGroups(gridDto)
|
||||
const sortedFormDto = gridDto.gridOptions.editingFormDto
|
||||
.slice()
|
||||
.sort((a: any, b: any) => (a.order >= b.order ? 1 : -1))
|
||||
|
||||
|
|
@ -1388,7 +1400,7 @@ const Tree = (props: TreeProps) => {
|
|||
const result: any[] = []
|
||||
|
||||
// Helper function: item mapper
|
||||
const mapFormItem = (i: ColumnFormatDto) => {
|
||||
const mapFormItem = (i: EditingFormItemDto) => {
|
||||
let editorOptions: EditorOptionsWithButtons = {}
|
||||
let parsedEditorOptions: EditorOptionsWithButtons = {}
|
||||
const forcedEditorOptions: EditorOptionsWithButtons = {}
|
||||
|
|
@ -1403,12 +1415,12 @@ const Tree = (props: TreeProps) => {
|
|||
const filters = extractSearchParamsFields(parsed)
|
||||
|
||||
const hasFilter = filters.some(
|
||||
([field, op, val]) => field === i.fieldName,
|
||||
([field, op, val]) => field === i.dataField,
|
||||
)
|
||||
|
||||
if (hasFilter) {
|
||||
const existsInExtra = extraFilters.some(
|
||||
(f) => f.fieldName === i.fieldName && !!f.value,
|
||||
(f) => f.fieldName === i.dataField && !!f.value,
|
||||
)
|
||||
|
||||
if (!existsInExtra) {
|
||||
|
|
@ -1417,11 +1429,13 @@ const Tree = (props: TreeProps) => {
|
|||
}
|
||||
}
|
||||
} catch (err){
|
||||
console.error('EditorOptions parse error:', i.fieldName, err)
|
||||
console.error('EditorOptions parse error:', i.dataField, err)
|
||||
}
|
||||
|
||||
const fieldName = i.fieldName!
|
||||
const listFormField = i
|
||||
const fieldName = i.dataField.split(':')[0]
|
||||
const listFormField = gridDto.columnFormats.find(
|
||||
(x: any) => x.fieldName === fieldName,
|
||||
)
|
||||
|
||||
const defaultEditorOptions: EditorOptionsWithButtons = {}
|
||||
|
||||
|
|
@ -1470,8 +1484,8 @@ const Tree = (props: TreeProps) => {
|
|||
canExport: listFormField?.canExport ?? false,
|
||||
allowEditing: listFormField?.allowEditing ?? true,
|
||||
allowAdding: listFormField?.allowAdding ?? true,
|
||||
dataField: i.fieldName,
|
||||
name: i.fieldName,
|
||||
dataField: i.dataField,
|
||||
name: i.dataField,
|
||||
editorType2: i.editorType2,
|
||||
editorType:
|
||||
i.editorType2 == PlatformEditorTypes.dxGridBox
|
||||
|
|
@ -1489,12 +1503,12 @@ const Tree = (props: TreeProps) => {
|
|||
item.template = 'cellEditImageViewer'
|
||||
item.editorOptions = {
|
||||
...item.editorOptions,
|
||||
value: getValueByField(editingFormDataRef.current, i.fieldName),
|
||||
value: getValueByField(editingFormDataRef.current, i.dataField),
|
||||
}
|
||||
}
|
||||
|
||||
if (i.fieldName?.indexOf(':') >= 0) {
|
||||
item.label = { text: captionize(i.fieldName.split(':')[1]) }
|
||||
if (i.dataField.indexOf(':') >= 0) {
|
||||
item.label = { text: captionize(i.dataField.split(':')[1]) }
|
||||
}
|
||||
|
||||
if (
|
||||
|
|
@ -1518,9 +1532,7 @@ const Tree = (props: TreeProps) => {
|
|||
colSpan: e.colSpan,
|
||||
caption: e.caption, // Group'larda caption olmalı
|
||||
items: e.items
|
||||
?.sort((a: any, b: any) =>
|
||||
(a.editOrderNo ?? 0) >= (b.editOrderNo ?? 0) ? 1 : -1,
|
||||
)
|
||||
?.sort((a: any, b: any) => (a.order >= b.order ? 1 : -1))
|
||||
.map(mapFormItem)
|
||||
.filter((a: any) => {
|
||||
if (mode === 'view') {
|
||||
|
|
@ -1549,9 +1561,7 @@ const Tree = (props: TreeProps) => {
|
|||
title: tabbedItem.caption, // Her tab'ın title'ı
|
||||
colCount: effectiveColCount,
|
||||
items: tabbedItem.items
|
||||
?.sort((a: any, b: any) =>
|
||||
(a.editOrderNo ?? 0) >= (b.editOrderNo ?? 0) ? 1 : -1,
|
||||
)
|
||||
?.sort((a: any, b: any) => (a.order >= b.order ? 1 : -1))
|
||||
.map(mapFormItem)
|
||||
.filter((a: any) => {
|
||||
if (mode === 'view') {
|
||||
|
|
|
|||
|
|
@ -2,24 +2,6 @@ import type { DataType } from 'devextreme/common'
|
|||
import type { PivotGridDataType } from 'devextreme/ui/pivot_grid/data_source'
|
||||
import { MULTIVALUE_DELIMITER } from '../../constants/app.constant'
|
||||
import { ChartSeriesDto } from '@/proxy/admin/charts/models'
|
||||
import type { GridDto } from '@/proxy/form/models'
|
||||
|
||||
/** EditingFormDto gruplarını ColumnFormatDto alanlarıyla DevExtreme için birleştirir. */
|
||||
export const getEditingFormFields = (gridDto: GridDto) =>
|
||||
gridDto.columnFormats
|
||||
.filter((field) => field.editOrderNo != null && field.fieldName)
|
||||
.sort((left, right) => left.editOrderNo! - right.editOrderNo!)
|
||||
|
||||
export const getEditingFormGroups = (gridDto: GridDto) => {
|
||||
const fields = getEditingFormFields(gridDto)
|
||||
|
||||
return [...(gridDto.gridOptions.editingFormDto ?? [])]
|
||||
.sort((left, right) => left.order - right.order)
|
||||
.map((group) => ({
|
||||
...group,
|
||||
items: fields.filter((field) => (field.editGroupOrderNo ?? 1) === group.order),
|
||||
}))
|
||||
}
|
||||
|
||||
export interface GridExtraFilterState {
|
||||
fieldName: string
|
||||
|
|
@ -149,15 +131,19 @@ export function pivotFieldConvertDataType(fieldDbType?: DataType): PivotGridData
|
|||
|
||||
export function setGridPanelColor(color: any) {
|
||||
//DataGrid icin
|
||||
const pnlGrid = document.querySelector<HTMLElement>('.dx-datagrid-header-panel')
|
||||
if (pnlGrid) {
|
||||
pnlGrid.style.borderBottom = `3px solid ${color}`
|
||||
const pnlGrid = document.getElementsByClassName(
|
||||
'dx-datagrid-header-panel',
|
||||
) as HTMLCollectionOf<HTMLElement>
|
||||
if (pnlGrid?.length) {
|
||||
pnlGrid[0].style.borderBottom = `3px solid ${color}`
|
||||
}
|
||||
|
||||
//TreeList icin
|
||||
const pnlTree = document.querySelector<HTMLElement>('.dx-treelist-header-panel')
|
||||
if (pnlTree) {
|
||||
pnlTree.style.borderBottom = `3px solid ${color}`
|
||||
const pnlTree = document.getElementsByClassName(
|
||||
'dx-treelist-header-panel',
|
||||
) as HTMLCollectionOf<HTMLElement>
|
||||
if (pnlTree?.length) {
|
||||
pnlTree[0].style.borderBottom = `3px solid ${color}`
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,12 +11,13 @@ import { dynamicFetch } from '@/services/form.service'
|
|||
import { GridColumnData } from './GridColumnData'
|
||||
import {
|
||||
ColumnFormatDto,
|
||||
EditingFormItemDto,
|
||||
GridDto,
|
||||
PlatformEditorTypes,
|
||||
UiCommandButtonPositionTypeEnum,
|
||||
UiLookupDataSourceTypeEnum,
|
||||
} from '@/proxy/form/models'
|
||||
import { addCss, getEditingFormFields } from './Utils'
|
||||
import { addCss } from './Utils'
|
||||
|
||||
const NO_IMAGE = '/img/others/no-image.png'
|
||||
|
||||
|
|
@ -922,18 +923,15 @@ const useListFormColumns = ({
|
|||
|
||||
column.allowEditing = colData?.allowEditing || colData?.allowAdding
|
||||
|
||||
if (colData.editorType2 === 'dxHtmlEditor') {
|
||||
column.encodeHtml = false
|
||||
}
|
||||
|
||||
// #region lookup ayarlari
|
||||
if (colData.lookupDto?.dataSourceType) {
|
||||
// UiColumnEditorTemplateTypeEnum : None:0, Table:1, TagBox:2
|
||||
const formItem = colData.editOrderNo != null ? colData : undefined
|
||||
const allItems = gridDto.gridOptions.editingFormDto.flatMap((group) => group.items)
|
||||
const formItem = allItems.find((a) => a?.dataField === colData.fieldName)
|
||||
if (formItem?.editorType2 === PlatformEditorTypes.dxTagBox) {
|
||||
column.extras = {
|
||||
multiValue: true,
|
||||
editorOptions,
|
||||
editorOptions: formItem.editorOptions,
|
||||
tagBoxOptions: formItem.tagBoxOptions,
|
||||
}
|
||||
column.editCellTemplate = 'cellEditTagBox'
|
||||
|
|
@ -942,7 +940,7 @@ const useListFormColumns = ({
|
|||
} else if (formItem?.editorType2 === PlatformEditorTypes.dxGridBox) {
|
||||
column.extras = {
|
||||
multiValue: false,
|
||||
editorOptions,
|
||||
editorOptions: formItem.editorOptions,
|
||||
gridBoxOptions: formItem.gridBoxOptions,
|
||||
}
|
||||
column.editCellTemplate = 'cellEditGridBox'
|
||||
|
|
@ -978,7 +976,8 @@ const useListFormColumns = ({
|
|||
|
||||
// #region image upload editor
|
||||
if (!colData.lookupDto?.dataSourceType) {
|
||||
const imageFormItem = colData.editOrderNo != null ? colData : undefined
|
||||
const allFormItems = gridDto.gridOptions.editingFormDto.flatMap((group) => group.items)
|
||||
const imageFormItem = allFormItems.find((a) => a?.dataField === colData.fieldName)
|
||||
const isImageUploadEditor =
|
||||
imageFormItem?.editorType2 === PlatformEditorTypes.dxImageUpload
|
||||
const isImageViewerEditor =
|
||||
|
|
@ -1007,7 +1006,7 @@ const useListFormColumns = ({
|
|||
}
|
||||
column.extras = {
|
||||
multiValue: imageUploadOptions?.multiple ?? false,
|
||||
editorOptions,
|
||||
editorOptions: imageFormItem?.editorOptions ?? colData.editorOptions,
|
||||
imageUploadOptions: imageUploadOptions,
|
||||
}
|
||||
if (isImageUploadEditor) {
|
||||
|
|
@ -1092,19 +1091,25 @@ const useListFormColumns = ({
|
|||
}
|
||||
}
|
||||
|
||||
// Formda kullanılan fakat listede görünmeyen ColumnFormatDto alanlarını
|
||||
// DevExtreme'in düzenleme modeline gizli kolon olarak ekliyoruz.
|
||||
// FormEditingExtraItem
|
||||
// Devexpress Gridde kaydete basılınca
|
||||
// formda gözükecek olan EditingFormDto.Items elemanları gelmiyor
|
||||
// Sadece grid'de tanımlanmış columnları getiriyor.
|
||||
// Bu elemanları da getirmesi için aşağıdaki şekilde,
|
||||
// columns'da olmayan alanları da gizli olarak ekliyoruz
|
||||
if (columns?.length) {
|
||||
getEditingFormFields(gridDto).forEach((item: ColumnFormatDto) => {
|
||||
if (!columns.some((a) => a.dataField === item.fieldName)) {
|
||||
columns.push({
|
||||
dataField: item.fieldName,
|
||||
visible: false,
|
||||
showInColumnChooser: false,
|
||||
allowSearch: false,
|
||||
})
|
||||
insertedColumns.push(item.fieldName)
|
||||
}
|
||||
gridDto.gridOptions.editingFormDto.forEach((group) => {
|
||||
group.items?.forEach((item: EditingFormItemDto) => {
|
||||
if (!columns.some((a) => a.dataField === item.dataField)) {
|
||||
columns.push({
|
||||
dataField: item.dataField,
|
||||
visible: false,
|
||||
showInColumnChooser: false,
|
||||
allowSearch: false
|
||||
})
|
||||
insertedColumns.push(item.dataField)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue