Przeglądaj źródła

Added display for Kanban Tags on Task Panel

Kenric Nugteren 1 dzień temu
rodzic
commit
b9b0c29c6c

+ 2 - 0
prs.classes/Entities/Kanban/IKanban.cs

@@ -37,5 +37,7 @@ namespace Comal.Classes
         KanbanTypeLink Type { get; set; }
 
         bool Locked { get; set; }
+
+        string Tags { get; set; }
     }
 }

+ 3 - 0
prs.classes/Entities/Kanban/KanbanLink.cs

@@ -59,5 +59,8 @@ namespace Comal.Classes
 
         [NullEditor]
         public bool Locked { get; set; }
+
+        [NullEditor]
+        public string Tags { get; set; }
     }
 }

+ 4 - 2
prs.desktop/Panels/Tasks/KanbanResources.xaml

@@ -135,7 +135,8 @@
                         <ColumnDefinition Width="Auto"/>
                     </Grid.ColumnDefinitions>
                     <TextBlock Grid.Row="0" Grid.Column="0">
-                            <Run FontWeight="DemiBold" Text="{Binding Path=Title}"/>
+                        <Run FontWeight="DemiBold" Text="{Binding Path=Title}"/>
+                        <!--Run FontStyle="Italic" Text="{Binding Path=TagDisplay}"/-->
                     </TextBlock>
                     <TextBlock Grid.Row="1" Grid.Column="0" Style="{StaticResource descriptionStyle}">
                             <Run Text="{Binding Path=Description}"/>
@@ -199,7 +200,8 @@
                         <ColumnDefinition Width="Auto"/>
                     </Grid.ColumnDefinitions>
                     <TextBlock Grid.Row="0" Grid.Column="0">
-                            <Run FontWeight="DemiBold" Text="{Binding Path=Title}"/>
+                        <Run FontWeight="DemiBold" Text="{Binding Path=Title}"/>
+                        <Run FontStyle="Italic" Text="{Binding Path=TagDisplay}"/>
                     </TextBlock>
                     <TextBlock Grid.Row="1" Grid.Column="0" Style="{StaticResource descriptionStyle}">
                             <Run Text="{Binding Path=Description}"/>

+ 29 - 0
prs.desktop/Panels/Tasks/TaskModel.cs

@@ -2,6 +2,7 @@
 using System.Windows.Media;
 using System.Windows.Media.Imaging;
 using Comal.Classes;
+using InABox.Core;
 using PropertyChanged;
 using Syncfusion.UI.Xaml.Kanban;
 
@@ -35,6 +36,34 @@ public class TaskModel
     public bool Locked { get; set; }
     public TimeSpan EstimatedTime { get; set; }
 
+    private string _tags;
+    public string Tags
+    {
+        get => _tags;
+        set
+        {
+            _tags = value;
+            _tagDisplay = null;
+        }
+    }
+
+    private static TagsEditor? _tagsEditor;
+
+    private string? _tagDisplay;
+    public string TagDisplay
+    {
+        get
+        {
+            _tagsEditor ??= DatabaseSchema.Property<Kanban>(x => x.Tags)?.Editor as TagsEditor;
+            _tagDisplay ??= string.Join(',', _tagsEditor?.ReadTags(Tags) ?? []);
+            return _tagDisplay;
+        }
+        set
+        {
+
+        }
+    }
+
     public bool ShowEmployeeImage { get; set; }
 
     /// <summary>

+ 3 - 1
prs.desktop/Panels/Tasks/TasksByStatusControl.xaml.cs

@@ -739,7 +739,8 @@ public partial class TasksByStatusControl : UserControl, ITaskControl, INotifyPr
             x => x.Number,
             x => x.Attachments,
             x => x.EstimatedTime,
-            x => x.Locked);
+            x => x.Locked,
+            x => x.Tags);
     }
 
     public void Refresh()
@@ -805,6 +806,7 @@ public partial class TasksByStatusControl : UserControl, ITaskControl, INotifyPr
                 model.CompletedDate = kanban.Completed;
                 model.Locked = kanban.Locked;
                 model.EstimatedTime = kanban.EstimatedTime;
+                model.Tags = kanban.Tags;
 
                 if (kanban.Notes is not null)
                 {

+ 4 - 2
prs.desktop/Panels/Tasks/TasksByUserControl.xaml.cs

@@ -426,7 +426,8 @@ public partial class TasksByUserControl : UserControl, INotifyPropertyChanged, I
             x => x.Number,
             x => x.Attachments,
             x => x.Locked,
-            x => x.EstimatedTime);
+            x => x.EstimatedTime,
+            x => x.Tags);
     }
 
     private IEnumerable<KanbanSubscriber> LoadSubscribers(Filter<KanbanSubscriber>? filter = null)
@@ -548,7 +549,8 @@ public partial class TasksByUserControl : UserControl, INotifyPropertyChanged, I
                     Code = kanban.Type.Code
                 },
                 Number = kanban.Number,
-                Checked = SelectedTasks.Any(x => x.ID == kanban.ID)
+                Checked = SelectedTasks.Any(x => x.ID == kanban.ID),
+                Tags = kanban.Tags
             };
 
             var colour = subscriber.Employee.ID == kanban.Employee.ID