ListFormField için AllowAdding özelliği eklendi

This commit is contained in:
Sedat Öztürk 2026-04-25 21:12:31 +03:00
parent 3ac72ad19b
commit 5dbd8a0f3f
29 changed files with 106 additions and 55 deletions

View file

@ -80,6 +80,7 @@ public class ColumnFormatDto : AuditedEntityDto<Guid>
/// </summary> /// </summary>
public bool AllowSearch { get; set; } = false; public bool AllowSearch { get; set; } = false;
public bool AllowEditing { get; set; } = true; public bool AllowEditing { get; set; } = true;
public bool AllowAdding { 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

View file

@ -13,7 +13,7 @@ public class GridEditingDto
/// <summary>Accepted Values: 'full' | 'reshape' | 'repaint' /// <summary>Accepted Values: 'full' | 'reshape' | 'repaint'
/// </summary> /// </summary>
public string RefreshMode { get; set; } = "full"; public string RefreshMode { get; set; } = "full";
public bool AllowEditing { get; set; } = false; public bool AllowUpdating { get; set; } = false;
public bool AllowDetail { get; set; } = false; public bool AllowDetail { get; set; } = false;
public bool AllowDeleting { get; set; } = false; public bool AllowDeleting { get; set; } = false;
public bool AllowAllDeleting { get; set; } = false; public bool AllowAllDeleting { get; set; } = false;

View file

@ -15,7 +15,7 @@ public class ListFormWizardDto
public bool IsOrganizationUnit { get; set; } public bool IsOrganizationUnit { get; set; }
public bool AllowAdding { get; set; } public bool AllowAdding { get; set; }
public bool AllowEditing { get; set; } public bool AllowUpdating { get; set; }
public bool AllowDeleting { get; set; } public bool AllowDeleting { get; set; }
public bool AllowDetail { get; set; } public bool AllowDetail { get; set; }
public bool ConfirmDelete { get; set; } public bool ConfirmDelete { get; set; }

View file

@ -58,6 +58,7 @@ public class ListFormFieldsAppService : CrudAppService<
entity.Visible = updateInput.Visible; entity.Visible = updateInput.Visible;
entity.AllowSearch = updateInput.AllowSearch; entity.AllowSearch = updateInput.AllowSearch;
entity.AllowEditing = updateInput.AllowEditing; entity.AllowEditing = updateInput.AllowEditing;
entity.AllowAdding = updateInput.AllowAdding;
entity.ListOrderNo = updateInput.ListOrderNo; entity.ListOrderNo = updateInput.ListOrderNo;
entity.SourceDbType = updateInput.SourceDbType; entity.SourceDbType = updateInput.SourceDbType;
entity.Width = updateInput.Width; entity.Width = updateInput.Width;
@ -150,6 +151,7 @@ public class ListFormFieldsAppService : CrudAppService<
item.Visible = input.Visible; item.Visible = input.Visible;
item.AllowSearch = input.AllowSearch; item.AllowSearch = input.AllowSearch;
item.AllowEditing = input.AllowEditing; item.AllowEditing = input.AllowEditing;
item.AllowAdding = input.AllowAdding;
} }
else if (input.EditType == ListFormFieldEditTabs.CustomizationForm) else if (input.EditType == ListFormFieldEditTabs.CustomizationForm)
{ {
@ -266,6 +268,7 @@ public class ListFormFieldsAppService : CrudAppService<
field.Visible = sourceField.Visible; field.Visible = sourceField.Visible;
field.AllowSearch = sourceField.AllowSearch; field.AllowSearch = sourceField.AllowSearch;
field.AllowEditing = sourceField.AllowEditing; field.AllowEditing = sourceField.AllowEditing;
field.AllowAdding = sourceField.AllowAdding;
} }
else if (input.CopiedFields.All || input.CopiedFields.Permission) else if (input.CopiedFields.All || input.CopiedFields.Permission)
{ {

View file

@ -220,7 +220,7 @@ public class ListFormWizardAppService(
DeleteFieldsDefaultValueJson = WizardConsts.DefaultDeleteFieldsDefaultValueJson(input.KeyFieldDbSourceType), DeleteFieldsDefaultValueJson = WizardConsts.DefaultDeleteFieldsDefaultValueJson(input.KeyFieldDbSourceType),
InsertFieldsDefaultValueJson = WizardConsts.DefaultInsertFieldsDefaultValueJson(input.KeyFieldDbSourceType), InsertFieldsDefaultValueJson = WizardConsts.DefaultInsertFieldsDefaultValueJson(input.KeyFieldDbSourceType),
PagerOptionJson = WizardConsts.DefaultPagerOptionJson, PagerOptionJson = WizardConsts.DefaultPagerOptionJson,
EditingOptionJson = WizardConsts.DefaultEditingOptionJson(titleLangKey, 600, 500, input.AllowDeleting, input.AllowAdding, input.AllowEditing, input.ConfirmDelete, false, input.AllowDetail), 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, EditingFormJson = editingFormDtos.Count > 0 ? JsonSerializer.Serialize(editingFormDtos) : null,
}, autoSave: true); }, autoSave: true);

View file

@ -4530,12 +4530,24 @@
"en": "Auto Expand All", "en": "Auto Expand All",
"tr": "Otomatik Tümünü Genişlet" "tr": "Otomatik Tümünü Genişlet"
}, },
{
"resourceName": "Platform",
"key": "ListForms.ListFormEdit.AllowUpdating",
"en": "Allow Updating",
"tr": "Güncellemeye İzin Ver"
},
{ {
"resourceName": "Platform", "resourceName": "Platform",
"key": "ListForms.ListFormEdit.AllowEditing", "key": "ListForms.ListFormEdit.AllowEditing",
"en": "Allow Editing", "en": "Allow Editing",
"tr": "Düzenlemeye İzin Ver" "tr": "Düzenlemeye İzin Ver"
}, },
{
"resourceName": "Platform",
"key": "ListForms.ListFormEdit.AllowAdding",
"en": "Allow Adding",
"tr": "Ekleme İzni"
},
{ {
"resourceName": "Platform", "resourceName": "Platform",
"key": "ListForms.ListFormEdit.AllowTaskAdding", "key": "ListForms.ListFormEdit.AllowTaskAdding",

View file

@ -35,7 +35,7 @@ public static class ListFormSeeder_DefaultJsons
int Height, int Height,
bool AllowDeleting, bool AllowDeleting,
bool AllowAdding, bool AllowAdding,
bool AllowEditing, bool AllowUpdating,
bool ConfirmDelete, bool ConfirmDelete,
bool SendOnlyChangedFormValuesUpdate, bool SendOnlyChangedFormValuesUpdate,
bool AllowDetail = false) => JsonSerializer.Serialize(new GridEditingDto bool AllowDetail = false) => JsonSerializer.Serialize(new GridEditingDto
@ -43,7 +43,7 @@ public static class ListFormSeeder_DefaultJsons
Popup = new GridEditingPopupDto() { Title = Title, Width = Width, Height = Height }, Popup = new GridEditingPopupDto() { Title = Title, Width = Width, Height = Height },
AllowDeleting = AllowDeleting, AllowDeleting = AllowDeleting,
AllowAdding = AllowAdding, AllowAdding = AllowAdding,
AllowEditing = AllowEditing, AllowUpdating = AllowUpdating,
ConfirmDelete = ConfirmDelete, ConfirmDelete = ConfirmDelete,
SendOnlyChangedFormValuesUpdate = SendOnlyChangedFormValuesUpdate, SendOnlyChangedFormValuesUpdate = SendOnlyChangedFormValuesUpdate,
AllowDetail = AllowDetail AllowDetail = AllowDetail

View file

@ -198,7 +198,7 @@ public static class WizardConsts
int Height, int Height,
bool AllowDeleting, bool AllowDeleting,
bool AllowAdding, bool AllowAdding,
bool AllowEditing, bool AllowUpdating,
bool ConfirmDelete, bool ConfirmDelete,
bool SendOnlyChangedFormValuesUpdate, bool SendOnlyChangedFormValuesUpdate,
bool AllowDetail = false) => JsonSerializer.Serialize(new bool AllowDetail = false) => JsonSerializer.Serialize(new
@ -206,7 +206,7 @@ public static class WizardConsts
Popup = new { Title = Title, Width = Width, Height = Height }, Popup = new { Title = Title, Width = Width, Height = Height },
AllowDeleting = AllowDeleting, AllowDeleting = AllowDeleting,
AllowAdding = AllowAdding, AllowAdding = AllowAdding,
AllowEditing = AllowEditing, AllowUpdating = AllowUpdating,
ConfirmDelete = ConfirmDelete, ConfirmDelete = ConfirmDelete,
SendOnlyChangedFormValuesUpdate = SendOnlyChangedFormValuesUpdate, SendOnlyChangedFormValuesUpdate = SendOnlyChangedFormValuesUpdate,
AllowDetail = AllowDetail AllowDetail = AllowDetail

View file

@ -23,7 +23,8 @@ 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; } = true; public bool? AllowSearch { get; set; } = true;
public bool? AllowEditing { get; set; } public bool? AllowEditing { get; set; } = true;
public bool? AllowAdding { get; set; } = true;
public string BandName { get; set; } public string BandName { get; set; }
public string ColumnFilterJson { get; set; } public string ColumnFilterJson { get; set; }

View file

@ -370,6 +370,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.AllowEditing).HasDefaultValue(true);
b.Property(a => a.AllowAdding).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);

View file

@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore;
namespace Sozsoft.Platform.Migrations namespace Sozsoft.Platform.Migrations
{ {
[DbContext(typeof(PlatformDbContext))] [DbContext(typeof(PlatformDbContext))]
[Migration("20260330120142_Initial")] [Migration("20260425160411_Initial")]
partial class Initial partial class Initial
{ {
/// <inheritdoc /> /// <inheritdoc />
@ -2538,6 +2538,11 @@ namespace Sozsoft.Platform.Migrations
.HasColumnType("nvarchar(20)") .HasColumnType("nvarchar(20)")
.HasDefaultValue("left"); .HasDefaultValue("left");
b.Property<bool?>("AllowAdding")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(true);
b.Property<bool?>("AllowEditing") b.Property<bool?>("AllowEditing")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("bit") .HasColumnType("bit")

View file

@ -2041,6 +2041,7 @@ namespace Sozsoft.Platform.Migrations
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), AllowEditing = table.Column<bool>(type: "bit", nullable: true, defaultValue: true),
AllowAdding = 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),

View file

@ -2535,6 +2535,11 @@ namespace Sozsoft.Platform.Migrations
.HasColumnType("nvarchar(20)") .HasColumnType("nvarchar(20)")
.HasDefaultValue("left"); .HasDefaultValue("left");
b.Property<bool?>("AllowAdding")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(true);
b.Property<bool?>("AllowEditing") b.Property<bool?>("AllowEditing")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("bit") .HasColumnType("bit")

View file

@ -39,7 +39,7 @@ export interface ListFormWizardDto {
isBranch: boolean isBranch: boolean
isOrganizationUnit: boolean isOrganizationUnit: boolean
allowAdding: boolean allowAdding: boolean
allowEditing: boolean allowUpdating: boolean
allowDeleting: boolean allowDeleting: boolean
confirmDelete: boolean confirmDelete: boolean
allowDetail: boolean allowDetail: boolean

View file

@ -209,6 +209,7 @@ export interface ColumnFormatDto extends AuditedEntityDto<string> {
sortDirection?: string sortDirection?: string
allowSearch: boolean allowSearch: boolean
allowEditing: boolean allowEditing: boolean
allowAdding: boolean
columnCssClass?: string columnCssClass?: string
columnCssValue?: string columnCssValue?: string
bandName?: string bandName?: string
@ -440,7 +441,7 @@ export interface SchedulerResourceDto {
export interface GridEditingDto { export interface GridEditingDto {
mode?: GridsEditMode mode?: GridsEditMode
refreshMode?: GridsEditRefreshMode refreshMode?: GridsEditRefreshMode
allowEditing: boolean allowUpdating: boolean
allowDetail: boolean allowDetail: boolean
allowDeleting: boolean allowDeleting: boolean
allowAllDeleting: boolean allowAllDeleting: boolean

View file

@ -39,7 +39,7 @@ const initialValues: ListFormWizardDto = {
isBranch: false, isBranch: false,
isOrganizationUnit: false, isOrganizationUnit: false,
allowAdding: true, allowAdding: true,
allowEditing: true, allowUpdating: true,
allowDeleting: true, allowDeleting: true,
confirmDelete: true, confirmDelete: true,
allowDetail: false, allowDetail: false,
@ -87,7 +87,7 @@ const step2ValidationSchema = Yup.object().shape({
isBranch: Yup.boolean(), isBranch: Yup.boolean(),
isOrganizationUnit: Yup.boolean(), isOrganizationUnit: Yup.boolean(),
allowAdding: Yup.boolean(), allowAdding: Yup.boolean(),
allowEditing: Yup.boolean(), allowUpdating: Yup.boolean(),
allowDeleting: Yup.boolean(), allowDeleting: Yup.boolean(),
confirmDelete: Yup.boolean(), confirmDelete: Yup.boolean(),
}) })

View file

@ -175,7 +175,7 @@ function TreeNode({
className={`text-xs shrink-0 ${isSelected ? 'text-indigo-200' : 'text-gray-400'}`} className={`text-xs shrink-0 ${isSelected ? 'text-indigo-200' : 'text-gray-400'}`}
onClick={() => !isEditing && onSelect(node.code)} onClick={() => !isEditing && onSelect(node.code)}
> >
{translate('::' + node.code)} {translate('::' + node.displayName)}
</span> </span>
{isEditing ? ( {isEditing ? (

View file

@ -362,11 +362,11 @@ const WizardStep2 = ({
</FormItem> </FormItem>
<FormItem <FormItem
label={translate('::ListForms.ListFormEdit.AllowEditing')} label={translate('::ListForms.ListFormEdit.AllowUpdating')}
invalid={!!(errors.allowEditing && touched.allowEditing)} invalid={!!(errors.allowUpdating && touched.allowUpdating)}
errorMessage={errors.allowEditing} errorMessage={errors.allowUpdating}
> >
<Field type="checkbox" autoComplete="off" name="allowEditing" component={Checkbox} /> <Field type="checkbox" autoComplete="off" name="allowUpdating" component={Checkbox} />
</FormItem> </FormItem>
<FormItem <FormItem

View file

@ -1,4 +1,4 @@
import { Alert, Notification, Tabs, toast } from '@/components/ui' import { Alert, Badge, Notification, Tabs, toast } from '@/components/ui'
import TabContent from '@/components/ui/Tabs/TabContent' import TabContent from '@/components/ui/Tabs/TabContent'
import TabList from '@/components/ui/Tabs/TabList' import TabList from '@/components/ui/Tabs/TabList'
import TabNav from '@/components/ui/Tabs/TabNav' import TabNav from '@/components/ui/Tabs/TabNav'
@ -178,20 +178,20 @@ const FormEdit = () => {
title={`${listFormCode} - ${translate(`::${listFormValues.title}`)}`} title={`${listFormCode} - ${translate(`::${listFormValues.title}`)}`}
defaultTitle={APP_NAME} defaultTitle={APP_NAME}
></Helmet> ></Helmet>
<div className="lg:flex items-center justify-between mb-4 gap-3"> <div className="flex items-center justify-between mb-2 gap-3">
<div className="mb-4 lg:mb-0"> {/* SOL TARAF */}
<h4> <h4 className="mb-0">
<Link to={ROUTES_ENUM.protected.admin.list.replace(':listFormCode', listFormCode)}> <Link to={ROUTES_ENUM.protected.admin.list.replace(':listFormCode', listFormCode)}>
🔙 {listFormCode} - {translate(`::${listFormValues.title}`)} 🔙 {listFormCode} - {translate(`::${listFormValues.title}`)}
</Link> </Link>
</h4> </h4>
{listFormValues.isTenant && (
<Alert showIcon className="my-2" type="warning"> {/* SAĞ TARAF */}
Bu bir MULTI TENANT form'dur, veri kaybı olmaması için, sorgularda TENANTID {listFormValues.isTenant && (
parametresini kullanmayı unutmayınız. <Badge className='font-semibold' content="Bu bir MULTI TENANT form'dur, veri kaybı olmaması için, sorgularda TENANTID
</Alert> parametresini kullanmayı unutmayınız." innerClass="p-1 bg-red-50 text-red-500">
)} </Badge>
</div> )}
</div> </div>
<Tabs defaultValue="details" variant="pill"> <Tabs defaultValue="details" variant="pill">
<TabList className="flex-wrap border-b mb-2 bg-slate-50"> <TabList className="flex-wrap border-b mb-2 bg-slate-50">

View file

@ -73,16 +73,16 @@ function FormTabEdit(props: FormEditProps & { listFormCode: string }) {
/> />
</FormItem> </FormItem>
<FormItem <FormItem
label={translate('::ListForms.ListFormEdit.AllowEditing')} label={translate('::ListForms.ListFormEdit.AllowUpdating')}
invalid={ invalid={
errors.editingOptionDto?.allowEditing && errors.editingOptionDto?.allowUpdating &&
touched.editingOptionDto?.allowEditing touched.editingOptionDto?.allowUpdating
} }
errorMessage={errors.editingOptionDto?.allowEditing} errorMessage={errors.editingOptionDto?.allowUpdating}
> >
<Field <Field
name="editingOptionDto.allowEditing" name="editingOptionDto.allowUpdating"
placeholder={translate('::ListForms.ListFormEdit.AllowEditing')} placeholder={translate('::ListForms.ListFormEdit.AllowUpdating')}
component={Checkbox} component={Checkbox}
/> />
</FormItem> </FormItem>

View file

@ -18,6 +18,7 @@ const schema = object().shape({
visible: bool().required(), visible: bool().required(),
allowSearch: bool().required(), allowSearch: bool().required(),
allowEditing: bool().required(), allowEditing: bool().required(),
allowAdding: bool().required(),
}) })
function FormFieldTabOptions({ function FormFieldTabOptions({
@ -104,6 +105,9 @@ function FormFieldTabOptions({
<FormItem label={translate('::ListForms.ListFormEdit.AllowEditing')}> <FormItem label={translate('::ListForms.ListFormEdit.AllowEditing')}>
<Field name="allowEditing" component={Checkbox} /> <Field name="allowEditing" component={Checkbox} />
</FormItem> </FormItem>
<FormItem label={translate('::ListForms.ListFormEdit.AllowAdding')}>
<Field name="allowAdding" 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')}

View file

@ -155,7 +155,11 @@ const FormDevExpress = (props: {
colSpan={formGroupItem.colSpan} colSpan={formGroupItem.colSpan}
caption={formGroupItem.caption} caption={formGroupItem.caption}
> >
{(formGroupItem.items as SimpleItemWithColData[])?.map((formItem, i) => { {(formGroupItem.items as SimpleItemWithColData[])?.filter((formItem) => {
if (mode === 'edit') return formItem.allowEditing !== false
if (mode === 'new') return formItem.allowAdding !== false
return true
}).map((formItem, i) => {
return formItem.editorType2 === PlatformEditorTypes.dxTagBox ? ( return formItem.editorType2 === PlatformEditorTypes.dxTagBox ? (
<SimpleItemDx <SimpleItemDx
cssClass="font-semibold" cssClass="font-semibold"

View file

@ -19,6 +19,8 @@ export type SimpleItemWithColData = Overwrite<
canCreate: boolean canCreate: boolean
canUpdate: boolean canUpdate: boolean
canExport: boolean canExport: boolean
allowEditing: boolean
allowAdding: boolean
editorType2: EditorType2 editorType2: EditorType2
editorScript?: string editorScript?: string
} }

View file

@ -181,7 +181,7 @@ const useGridData = (props: {
checkPermission(gridDto?.gridOptions.permissionDto.c), checkPermission(gridDto?.gridOptions.permissionDto.c),
r: checkPermission(gridDto?.gridOptions.permissionDto.r), r: checkPermission(gridDto?.gridOptions.permissionDto.r),
u: u:
gridDto?.gridOptions.editingOptionDto.allowEditing === true && gridDto?.gridOptions.editingOptionDto.allowUpdating === true &&
checkPermission(gridDto?.gridOptions.permissionDto.u), checkPermission(gridDto?.gridOptions.permissionDto.u),
d: d:
gridDto?.gridOptions.editingOptionDto.allowDeleting === true && gridDto?.gridOptions.editingOptionDto.allowDeleting === true &&
@ -243,6 +243,12 @@ const useGridData = (props: {
canExport: canExport:
gridDto.columnFormats.find((x: any) => x.fieldName === i.dataField)?.canExport ?? gridDto.columnFormats.find((x: any) => x.fieldName === i.dataField)?.canExport ??
false, 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, dataField: i.dataField,
name: i.dataField, name: i.dataField,
editorType2: i.editorType2, editorType2: i.editorType2,
@ -278,11 +284,11 @@ const useGridData = (props: {
}) })
.filter((a: any) => { .filter((a: any) => {
if (mode === 'view') { if (mode === 'view') {
return a.canRead return a.canRead && a.allowEditing
} else if (mode === 'new') { } else if (mode === 'new') {
return a.canCreate || a.canRead return (a.canCreate || a.canRead) && a.allowAdding
} else if (mode === 'edit') { } else if (mode === 'edit') {
return a.canUpdate || a.canRead return (a.canUpdate || a.canRead) && a.allowEditing
} else { } else {
return false return false
} }

View file

@ -284,7 +284,7 @@ const GanttView = (props: GanttViewProps) => {
<Item location="after" widget="dxButton" options={getSettingButtonOptions()} /> <Item location="after" widget="dxButton" options={getSettingButtonOptions()} />
)} )}
</Toolbar> </Toolbar>
<Editing <Editing
enabled={gridDto.gridOptions.ganttOptionDto?.allowEditing} enabled={gridDto.gridOptions.ganttOptionDto?.allowEditing}
allowTaskAdding={gridDto.gridOptions.ganttOptionDto?.allowTaskAdding} allowTaskAdding={gridDto.gridOptions.ganttOptionDto?.allowTaskAdding}

View file

@ -73,7 +73,6 @@ import { useListFormCustomDataSource } from './useListFormCustomDataSource'
import { useListFormColumns } from './useListFormColumns' import { useListFormColumns } from './useListFormColumns'
import { Loading } from '@/components/shared' import { Loading } from '@/components/shared'
import { useStoreState } from '@/store' import { useStoreState } from '@/store'
import { placeholder } from '@babel/types'
interface GridProps { interface GridProps {
listFormCode: string listFormCode: string
@ -950,6 +949,8 @@ const Grid = (props: GridProps) => {
canUpdate: listFormField?.canUpdate ?? false, canUpdate: listFormField?.canUpdate ?? false,
canCreate: listFormField?.canCreate ?? false, canCreate: listFormField?.canCreate ?? false,
canExport: listFormField?.canExport ?? false, canExport: listFormField?.canExport ?? false,
allowEditing: listFormField?.allowEditing ?? true,
allowAdding: listFormField?.allowAdding ?? true,
dataField: i.dataField, dataField: i.dataField,
name: i.dataField, name: i.dataField,
editorType2: i.editorType2, editorType2: i.editorType2,
@ -1197,7 +1198,7 @@ const Grid = (props: GridProps) => {
refreshMode={gridDto.gridOptions.editingOptionDto?.refreshMode} refreshMode={gridDto.gridOptions.editingOptionDto?.refreshMode}
mode={smaller.md ? 'form' : gridDto.gridOptions.editingOptionDto?.mode} mode={smaller.md ? 'form' : gridDto.gridOptions.editingOptionDto?.mode}
allowDeleting={gridDto.gridOptions.editingOptionDto?.allowDeleting} allowDeleting={gridDto.gridOptions.editingOptionDto?.allowDeleting}
allowUpdating={gridDto.gridOptions.editingOptionDto?.allowEditing} allowUpdating={gridDto.gridOptions.editingOptionDto?.allowUpdating}
allowAdding={gridDto.gridOptions.editingOptionDto?.allowAdding} allowAdding={gridDto.gridOptions.editingOptionDto?.allowAdding}
useIcons={gridDto.gridOptions.editingOptionDto?.useIcons} useIcons={gridDto.gridOptions.editingOptionDto?.useIcons}
confirmDelete={gridDto.gridOptions.editingOptionDto?.confirmDelete} confirmDelete={gridDto.gridOptions.editingOptionDto?.confirmDelete}
@ -1307,9 +1308,9 @@ const Grid = (props: GridProps) => {
if (mode === 'view') { if (mode === 'view') {
return a.canRead return a.canRead
} else if (mode === 'new') { } else if (mode === 'new') {
return a.canCreate || a.canRead return (a.canCreate || a.canRead) && a.allowAdding
} else if (mode === 'edit') { } else if (mode === 'edit') {
return a.canUpdate || a.canRead return (a.canUpdate || a.canRead) && a.allowEditing
} else { } else {
return false return false
} }
@ -1336,9 +1337,9 @@ const Grid = (props: GridProps) => {
if (mode === 'view') { if (mode === 'view') {
return a.canRead return a.canRead
} else if (mode === 'new') { } else if (mode === 'new') {
return a.canCreate || a.canRead return (a.canCreate || a.canRead) && a.allowAdding
} else if (mode === 'edit') { } else if (mode === 'edit') {
return a.canUpdate || a.canRead return (a.canUpdate || a.canRead) && a.allowEditing
} else { } else {
return false return false
} }

View file

@ -902,7 +902,7 @@ const Tree = (props: TreeProps) => {
refreshMode={gridDto.gridOptions.editingOptionDto?.refreshMode} refreshMode={gridDto.gridOptions.editingOptionDto?.refreshMode}
mode={smaller.md ? 'form' : gridDto.gridOptions.editingOptionDto?.mode} mode={smaller.md ? 'form' : gridDto.gridOptions.editingOptionDto?.mode}
allowDeleting={gridDto.gridOptions.editingOptionDto?.allowDeleting} allowDeleting={gridDto.gridOptions.editingOptionDto?.allowDeleting}
allowUpdating={gridDto.gridOptions.editingOptionDto?.allowEditing} allowUpdating={gridDto.gridOptions.editingOptionDto?.allowUpdating}
allowAdding={gridDto.gridOptions.editingOptionDto?.allowAdding} allowAdding={gridDto.gridOptions.editingOptionDto?.allowAdding}
useIcons={gridDto.gridOptions.editingOptionDto?.useIcons} useIcons={gridDto.gridOptions.editingOptionDto?.useIcons}
confirmDelete={gridDto.gridOptions.editingOptionDto?.confirmDelete} confirmDelete={gridDto.gridOptions.editingOptionDto?.confirmDelete}

View file

@ -317,8 +317,12 @@ const useListFormColumns = ({
return return
} }
const hasCreate =
gridDto.gridOptions.editingOptionDto.allowAdding &&
checkPermission(gridDto.gridOptions.permissionDto.i)
const hasUpdate = const hasUpdate =
gridDto.gridOptions.editingOptionDto.allowEditing && gridDto.gridOptions.editingOptionDto.allowUpdating &&
checkPermission(gridDto.gridOptions.permissionDto.u) checkPermission(gridDto.gridOptions.permissionDto.u)
const hasDelete = const hasDelete =
@ -336,7 +340,7 @@ const useListFormColumns = ({
const hasCommandButtons = gridDto.gridOptions.commandColumnDto.length > 0 const hasCommandButtons = gridDto.gridOptions.commandColumnDto.length > 0
// Eğer hiçbir buton eklenecek durumda değilse: çık // Eğer hiçbir buton eklenecek durumda değilse: çık
if (!hasUpdate && !hasDelete && !hasCommandButtons) { if (!hasUpdate && !hasDelete && !hasCreate && !hasCommandButtons) {
return return
} }

View file

@ -328,7 +328,7 @@ const useToolbar = ({
// batch editing icin kaydet ve geri al butonu // batch editing icin kaydet ve geri al butonu
if ( if (
grdOpt.editingOptionDto?.allowEditing && grdOpt.editingOptionDto?.allowUpdating &&
grdOpt.editingOptionDto?.mode == 'batch' && grdOpt.editingOptionDto?.mode == 'batch' &&
checkPermission(grdOpt.permissionDto?.u) checkPermission(grdOpt.permissionDto?.u)
) { ) {