From 9ea283712e95cfcceb57f7d0e0888f38d594fcd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sedat=20=C3=96ZT=C3=9CRK?= <76204082+iamsedatozturk@users.noreply.github.com> Date: Mon, 29 Sep 2025 10:08:24 +0300 Subject: [PATCH] dxSelectBox showClearButton --- .../Seeds/ListFormsSeeder.cs | 40 +++++++++---------- ui/src/views/form/FormButtons.tsx | 29 +++++++++----- ui/src/views/form/FormDevExpress.tsx | 7 ++-- 3 files changed, 42 insertions(+), 34 deletions(-) diff --git a/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs b/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs index 1c768432..657464fd 100644 --- a/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs +++ b/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs @@ -756,10 +756,10 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency new() { Order=2, ColCount=1, ColSpan=1, ItemType="group", Items = [ new EditingFormItemDto { Order=1, DataField="Country", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton }, - new EditingFormItemDto { Order=2, DataField="City", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxSelectBox }, - new EditingFormItemDto { Order=3, DataField="District", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxSelectBox }, - new EditingFormItemDto { Order=4, DataField="Street", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxSelectBox }, - new EditingFormItemDto { Order=5, DataField="PostalCode", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order=2, DataField="City", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton }, + new EditingFormItemDto { Order=3, DataField="District", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton }, + new EditingFormItemDto { Order=4, DataField="Street", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton }, + new EditingFormItemDto { Order=5, DataField="PostalCode", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxTextBox, EditorOptions=showClearButton }, new EditingFormItemDto { Order=6, DataField="Address", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxTextBox }, new EditingFormItemDto { Order=7, DataField="Address2", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxTextBox }, new EditingFormItemDto { Order=8, DataField="Email", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxTextBox }, @@ -1486,9 +1486,9 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency new() { Order=2, ColCount=1, ColSpan=1, ItemType="group", Items = [ new EditingFormItemDto { Order=1, DataField="Country", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton }, - new EditingFormItemDto { Order=2, DataField="City", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxSelectBox }, - new EditingFormItemDto { Order=3, DataField="District", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxSelectBox }, - new EditingFormItemDto { Order=4, DataField="Street", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order=2, DataField="City", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton }, + new EditingFormItemDto { Order=3, DataField="District", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton }, + new EditingFormItemDto { Order=4, DataField="Street", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton }, new EditingFormItemDto { Order=5, DataField="Address", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxTextBox }, new EditingFormItemDto { Order=6, DataField="Address2", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxTextBox }, new EditingFormItemDto { Order=7, DataField="PostalCode", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxTextBox }, @@ -11540,11 +11540,11 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency new() { Order=1,ColCount=1,ColSpan=2,ItemType="group", Items= [ new EditingFormItemDto { Order = 1, DataField = "Name", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 2, DataField = "Type", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 2, DataField = "Type", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton }, new EditingFormItemDto { Order = 3, DataField = "Ratio", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxNumberBox }, new EditingFormItemDto { Order = 4, DataField = "Rounding", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxNumberBox }, new EditingFormItemDto { Order = 5, DataField = "IsActive", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxCheckBox }, - new EditingFormItemDto { Order = 6, DataField = "UomCategoryId", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 6, DataField = "UomCategoryId", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton }, ] } }), @@ -11880,7 +11880,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency new EditingFormItemDto { Order = 1, DataField = "Name", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, new EditingFormItemDto { Order = 2, DataField = "Progress", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxNumberBox }, new EditingFormItemDto { Order = 3, DataField = "IsDefault", ColSpan = 2, IsRequired = false, EditorType2=EditorTypes.dxCheckBox }, - new EditingFormItemDto { Order = 4, DataField = "SkillTypeId", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 4, DataField = "SkillTypeId", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton }, ] } }), @@ -12175,7 +12175,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency new() { Order=1,ColCount=1,ColSpan=2,ItemType="group", Items= [ new EditingFormItemDto { Order = 1, DataField = "Name", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 2, DataField = "SkillTypeId", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 2, DataField = "SkillTypeId", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton }, ] } }), @@ -13224,7 +13224,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency new EditingFormItemDto { Order = 1, DataField = "Key", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, new EditingFormItemDto { Order = 2, DataField = "Path", ColSpan = 2, EditorType2 = EditorTypes.dxTextBox }, new EditingFormItemDto { Order = 3, DataField = "ComponentPath", ColSpan = 2, EditorType2 = EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 4, DataField = "RouteType", ColSpan = 2, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 4, DataField = "RouteType", ColSpan = 2, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton }, new EditingFormItemDto { Order = 5, DataField = "Authority", ColSpan = 2, EditorType2 = EditorTypes.dxTextBox } ] } @@ -13511,9 +13511,9 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency ItemType = "group", Items = [ - new EditingFormItemDto { Order = 1, DataField = "Name", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, - new EditingFormItemDto { Order = 2, DataField = "Description", ColSpan = 2, EditorType2 = EditorTypes.dxSelectBox }, - new EditingFormItemDto { Order = 3, DataField = "Category", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 1, DataField = "Name", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton }, + new EditingFormItemDto { Order = 2, DataField = "Description", ColSpan = 2, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton }, + new EditingFormItemDto { Order = 3, DataField = "Category", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton }, new EditingFormItemDto { Order = 4, DataField = "Order", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxNumberBox }, new EditingFormItemDto { Order = 5, DataField = "MonthlyPrice", ColSpan = 2, EditorType2 = EditorTypes.dxNumberBox }, new EditingFormItemDto { Order = 6, DataField = "YearlyPrice", ColSpan = 2, EditorType2 = EditorTypes.dxNumberBox }, @@ -14251,7 +14251,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency new EditingFormItemDto { Order = 4, DataField = "TaxOffice", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, new EditingFormItemDto { Order = 5, DataField = "Address", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, new EditingFormItemDto { Order = 6, DataField = "Address2", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 7, DataField = "Country", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 7, DataField = "Country", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton }, new EditingFormItemDto { Order = 8, DataField = "City", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, new EditingFormItemDto { Order = 9, DataField = "District", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, new EditingFormItemDto { Order = 10, DataField = "PostalCode", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, @@ -15390,10 +15390,10 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency ItemType = "group", Items = [ - new EditingFormItemDto { Order = 1, DataField = "Title", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 1, DataField = "Title", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton }, new EditingFormItemDto { Order = 2, DataField = "Icon", ColSpan = 2, IsRequired = false, EditorType2 = EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 3, DataField = "Description", ColSpan = 2, IsRequired = false, EditorType2 = EditorTypes.dxSelectBox }, - new EditingFormItemDto { Order = 4, DataField = "Type", ColSpan = 2, IsRequired = false, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 3, DataField = "Description", ColSpan = 2, IsRequired = false, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton }, + new EditingFormItemDto { Order = 4, DataField = "Type", ColSpan = 2, IsRequired = false, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton }, new EditingFormItemDto { Order = 5, DataField = "Features", ColSpan = 2, IsRequired = false, EditorType2 = EditorTypes.dxTextArea, EditorOptions="{\"height\":200}" }, ] } @@ -15923,7 +15923,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency ItemType = "group", Items = [ - new EditingFormItemDto { Order = 1, DataField = "Address", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 1, DataField = "Address", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton }, new EditingFormItemDto { Order = 2, DataField = "Phone", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, new EditingFormItemDto { Order = 3, DataField = "Email", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, new EditingFormItemDto { Order = 4, DataField = "Location", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, diff --git a/ui/src/views/form/FormButtons.tsx b/ui/src/views/form/FormButtons.tsx index 1af6df1d..db766981 100644 --- a/ui/src/views/form/FormButtons.tsx +++ b/ui/src/views/form/FormButtons.tsx @@ -3,7 +3,16 @@ import navigationIcon from '@/configs/navigation-icon.config' import { useLocalization } from '@/utils/hooks/useLocalization' import CustomStore from 'devextreme/data/custom_store' import { useState } from 'react' -import { FaPlus, FaTrash, FaEdit, FaFileAlt, FaSave, FaInfo, FaBackward } from 'react-icons/fa' +import { + FaChevronLeft, + FaTrashAlt, + FaPlusCircle, + FaPencilAlt, + FaEye, + FaTools, + FaCloudUploadAlt, + FaSave, +} from 'react-icons/fa' import { useNavigate } from 'react-router-dom' import { GridColumnData } from '../list/GridColumnData' import { useToolbar } from '../list/useToolbar' @@ -175,7 +184,7 @@ const FormButtons = (props: { size="xs" variant="default" className="dx-button dx-button-mode-contained dx-button-normal" - icon={} + icon={} color="gray-500" title={translate('::Cancel')} onClick={() => { @@ -185,30 +194,28 @@ const FormButtons = (props: { navigate(-1) } }} - > - + > )} {mode != 'new' && ( + > )} {mode != 'new' && (