diff --git a/api/src/Kurs.Platform.Application.Contracts/ListForms/GridOptionsDto/GridOptionsDto.cs b/api/src/Kurs.Platform.Application.Contracts/ListForms/GridOptionsDto/GridOptionsDto.cs index f1d81338..29cc7143 100644 --- a/api/src/Kurs.Platform.Application.Contracts/ListForms/GridOptionsDto/GridOptionsDto.cs +++ b/api/src/Kurs.Platform.Application.Contracts/ListForms/GridOptionsDto/GridOptionsDto.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using Kurs.Platform.Charts.Dto; using Kurs.Platform.Enums; using Volo.Abp.Application.Dtos; @@ -332,4 +333,356 @@ public class GridOptionsDto : AuditedEntityDto } set { LayoutJson = JsonSerializer.Serialize(value); } } + + /// Chart a yetkili kullanıcı. UserId ve RoleId boş ise herkes yetkilidir + /// + public string UserId { get; set; } + /// Chart a yetkili rol. UserId ve RoleId boş ise herkes yetkilidir + /// + public string RoleId { get; set; } + /// Grafik hangi dile ait + /// + + /// DxChart'ın istediği diğer bütün ayarların tutulduğu Json veri yapısı + /// + [JsonIgnore] + public string CommonJson { get; set; } + public ChartCommonDto CommonDto + { + get + { + if (!string.IsNullOrEmpty(CommonJson)) + return JsonSerializer.Deserialize(CommonJson); + return new ChartCommonDto(); + } + set { CommonJson = JsonSerializer.Serialize(value); } + } + + /// Uyarlanabilir düzen özelliklerini tutan Json veri yapısıdır. + /// Uyarlanabilir düzen, UI bileşeninin, kapsayıcıya sığmayan isteğe bağlı öğeleri gizlemesini sağlar. + /// Şu sırada gizlenir: Title, Export menu icon, Legend, Axis titles, Axis labels + /// + [JsonIgnore] + public string AdaptiveLayoutJson { get; set; } + public ChartAdaptivelayoutDto AdaptivelayoutDto + { + get + { + if (!string.IsNullOrEmpty(AdaptiveLayoutJson)) + return JsonSerializer.Deserialize(AdaptiveLayoutJson); + return new ChartAdaptivelayoutDto(); + } + set { AdaptiveLayoutJson = JsonSerializer.Serialize(value); } + } + + /// Animasyon özelliklerini belirtir. + /// UI bileşeni, öğeler ilk yüklenirken ve veri kaynağı değiştiğinde canlandırır + /// + [JsonIgnore] + public string AnimationJson { get; set; } + public ChartAnimationDto AnimationDto + { + get + { + if (!string.IsNullOrEmpty(AnimationJson)) + return JsonSerializer.Deserialize(AnimationJson); + return new ChartAnimationDto(); + } + set { AnimationJson = JsonSerializer.Serialize(value); } + } + + /// Ek açıklama koleksiyonuna ait Json veri yapısı. + /// Ek açıklamalar, görselleştirilmiş veriler hakkında ek bilgiler görüntüleyen resimler, metin blokları ve özel içerik için içeriklerdir + /// + [JsonIgnore] + public string AnnotationsJson { get; set; } + public List AnnotationsDto + { + get + { + if (!string.IsNullOrEmpty(AnnotationsJson)) + return JsonSerializer.Deserialize>(AnnotationsJson); + return new List(); + } + set { AnnotationsJson = JsonSerializer.Serialize(value); } + } + + /// Bağımsız değişken eksenini yapılandırır. + /// Burada açıklanan argumentAxis nesnesi, bağımsız değişken eksenini ayrı ayrı yapılandırır. + /// Bir grafikteki tüm eksenler için ortak ayarlar belirtmek üzere commonAxisSettings nesnesini kullanılmalıdır. + /// Eksene özgü ayarlar, ortak ayarları geçersiz kılar. + /// + [JsonIgnore] + public string ArgumentAxisJson { get; set; } + public ChartArgumentAxisDto ArgumentAxisDto + { + get + { + if (!string.IsNullOrEmpty(ArgumentAxisJson)) + return JsonSerializer.Deserialize(ArgumentAxisJson); + return new ChartArgumentAxisDto(); + } + set { ArgumentAxisJson = JsonSerializer.Serialize(value); } + } + + /// Grafikteki tüm detaylandırmalar için ortak olan ayarları belirtir. + /// Burada belirtilen ayarlar, AnnotationsJson dizisinde belirtilen bireysel ek açıklama ayarlar var ise göz ardı edilebilir. + /// Ek açıklamaların nasıl yapılandırılacağı hakkında bilgi için AnnotationsJson açıklamasına bakın. + /// + [JsonIgnore] + public string CommonAnnotationsSettingsJson { get; set; } + public ChartCommonAnnotationDto CommonAnnotationSettingsDto + { + get + { + if (!string.IsNullOrEmpty(CommonAnnotationsSettingsJson)) + return JsonSerializer.Deserialize(CommonAnnotationsSettingsJson); + return new ChartCommonAnnotationDto(); + } + set { CommonAnnotationsSettingsJson = JsonSerializer.Serialize(value); } + } + + /// Bir grafikte hem bağımsız değişken hem de değer ekseni için ortak ayarları tanımlar. + /// Burada belirtilen ayarlar, ArgumentAxisJson yada ValueAxisJson ayarları dolu ise göz ardı edilir + /// + [JsonIgnore] + public string CommonAxisSettingsJson { get; set; } + /// Bir grafikte hem bağımsız değişken hem de değer ekseni için ortak ayarları tanımlar. + /// + public ChartCommonAxisDto CommonAxisSettingsDto + { + get + { + if (!string.IsNullOrEmpty(CommonAxisSettingsJson)) + return JsonSerializer.Deserialize(CommonAxisSettingsJson); + return new ChartCommonAxisDto(); + } + set { CommonAxisSettingsJson = JsonSerializer.Serialize(value); } + } + + /// Bir grafikteki tüm bölmeler için ortak ayarları tanımlar. + /// Bölme, dizi içeren bir grafik alanıdır. Bir grafikte çok sayıda seri varsa, bunlar birden çok bölme arasında dağıtılabilir. + /// + [JsonIgnore] + public string CommonPaneSettingsJson { get; set; } + public ChartCommonPaneDto CommonPaneSettingsDto + { + get + { + if (!string.IsNullOrEmpty(CommonPaneSettingsJson)) + return JsonSerializer.Deserialize(CommonPaneSettingsJson); + return new ChartCommonPaneDto(); + } + set { CommonPaneSettingsJson = JsonSerializer.Serialize(value); } + } + + /// Grafikteki tüm seriler için ortak olan ayarları belirtir. + /// + [JsonIgnore] + public string CommonSeriesSettingsJson { get; set; } + public ChartCommonSeriesSettingsDto CommonSeriesSettingsDto + { + get + { + if (!string.IsNullOrEmpty(CommonSeriesSettingsJson)) + return JsonSerializer.Deserialize(CommonSeriesSettingsJson); + return new ChartCommonSeriesSettingsDto(); + } + set { CommonSeriesSettingsJson = JsonSerializer.Serialize(value); } + } + + /// fare ile grafik üzerindeki bir noktaya gelindiğinde yatay ve dikey çizgilerin çıkmasını sağlayan Json veri yapısıdır + /// + [JsonIgnore] + public string CrosshairJson { get; set; } + public ChartCrosshairDto CrosshairDto + { + get + { + if (!string.IsNullOrEmpty(CrosshairJson)) + return JsonSerializer.Deserialize(CrosshairJson); + return new ChartCrosshairDto(); + } + set { CrosshairJson = JsonSerializer.Serialize(value); } + } + + /// Dışa aktarma ve yazdırma özelliklerini yapılandırır + /// + [JsonIgnore] + public string ExportJson { get; set; } + public ChartExportDto ExportDto + { + get + { + if (!string.IsNullOrEmpty(ExportJson)) + return JsonSerializer.Deserialize(ExportJson); + return new ChartExportDto(); + } + set { ExportJson = JsonSerializer.Serialize(value); } + } + + /// Bir grafiğin açıklamasının (lejant) özelliklerini belirtir. + /// Grafik Kullanıcı Arabirimi bileşeni, bir diziyi tanımlamanıza yardımcı olan açıklayıcı bir bileşen olan bir açıklama içerebilir. + /// Her seri, bir Legend bir öğe ile temsil edilir. Bir öğe işaretçisi, seri rengini tanımlar. + /// + [JsonIgnore] + public string LegendJson { get; set; } + public ChartLegendDto LegendDto + { + get + { + if (!string.IsNullOrEmpty(LegendJson)) + return JsonSerializer.Deserialize(LegendJson); + return new ChartLegendDto(); + } + set { LegendJson = JsonSerializer.Serialize(value); } + } + + /// UI bileşeni çevresinde boşluk ayarlarını yapılandırır + /// + [JsonIgnore] + public string MarginJson { get; set; } + public ChartMarginDto MarginDto + { + get + { + if (!string.IsNullOrEmpty(MarginJson)) + return JsonSerializer.Deserialize(MarginJson); + return new ChartMarginDto(); + } + set { MarginJson = JsonSerializer.Serialize(value); } + } + + /// Bölme alanlarını bildirir. Bölme, dizi içeren bir grafik alanıdır. + /// Bir grafikte çok sayıda seri varsa, bunlar birden çok bölme arasında dağıtılabilir. + /// + [JsonIgnore] + public string PanesJson { get; set; } + /// + /// Bilgilendirme: PanesDto dolu ise Serilerin Pane property leri mutlaka dolu olmalıdır + /// + public List PanesDto + { + get + { + if (!string.IsNullOrEmpty(PanesJson)) + return JsonSerializer.Deserialize>(PanesJson); + return new List(); + } + set { PanesJson = JsonSerializer.Serialize(value); } + } + + /// Kaydırma çubuğunun ayarlarını belirtir. + /// + [JsonIgnore] + public string ScrollBarJson { get; set; } + public ChartScrollBarDto ScrollBarDto + { + get + { + if (!string.IsNullOrEmpty(ScrollBarJson)) + return JsonSerializer.Deserialize(ScrollBarJson); + return new ChartScrollBarDto(); + } + set { ScrollBarJson = JsonSerializer.Serialize(value); } + } + + /// Chart UI bileşen serisi için özellikleri belirtir. + /// Cannot be used in themes + /// + [JsonIgnore] + public string SeriesJson { get; set; } + public List SeriesDto + { + get + { + if (!string.IsNullOrEmpty(SeriesJson)) + return JsonSerializer.Deserialize>(SeriesJson); + return new List(); + } + set { SeriesJson = JsonSerializer.Serialize(value); } + } + + /// Char boyutunu belirtir + /// + [JsonIgnore] + public string SizeJson { get; set; } + public ChartSizeDto SizeDto + { + get + { + if (!string.IsNullOrEmpty(SizeJson)) + return JsonSerializer.Deserialize(SizeJson); + return new ChartSizeDto(); + } + set { SizeJson = JsonSerializer.Serialize(value); } + } + + /// Başlık ayarlarını içeren Json veri yapısı + /// + [JsonIgnore] + public string TitleJson { get; set; } + /// Başlık ayarlarının nesnesi + /// + public ChartTitleDto TitleDto + { + get + { + if (!string.IsNullOrEmpty(TitleJson)) + return JsonSerializer.Deserialize(TitleJson); + return new ChartTitleDto(); + } + set { TitleJson = JsonSerializer.Serialize(value); } + } + + /// Tooltip ayarlarını içeren Json veri yapısıdır. + /// Tooltip, bir seri noktasının değerlerini gösteren minyatür bir dikdörtgendir. + /// Kullanıcı imleci bir dizi noktasının üzerine getirdiğinde bir araç ipucu görünür. + /// + [JsonIgnore] + public string TooltipJson { get; set; } + public ChartTooltipDto TooltipDto + { + get + { + if (!string.IsNullOrEmpty(TooltipJson)) + return JsonSerializer.Deserialize(TooltipJson); + return new ChartTooltipDto(); + } + set { TooltipJson = JsonSerializer.Serialize(value); } + } + + /// Değer eksenini yapılandırır. + /// Burada açıklanan valueAxis nesnesi, değer eksenini ayrı ayrı yapılandırır. + /// Bir grafikteki tüm eksenler için ortak ayarlar belirtmek üzere commonAxisSettings nesnesini kullanılmalıdır. Eksene özgü ayarlar, ortak ayarları geçersiz kılar. + /// + [JsonIgnore] + public string ValueAxisJson { get; set; } + public List ValueAxisDto + { + get + { + if (!string.IsNullOrEmpty(ValueAxisJson)) + return JsonSerializer.Deserialize>(ValueAxisJson); + return new List(); + } + set { ValueAxisJson = JsonSerializer.Serialize(value); } + } + + /// Yakınlaştırmayı ve kaydırmayı yapılandırır. + /// Bağımsız değişken ve değer eksenleri için yakınlaştırmayı ve kaydırmayı etkinleştirebilirsiniz. + /// Belirli bir eksen için yakınlaştırmayı, kaydırmayı veya her ikisini birden etkinleştirmek için argumentAxis ve valueAxis özellikleri ayarlanmalıdır + /// + [JsonIgnore] + public string ZoomAndPanJson { get; set; } + public ChartZoomAndPanDto ZoomAndPanDto + { + get + { + if (!string.IsNullOrEmpty(ZoomAndPanJson)) + return JsonSerializer.Deserialize(ZoomAndPanJson); + return new ChartZoomAndPanDto(); + } + set { ZoomAndPanJson = JsonSerializer.Serialize(value); } + } } diff --git a/api/src/Kurs.Platform.Application.Contracts/ListForms/ListFormEditTabs.cs b/api/src/Kurs.Platform.Application.Contracts/ListForms/ListFormEditTabs.cs index 111de440..0b51ea72 100644 --- a/api/src/Kurs.Platform.Application.Contracts/ListForms/ListFormEditTabs.cs +++ b/api/src/Kurs.Platform.Application.Contracts/ListForms/ListFormEditTabs.cs @@ -51,4 +51,15 @@ public class ListFormEditTabs public const string Fields = "fields"; public const string Customization = "customization"; public const string ExtraFilterForm = "extraFilter"; + // Chart ile ilgili sekmeler + public const string ChartAnimations = "chartAnimations"; + public const string ChartAnnotations = "chartAnnotations"; + public const string ChartCommon = "chartCommon"; + public const string ChartSeries = "chartSeries"; + public const string ChartAxis = "chartAxis"; + public const string ChartPanes = "chartPanes"; + public const string ChartCrosshair = "chartCrosshair"; + public const string ChartExport = "chartExport"; + public const string ChartLegend = "chartLegend"; + public const string ChartZoom = "chartZoom"; } diff --git a/api/src/Kurs.Platform.Application/ListForms/Administration/ListFormsAppService.cs b/api/src/Kurs.Platform.Application/ListForms/Administration/ListFormsAppService.cs index 48be1d89..66806783 100644 --- a/api/src/Kurs.Platform.Application/ListForms/Administration/ListFormsAppService.cs +++ b/api/src/Kurs.Platform.Application/ListForms/Administration/ListFormsAppService.cs @@ -66,6 +66,10 @@ public class ListFormsAppService : CrudAppService< item.IsSubForm = input.IsSubForm; item.ListFormType = input.ListFormType; item.LayoutJson = JsonSerializer.Serialize(input.LayoutDto); + + //Chart ile ilgili sütunlar + item.RoleId = input.RoleId; + item.UserId = input.UserId; } else if (input.EditType == ListFormEditTabs.Database.DataSourceForm) { @@ -147,6 +151,49 @@ public class ListFormsAppService : CrudAppService< item.SubFormsJson = JsonSerializer.Serialize(input.SubFormsDto); } + /*Chart*/ + else if (input.EditType == ListFormEditTabs.ChartCommon) + { + item.CommonJson = JsonSerializer.Serialize(input.CommonDto); + } + else if (input.EditType == ListFormEditTabs.ChartSeries) + { + item.SeriesJson = JsonSerializer.Serialize(input.SeriesDto); + } + else if (input.EditType == ListFormEditTabs.ChartAxis) + { + item.CommonAxisSettingsJson = JsonSerializer.Serialize(input.CommonAxisSettingsDto); + item.ArgumentAxisJson = JsonSerializer.Serialize(input.ArgumentAxisDto); + } + else if (input.EditType == ListFormEditTabs.ChartPanes) + { + item.PanesJson = JsonSerializer.Serialize(input.PanesDto); + } + else if (input.EditType == ListFormEditTabs.ChartAnimations) + { + item.AnimationJson = JsonSerializer.Serialize(input.AnimationDto); + } + else if (input.EditType == ListFormEditTabs.ChartAnnotations) + { + item.AnnotationsJson = JsonSerializer.Serialize(input.AnnotationsDto); + } + else if (input.EditType == ListFormEditTabs.ChartZoom) + { + item.ZoomAndPanJson = JsonSerializer.Serialize(input.ZoomAndPanDto); + } + else if (input.EditType == ListFormEditTabs.ChartLegend) + { + item.LegendJson = JsonSerializer.Serialize(input.LegendDto); + } + else if (input.EditType == ListFormEditTabs.ChartExport) + { + item.ExportJson = JsonSerializer.Serialize(input.ExportDto); + } + else if (input.EditType == ListFormEditTabs.ChartCrosshair) + { + item.CrosshairJson = JsonSerializer.Serialize(input.CrosshairDto); + } + await Repository.UpdateAsync(item, autoSave: true); return await MapToGetOutputDtoAsync(item); diff --git a/api/src/Kurs.Platform.Domain/Entities/ListForm.cs b/api/src/Kurs.Platform.Domain/Entities/ListForm.cs index aacd9a54..869ca466 100644 --- a/api/src/Kurs.Platform.Domain/Entities/ListForm.cs +++ b/api/src/Kurs.Platform.Domain/Entities/ListForm.cs @@ -125,4 +125,105 @@ public class ListForm : FullAuditedEntity /// bu listform'un üstünde yer alan widgetların listesidir public string LayoutJson { get; set; } + + /* + Chart ile ilgili alanlar + */ + + /// Chart a yetkili kullanıcı. UserId ve RoleId boş ise herkes yetkilidir + /// + public string UserId { get; set; } + /// Chart a yetkili rol. UserId ve RoleId boş ise herkes yetkilidir + /// + public string RoleId { get; set; } + + /// DxChart'ın istediği ve aşağıdaki diğer propertyler içerisinde olmayan diğer bütün ayarların tutulduğu Json veri yapısı + /// + public string CommonJson { get; set; } + /// Chart'a ait sorguların tutulduğu Json veri yapısı + /// + public string DataSourceJson { get; set; } + + /// Uyarlanabilir düzen özelliklerini tutan Json veri yapısıdır. + /// Uyarlanabilir düzen, UI bileşeninin, kapsayıcıya sığmayan isteğe bağlı öğeleri gizlemesini sağlar. + /// + public string AdaptiveLayoutJson { get; set; } + /// Animasyon özelliklerini belirtir. + /// UI bileşeni, öğeler ilk yüklenirken ve veri kaynağı değiştiğinde canlandırır + /// + public string AnimationJson { get; set; } + /// Ek açıklama koleksiyonuna ait Json veri yapısı. + /// Ek açıklamalar, görselleştirilmiş veriler hakkında ek bilgiler görüntüleyen resimler, metin blokları ve özel içerik için içeriklerdir + /// + public string AnnotationsJson { get; set; } + /// Bağımsız değişken eksenini yapılandırır. + /// Burada açıklanan argumentAxis nesnesi, bağımsız değişken eksenini ayrı ayrı yapılandırır. + /// Bir grafikteki tüm eksenler için ortak ayarlar belirtmek üzere commonAxisSettings nesnesini kullanılmalıdır. + /// Eksene özgü ayarlar, ortak ayarları geçersiz kılar. + /// + public string ArgumentAxisJson { get; set; } + + /// Grafikteki tüm detaylandırmalar için ortak olan ayarları belirtir. + /// Burada belirtilen ayarlar, AnnotationsJson dizisinde belirtilen bireysel ek açıklama ayarlar var ise göz ardı edilebilir. + /// Ek açıklamaların nasıl yapılandırılacağı hakkında bilgi için AnnotationsJson açıklamasına bakın. + /// + public string CommonAnnotationsSettingsJson { get; set; } + /// Bir grafikte hem bağımsız değişken hem de değer ekseni için ortak ayarları tanımlar. + /// Burada belirtilen ayarlar, ArgumentAxisJson yada ValueAxisJson ayarları dolu ise göz ardı edilir + /// + public string CommonAxisSettingsJson { get; set; } + /// Bir grafikteki tüm bölmeler için ortak ayarları tanımlar. + /// Bölme, dizi içeren bir grafik alanıdır. Bir grafikte çok sayıda seri varsa, bunlar birden çok bölme arasında dağıtılabilir. + /// + public string CommonPaneSettingsJson { get; set; } + /// Grafikteki tüm seriler için ortak olan ayarları belirtir. + /// + public string CommonSeriesSettingsJson { get; set; } + + /// fare ile grafik üzerindeki bir noktaya gelindiğinde yatay ve dikey çizgilerin çıkmasını sağlayan Json veri yapısıdır + /// + public string CrosshairJson { get; set; } + /// Dışa aktarma ve yazdırma özelliklerini yapılandırır + /// + public string ExportJson { get; set; } + /// Bir grafiğin açıklamasının (lejant) özelliklerini belirtir. + /// Grafik Kullanıcı Arabirimi bileşeni, bir diziyi tanımlamanıza yardımcı olan açıklayıcı bir bileşen olan bir açıklama içerebilir. + /// Her seri, bir Legend bir öğe ile temsil edilir. Bir öğe işaretçisi, seri rengini tanımlar. + /// + public string LegendJson { get; set; } + /// UI bileşeni çevresinde boşluk ayarlarını yapılandırır + /// + public string MarginJson { get; set; } + /// Bölme alanlarını bildirir. Bölme, dizi içeren bir grafik alanıdır. + /// Bir grafikte çok sayıda seri varsa, bunlar birden çok bölme arasında dağıtılabilir. + /// + public string PanesJson { get; set; } + /// Kaydırma çubuğunun ayarlarını belirtir. + /// + public string ScrollBarJson { get; set; } + /// Chart UI bileşen serisi için özellikleri belirtir. + /// Cannot be used in themes + /// + public string SeriesJson { get; set; } + /// Char boyutunu belirtir + /// + public string SizeJson { get; set; } + /// Başlık ayarlarını içeren Json veri yapısı + /// + public string TitleJson { get; set; } + /// Tooltip ayarlarını içeren Json veri yapısıdır. + /// Tooltip, bir seri noktasının değerlerini gösteren minyatür bir dikdörtgendir. + /// Kullanıcı imleci bir dizi noktasının üzerine getirdiğinde bir araç ipucu görünür. + /// + public string TooltipJson { get; set; } + /// Değer eksenini yapılandırır. + /// Burada açıklanan valueAxis nesnesi, değer eksenini ayrı ayrı yapılandırır. + /// Bir grafikteki tüm eksenler için ortak ayarlar belirtmek üzere commonAxisSettings nesnesini kullanılmalıdır. Eksene özgü ayarlar, ortak ayarları geçersiz kılar. + /// + public string ValueAxisJson { get; set; } + /// Yakınlaştırmayı ve kaydırmayı yapılandırır. + /// Bağımsız değişken ve değer eksenleri için yakınlaştırmayı ve kaydırmayı etkinleştirebilirsiniz. + /// Belirli bir eksen için yakınlaştırmayı, kaydırmayı veya her ikisini birden etkinleştirmek için argumentAxis ve valueAxis özellikleri ayarlanmalıdır + /// + public string ZoomAndPanJson { get; set; } } diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20250925111605_Initial.Designer.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20250926063427_Initial.Designer.cs similarity index 98% rename from api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20250925111605_Initial.Designer.cs rename to api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20250926063427_Initial.Designer.cs index 23f39a59..3782c4c6 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20250925111605_Initial.Designer.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20250926063427_Initial.Designer.cs @@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore; namespace Kurs.Platform.Migrations { [DbContext(typeof(PlatformDbContext))] - [Migration("20250925111605_Initial")] + [Migration("20250926063427_Initial")] partial class Initial { /// @@ -2751,12 +2751,39 @@ namespace Kurs.Platform.Migrations b.Property("Id") .HasColumnType("uniqueidentifier"); + b.Property("AdaptiveLayoutJson") + .HasColumnType("nvarchar(max)"); + + b.Property("AnimationJson") + .HasColumnType("nvarchar(max)"); + + b.Property("AnnotationsJson") + .HasColumnType("nvarchar(max)"); + + b.Property("ArgumentAxisJson") + .HasColumnType("nvarchar(max)"); + b.Property("ColumnOptionJson") .HasColumnType("nvarchar(max)"); b.Property("CommandColumnJson") .HasColumnType("nvarchar(max)"); + b.Property("CommonAnnotationsSettingsJson") + .HasColumnType("nvarchar(max)"); + + b.Property("CommonAxisSettingsJson") + .HasColumnType("nvarchar(max)"); + + b.Property("CommonJson") + .HasColumnType("nvarchar(max)"); + + b.Property("CommonPaneSettingsJson") + .HasColumnType("nvarchar(max)"); + + b.Property("CommonSeriesSettingsJson") + .HasColumnType("nvarchar(max)"); + b.Property("CreationTime") .HasColumnType("datetime2") .HasColumnName("CreationTime"); @@ -2765,6 +2792,9 @@ namespace Kurs.Platform.Migrations .HasColumnType("uniqueidentifier") .HasColumnName("CreatorId"); + b.Property("CrosshairJson") + .HasColumnType("nvarchar(max)"); + b.Property("CultureName") .HasColumnType("nvarchar(max)"); @@ -2777,6 +2807,9 @@ namespace Kurs.Platform.Migrations b.Property("DataSourceCode") .HasColumnType("nvarchar(max)"); + b.Property("DataSourceJson") + .HasColumnType("nvarchar(max)"); + b.Property("DefaultFilter") .HasColumnType("nvarchar(max)"); @@ -2806,6 +2839,9 @@ namespace Kurs.Platform.Migrations b.Property("EditingOptionJson") .HasColumnType("nvarchar(max)"); + b.Property("ExportJson") + .HasColumnType("nvarchar(max)"); + b.Property("ExtraFilterJson") .HasColumnType("nvarchar(max)"); @@ -2872,6 +2908,9 @@ namespace Kurs.Platform.Migrations b.Property("LayoutJson") .HasColumnType("nvarchar(max)"); + b.Property("LegendJson") + .HasColumnType("nvarchar(max)"); + b.Property("ListFormCode") .IsRequired() .HasColumnType("nvarchar(450)"); @@ -2879,6 +2918,9 @@ namespace Kurs.Platform.Migrations b.Property("ListFormType") .HasColumnType("nvarchar(max)"); + b.Property("MarginJson") + .HasColumnType("nvarchar(max)"); + b.Property("Name") .HasColumnType("nvarchar(max)"); @@ -2890,12 +2932,21 @@ namespace Kurs.Platform.Migrations b.Property("PagerOptionJson") .HasColumnType("nvarchar(max)"); + b.Property("PanesJson") + .HasColumnType("nvarchar(max)"); + b.Property("PermissionJson") .HasColumnType("nvarchar(max)"); b.Property("PivotOptionJson") .HasColumnType("nvarchar(max)"); + b.Property("RoleId") + .HasColumnType("nvarchar(max)"); + + b.Property("ScrollBarJson") + .HasColumnType("nvarchar(max)"); + b.Property("SearchPanelJson") .HasColumnType("nvarchar(max)"); @@ -2911,6 +2962,12 @@ namespace Kurs.Platform.Migrations b.Property("SelectionJson") .HasColumnType("nvarchar(max)"); + b.Property("SeriesJson") + .HasColumnType("nvarchar(max)"); + + b.Property("SizeJson") + .HasColumnType("nvarchar(max)"); + b.Property("SortMode") .HasColumnType("nvarchar(max)"); @@ -2926,6 +2983,12 @@ namespace Kurs.Platform.Migrations b.Property("Title") .HasColumnType("nvarchar(max)"); + b.Property("TitleJson") + .HasColumnType("nvarchar(max)"); + + b.Property("TooltipJson") + .HasColumnType("nvarchar(max)"); + b.Property("UpdateCommand") .HasColumnType("nvarchar(max)"); @@ -2935,12 +2998,21 @@ namespace Kurs.Platform.Migrations b.Property("UpdateServiceAddress") .HasColumnType("nvarchar(max)"); + b.Property("UserId") + .HasColumnType("nvarchar(max)"); + + b.Property("ValueAxisJson") + .HasColumnType("nvarchar(max)"); + b.Property("WidgetsJson") .HasColumnType("nvarchar(max)"); b.Property("Width") .HasColumnType("int"); + b.Property("ZoomAndPanJson") + .HasColumnType("nvarchar(max)"); + b.HasKey("Id"); b.ToTable("PListForm", (string)null); diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20250925111605_Initial.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20250926063427_Initial.cs similarity index 98% rename from api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20250925111605_Initial.cs rename to api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20250926063427_Initial.cs index 55a50b8f..195fdcca 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20250925111605_Initial.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20250926063427_Initial.cs @@ -1243,6 +1243,30 @@ namespace Kurs.Platform.Migrations WidgetsJson = table.Column(type: "nvarchar(max)", nullable: true), ExtraFilterJson = table.Column(type: "nvarchar(max)", nullable: true), LayoutJson = table.Column(type: "nvarchar(max)", nullable: true), + UserId = table.Column(type: "nvarchar(max)", nullable: true), + RoleId = table.Column(type: "nvarchar(max)", nullable: true), + CommonJson = table.Column(type: "nvarchar(max)", nullable: true), + DataSourceJson = table.Column(type: "nvarchar(max)", nullable: true), + AdaptiveLayoutJson = table.Column(type: "nvarchar(max)", nullable: true), + AnimationJson = table.Column(type: "nvarchar(max)", nullable: true), + AnnotationsJson = table.Column(type: "nvarchar(max)", nullable: true), + ArgumentAxisJson = table.Column(type: "nvarchar(max)", nullable: true), + CommonAnnotationsSettingsJson = table.Column(type: "nvarchar(max)", nullable: true), + CommonAxisSettingsJson = table.Column(type: "nvarchar(max)", nullable: true), + CommonPaneSettingsJson = table.Column(type: "nvarchar(max)", nullable: true), + CommonSeriesSettingsJson = table.Column(type: "nvarchar(max)", nullable: true), + CrosshairJson = table.Column(type: "nvarchar(max)", nullable: true), + ExportJson = table.Column(type: "nvarchar(max)", nullable: true), + LegendJson = table.Column(type: "nvarchar(max)", nullable: true), + MarginJson = table.Column(type: "nvarchar(max)", nullable: true), + PanesJson = table.Column(type: "nvarchar(max)", nullable: true), + ScrollBarJson = table.Column(type: "nvarchar(max)", nullable: true), + SeriesJson = table.Column(type: "nvarchar(max)", nullable: true), + SizeJson = table.Column(type: "nvarchar(max)", nullable: true), + TitleJson = table.Column(type: "nvarchar(max)", nullable: true), + TooltipJson = table.Column(type: "nvarchar(max)", nullable: true), + ValueAxisJson = table.Column(type: "nvarchar(max)", nullable: true), + ZoomAndPanJson = table.Column(type: "nvarchar(max)", nullable: true), CreationTime = table.Column(type: "datetime2", nullable: false), CreatorId = table.Column(type: "uniqueidentifier", nullable: true), LastModificationTime = table.Column(type: "datetime2", nullable: true), diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs index 9662f861..1dc37918 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs @@ -2748,12 +2748,39 @@ namespace Kurs.Platform.Migrations b.Property("Id") .HasColumnType("uniqueidentifier"); + b.Property("AdaptiveLayoutJson") + .HasColumnType("nvarchar(max)"); + + b.Property("AnimationJson") + .HasColumnType("nvarchar(max)"); + + b.Property("AnnotationsJson") + .HasColumnType("nvarchar(max)"); + + b.Property("ArgumentAxisJson") + .HasColumnType("nvarchar(max)"); + b.Property("ColumnOptionJson") .HasColumnType("nvarchar(max)"); b.Property("CommandColumnJson") .HasColumnType("nvarchar(max)"); + b.Property("CommonAnnotationsSettingsJson") + .HasColumnType("nvarchar(max)"); + + b.Property("CommonAxisSettingsJson") + .HasColumnType("nvarchar(max)"); + + b.Property("CommonJson") + .HasColumnType("nvarchar(max)"); + + b.Property("CommonPaneSettingsJson") + .HasColumnType("nvarchar(max)"); + + b.Property("CommonSeriesSettingsJson") + .HasColumnType("nvarchar(max)"); + b.Property("CreationTime") .HasColumnType("datetime2") .HasColumnName("CreationTime"); @@ -2762,6 +2789,9 @@ namespace Kurs.Platform.Migrations .HasColumnType("uniqueidentifier") .HasColumnName("CreatorId"); + b.Property("CrosshairJson") + .HasColumnType("nvarchar(max)"); + b.Property("CultureName") .HasColumnType("nvarchar(max)"); @@ -2774,6 +2804,9 @@ namespace Kurs.Platform.Migrations b.Property("DataSourceCode") .HasColumnType("nvarchar(max)"); + b.Property("DataSourceJson") + .HasColumnType("nvarchar(max)"); + b.Property("DefaultFilter") .HasColumnType("nvarchar(max)"); @@ -2803,6 +2836,9 @@ namespace Kurs.Platform.Migrations b.Property("EditingOptionJson") .HasColumnType("nvarchar(max)"); + b.Property("ExportJson") + .HasColumnType("nvarchar(max)"); + b.Property("ExtraFilterJson") .HasColumnType("nvarchar(max)"); @@ -2869,6 +2905,9 @@ namespace Kurs.Platform.Migrations b.Property("LayoutJson") .HasColumnType("nvarchar(max)"); + b.Property("LegendJson") + .HasColumnType("nvarchar(max)"); + b.Property("ListFormCode") .IsRequired() .HasColumnType("nvarchar(450)"); @@ -2876,6 +2915,9 @@ namespace Kurs.Platform.Migrations b.Property("ListFormType") .HasColumnType("nvarchar(max)"); + b.Property("MarginJson") + .HasColumnType("nvarchar(max)"); + b.Property("Name") .HasColumnType("nvarchar(max)"); @@ -2887,12 +2929,21 @@ namespace Kurs.Platform.Migrations b.Property("PagerOptionJson") .HasColumnType("nvarchar(max)"); + b.Property("PanesJson") + .HasColumnType("nvarchar(max)"); + b.Property("PermissionJson") .HasColumnType("nvarchar(max)"); b.Property("PivotOptionJson") .HasColumnType("nvarchar(max)"); + b.Property("RoleId") + .HasColumnType("nvarchar(max)"); + + b.Property("ScrollBarJson") + .HasColumnType("nvarchar(max)"); + b.Property("SearchPanelJson") .HasColumnType("nvarchar(max)"); @@ -2908,6 +2959,12 @@ namespace Kurs.Platform.Migrations b.Property("SelectionJson") .HasColumnType("nvarchar(max)"); + b.Property("SeriesJson") + .HasColumnType("nvarchar(max)"); + + b.Property("SizeJson") + .HasColumnType("nvarchar(max)"); + b.Property("SortMode") .HasColumnType("nvarchar(max)"); @@ -2923,6 +2980,12 @@ namespace Kurs.Platform.Migrations b.Property("Title") .HasColumnType("nvarchar(max)"); + b.Property("TitleJson") + .HasColumnType("nvarchar(max)"); + + b.Property("TooltipJson") + .HasColumnType("nvarchar(max)"); + b.Property("UpdateCommand") .HasColumnType("nvarchar(max)"); @@ -2932,12 +2995,21 @@ namespace Kurs.Platform.Migrations b.Property("UpdateServiceAddress") .HasColumnType("nvarchar(max)"); + b.Property("UserId") + .HasColumnType("nvarchar(max)"); + + b.Property("ValueAxisJson") + .HasColumnType("nvarchar(max)"); + b.Property("WidgetsJson") .HasColumnType("nvarchar(max)"); b.Property("Width") .HasColumnType("int"); + b.Property("ZoomAndPanJson") + .HasColumnType("nvarchar(max)"); + b.HasKey("Id"); b.ToTable("PListForm", (string)null); diff --git a/ui/src/proxy/admin/list-form/models.ts b/ui/src/proxy/admin/list-form/models.ts index ec996804..085f1b06 100644 --- a/ui/src/proxy/admin/list-form/models.ts +++ b/ui/src/proxy/admin/list-form/models.ts @@ -82,6 +82,17 @@ export const ListFormEditTabs = { Fields: 'fields', Customization: 'customization', ExtraFilter: 'extraFilter', + //Chart Tabs + ChartCommon: 'chartCommon', + ChartSeries: 'chartSeries', + ChartAxis: 'chartAxis', + ChartPanes: 'chartPanes', + ChartAnimations: 'chartAnimations', + ChartAnnotations: 'chartAnnotations', + ChartZoom: 'chartZoom', + ChartLegend: 'chartLegend', + ChartExport: 'chartExport', + ChartCrosshair: 'chartCrosshair', } as const export const extraFilterControlTypeOptions = [ diff --git a/ui/src/proxy/form/models.ts b/ui/src/proxy/form/models.ts index 65573046..517714f7 100644 --- a/ui/src/proxy/form/models.ts +++ b/ui/src/proxy/form/models.ts @@ -20,6 +20,29 @@ import { FormItemComponent } from 'devextreme/ui/form' import { AuditedEntityDto } from '../abp' import { EditorType2, RowMode } from '../../views/form/types' import { bool } from 'yup' +import { + ChartCommonDto, + ChartAdaptivelayoutDto, + ChartAnimationDto, + ChartAnnotationDto, + ChartArgumentAxisDto, + ChartCommonAnnotationDto, + ChartCommonAxisDto, + ChartCommonPaneDto, + ChartCommonSeriesSettingsDto, + ChartCrosshairDto, + ChartExportDto, + ChartLegendDto, + ChartMarginDto, + ChartPanesDto, + ChartScrollBarDto, + ChartSeriesDto, + ChartSizeDto, + ChartTitleDto, + ChartTooltipDto, + ChartValueAxisDto, + ChartZoomAndPanDto, +} from '../charts/models' //1 export interface SelectListItem { @@ -489,6 +512,52 @@ export interface GridOptionsDto extends AuditedEntityDto { extraFilterJson?: string extraFilterDto: ExtraFilterDto[] layoutDto: LayoutDto + + //ChartEditDto + userId?: string + roleId?: string + commonJson?: string + commonDto: ChartCommonDto + adaptiveLayoutJson?: string + adaptivelayoutDto: ChartAdaptivelayoutDto + animationJson?: string + animationDto: ChartAnimationDto + annotationsJson?: string + annotationsDto: ChartAnnotationDto[] + argumentAxisJson?: string + argumentAxisDto: ChartArgumentAxisDto + commonAnnotationsSettingsJson?: string + commonAnnotationSettingsDto: ChartCommonAnnotationDto + commonAxisSettingsJson?: string + commonAxisSettingsDto: ChartCommonAxisDto + commonPaneSettingsJson?: string + commonPaneSettingsDto: ChartCommonPaneDto + commonSeriesSettingsJson?: string + commonSeriesSettingsDto: ChartCommonSeriesSettingsDto + crosshairJson?: string + crosshairDto: ChartCrosshairDto + exportJson?: string + exportDto: ChartExportDto + legendJson?: string + legendDto: ChartLegendDto + marginJson?: string + marginDto: ChartMarginDto + panesJson?: string + panesDto: ChartPanesDto[] + scrollBarJson?: string + scrollBarDto: ChartScrollBarDto + seriesJson?: string + seriesDto: ChartSeriesDto[] + sizeJson?: string + sizeDto: ChartSizeDto + titleJson?: string + titleDto: ChartTitleDto + tooltipJson?: string + tooltipDto: ChartTooltipDto + valueAxisJson?: string + valueAxisDto: ChartValueAxisDto[] + zoomAndPanJson?: string + zoomAndPanDto: ChartZoomAndPanDto } export interface GridOptionsEditDto extends GridOptionsDto, Record { diff --git a/ui/src/views/admin/chart/ChartEdit.tsx b/ui/src/views/admin/chart/ChartEdit.tsx deleted file mode 100644 index 3ed3e27b..00000000 --- a/ui/src/views/admin/chart/ChartEdit.tsx +++ /dev/null @@ -1,1534 +0,0 @@ -import { - Alert, - Button, - Card, - Checkbox, - Dialog, - FormContainer, - FormItem, - Input, - Notification, - Select, - Tabs, - toast, -} from '@/components/ui' -import TabContent from '@/components/ui/Tabs/TabContent' -import TabList from '@/components/ui/Tabs/TabList' -import TabNav from '@/components/ui/Tabs/TabNav' -import { getRoles, getUsers } from '@/services/identity.service' -import { - deleteChartJsonItem, - getChartByCode, - putChartJsonItem, - putCharts, -} from '@/services/chart.service' -import { SelectBoxOption } from '@/shared/types' -import { useStoreState } from '@/store' -import { useLocalization } from '@/utils/hooks/useLocalization' -import setNull from '@/utils/setNull' -import { Field, FieldArray, FieldProps, Form, Formik, FormikProps, getIn } from 'formik' -import { useEffect, useState } from 'react' -import { Helmet } from 'react-helmet' -import { Link, useParams } from 'react-router-dom' -import { object, string } from 'yup' -import { - chartAnnotationTypeListOptions, - chartArgumentAxisPositionListOptions, - chartArgumentAxisTypeListOptions, - chartBreakStyleLineListOptions, - chartSeriesDashStyleOptions, - chartSeriesSelectionModeOptions, - chartSeriesTypeOptions, - chartTitleWordWrapListOptions, -} from './options' -import { ChartDialogType, ChartOperation } from './types' -import { IdentityRoleDto, IdentityUserDto } from '@/proxy/admin/models' -import { - BreakDto, - ChartAnnotationDto, - ChartEditDto, - ChartPanesDto, - ChartSeriesDto, - ChartValueAxisDto, -} from '@/proxy/charts/models' -import { Container } from '@/components/shared' -import ChartEditDetailsTab from './edit/ChartTabDetails' -import ChartEditDatabaseTab from './edit/ChartTabDatabase' -import ChartEditCommonSettingsTab from './edit/ChartTabCommonSettings' -import ChartEditPermissionsTab from './edit/ChartTabPermissions' -import ChartEditSeriesTab from './edit/ChartTabSeries' -import ChartEditAxisTab from './edit/ChartTabAxis' -import ChartEditPanesTab from './edit/ChartTabPanes' -import ChartEditCrosshairTab from './edit/ChartTabCrosshair' -import ChartTabAnimation from './edit/ChartTabAnimation' -import ChartEditExportTab from './edit/ChartTabExport' -import ChartTabLegend from './edit/ChartTabLegend' -import ChartTabAnnotations from './edit/ChartTabAnnotations' -import ChartEditZoomAndPanTab from './edit/ChartTabZoomAndPan' -import { getDataSources } from '@/proxy/data-source' -import { tooltipFormatListOptions } from '@/shared/options' -import { FaMinus } from 'react-icons/fa' -import { ROUTES_ENUM } from '@/routes/route.constant' - -const chartPanesValidationSchema = object().shape({ - name: string().required(), -}) - -const chartSeriesValidationSchema = object().shape({ - name: string().required(), -}) - -const chartAxisValidationSchema = object().shape({ - name: string().required(), - title: string().required(), -}) - -const chartAnnotationsValidationSchema = object().shape({ - name: string().required(), -}) - -const fieldFeedback = (form: FormikProps, name: string) => { - const error = getIn(form.errors, name) - const touch = getIn(form.touched, name) - return { - errorMessage: error || '', - invalid: typeof touch === 'undefined' ? false : error && touch, - } -} - -const chartValidationSchema = object().shape({ - cultureName: string().required(), - chartCode: string().required(), -}) - -export interface DatabaseOperation { - isOpen: ChartDialogType - id: string - operation: ChartOperation - index: number - panesValues?: ChartPanesDto - seriesValues?: ChartSeriesDto - annotationsValues?: ChartAnnotationDto - axisValues?: ChartValueAxisDto -} - -const defaultDatabaseOperation: DatabaseOperation = { - isOpen: '', - id: '', - operation: 'select', - index: -1, -} - -export interface ConfirmDelete { - isOpen: boolean - id: string - index: number - fieldName: ChartDialogType -} - -const defaultConfirmDelete: ConfirmDelete = { - isOpen: false, - id: '', - index: -1, - fieldName: 'pane', -} - -function ChartEdit() { - const { chartCode } = useParams() - const { translate } = useLocalization() - const [dataSourceList, setDataSourceList] = useState([]) - const languages = useStoreState((state) => state.abpConfig.config?.localization.languages) - const permissions: Record | undefined = useStoreState( - (state) => state.abpConfig.config?.auth.grantedPolicies, - ) - const [chartValues, setChartValues] = useState() - const [langOptions, setLangOptions] = useState([]) - const [roleList, setRoleList] = useState([]) - const [userList, setUserList] = useState([]) - const [permissionOptions, setPermissionOptions] = useState([]) - const [confirmDelete, setConfirmDelete] = useState(defaultConfirmDelete) - const [databaseOperationsModalData, setDatabaseOperationsModalData] = - useState(defaultDatabaseOperation) - - const onSubmit = async (editType: string, values: Partial): Promise => { - try { - await putCharts({ - ...chartValues, - ...values, // sadece güncellenen tab'ın değerleri override edilir - } as ChartEditDto) // chartValues null olamaz çünkü form ancak chartValues yüklendikten sonra render ediliyor - - toast.push( - - {`${editType} kaydedildi.`} - , - { placement: 'top-end' }, - ) - - await getChartValues() - } catch (error) { - toast.push(Hata: {String(error)}) - } - } - - const valueAxisList = () => { - return chartValues?.valueAxisDto.map((key: ChartValueAxisDto) => ({ - value: key.name, - label: key.name, - })) - } - - const valuePaneList = () => { - return chartValues?.panesDto.map((key: ChartPanesDto) => ({ - value: key.name, - label: key.name, - })) - } - - const SeriesList = () => { - return chartValues?.seriesDto.map((key: ChartSeriesDto) => ({ - value: key.name, - label: key.name, - })) - } - - useEffect(() => { - if (languages) { - setLangOptions( - languages.map((lang) => ({ - value: lang.cultureName, - label: lang.displayName, - })), - ) - } - }, [languages]) - - useEffect(() => { - if (permissions) { - setPermissionOptions( - Object.keys(permissions).map((key) => { - return { - value: key, - label: key, - } - }), - ) - } - }, [permissions]) - - const getRoleList = async () => { - const response = await getRoles() - if (response.data?.items) { - setRoleList( - response.data.items.map((role: IdentityRoleDto) => ({ - value: role.id, - label: role.name, - })), - ) - } - } - - const getUserList = async () => { - const response = await getUsers() - if (response.data?.items) { - setUserList( - response.data.items.map((user: IdentityUserDto) => ({ - value: user.id, - label: user.name, - })), - ) - } - } - - const getChartValues = async () => { - if (!chartCode) return - - const res = await getChartByCode(chartCode) - setNull(res.data) - setChartValues(res.data) - } - - const getDataSourceList = async () => { - const response = await getDataSources() - if (response.data?.items) { - setDataSourceList( - response.data.items.map((a) => ({ - value: a.code, - label: a.code, - })), - ) - } - } - - useEffect(() => { - getChartValues() - getRoleList() - getUserList() - getDataSourceList() - }, [chartCode]) - - return chartValues && roleList && userList && permissionOptions ? ( - - - - { - setSubmitting(true) - await putCharts({ ...values }) - toast.push( - - {'Chart Bilgileri Kaydedildi.'} - , - { - placement: 'top-end', - }, - ) - - setSubmitting(false) - }} - > - {({ touched, errors, resetForm, isSubmitting, values }) => ( -
- -
-
-

- - 🔙 {chartCode} - -

- {chartValues.isTenant && ( - - Bu bir MULTI TENANT form'dur, veri kaybı olmaması için, sorgularda TENANTID - parametresini kullanmayı unutmayınız. - - )} -
-
- - - - Details - Database - Permissions - Common - Series - Axis - Panes - Animations - Crosshair - Export - Legend - Zoom & Pan - Annotations - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
-
-
- )} -
- - setDatabaseOperationsModalData(defaultDatabaseOperation)} - onRequestClose={() => setDatabaseOperationsModalData(defaultDatabaseOperation)} - > -
{databaseOperationsModalData.index === -1 ? 'Add' : 'Update'}
- - { - setSubmitting(true) - await putChartJsonItem({ - id: chartValues.id, - chartCode: chartValues.chartCode, - index: databaseOperationsModalData.index, - fieldName: 'pane', - itemPane: { ...values }, - }) - - toast.push( - - {databaseOperationsModalData.index === -1 - ? 'Kayıt eklendi.' - : 'Kayıt Değiştirildi.'} - , - { - placement: 'top-end', - }, - ) - - getChartValues() - setSubmitting(false) - setDatabaseOperationsModalData(defaultDatabaseOperation) - }} - > - {({ touched, errors, resetForm, isSubmitting, values }) => ( -
- -
- - - - - - - - - - - -
-
- -
-
-
- )} -
-
- - setDatabaseOperationsModalData(defaultDatabaseOperation)} - onRequestClose={() => setDatabaseOperationsModalData(defaultDatabaseOperation)} - > -
{databaseOperationsModalData.index === -1 ? 'Add' : 'Update'}
- - { - setSubmitting(true) - await putChartJsonItem({ - chartCode: chartValues.chartCode, - id: chartValues.id, - index: databaseOperationsModalData.index, - fieldName: 'serie', - itemSerie: { ...values } as ChartSeriesDto, - }) - - toast.push( - - {databaseOperationsModalData.index === -1 - ? 'Kayıt eklendi.' - : 'Kayıt Değiştirildi.'} - , - { - placement: 'top-end', - }, - ) - - getChartValues() - setSubmitting(false) - setDatabaseOperationsModalData(defaultDatabaseOperation) - }} - > - {({ touched, errors, resetForm, isSubmitting, values }) => ( -
- -
- - - - - - - - - - - - - - - {({ field, form }: FieldProps) => ( - option.value === values.axis)} - onChange={(option) => form.setFieldValue(field.name, option?.value)} - /> - )} - - - - - - {({ field, form }: FieldProps) => ( - option.value === values.dashStyle, - )} - onChange={(option) => form.setFieldValue(field.name, option?.value)} - /> - )} - - - - - - - - - - {({ field, form }: FieldProps) => ( - option.value === values.label.format, - )} - onChange={(option) => form.setFieldValue(field.name, option?.value)} - /> - )} - - - - - - - -
-
- -
-
-
- )} -
-
- - setDatabaseOperationsModalData(defaultDatabaseOperation)} - onRequestClose={() => setDatabaseOperationsModalData(defaultDatabaseOperation)} - > -
{databaseOperationsModalData.index === -1 ? 'Add' : 'Update'}
- - { - setSubmitting(true) - await putChartJsonItem({ - chartCode: chartValues.chartCode, - id: chartValues.id, - index: databaseOperationsModalData.index, - fieldName: 'axis', - itemAxis: { ...values }, - }) - toast.push( - - {databaseOperationsModalData.index === -1 - ? 'Kayıt eklendi.' - : 'Kayıt Değiştirildi.'} - , - { - placement: 'top-end', - }, - ) - - getChartValues() - setSubmitting(false) - setDatabaseOperationsModalData(defaultDatabaseOperation) - }} - > - {({ touched, errors, resetForm, isSubmitting, values }) => { - const breaks = values.breaks - - return ( -
- -
- - - - - - - {({ field, form }: FieldProps) => ( - option.value === values.type, - )} - onChange={(option) => form.setFieldValue(field.name, option?.value)} - /> - )} - - - - - - {({ field, form }: FieldProps) => ( - option.value === values.breakStyle.line, - )} - onChange={(option) => - form.setFieldValue(field.name, option?.value) - } - /> - )} - - - - - - {({ form, remove, push }) => ( -
- {breaks && breaks.length > 0 - ? breaks.map((_, index) => { - const startValueFeedBack = fieldFeedback( - form, - `breaks[${index}].startValue`, - ) - const endValueFeedBack = fieldFeedback( - form, - `breaks[${index}].endValue`, - ) - - return ( -
- - - - - - - - -
- ) - }) - : null} -
- -
-
- )} -
-
-
- - -
- -
-
-
- ) - }} -
-
- - setDatabaseOperationsModalData(defaultDatabaseOperation)} - onRequestClose={() => setDatabaseOperationsModalData(defaultDatabaseOperation)} - > -
{databaseOperationsModalData.index === -1 ? 'Add' : 'Update'}
- - { - setSubmitting(true) - await putChartJsonItem({ - chartCode: chartValues.chartCode, - id: chartValues.id, - index: databaseOperationsModalData.index, - fieldName: 'annotation', - itemAnnotation: { ...values }, - }) - toast.push( - - {databaseOperationsModalData.index === -1 - ? 'Kayıt eklendi.' - : 'Kayıt Değiştirildi.'} - , - { - placement: 'top-end', - }, - ) - - getChartValues() - setSubmitting(false) - setDatabaseOperationsModalData(defaultDatabaseOperation) - }} - > - {({ touched, errors, resetForm, isSubmitting, values }) => ( -
- -
- - - General - Border - - - - - - - - - {({ field, form }: FieldProps) => ( - option.value === values.series)} - onChange={(option) => form.setFieldValue(field.name, option?.value)} - /> - )} - - - - - - - - - - - - - - - - - - - - - - - - - - {({ field, form }: FieldProps) => ( - option.value === values.border.dashStyle, - )} - onChange={(option) => form.setFieldValue(field.name, option?.value)} - /> - )} - - - - - - - - -
-
- -
-
-
- )} -
-
- - setConfirmDelete(defaultConfirmDelete)} - onRequestClose={() => setConfirmDelete(defaultConfirmDelete)} - > -
Delete
- -

Silmek istediğinize emin misiniz?

- -
- - -
-
-
- ) : ( - <> - ) -} - -export default ChartEdit diff --git a/ui/src/views/admin/chart/edit/ChartTabAnimation.tsx b/ui/src/views/admin/chart/edit/ChartTabAnimation.tsx deleted file mode 100644 index f5df2756..00000000 --- a/ui/src/views/admin/chart/edit/ChartTabAnimation.tsx +++ /dev/null @@ -1,69 +0,0 @@ -import { Card, Checkbox, FormItem, Input, Select } from '@/components/ui' -import { ChartEditDto } from '@/proxy/charts/models' -import { SelectBoxOption } from '@/shared/types' -import { Field, FieldProps, FormikErrors, FormikTouched } from 'formik' -import { chartEasingListOptions } from './../options' - -interface ChartTabAnimationProps { - values: ChartEditDto - errors: FormikErrors - touched: FormikTouched -} - -const ChartTabAnimation = ({ values, errors, touched }: ChartTabAnimationProps) => { - return ( - - - - - - - - {({ field, form }: FieldProps) => ( - option.value === values.commonAnnotationSettingsDto.type, - )} - onChange={(option) => form.setFieldValue(field.name, option?.value)} - /> - )} - - - - - - {({ field, form }: FieldProps) => ( - option.value === values.commonAnnotationSettingsDto.wordWrap, - )} - onChange={(option) => form.setFieldValue(field.name, option?.value)} - /> - )} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {({ field, form }: FieldProps) => ( - option.value === values.argumentAxisDto.hoverMode, - )} - onChange={(option) => form.setFieldValue(field.name, option?.value)} - /> - )} - - - - - - {({ field, form }: FieldProps) => ( - option.value === values.argumentAxisDto.position, - )} - onChange={(option) => form.setFieldValue(field.name, option?.value)} - /> - )} - - - - - - - - - - {({ field, form }: FieldProps) => ( - option.value === values.argumentAxisDto.label.displayMode, - )} - onChange={(option) => form.setFieldValue(field.name, option?.value)} - /> - )} - - - - - - - - - - {({ field, form }: FieldProps) => ( - option.value === values.commonDto.theme)} - onChange={(option) => form.setFieldValue(field.name, option?.value)} - /> - )} - - - - - - {({ field, form }: FieldProps) => ( - option.value === values.commonDto.paletteExtensionMode, - )} - onChange={(option) => form.setFieldValue(field.name, option?.value)} - /> - )} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {({ field, form }: FieldProps) => ( - option.value === values.titleDto.horizontalAlignment, - )} - onChange={(option) => form.setFieldValue(field.name, option?.value)} - /> - )} - - - - - - {({ field, form }: FieldProps) => ( - option.value === values.titleDto.wordWrap, - )} - onChange={(option) => form.setFieldValue(field.name, option?.value)} - /> - )} - - - - - - - - - - - - - - - - - {({ field, form }: FieldProps) => ( - option.value === values.tooltipDto.location, - )} - onChange={(option) => form.setFieldValue(field.name, option?.value)} - /> - )} - - - - - - - - - - - - - - - - - - - - - - - -
Tooltip Settings - Font
- - - - - - - - - - - - - - - - -
Tooltip Settings - Border
- - - - - - - {({ field, form }: FieldProps) => ( - option.value === values.scrollBarDto.position, - )} - onChange={(option) => form.setFieldValue(field.name, option?.value)} - /> - )} - - - - - - - - - - - -
- - ) -} - -export default ChartTabCommonSettings diff --git a/ui/src/views/admin/chart/edit/ChartTabCrosshair.tsx b/ui/src/views/admin/chart/edit/ChartTabCrosshair.tsx deleted file mode 100644 index c96c288d..00000000 --- a/ui/src/views/admin/chart/edit/ChartTabCrosshair.tsx +++ /dev/null @@ -1,302 +0,0 @@ -import { Card, Checkbox, FormItem, Input, Select } from '@/components/ui' -import { ChartEditDto } from '@/proxy/charts/models' -import { tooltipFormatListOptions } from '@/shared/options' -import { SelectBoxOption } from '@/shared/types' -import { Field, FieldProps, FormikErrors, FormikTouched } from 'formik' -import { chartSeriesDashStyleOptions } from './../options' - -interface ChartTabCrosshairProps { - values: ChartEditDto - errors: FormikErrors - touched: FormikTouched -} - -const ChartTabCrosshair = ({ values, errors, touched }: ChartTabCrosshairProps) => { - return ( - <> - - - - - - - - - - - - {({ field, form }: FieldProps) => ( - option.value === values.crosshairDto.label.format, - )} - onChange={(option) => form.setFieldValue(field.name, option?.value)} - /> - )} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {({ field, form }: FieldProps) => ( - option.value === values.crosshairDto.verticalLine.dashStyle, - )} - onChange={(option) => form.setFieldValue(field.name, option?.value)} - /> - )} - - - - - - - - - ) -} - -export default ChartTabCrosshair diff --git a/ui/src/views/admin/chart/edit/ChartTabDatabase.tsx b/ui/src/views/admin/chart/edit/ChartTabDatabase.tsx deleted file mode 100644 index 241dd417..00000000 --- a/ui/src/views/admin/chart/edit/ChartTabDatabase.tsx +++ /dev/null @@ -1,83 +0,0 @@ -import { Checkbox, FormItem, Input, Select } from '@/components/ui' -import { ChartEditDto } from '@/proxy/charts/models' -import { DataSourceTypeEnum } from '@/proxy/form/models' -import { SelectBoxOption } from '@/shared/types' -import { useLocalization } from '@/utils/hooks/useLocalization' -import { Field, FieldProps, FormikErrors, FormikTouched } from 'formik' - -interface ChartTabDatabaseProps { - values: ChartEditDto - errors: FormikErrors - touched: FormikTouched - dataSourceList: SelectBoxOption[] -} - -const ChartTabDatabase = ({ values, errors, touched, dataSourceList }: ChartTabDatabaseProps) => { - const { translate } = useLocalization() - - return ( - <> - - - - - - - - - - - - - {({ field, form }: FieldProps) => ( - option.value === values.cultureName)} - onChange={(option) => form.setFieldValue(field.name, option?.value)} - /> - )} - - - - - - {({ field, form }: FieldProps) => ( - option.value === values.userId)} - onChange={(option) => form.setFieldValue(field.name, option?.value)} - /> - )} - - - - ) -} - -export default ChartTabDetails diff --git a/ui/src/views/admin/chart/edit/ChartTabExport.tsx b/ui/src/views/admin/chart/edit/ChartTabExport.tsx deleted file mode 100644 index 7f1b3c4a..00000000 --- a/ui/src/views/admin/chart/edit/ChartTabExport.tsx +++ /dev/null @@ -1,48 +0,0 @@ -import { Card, Checkbox, FormItem, Input } from '@/components/ui' -import { ChartEditDto } from '@/proxy/charts/models' -import { Field, FormikErrors, FormikTouched } from 'formik' - -interface ChartTabExportProps { - errors: FormikErrors - touched: FormikTouched -} - -const ChartTabExport = ({ errors, touched }: ChartTabExportProps) => { - return ( - - - - - - - - - - - - - - - - - - ) -} - -export default ChartTabExport diff --git a/ui/src/views/admin/chart/edit/ChartTabLegend.tsx b/ui/src/views/admin/chart/edit/ChartTabLegend.tsx deleted file mode 100644 index 54fd327a..00000000 --- a/ui/src/views/admin/chart/edit/ChartTabLegend.tsx +++ /dev/null @@ -1,176 +0,0 @@ -import { Card, Checkbox, FormItem, Input, Select, Tabs } from '@/components/ui' -import TabContent from '@/components/ui/Tabs/TabContent' -import TabList from '@/components/ui/Tabs/TabList' -import TabNav from '@/components/ui/Tabs/TabNav' -import { ChartEditDto } from '@/proxy/charts/models' -import { SelectBoxOption } from '@/shared/types' -import { Field, FieldProps, FormikErrors, FormikTouched } from 'formik' -import { - chartLegendOrientationListOptions, - chartLegendPositionListOptions, - chartSeriesDashStyleOptions, -} from './../options' - -interface ChartTabLegendProps { - values: ChartEditDto - errors: FormikErrors - touched: FormikTouched -} - -const ChartTabLegend = ({ values, errors, touched }: ChartTabLegendProps) => { - return ( - - - General - Border - - - - - - - - - - - - - - - - - - {({ field, form }: FieldProps) => ( - option.value === values.legendDto.position, - )} - onChange={(option) => form.setFieldValue(field.name, option?.value)} - /> - )} - - - - - - - - - - - - - - - - - - - - - - - - - {({ field, form }: FieldProps) => ( - option.value === values.permissionDto.c)} - onChange={(option) => form.setFieldValue(field.name, option?.value)} - /> - )} - - - - - {({ field, form }: FieldProps) => ( - option.value === values.permissionDto.u)} - onChange={(option) => form.setFieldValue(field.name, option?.value)} - /> - )} - - - - - {({ field, form }: FieldProps) => ( - option.value === values.commonSeriesSettingsDto.type, - )} - onChange={(option) => form.setFieldValue(field.name, option?.value)} - /> - )} - - - - - - {({ field, form }: FieldProps) => ( - option.value === values.commonSeriesSettingsDto.axis, - )} - onChange={(option) => form.setFieldValue(field.name, option?.value)} - /> - )} - - - - - - {({ field, form }: FieldProps) => ( - option.value === values.commonSeriesSettingsDto.dashStyle, - )} - onChange={(option) => form.setFieldValue(field.name, option?.value)} - /> - )} - - - - - - - - - - ) -} - -export default ChartTabSeries diff --git a/ui/src/views/admin/chart/edit/ChartTabZoomAndPan.tsx b/ui/src/views/admin/chart/edit/ChartTabZoomAndPan.tsx deleted file mode 100644 index 11993f35..00000000 --- a/ui/src/views/admin/chart/edit/ChartTabZoomAndPan.tsx +++ /dev/null @@ -1,142 +0,0 @@ -import { Card, Checkbox, FormItem, Input, Select } from '@/components/ui' -import { ChartEditDto } from '@/proxy/charts/models' -import { SelectBoxOption } from '@/shared/types' -import { Field, FieldProps, FormikErrors, FormikTouched } from 'formik' -import { chartZoomAndPanAxisOptions, chartZoomAndPanKeyOptions } from './../options' - -interface ChartTabZoomAndPanProps { - values: ChartEditDto - errors: FormikErrors - touched: FormikTouched -} - -const ChartTabZoomAndPan = ({ values, errors, touched }: ChartTabZoomAndPanProps) => { - return ( - <> - - - - - - - - - - - - - - - - {({ field, form }: FieldProps) => ( - option.value === values.zoomAndPanDto.valueAxis, - )} - onChange={(option) => form.setFieldValue(field.name, option?.value)} - /> - )} - - - - - - {({ field, form }: FieldProps) => ( - option.value === values.animationDto.easing, + )} + onChange={(option) => form.setFieldValue(field.name, option?.value)} + /> + )} + + + + + + + + + + + +
+ +
+ + + )} + + ) +} + +export default ChartTabAnimation diff --git a/ui/src/views/admin/listForm/edit/ChartTabAnnotations.tsx b/ui/src/views/admin/listForm/edit/ChartTabAnnotations.tsx new file mode 100644 index 00000000..cf9dba04 --- /dev/null +++ b/ui/src/views/admin/listForm/edit/ChartTabAnnotations.tsx @@ -0,0 +1,627 @@ +import { + Button, + Card, + Checkbox, + FormContainer, + FormItem, + Input, + Select, + Table, + Tabs, +} from '@/components/ui' +import TabContent from '@/components/ui/Tabs/TabContent' +import TabList from '@/components/ui/Tabs/TabList' +import TabNav from '@/components/ui/Tabs/TabNav' +import TBody from '@/components/ui/Table/TBody' +import THead from '@/components/ui/Table/THead' +import Td from '@/components/ui/Table/Td' +import Th from '@/components/ui/Table/Th' +import Tr from '@/components/ui/Table/Tr' +import { SelectBoxOption } from '@/shared/types' +import { Field, FieldProps, Form, Formik } from 'formik' +import { FaEdit, FaFileMedical, FaTrash } from 'react-icons/fa' +import { object, string } from 'yup' +import { FormEditProps } from './FormEdit' +import { useStoreState } from '@/store/store' +import { useLocalization } from '@/utils/hooks/useLocalization' +import { ListFormEditTabs } from '@/proxy/admin/list-form/models' +import { + chartAnnotationTypeListOptions, + chartWordWrapListOptions, + chartSeriesDashStyleOptions, +} from './options' +import { ChartSeriesDto } from '@/proxy/charts/models' + +const schema = object().shape({ + name: string().required(), +}) + +function ChartTabAnnotations( + props: FormEditProps & { setDatabaseOperationsModalData: Function; setConfirmDelete: Function }, +) { + const { translate } = useLocalization() + + const listFormValues = useStoreState((s) => s.admin.listFormValues) + if (!listFormValues) { + return null + } + + const SeriesList = () => { + return listFormValues?.seriesDto.map((key: ChartSeriesDto) => ({ + value: key.name, + label: key.name, + })) + } + + return ( + { + await props.onSubmit(ListFormEditTabs.ChartAnnotations, values, formikHelpers) + }} + > + {({ touched, errors, resetForm, isSubmitting, values }) => ( +
+ + + + General + Common Pane + + + + + + + + + + + + + + + + + {listFormValues.annotationsDto.map((row, index) => ( + + + + + + + + + + ))} + +
+ TypeNameTextSeriesValueWidth
+
+
+
{row.type}{row.name}{row.text}{row.series}{row.value}{row.width}
+
+
+ + + + + + + + + {({ field, form }: FieldProps) => ( + option.value === values.commonAnnotationSettingsDto.series, + )} + onChange={(option) => form.setFieldValue(field.name, option?.value)} + /> + )} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {({ field, form }: FieldProps) => ( + + option.value === values.commonAnnotationSettingsDto.border.dashStyle, + )} + onChange={(option) => form.setFieldValue(field.name, option?.value)} + /> + )} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ )} +
+ ) +} + +export default ChartTabAnnotations diff --git a/ui/src/views/admin/listForm/edit/ChartTabAxis.tsx b/ui/src/views/admin/listForm/edit/ChartTabAxis.tsx new file mode 100644 index 00000000..aec44997 --- /dev/null +++ b/ui/src/views/admin/listForm/edit/ChartTabAxis.tsx @@ -0,0 +1,504 @@ +import { + Button, + Card, + Checkbox, + FormContainer, + FormItem, + Input, + Select, + Table, + Tabs, +} from '@/components/ui' +import TBody from '@/components/ui/Table/TBody' +import THead from '@/components/ui/Table/THead' +import Td from '@/components/ui/Table/Td' +import Th from '@/components/ui/Table/Th' +import Tr from '@/components/ui/Table/Tr' +import TabContent from '@/components/ui/Tabs/TabContent' +import TabList from '@/components/ui/Tabs/TabList' +import TabNav from '@/components/ui/Tabs/TabNav' +import { SelectBoxOption } from '@/shared/types' +import { Field, FieldProps, Form, Formik } from 'formik' +import { FaEdit, FaPlus, FaTrash } from 'react-icons/fa' +import { FormEditProps } from '../../listForm/edit/FormEdit' +import { useLocalization } from '@/utils/hooks/useLocalization' +import { useStoreState } from '@/store/store' +import { ListFormEditTabs } from '@/proxy/admin/list-form/models' +import { object, string } from 'yup' +import { + chartArgumentAxisHoverModeListOptions, + chartArgumentAxisTypeListOptions, + chartArgumentAxisPositionListOptions, + chartArgumentAxisIntervalListOptions, + chartArgumentAxisLabelDisplayModeListOptions, + chartArgumentAxisLabelOverlappingBehaviorListOptions, +} from './options' + +const schema = object().shape({ + name: string().required(), + title: string().required(), +}) + +function ChartTabAxis( + props: FormEditProps & { setDatabaseOperationsModalData: Function; setConfirmDelete: Function }, +) { + const { translate } = useLocalization() + + const listFormValues = useStoreState((s) => s.admin.listFormValues) + if (!listFormValues) { + return null + } + + return ( + { + await props.onSubmit(ListFormEditTabs.ChartAxis, values, formikHelpers) + }} + > + {({ touched, errors, resetForm, isSubmitting, values }) => ( +
+ + + + Value Axis + Argument Axis Options + Common Axis Settings + + + + + + + + + + + + + + + + + {listFormValues.valueAxisDto.map((row, index) => ( + + + + + + + + + + ))} + +
+ Value TypePositionTypeNameTitleVisible
+
+
+
{row.valueType}{row.position}{row.type}{row.name}{row.title}{row.visible}
+
+
+ + + + + + + + + + + + + + + + + {({ field, form }: FieldProps) => ( + option.value === values.argumentAxisDto.argumentType, + )} + onChange={(option) => form.setFieldValue(field.name, option?.value)} + /> + )} + + + + + + {({ field, form }: FieldProps) => ( + option.value === values.argumentAxisDto.aggregationInterval, + )} + onChange={(option) => form.setFieldValue(field.name, option?.value)} + /> + )} + + + + + + + + + + + + + + + + + + + + + + {({ field, form }: FieldProps) => ( + + option.value === values.argumentAxisDto.label.overlappingBehavior, + )} + onChange={(option) => form.setFieldValue(field.name, option?.value)} + /> + )} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ )} +
+ ) +} + +export default ChartTabAxis diff --git a/ui/src/views/admin/listForm/edit/ChartTabCommonSettings.tsx b/ui/src/views/admin/listForm/edit/ChartTabCommonSettings.tsx new file mode 100644 index 00000000..135fb076 --- /dev/null +++ b/ui/src/views/admin/listForm/edit/ChartTabCommonSettings.tsx @@ -0,0 +1,652 @@ +import { + Button, + Card, + Checkbox, + FormContainer, + FormItem, + Input, + Select, + Tabs, +} from '@/components/ui' +import TabContent from '@/components/ui/Tabs/TabContent' +import TabList from '@/components/ui/Tabs/TabList' +import TabNav from '@/components/ui/Tabs/TabNav' +import { IdentityRoleDto } from '@/proxy/admin/models' +import { SelectBoxOption } from '@/shared/types' +import { Field, FieldProps, Form, Formik, FormikErrors, FormikTouched } from 'formik' +import { themeOptions, tooltipFormatListOptions } from '@/shared/options' +import { FormEditProps } from '../../listForm/edit/FormEdit' +import { useLocalization } from '@/utils/hooks/useLocalization' +import { useStoreState } from '@/store/store' +import { ListFormEditTabs } from '@/proxy/admin/list-form/models' +import { object } from 'yup' +import { + chartPaletteOptions, + chartPaletteExtensionModeOptions, + chartTitleVerticalAlignmentListOptions, + chartTitleHorizantalAlignmentListOptions, + chartTitleTextOverFlowListOptions, + chartTitleWordWrapListOptions, + chartTooltipLocationListOptions, + chartSeriesDashStyleOptions, + chartArgumentAxisPositionListOptions, +} from './options' + +const schema = object() + +function ChartTabCommonSettings(props: FormEditProps) { + const { translate } = useLocalization() + + const listFormValues = useStoreState((s) => s.admin.listFormValues) + if (!listFormValues) { + return null + } + + return ( + { + await props.onSubmit(ListFormEditTabs.ChartCommon, values, formikHelpers) + }} + > + {({ touched, errors, resetForm, isSubmitting, values }) => ( +
+ + + + General + Adaptive Layout Settings + Title Settings + Tooltip Settings + Margin Settings + Size Settings + ScrollBar Settings + + + + + + + + + + + + + + + + + + + + + + {({ field, form }: FieldProps) => ( + option.value === values.commonDto.palette, + )} + onChange={(option) => form.setFieldValue(field.name, option?.value)} + /> + )} + + + + + + {({ field, form }: FieldProps) => ( + option.value === values.titleDto.verticalAlignment, + )} + onChange={(option) => form.setFieldValue(field.name, option?.value)} + /> + )} + + + + + + {({ field, form }: FieldProps) => ( + option.value === values.titleDto.textOverflow, + )} + onChange={(option) => form.setFieldValue(field.name, option?.value)} + /> + )} + + + + + + {({ field, form }: FieldProps) => ( + option.value === values.tooltipDto.format, + )} + onChange={(option) => form.setFieldValue(field.name, option?.value)} + /> + )} + + + + + + {({ field, form }: FieldProps) => ( + option.value === values.tooltipDto.border.dashStyle, + )} + onChange={(option) => form.setFieldValue(field.name, option?.value)} + /> + )} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {({ field, form }: FieldProps) => ( + option.value === values.crosshairDto.dashStyle, + )} + onChange={(option) => form.setFieldValue(field.name, option?.value)} + /> + )} + + + + + + + + + + + + + + + + + + + + {({ field, form }: FieldProps) => ( + option.value === values.crosshairDto.horizontalLine.dashStyle, + )} + onChange={(option) => form.setFieldValue(field.name, option?.value)} + /> + )} + + + + + + + + + + + + + + + + + + + + {({ field, form }: FieldProps) => ( + option.value === values.legendDto.orientation, + )} + onChange={(option) => form.setFieldValue(field.name, option?.value)} + /> + )} + + + + + + {({ field, form }: FieldProps) => ( + option.value === values.legendDto.border.dashStyle, + )} + onChange={(option) => form.setFieldValue(field.name, option?.value)} + /> + )} + + + + + + + + + + + + + +
+ +
+
+
+ )} +
+ ) +} + +export default ChartTabLegend diff --git a/ui/src/views/admin/listForm/edit/ChartTabPanes.tsx b/ui/src/views/admin/listForm/edit/ChartTabPanes.tsx new file mode 100644 index 00000000..48a2ef6f --- /dev/null +++ b/ui/src/views/admin/listForm/edit/ChartTabPanes.tsx @@ -0,0 +1,144 @@ +import { Button, Card, FormContainer, FormItem, Input, Table } from '@/components/ui' +import TBody from '@/components/ui/Table/TBody' +import THead from '@/components/ui/Table/THead' +import Td from '@/components/ui/Table/Td' +import Th from '@/components/ui/Table/Th' +import Tr from '@/components/ui/Table/Tr' +import { Field, Form, Formik } from 'formik' +import { FaEdit, FaFileMedical, FaTrash } from 'react-icons/fa' +import { FormEditProps } from '../../listForm/edit/FormEdit' +import { useStoreState } from '@/store/store' +import { useLocalization } from '@/utils/hooks/useLocalization' +import { ListFormEditTabs } from '@/proxy/admin/list-form/models' +import { object, string } from 'yup' + +const schema = object().shape({ + name: string().required(), +}) + +function ChartTabPanes( + props: FormEditProps & { setDatabaseOperationsModalData: Function; setConfirmDelete: Function }, +) { + const { translate } = useLocalization() + + const listFormValues = useStoreState((s) => s.admin.listFormValues) + if (!listFormValues) { + return null + } + + return ( + { + await props.onSubmit(ListFormEditTabs.ChartPanes, values, formikHelpers) + }} + > + {({ touched, errors, resetForm, isSubmitting, values }) => ( +
+ + + + + + + + + + + + + + + + + + {listFormValues.panesDto.map((row, index) => ( + + + + + + + ))} + +
+ NameBackground ColorHeight
+
+
+
{row.name}{row.backgroundColor}{row.height}
+
+
+ +
+
+
+ )} +
+ ) +} + +export default ChartTabPanes diff --git a/ui/src/views/admin/listForm/edit/ChartTabSeries.tsx b/ui/src/views/admin/listForm/edit/ChartTabSeries.tsx new file mode 100644 index 00000000..7168f7c0 --- /dev/null +++ b/ui/src/views/admin/listForm/edit/ChartTabSeries.tsx @@ -0,0 +1,420 @@ +import { + Button, + Card, + Checkbox, + FormContainer, + FormItem, + Input, + Select, + Table, + Tabs, +} from '@/components/ui' +import TBody from '@/components/ui/Table/TBody' +import THead from '@/components/ui/Table/THead' +import Td from '@/components/ui/Table/Td' +import Th from '@/components/ui/Table/Th' +import Tr from '@/components/ui/Table/Tr' +import TabContent from '@/components/ui/Tabs/TabContent' +import TabList from '@/components/ui/Tabs/TabList' +import TabNav from '@/components/ui/Tabs/TabNav' +import { ChartPanesDto, ChartValueAxisDto } from '@/proxy/charts/models' +import { SelectBoxOption } from '@/shared/types' +import { Field, FieldProps, Form, Formik } from 'formik' +import { FaEdit, FaPlus, FaTrash } from 'react-icons/fa' +import { FormEditProps } from '../../listForm/edit/FormEdit' +import { ListFormEditTabs } from '@/proxy/admin/list-form/models' +import { useLocalization } from '@/utils/hooks/useLocalization' +import { useStoreState } from '@/store/store' +import { object, string } from 'yup' +import { + chartSeriesTypeOptions, + chartSeriesSelectionModeOptions, + chartSeriesDashStyleOptions, +} from './options' + +const schema = object().shape({ + name: string().required(), +}) + +function ChartTabSeries( + props: FormEditProps & { setDatabaseOperationsModalData: Function; setConfirmDelete: Function }, +) { + const { translate } = useLocalization() + + const listFormValues = useStoreState((s) => s.admin.listFormValues) + if (!listFormValues) { + return null + } + + const valueAxisList = () => { + return listFormValues?.valueAxisDto.map((key: ChartValueAxisDto) => ({ + value: key.name, + label: key.name, + })) + } + + const valuePaneList = () => { + return listFormValues?.panesDto.map((key: ChartPanesDto) => ({ + value: key.name, + label: key.name, + })) + } + + return ( + { + await props.onSubmit(ListFormEditTabs.ChartSeries, values, formikHelpers) + }} + > + {({ touched, errors, resetForm, isSubmitting, values }) => ( +
+ + + + General + Common Series Settings + + + + + + + + + + + + + + + + + {listFormValues.seriesDto.map((row, index) => ( + + + + + + + + + + ))} + +
+ TypeNameArgument FieldValue FieldPaneAxis
+
+
+
{row.type}{row.name}{row.argumentField}{row.valueField}{row.pane}{row.axis}
+
+
+ + + + + + + + + + + + + + + + + {({ field, form }: FieldProps) => ( + + option.value === values.commonSeriesSettingsDto.selectionMode, + )} + onChange={(option) => form.setFieldValue(field.name, option?.value)} + /> + )} + + + + + + + + + + + + + + {({ field, form }: FieldProps) => ( + option.value === values.commonSeriesSettingsDto.pane, + )} + onChange={(option) => form.setFieldValue(field.name, option?.value)} + /> + )} + + + + + + + + + + + + + + {({ field, form }: FieldProps) => ( + option.value === values.zoomAndPanDto.argumentAxis, + )} + onChange={(option) => form.setFieldValue(field.name, option?.value)} + /> + )} + + + + + + {({ field, form }: FieldProps) => ( + option.value === values.zoomAndPanDto.panKey, + )} + onChange={(option) => form.setFieldValue(field.name, option?.value)} + /> + )} + + + + + + + + + + + + + +
+ +
+
+
+ )} +
+ ) +} + +export default ChartTabZoomAndPan diff --git a/ui/src/views/admin/listForm/edit/FormEdit.tsx b/ui/src/views/admin/listForm/edit/FormEdit.tsx index 5a9c59bc..baeeb4c6 100644 --- a/ui/src/views/admin/listForm/edit/FormEdit.tsx +++ b/ui/src/views/admin/listForm/edit/FormEdit.tsx @@ -1,4 +1,17 @@ -import { Alert, Notification, Tabs, toast } from '@/components/ui' +import { + Alert, + Button, + Card, + Checkbox, + Dialog, + FormContainer, + FormItem, + Input, + Notification, + Select, + Tabs, + toast, +} from '@/components/ui' import TabContent from '@/components/ui/Tabs/TabContent' import TabList from '@/components/ui/Tabs/TabList' import TabNav from '@/components/ui/Tabs/TabNav' @@ -6,7 +19,7 @@ import { LanguageInfo } from '@/proxy/config/models' import { SelectBoxOption } from '@/shared/types' import { useStoreActions, useStoreState } from '@/store' import { useLocalization } from '@/utils/hooks/useLocalization' -import { FormikHelpers } from 'formik' +import { Form, Field, FieldArray, FieldProps, Formik, FormikHelpers, FormikProps } from 'formik' import { useEffect, useState } from 'react' import { Helmet } from 'react-helmet' import { Link, useParams } from 'react-router-dom' @@ -36,6 +49,101 @@ import FormTabWidgets from './FormTabWidgets' import FormTabExtraFilters from './FormTabExtraFilters' import FormTabEditForm from './FormTabEditForm' import FormTabPivots from './FormTabPivots' +import ChartTabAnimation from './ChartTabAnimation' +import ChartTabAnnotations from './ChartTabAnnotations' +import { + BreakDto, + ChartAnnotationDto, + ChartPanesDto, + ChartSeriesDto, + ChartValueAxisDto, +} from '@/proxy/charts/models' +import ChartTabZoomAndPan from './ChartTabZoomAndPan' +import ChartTabLegend from './ChartTabLegend' +import ChartTabExport from './ChartTabExport' +import ChartTabCrosshair from './ChartTabCrosshair' +import ChartTabCommonSettings from './ChartTabCommonSettings' +import ChartTabSeries from './ChartTabSeries' +import ChartTabAxis from './ChartTabAxis' +import ChartTabPanes from './ChartTabPanes' +import { ChartDialogType, ChartOperation } from './types' +import { getIn, object, string } from 'yup' +import { + chartAnnotationTypeListOptions, + chartArgumentAxisPositionListOptions, + chartArgumentAxisTypeListOptions, + chartBreakStyleLineListOptions, + chartSeriesDashStyleOptions, + chartSeriesSelectionModeOptions, + chartSeriesTypeOptions, + chartTitleWordWrapListOptions, +} from './options' +import { tooltipFormatListOptions } from '@/shared/options' +import { FaMinus } from 'react-icons/fa' +import { deleteChartJsonItem, putChartJsonItem } from '@/services/chart.service' + +const chartSeriesValidationSchema = object().shape({ + name: string().required(), +}) + +const chartAnnotationsValidationSchema = object().shape({ + name: string().required(), +}) + +const chartPanesValidationSchema = object().shape({ + name: string().required(), +}) + +const chartAxisValidationSchema = object().shape({ + name: string().required(), + title: string().required(), +}) + +const chartValidationSchema = object().shape({ + cultureName: string().required(), + chartCode: string().required(), +}) + +const fieldFeedback = (form: FormikProps, name: string) => { + const error = getIn(form.errors, name) + const touch = getIn(form.touched, name) + return { + errorMessage: error || '', + invalid: typeof touch === 'undefined' ? false : error && touch, + } +} + +export interface DatabaseOperation { + isOpen: ChartDialogType + id: string + operation: ChartOperation + index: number + panesValues?: ChartPanesDto + seriesValues?: ChartSeriesDto + annotationsValues?: ChartAnnotationDto + axisValues?: ChartValueAxisDto +} + +const defaultDatabaseOperation: DatabaseOperation = { + isOpen: '', + id: '', + operation: 'select', + index: -1, +} + +export interface ConfirmDelete { + isOpen: boolean + id: string + index: number + fieldName: ChartDialogType +} + +const defaultConfirmDelete: ConfirmDelete = { + isOpen: false, + id: '', + index: -1, + fieldName: 'pane', +} export interface FormEditProps { onSubmit: ( @@ -58,6 +166,10 @@ const FormEdit = () => { (state) => state.abpConfig.config?.localization.languages, ) + const [confirmDelete, setConfirmDelete] = useState(defaultConfirmDelete) + const [databaseOperationsModalData, setDatabaseOperationsModalData] = + useState(defaultDatabaseOperation) + const listFormValues = useStoreState((s) => s.admin.listFormValues) const { getListFormValues } = useStoreActions((a) => a.admin) @@ -114,6 +226,27 @@ const FormEdit = () => { await getUserList() } + const valueAxisList = () => { + return listFormValues?.valueAxisDto.map((key: ChartValueAxisDto) => ({ + value: key.name, + label: key.name, + })) + } + + const valuePaneList = () => { + return listFormValues?.panesDto.map((key: ChartPanesDto) => ({ + value: key.name, + label: key.name, + })) + } + + const SeriesList = () => { + return listFormValues?.seriesDto.map((key: ChartSeriesDto) => ({ + value: key.name, + label: key.name, + })) + } + //LİST FORM ve LİST FORM FİELDS AİT BİLGİLER useEffect(() => { refreshData() @@ -199,9 +332,20 @@ const FormEdit = () => { {translate('::ListForms.ListFormEdit.EditingForm')} {translate('::ListForms.ListFormEdit.TabSubForms')} {translate('::ListForms.ListFormEdit.TabWidgets')} + + Common + Series + Axis + Panes + Animations + Annotations + Zoom & Pan + Legend + Export + Crosshair - + @@ -268,7 +412,1126 @@ const FormEdit = () => { + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + setDatabaseOperationsModalData(defaultDatabaseOperation)} + onRequestClose={() => setDatabaseOperationsModalData(defaultDatabaseOperation)} + > +
{databaseOperationsModalData.index === -1 ? 'Add' : 'Update'}
+ + { + setSubmitting(true) + await putChartJsonItem({ + id: listFormValues.id, + chartCode: listFormValues.listFormCode, + index: databaseOperationsModalData.index, + fieldName: 'pane', + itemPane: { ...values }, + }) + + toast.push( + + {databaseOperationsModalData.index === -1 + ? 'Kayıt eklendi.' + : 'Kayıt Değiştirildi.'} + , + { + placement: 'top-end', + }, + ) + + getListFormValues() + setSubmitting(false) + setDatabaseOperationsModalData(defaultDatabaseOperation) + }} + > + {({ touched, errors, resetForm, isSubmitting, values }) => ( +
+ +
+ + + + + + + + + + + +
+
+ +
+
+
+ )} +
+
+ + setDatabaseOperationsModalData(defaultDatabaseOperation)} + onRequestClose={() => setDatabaseOperationsModalData(defaultDatabaseOperation)} + > +
{databaseOperationsModalData.index === -1 ? 'Add' : 'Update'}
+ + { + setSubmitting(true) + await putChartJsonItem({ + chartCode: listFormValues.listFormCode, + id: listFormValues.id, + index: databaseOperationsModalData.index, + fieldName: 'serie', + itemSerie: { ...values } as ChartSeriesDto, + }) + + toast.push( + + {databaseOperationsModalData.index === -1 + ? 'Kayıt eklendi.' + : 'Kayıt Değiştirildi.'} + , + { + placement: 'top-end', + }, + ) + + getListFormValues() + setSubmitting(false) + setDatabaseOperationsModalData(defaultDatabaseOperation) + }} + > + {({ touched, errors, resetForm, isSubmitting, values }) => ( +
+ +
+ + + + + + + + + + + + + + + {({ field, form }: FieldProps) => ( + option.value === values.axis)} + onChange={(option) => form.setFieldValue(field.name, option?.value)} + /> + )} + + + + + + {({ field, form }: FieldProps) => ( + option.value === values.dashStyle, + )} + onChange={(option) => form.setFieldValue(field.name, option?.value)} + /> + )} + + + + + + + + + + {({ field, form }: FieldProps) => ( + option.value === values.label.format, + )} + onChange={(option) => form.setFieldValue(field.name, option?.value)} + /> + )} + + + + + + + +
+
+ +
+
+
+ )} +
+
+ + setDatabaseOperationsModalData(defaultDatabaseOperation)} + onRequestClose={() => setDatabaseOperationsModalData(defaultDatabaseOperation)} + > +
{databaseOperationsModalData.index === -1 ? 'Add' : 'Update'}
+ + { + setSubmitting(true) + await putChartJsonItem({ + chartCode: listFormValues.listFormCode, + id: listFormValues.id, + index: databaseOperationsModalData.index, + fieldName: 'axis', + itemAxis: { ...values }, + }) + toast.push( + + {databaseOperationsModalData.index === -1 + ? 'Kayıt eklendi.' + : 'Kayıt Değiştirildi.'} + , + { + placement: 'top-end', + }, + ) + + getListFormValues() + setSubmitting(false) + setDatabaseOperationsModalData(defaultDatabaseOperation) + }} + > + {({ touched, errors, resetForm, isSubmitting, values }) => { + const breaks = values.breaks + + return ( +
+ +
+ + + + + + + {({ field, form }: FieldProps) => ( + option.value === values.type, + )} + onChange={(option) => form.setFieldValue(field.name, option?.value)} + /> + )} + + + + + + {({ field, form }: FieldProps) => ( + option.value === values.breakStyle.line, + )} + onChange={(option) => + form.setFieldValue(field.name, option?.value) + } + /> + )} + + + + + + {({ form, remove, push }) => ( +
+ {breaks && breaks.length > 0 + ? breaks.map((_, index) => { + const startValueFeedBack = fieldFeedback( + form, + `breaks[${index}].startValue`, + ) + const endValueFeedBack = fieldFeedback( + form, + `breaks[${index}].endValue`, + ) + + return ( +
+ + + + + + + + +
+ ) + }) + : null} +
+ +
+
+ )} +
+
+
+ + +
+ +
+
+
+ ) + }} +
+
+ + setDatabaseOperationsModalData(defaultDatabaseOperation)} + onRequestClose={() => setDatabaseOperationsModalData(defaultDatabaseOperation)} + > +
{databaseOperationsModalData.index === -1 ? 'Add' : 'Update'}
+ + { + setSubmitting(true) + await putChartJsonItem({ + chartCode: listFormValues.listFormCode, + id: listFormValues.id, + index: databaseOperationsModalData.index, + fieldName: 'annotation', + itemAnnotation: { ...values }, + }) + toast.push( + + {databaseOperationsModalData.index === -1 + ? 'Kayıt eklendi.' + : 'Kayıt Değiştirildi.'} + , + { + placement: 'top-end', + }, + ) + + getListFormValues() + setSubmitting(false) + setDatabaseOperationsModalData(defaultDatabaseOperation) + }} + > + {({ touched, errors, resetForm, isSubmitting, values }) => ( +
+ +
+ + + General + Border + + + + + + + + + {({ field, form }: FieldProps) => ( + option.value === values.series)} + onChange={(option) => form.setFieldValue(field.name, option?.value)} + /> + )} + + + + + + + + + + + + + + + + + + + + + + + + + + {({ field, form }: FieldProps) => ( + option.value === values.border.dashStyle, + )} + onChange={(option) => form.setFieldValue(field.name, option?.value)} + /> + )} + + + + + + + + +
+
+ +
+
+
+ )} +
+
+ + setConfirmDelete(defaultConfirmDelete)} + onRequestClose={() => setConfirmDelete(defaultConfirmDelete)} + > +
Delete
+ +

Silmek istediğinize emin misiniz?

+ +
+ + +
+
) : ( <> diff --git a/ui/src/views/admin/listForm/edit/FormTabDetails.tsx b/ui/src/views/admin/listForm/edit/FormTabDetails.tsx index 6e8a7abb..c8d2837c 100644 --- a/ui/src/views/admin/listForm/edit/FormTabDetails.tsx +++ b/ui/src/views/admin/listForm/edit/FormTabDetails.tsx @@ -11,6 +11,7 @@ import { useEffect, useState } from 'react' import * as Yup from 'yup' import { FormEditProps } from './FormEdit' import { listFormDefaultLayoutOptions, listFormTypeOptions } from './options' +import { IdentityRoleDto, IdentityUserDto } from '@/proxy/admin/models' const schema = Yup.object().shape({ cultureName: Yup.string().required('Culture Name Required'), @@ -27,7 +28,9 @@ const schema = Yup.object().shape({ }), }) -function FormTabDetails(props: FormEditProps) { +function FormTabDetails( + props: FormEditProps & { roleList: SelectBoxOption[]; userList: SelectBoxOption[] }, +) { const [langOptions, setLangOptions] = useState([]) const { translate } = useLocalization() @@ -287,6 +290,44 @@ function FormTabDetails(props: FormEditProps) { + + + {({ field, form }: FieldProps) => ( + option.value === values.userId)} + onChange={(option) => form.setFieldValue(field.name, option?.value)} + /> + )} + + + diff --git a/ui/src/views/admin/listForm/edit/FormTabPivots.tsx b/ui/src/views/admin/listForm/edit/FormTabPivots.tsx index 478a3c5f..7039f5af 100644 --- a/ui/src/views/admin/listForm/edit/FormTabPivots.tsx +++ b/ui/src/views/admin/listForm/edit/FormTabPivots.tsx @@ -7,7 +7,7 @@ import { Field, FieldProps, Form, Formik } from 'formik' import * as Yup from 'yup' import { FormEditProps } from './FormEdit' import { SelectBoxOption } from '@/shared/types' -import { chartSeriesTypeOptions } from '../../chart/options' +import { chartSeriesTypeOptions } from './options' const validationSchema = Yup.object().shape({}) diff --git a/ui/src/views/admin/listForm/edit/options.ts b/ui/src/views/admin/listForm/edit/options.ts index 1b8683bf..47dec2da 100644 --- a/ui/src/views/admin/listForm/edit/options.ts +++ b/ui/src/views/admin/listForm/edit/options.ts @@ -200,6 +200,190 @@ export const listFormAlignmentOptions = [ { value: 'right', label: 'Right' }, ] +export const chartPaletteOptions = [ + { value: 'Bright', label: 'Bright' }, + { value: 'Carmine', label: 'Carmine' }, + { value: 'Dark Moon', label: 'Dark Moon' }, + { value: 'Dark Violet', label: 'Dark Violet' }, + { value: 'Green Mist', label: 'Green Mist' }, + { value: 'Harmony Light', label: 'Harmony Light' }, + { value: 'Material', label: 'Material' }, + { value: 'Ocean', label: 'Ocean' }, + { value: 'Office', label: 'Office' }, + { value: 'Pastel', label: 'Pastel' }, + { value: 'Soft', label: 'Soft' }, + { value: 'Soft Blue', label: 'Soft Blue' }, + { value: 'Soft Pastel', label: 'Soft Pastel' }, + { value: 'Vintage', label: 'Vintage' }, + { value: 'Violet', label: 'Violet' }, +] + +export const chartPaletteExtensionModeOptions = [ + { value: 'alternate', label: 'Alternate' }, + { value: 'blend', label: 'Blend' }, + { value: 'extrapolate', label: 'Extrapolate' }, +] + +export const chartSeriesTypeOptions = [ + { value: 'line', label: 'Line' }, + { value: 'stepline', label: 'Stepline' }, + { value: 'bar', label: 'Bar' }, + { value: 'fullstackedbar', label: 'Fullstackedbar' }, + { value: 'rangebar', label: 'Rangebar' }, + { value: 'rangearea', label: 'Rangearea' }, + { value: 'fullstackedarea', label: 'Fullstackedarea' }, + { value: 'area', label: 'Area' }, + { value: 'bubble', label: 'Bubble' }, + { value: 'candlestick', label: 'Candlestick' }, + { value: 'fullstackedline', label: 'Fullstackedline' }, + { value: 'fullstackedspline', label: 'Fullstackedspline' }, + { value: 'fullstackedsplinearea', label: 'Fullstackedsplinearea' }, + { value: 'scatter', label: 'Scatter' }, + { value: 'spline', label: 'Spline' }, + { value: 'splinearea', label: 'Splinearea' }, + { value: 'stackedarea', label: 'Stackedarea' }, + { value: 'stackedbar', label: 'Stackedbar' }, + { value: 'stackedline', label: 'Stackedline' }, + { value: 'stackedspline', label: 'Stackedspline' }, + { value: 'stackedsplinearea', label: 'Stackedsplinearea' }, + { value: 'steparea', label: 'Steparea' }, + { value: 'stock', label: 'Stock' }, +] + +export const chartSeriesSelectionModeOptions = [ + { value: 'none', label: 'None' }, + { value: 'allArgumentPoints', label: 'All Argument Points' }, + { value: 'allSeriesPoints', label: 'All Series Points' }, + { value: 'excludePoints', label: 'Exclude Points' }, + { value: 'includePoints', label: 'Include Points' }, + { value: 'onlyPoint', label: 'Only Point' }, +] + +export const chartSeriesDashStyleOptions = [ + { value: 'dash', label: 'Dash' }, + { value: 'solid', label: 'Dash Solid' }, + { value: 'dot', label: 'Dot' }, + { value: 'longDash', label: 'Long Dash' }, +] + +export const chartEasingListOptions = [ + { value: 'linear', label: 'Linear' }, + { value: 'easeOutCubic', label: 'Ease Out Cubic' }, +] + +export const chartArgumentAxisHoverModeListOptions = [ + { value: 'none', label: 'None' }, + { value: 'allArgumentPoints', label: 'All Argument Points' }, +] + +export const chartArgumentAxisTypeListOptions = [ + { value: null, label: 'None' }, + { value: 'numeric', label: 'Numeric' }, + { value: 'datetime', label: 'Datetime' }, + { value: 'string', label: 'String' }, +] + +export const chartArgumentAxisPositionListOptions = [ + { value: 'bottom', label: 'Bottom' }, + { value: 'left', label: 'Left' }, + { value: 'right', label: 'Right' }, + { value: 'top', label: 'Top' }, +] + +export const chartArgumentAxisIntervalListOptions = [ + { value: 'millisecond', label: 'Millisecond' }, + { value: 'second', label: 'Second' }, + { value: 'minute', label: 'Minute' }, + { value: 'hour', label: 'Hour' }, + { value: 'day', label: 'Day' }, + { value: 'week', label: 'Week' }, + { value: 'month', label: 'Month' }, + { value: 'quarter', label: 'Quarter' }, + { value: 'year', label: 'Year' }, +] + +export const chartArgumentAxisLabelDisplayModeListOptions = [ + { value: 'rotate', label: 'Rotate' }, + { value: 'stagger', label: 'Stagger' }, + { value: 'standard', label: 'Standard' }, +] + +export const chartArgumentAxisLabelOverlappingBehaviorListOptions = [ + { value: 'none', label: 'None' }, + { value: 'hide', label: 'Hide' }, + { value: 'standard', label: 'Standard' }, + { value: 'stagger', label: 'Stagger' }, +] + +export const chartLegendOrientationListOptions = [ + { value: 'horizontal', label: 'Horizontal' }, + { value: 'vertical', label: 'Vertical' }, +] + +export const chartLegendPositionListOptions = [ + { value: 'inside', label: 'Inside' }, + { value: 'outside', label: 'Outside' }, +] + +export const chartTitleVerticalAlignmentListOptions = [ + { value: 'bottom', label: 'Bottom' }, + { value: 'top', label: 'Top' }, +] + +export const chartTitleHorizantalAlignmentListOptions = [ + { value: 'center', label: 'Center' }, + { value: 'left', label: 'Left' }, + { value: 'right', label: 'Right' }, +] + +export const chartTitleTextOverFlowListOptions = [ + { value: 'none', label: 'None' }, + { value: 'ellipsis', label: 'Ellipsis' }, + { value: 'hide', label: 'Hide' }, +] + +export const chartTitleWordWrapListOptions = [ + { value: 'none', label: 'None' }, + { value: 'normal', label: 'Normal' }, + { value: 'breakWord', label: 'Break Word' }, +] + +export const chartTooltipLocationListOptions = [ + { value: 'center', label: 'Center' }, + { value: 'edge', label: 'Edge' }, +] + +export const chartZoomAndPanAxisOptions = [ + { value: 'none', label: 'None' }, + { value: 'edge', label: 'Both' }, + { value: 'pan', label: 'Pan' }, + { value: 'zoom', label: 'Zoom' }, +] + +export const chartZoomAndPanKeyOptions = [ + { value: 'alt', label: 'Alt' }, + { value: 'ctrl', label: 'Ctrl' }, + { value: 'meta', label: 'Meta' }, + { value: 'shift', label: 'Shift' }, +] + +export const chartAnnotationTypeListOptions = [ + { value: 'text', label: 'Text' }, + { value: 'image', label: 'Image' }, + { value: 'custom', label: 'Custom' }, +] + +export const chartWordWrapListOptions = [ + { value: 'none', label: 'None' }, + { value: 'normal', label: 'Normal' }, + { value: 'breakWord', label: 'Break Word' }, +] + +export const chartBreakStyleLineListOptions = [ + { value: 'straight', label: 'Straight' }, + { value: 'waved', label: 'Waved' }, +] + export const dbSourceTypeOptions = enumToList(DbTypeEnum) export const dataSourceTypeOptions = enumToList(DataSourceTypeEnum) export const selectCommandTypeOptions = enumToList(SelectCommandTypeEnum) diff --git a/ui/src/views/admin/chart/types.ts b/ui/src/views/admin/listForm/edit/types.ts similarity index 100% rename from ui/src/views/admin/chart/types.ts rename to ui/src/views/admin/listForm/edit/types.ts