ListFormField AllowEditing
This commit is contained in:
parent
2468e46bfb
commit
66a3261e2c
12 changed files with 33 additions and 61 deletions
|
|
@ -1,9 +0,0 @@
|
||||||
namespace Sozsoft.Platform.ListForms;
|
|
||||||
|
|
||||||
public class ColumnEditingDto
|
|
||||||
{
|
|
||||||
public bool AllowEditing { get; set; } = true;
|
|
||||||
//public bool AllowInserting { get; set; } = true;
|
|
||||||
//public object DefaultValue { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -79,6 +79,7 @@ public class ColumnFormatDto : AuditedEntityDto<Guid>
|
||||||
/// <summary> butun alanlarda OR ile arama yaptigi icin varsayilan ozelligi kapatildi, bilincli olarak acilmalidir
|
/// <summary> butun alanlarda OR ile arama yaptigi icin varsayilan ozelligi kapatildi, bilincli olarak acilmalidir
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool AllowSearch { get; set; } = false;
|
public bool AllowSearch { get; set; } = false;
|
||||||
|
public bool AllowEditing { get; set; } = true;
|
||||||
public string ColumnCssClass { get; set; } // Sutuna css sinif ismi
|
public string ColumnCssClass { get; set; } // Sutuna css sinif ismi
|
||||||
//[TextArea]
|
//[TextArea]
|
||||||
public string ColumnCssValue { get; set; } // Sutuna ait css sinifinin icerigi
|
public string ColumnCssValue { get; set; } // Sutuna ait css sinifinin icerigi
|
||||||
|
|
@ -163,19 +164,6 @@ public class ColumnFormatDto : AuditedEntityDto<Guid>
|
||||||
set { GroupSummaryJson = JsonSerializer.Serialize(value); }
|
set { GroupSummaryJson = JsonSerializer.Serialize(value); }
|
||||||
}
|
}
|
||||||
|
|
||||||
[JsonIgnore]
|
|
||||||
public string EditingJson { get; set; }
|
|
||||||
public ColumnEditingDto ColumnEditingDto
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if (!string.IsNullOrEmpty(EditingJson))
|
|
||||||
return JsonSerializer.Deserialize<ColumnEditingDto>(EditingJson);
|
|
||||||
return new ColumnEditingDto();
|
|
||||||
}
|
|
||||||
set { EditingJson = JsonSerializer.Serialize(value); }
|
|
||||||
}
|
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public string LookupJson { get; set; }
|
public string LookupJson { get; set; }
|
||||||
public LookupDto LookupDto
|
public LookupDto LookupDto
|
||||||
|
|
|
||||||
|
|
@ -55,8 +55,8 @@ public class ListFormFieldsAppService : CrudAppService<
|
||||||
entity.BandName = updateInput.BandName;
|
entity.BandName = updateInput.BandName;
|
||||||
entity.IsActive = updateInput.IsActive;
|
entity.IsActive = updateInput.IsActive;
|
||||||
entity.Visible = updateInput.Visible;
|
entity.Visible = updateInput.Visible;
|
||||||
entity.EditingJson = JsonSerializer.Serialize(updateInput.ColumnEditingDto);
|
|
||||||
entity.AllowSearch = updateInput.AllowSearch;
|
entity.AllowSearch = updateInput.AllowSearch;
|
||||||
|
entity.AllowEditing = updateInput.AllowEditing;
|
||||||
entity.ListOrderNo = updateInput.ListOrderNo;
|
entity.ListOrderNo = updateInput.ListOrderNo;
|
||||||
entity.SourceDbType = updateInput.SourceDbType;
|
entity.SourceDbType = updateInput.SourceDbType;
|
||||||
entity.Width = updateInput.Width;
|
entity.Width = updateInput.Width;
|
||||||
|
|
@ -146,8 +146,8 @@ public class ListFormFieldsAppService : CrudAppService<
|
||||||
item.SortIndex = input.SortIndex;
|
item.SortIndex = input.SortIndex;
|
||||||
item.IsActive = input.IsActive;
|
item.IsActive = input.IsActive;
|
||||||
item.Visible = input.Visible;
|
item.Visible = input.Visible;
|
||||||
item.EditingJson = input.EditingJson;
|
|
||||||
item.AllowSearch = input.AllowSearch;
|
item.AllowSearch = input.AllowSearch;
|
||||||
|
item.AllowEditing = input.AllowEditing;
|
||||||
}
|
}
|
||||||
else if (input.EditType == ListFormFieldEditTabs.CustomizationForm)
|
else if (input.EditType == ListFormFieldEditTabs.CustomizationForm)
|
||||||
{
|
{
|
||||||
|
|
@ -262,14 +262,12 @@ public class ListFormFieldsAppService : CrudAppService<
|
||||||
field.IsActive = sourceField.IsActive;
|
field.IsActive = sourceField.IsActive;
|
||||||
field.Visible = sourceField.Visible;
|
field.Visible = sourceField.Visible;
|
||||||
field.AllowSearch = sourceField.AllowSearch;
|
field.AllowSearch = sourceField.AllowSearch;
|
||||||
field.EditingJson = sourceField.EditingJson;
|
field.AllowEditing = sourceField.AllowEditing;
|
||||||
}
|
}
|
||||||
else if (input.CopiedFields.All || input.CopiedFields.Permission)
|
else if (input.CopiedFields.All || input.CopiedFields.Permission)
|
||||||
{
|
{
|
||||||
field.PermissionJson = sourceField.PermissionJson;
|
field.PermissionJson = sourceField.PermissionJson;
|
||||||
}
|
}
|
||||||
else if (input.CopiedFields.All || input.CopiedFields.Lookup)
|
|
||||||
field.EditingJson = sourceField.LookupJson;
|
|
||||||
else if (input.CopiedFields.All || input.CopiedFields.Customization)
|
else if (input.CopiedFields.All || input.CopiedFields.Customization)
|
||||||
field.ColumnCustomizationJson = sourceField.ColumnCustomizationJson;
|
field.ColumnCustomizationJson = sourceField.ColumnCustomizationJson;
|
||||||
else if (input.CopiedFields.All || input.CopiedFields.Filtering)
|
else if (input.CopiedFields.All || input.CopiedFields.Filtering)
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@ public class ListFormField : FullAuditedEntity<Guid>
|
||||||
|
|
||||||
public string SortDirection { get; set; } // Sortindex varsa alacagi degerler asc, desc
|
public string SortDirection { get; set; } // Sortindex varsa alacagi degerler asc, desc
|
||||||
public bool? AllowSearch { get; set; }
|
public bool? AllowSearch { get; set; }
|
||||||
|
public bool? AllowEditing { get; set; }
|
||||||
public string BandName { get; set; }
|
public string BandName { get; set; }
|
||||||
|
|
||||||
public string ColumnFilterJson { get; set; }
|
public string ColumnFilterJson { get; set; }
|
||||||
|
|
@ -33,7 +34,6 @@ public class ListFormField : FullAuditedEntity<Guid>
|
||||||
public string ColumnCssClass { get; set; } // Sutuna css sinif ismi
|
public string ColumnCssClass { get; set; } // Sutuna css sinif ismi
|
||||||
public string ColumnCssValue { get; set; } // Sutuna ait css sinifinin icerigi
|
public string ColumnCssValue { get; set; } // Sutuna ait css sinifinin icerigi
|
||||||
public string JoinTableJson { get; set; } // kolon farkli bir tablodan gelecek ise ona ait gerekli ayarlar
|
public string JoinTableJson { get; set; } // kolon farkli bir tablodan gelecek ise ona ait gerekli ayarlar
|
||||||
public string EditingJson { get; set; }
|
|
||||||
public string LookupJson { get; set; }
|
public string LookupJson { get; set; }
|
||||||
public string ValidationRuleJson { get; set; }
|
public string ValidationRuleJson { get; set; }
|
||||||
public string ColumnStylingJson { get; set; }
|
public string ColumnStylingJson { get; set; }
|
||||||
|
|
|
||||||
|
|
@ -358,6 +358,7 @@ public class PlatformDbContext :
|
||||||
|
|
||||||
// Varsayılan değerler
|
// Varsayılan değerler
|
||||||
b.Property(a => a.AllowSearch).HasDefaultValue(false);
|
b.Property(a => a.AllowSearch).HasDefaultValue(false);
|
||||||
|
b.Property(a => a.AllowEditing).HasDefaultValue(true);
|
||||||
b.Property(a => a.IsActive).HasDefaultValue(true);
|
b.Property(a => a.IsActive).HasDefaultValue(true);
|
||||||
b.Property(a => a.Visible).HasDefaultValue(true);
|
b.Property(a => a.Visible).HasDefaultValue(true);
|
||||||
b.Property(a => a.ListOrderNo).HasDefaultValue(30);
|
b.Property(a => a.ListOrderNo).HasDefaultValue(30);
|
||||||
|
|
@ -373,7 +374,6 @@ public class PlatformDbContext :
|
||||||
b.Property(a => a.TotalSummaryJson).HasColumnType("text");
|
b.Property(a => a.TotalSummaryJson).HasColumnType("text");
|
||||||
b.Property(a => a.GroupSummaryJson).HasColumnType("text");
|
b.Property(a => a.GroupSummaryJson).HasColumnType("text");
|
||||||
b.Property(a => a.JoinTableJson).HasColumnType("text");
|
b.Property(a => a.JoinTableJson).HasColumnType("text");
|
||||||
b.Property(a => a.EditingJson).HasColumnType("text");
|
|
||||||
b.Property(a => a.LookupJson).HasColumnType("text");
|
b.Property(a => a.LookupJson).HasColumnType("text");
|
||||||
b.Property(a => a.ValidationRuleJson).HasColumnType("text");
|
b.Property(a => a.ValidationRuleJson).HasColumnType("text");
|
||||||
b.Property(a => a.ColumnStylingJson).HasColumnType("text");
|
b.Property(a => a.ColumnStylingJson).HasColumnType("text");
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore;
|
||||||
namespace Sozsoft.Platform.Migrations
|
namespace Sozsoft.Platform.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(PlatformDbContext))]
|
[DbContext(typeof(PlatformDbContext))]
|
||||||
[Migration("20260311115619_Initial")]
|
[Migration("20260315193224_Initial")]
|
||||||
partial class Initial
|
partial class Initial
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
|
@ -2449,6 +2449,11 @@ namespace Sozsoft.Platform.Migrations
|
||||||
.HasColumnType("nvarchar(20)")
|
.HasColumnType("nvarchar(20)")
|
||||||
.HasDefaultValue("left");
|
.HasDefaultValue("left");
|
||||||
|
|
||||||
|
b.Property<bool?>("AllowEditing")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("bit")
|
||||||
|
.HasDefaultValue(true);
|
||||||
|
|
||||||
b.Property<bool?>("AllowSearch")
|
b.Property<bool?>("AllowSearch")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
.HasColumnType("bit")
|
.HasColumnType("bit")
|
||||||
|
|
@ -2503,9 +2508,6 @@ namespace Sozsoft.Platform.Migrations
|
||||||
.HasColumnType("datetime2")
|
.HasColumnType("datetime2")
|
||||||
.HasColumnName("DeletionTime");
|
.HasColumnName("DeletionTime");
|
||||||
|
|
||||||
b.Property<string>("EditingJson")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("EditorOptions")
|
b.Property<string>("EditorOptions")
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
|
@ -1989,6 +1989,7 @@ namespace Sozsoft.Platform.Migrations
|
||||||
SortIndex = table.Column<int>(type: "int", nullable: true),
|
SortIndex = table.Column<int>(type: "int", nullable: true),
|
||||||
SortDirection = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: true),
|
SortDirection = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: true),
|
||||||
AllowSearch = table.Column<bool>(type: "bit", nullable: true, defaultValue: false),
|
AllowSearch = table.Column<bool>(type: "bit", nullable: true, defaultValue: false),
|
||||||
|
AllowEditing = table.Column<bool>(type: "bit", nullable: true, defaultValue: true),
|
||||||
BandName = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
|
BandName = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
|
||||||
ColumnFilterJson = table.Column<string>(type: "text", nullable: true),
|
ColumnFilterJson = table.Column<string>(type: "text", nullable: true),
|
||||||
ColumnHeaderJson = table.Column<string>(type: "text", nullable: true),
|
ColumnHeaderJson = table.Column<string>(type: "text", nullable: true),
|
||||||
|
|
@ -1999,7 +2000,6 @@ namespace Sozsoft.Platform.Migrations
|
||||||
ColumnCssClass = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
|
ColumnCssClass = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
|
||||||
ColumnCssValue = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
|
ColumnCssValue = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
|
||||||
JoinTableJson = table.Column<string>(type: "text", nullable: true),
|
JoinTableJson = table.Column<string>(type: "text", nullable: true),
|
||||||
EditingJson = table.Column<string>(type: "text", nullable: true),
|
|
||||||
LookupJson = table.Column<string>(type: "text", nullable: true),
|
LookupJson = table.Column<string>(type: "text", nullable: true),
|
||||||
ValidationRuleJson = table.Column<string>(type: "text", nullable: true),
|
ValidationRuleJson = table.Column<string>(type: "text", nullable: true),
|
||||||
ColumnStylingJson = table.Column<string>(type: "text", nullable: true),
|
ColumnStylingJson = table.Column<string>(type: "text", nullable: true),
|
||||||
|
|
@ -2446,6 +2446,11 @@ namespace Sozsoft.Platform.Migrations
|
||||||
.HasColumnType("nvarchar(20)")
|
.HasColumnType("nvarchar(20)")
|
||||||
.HasDefaultValue("left");
|
.HasDefaultValue("left");
|
||||||
|
|
||||||
|
b.Property<bool?>("AllowEditing")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("bit")
|
||||||
|
.HasDefaultValue(true);
|
||||||
|
|
||||||
b.Property<bool?>("AllowSearch")
|
b.Property<bool?>("AllowSearch")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
.HasColumnType("bit")
|
.HasColumnType("bit")
|
||||||
|
|
@ -2500,9 +2505,6 @@ namespace Sozsoft.Platform.Migrations
|
||||||
.HasColumnType("datetime2")
|
.HasColumnType("datetime2")
|
||||||
.HasColumnName("DeletionTime");
|
.HasColumnName("DeletionTime");
|
||||||
|
|
||||||
b.Property<string>("EditingJson")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("EditorOptions")
|
b.Property<string>("EditorOptions")
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -186,10 +186,6 @@ export interface ColumnCustomizationDto {
|
||||||
allowReordering: boolean
|
allowReordering: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ColumnEditingDto {
|
|
||||||
allowEditing: boolean
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ColumnFilterDto {
|
export interface ColumnFilterDto {
|
||||||
allowFiltering: boolean
|
allowFiltering: boolean
|
||||||
filterOperations: string[]
|
filterOperations: string[]
|
||||||
|
|
@ -211,6 +207,7 @@ export interface ColumnFormatDto extends AuditedEntityDto<string> {
|
||||||
sortIndex: number
|
sortIndex: number
|
||||||
sortDirection?: string
|
sortDirection?: string
|
||||||
allowSearch: boolean
|
allowSearch: boolean
|
||||||
|
allowEditing: boolean
|
||||||
columnCssClass?: string
|
columnCssClass?: string
|
||||||
columnCssValue?: string
|
columnCssValue?: string
|
||||||
bandName?: string
|
bandName?: string
|
||||||
|
|
@ -226,8 +223,6 @@ export interface ColumnFormatDto extends AuditedEntityDto<string> {
|
||||||
columnTotalSummaryDto: ColumnTotalSummaryDto
|
columnTotalSummaryDto: ColumnTotalSummaryDto
|
||||||
groupSummaryJson?: string
|
groupSummaryJson?: string
|
||||||
columnGroupSummaryDto: ColumnTotalSummaryDto
|
columnGroupSummaryDto: ColumnTotalSummaryDto
|
||||||
editingJson?: string
|
|
||||||
columnEditingDto: ColumnEditingDto
|
|
||||||
lookupJson?: string
|
lookupJson?: string
|
||||||
lookupDto: LookupDto
|
lookupDto: LookupDto
|
||||||
validationRuleJson?: string
|
validationRuleJson?: string
|
||||||
|
|
|
||||||
|
|
@ -187,31 +187,31 @@ const WizardStep2 = ({
|
||||||
translate('::ListForms.Wizard.Step2.StoredProcedures') ||
|
translate('::ListForms.Wizard.Step2.StoredProcedures') ||
|
||||||
'Stored Procedures',
|
'Stored Procedures',
|
||||||
options: dbObjects.storedProcedures.map((p) => ({
|
options: dbObjects.storedProcedures.map((p) => ({
|
||||||
label: p.procedureName,
|
label: p.objectName,
|
||||||
value: p.procedureName,
|
value: p.objectName,
|
||||||
__type: SelectCommandTypeEnum.StoredProcedure,
|
__type: SelectCommandTypeEnum.StoredProcedure,
|
||||||
__schema: p.schemaName,
|
__schema: p.schemaName,
|
||||||
__rawName: p.procedureName,
|
__rawName: p.objectName,
|
||||||
})),
|
})),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: translate('::ListForms.Wizard.Step2.Views') || 'Views',
|
label: translate('::ListForms.Wizard.Step2.Views') || 'Views',
|
||||||
options: dbObjects.views.map((v) => ({
|
options: dbObjects.views.map((v) => ({
|
||||||
label: v.viewName,
|
label: v.objectName,
|
||||||
value: v.viewName,
|
value: v.objectName,
|
||||||
__type: SelectCommandTypeEnum.View,
|
__type: SelectCommandTypeEnum.View,
|
||||||
__schema: v.schemaName,
|
__schema: v.schemaName,
|
||||||
__rawName: v.viewName,
|
__rawName: v.objectName,
|
||||||
})),
|
})),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: translate('::ListForms.Wizard.Step2.Functions') || 'Functions',
|
label: translate('::ListForms.Wizard.Step2.Functions') || 'Functions',
|
||||||
options: dbObjects.functions.map((f) => ({
|
options: dbObjects.functions.map((f) => ({
|
||||||
label: f.functionName,
|
label: f.objectName,
|
||||||
value: f.functionName,
|
value: f.objectName,
|
||||||
__type: SelectCommandTypeEnum.TableValuedFunction,
|
__type: SelectCommandTypeEnum.TableValuedFunction,
|
||||||
__schema: f.schemaName,
|
__schema: f.schemaName,
|
||||||
__rawName: f.functionName,
|
__rawName: f.objectName,
|
||||||
})),
|
})),
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -16,12 +16,8 @@ const schema = object().shape({
|
||||||
sortIndex: number(),
|
sortIndex: number(),
|
||||||
isActive: bool().required(),
|
isActive: bool().required(),
|
||||||
visible: bool().required(),
|
visible: bool().required(),
|
||||||
columnEditingDto: object()
|
|
||||||
.shape({
|
|
||||||
allowEditing: bool().required(),
|
|
||||||
})
|
|
||||||
.required(),
|
|
||||||
allowSearch: bool().required(),
|
allowSearch: bool().required(),
|
||||||
|
allowEditing: bool().required(),
|
||||||
})
|
})
|
||||||
|
|
||||||
function FormFieldTabOptions({
|
function FormFieldTabOptions({
|
||||||
|
|
@ -102,12 +98,12 @@ function FormFieldTabOptions({
|
||||||
>
|
>
|
||||||
<Field name="visible" component={Checkbox} />
|
<Field name="visible" component={Checkbox} />
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label={translate('::ListForms.ListFormEdit.EditingAllowEditing')}>
|
|
||||||
<Field name="columnEditingDto.allowEditing" component={Checkbox} />
|
|
||||||
</FormItem>
|
|
||||||
<FormItem label={translate('::ListForms.ListFormFieldEdit.HeaderingAllowSearch')}>
|
<FormItem label={translate('::ListForms.ListFormFieldEdit.HeaderingAllowSearch')}>
|
||||||
<Field name="allowSearch" component={Checkbox} />
|
<Field name="allowSearch" component={Checkbox} />
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
<FormItem label={translate('::ListForms.ListFormEdit.EditingAllowEditing')}>
|
||||||
|
<Field name="allowEditing" component={Checkbox} />
|
||||||
|
</FormItem>
|
||||||
|
|
||||||
<Button block variant="solid" loading={isSubmitting} type="submit">
|
<Button block variant="solid" loading={isSubmitting} type="submit">
|
||||||
{isSubmitting ? translate('::SavingWithThreeDot') : translate('::Save')}
|
{isSubmitting ? translate('::SavingWithThreeDot') : translate('::Save')}
|
||||||
|
|
|
||||||
|
|
@ -539,7 +539,7 @@ const useListFormColumns = ({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
column.allowEditing = colData.columnEditingDto?.allowEditing
|
column.allowEditing = colData?.allowEditing
|
||||||
|
|
||||||
// #region lookup ayarlari
|
// #region lookup ayarlari
|
||||||
if (colData.lookupDto?.dataSourceType) {
|
if (colData.lookupDto?.dataSourceType) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue