فهرست منبع

Merge remote-tracking branch 'origin/frank' into kenric

Kenric Nugteren 1 سال پیش
والد
کامیت
22bd4446f5

+ 1 - 1
prs.classes/Entities/Job/DocumentSet/JobDocumentSet.cs

@@ -83,7 +83,7 @@ namespace Comal.Classes
         public Filter<JobDocumentSetMileStone>? Filter { get; set; } = null;
 
         public SortOrder<JobDocumentSetMileStone>? Sort { get; set; }
-            = new SortOrder<JobDocumentSetMileStone>(x => x.Type.Sequence, SortDirection.Descending).ThenBy(x => x.Created);
+            = new SortOrder<JobDocumentSetMileStone>(x => x.Type.Sequence, SortDirection.Descending).ThenBy(x => x.Created, SortDirection.Descending);
 
         public Expression<Func<JobDocumentSetMileStone, Guid>> Parent => x => x.DocumentSet.ID;
     }

+ 42 - 1
prs.classes/Entities/Job/DocumentSet/JobDocumentSetLink.cs

@@ -1,11 +1,12 @@
 using System;
+using System.Linq;
 using InABox.Core;
 
 namespace Comal.Classes
 {
     public class JobDocumentSetLink : EntityLink<JobDocumentSet>, IJobDocumentSet
     {
-        [NullEditor]
+        [LookupEditor(typeof(JobDocumentSet))]
         public override Guid ID { get; set; }
         
         [NullEditor]
@@ -21,11 +22,51 @@ namespace Comal.Classes
         [TextBoxEditor(Editable = Editable.Hidden)]
         [EditorSequence(2)]
         public string Description { get; set; }
+        
         public JobDocumentSetDisciplineLink Discipline { get; set; }
+        
         public JobDocumentSetTypeLink Type { get; set; }
+        
         public JobDocumentSetCategoryLink Category { get; set; }
+        
         public JobITPLink Area { get; set; }
 
         public LightJobDocumentSetMileStoneLink CurrentMileStone { get; set; }
     }
+    
+    public class JobDocumentSetLookups : EntityLookup<JobDocumentSet>, ILookupDefinition<JobDocumentSet,Job>
+    {
+        public override Filter<JobDocumentSet>? DefineFilter()
+        {
+            return null;
+        }
+
+        public override SortOrder<JobDocumentSet> DefineSortOrder()
+        {
+            return new SortOrder<JobDocumentSet>(x=>x.Code);
+        }
+
+        public override Columns<JobDocumentSet> DefineColumns()
+        {
+            return new Columns<JobDocumentSet>(x => x.ID)
+                .Add(x => x.Code)
+                .Add(x => x.Description);
+        }
+
+
+        public Filter<JobDocumentSet>? DefineFilter(Job[] items)
+        {
+            var ids = items.Select(x => x.ID).Distinct().ToArray();
+            return ids.Any()
+                ? new Filter<JobDocumentSet>(x => x.Job.ID).InList(ids)
+                : new Filter<JobDocumentSet>().None();
+        }
+
+        public Columns<Job> DefineFilterColumns()
+        {
+            return new Columns<Job>(x => x.ID)
+                .Add(x => x.JobNumber)
+                .Add(x => x.Name);
+        }
+    }
 }

+ 1 - 0
prs.classes/Entities/Job/ITP/JobITPLink.cs

@@ -14,6 +14,7 @@ namespace Comal.Classes
         [TextBoxEditor(Editable = Editable.Hidden)]
         public string Description { get; set; }
         
+        [NullEditor]
         public JobLink Job { get; set; }
     }
 }

+ 10 - 4
prs.classes/Entities/Job/JobProductMapping.cs

@@ -8,19 +8,25 @@ namespace Comal.Classes
 {
     public class JobProductMapping : Entity, IRemotable, IPersistent, ILicense<ProjectManagementLicense>
     {
+        
+        [EntityRelationship(DeleteAction.Cascade)]
+        [NullEditor]
+        public JobLink Job { get; set; }
+        
         [CodeEditor(Editable = Editable.Enabled, Visible = Visible.Default)]
+        [EditorSequence(1)]
         public string Code { get; set; } = "";
 
         [MemoEditor(Visible = Visible.Default)]
+        [EditorSequence(2)]
         public string Description { get; set; } = "";
-
-        [EntityRelationship(DeleteAction.Cascade)]
-        public JobLink Job { get; set; }
-
+        
         [EntityRelationship(DeleteAction.SetNull)]
+        [EditorSequence(3)]
         public ProductLink Product { get; set; }
 
         [EntityRelationship(DeleteAction.SetNull)]
+        [EditorSequence(3)]
         public JobDocumentSetLink JobDocumentSet { get; set; }
     }
 }

+ 1 - 1
prs.classes/Entities/Job/JobStyle.cs

@@ -5,7 +5,7 @@ namespace Comal.Classes
     public class JobStyle : Entity, IRemotable, IPersistent, ILicense<ProjectManagementLicense>
     {
         [EntityRelationship(DeleteAction.Cascade)]
-        [EditorSequence(1)]
+        [Editable(Editable.Hidden)]
         public JobLink Job { get; set; }
 
         [EntityRelationship(DeleteAction.SetNull)]

+ 2 - 2
prs.desktop/Panels/Jobs/JobGrid.cs

@@ -96,10 +96,10 @@ namespace PRSDesktop
             var pages = new DynamicEditorPages(new IDynamicEditorPage[]
             {
                 new DynamicManyToManyGrid<JobDocument,Job>(),
-                new DynamicManyToManyGrid<JobStyle,Job>(),
+                //new DynamicManyToManyGrid<JobStyle,Job>(),
                 new DynamicOneToManyGrid<Job,JobDocumentSetTag>(),
                 new JobFormDefinitionGrid(),
-                new DynamicOneToManyGrid<Job, JobProductMapping>(),
+                //new DynamicOneToManyGrid<Job, JobProductMapping>(),
             });
             return pages;
         }

+ 15 - 2
prs.desktop/Panels/Jobs/JobProductMappingsGrid.cs

@@ -35,6 +35,19 @@ public class JobProductMappingsGrid : DynamicDataGrid<JobProductMapping>, IJobCo
         options.Add(DynamicGridOption.SelectColumns);
     }
 
+    public override DynamicGridColumns GenerateColumns()
+    {
+        var columns = new DynamicGridColumns();
+        columns.Add<JobProductMapping, string>(x => x.Code, 150, "", "", Alignment.MiddleCenter);
+        columns.Add<JobProductMapping, string>(x => x.Description, 0, "", "", Alignment.MiddleLeft);
+        columns.Add<JobProductMapping, string>(x => x.Product.Code, 200, "Product Code", "", Alignment.MiddleCenter);
+        columns.Add<JobProductMapping, string>(x => x.JobDocumentSet.Description, 0, "Approval Document", "", Alignment.MiddleLeft);
+        columns.Add<JobProductMapping, string>(x => x.JobDocumentSet.CurrentMileStone.Type.Code, 100, "Stage", "", Alignment.MiddleCenter);
+        columns.Add<JobProductMapping, string>(x => x.JobDocumentSet.CurrentMileStone.Revision, 50, "Rev", "", Alignment.MiddleCenter);
+        columns.Add<JobProductMapping, JobDocumentSetMileStoneStatus>(x => x.JobDocumentSet.CurrentMileStone.Status, 100, "Status", "", Alignment.MiddleCenter);
+        return columns;
+    }
+
     private void BuildMenu(DynamicMenuColumn column, CoreRow? row)
     {
         if (row is not null)
@@ -98,7 +111,7 @@ public class JobProductMappingsGrid : DynamicDataGrid<JobProductMapping>, IJobCo
         var docSet = new JobDocumentSet
         {
             Code = code,
-            Description = row.Get<JobProductMapping, string>(x => x.Description) + $"\nAttached to JobProductMapping '{code}'"
+            Description = $"{code} Approval".Trim()
         };
         docSet.Job.ID = Job.ID;
         docSet.Folder.ID = dialog.SelectedFolder;
@@ -141,7 +154,7 @@ public class JobProductMappingsGrid : DynamicDataGrid<JobProductMapping>, IJobCo
         var ids = ExtractValues(x => x.ID, selection).ToArray();
         return new BaseDataModel<JobProductMapping>(new Filter<JobProductMapping>(x => x.ID).InList(ids));
     }
-
+    
     #endregion
 
 }

+ 13 - 1
prs.desktop/Panels/Jobs/JobProductStylesGrid.cs

@@ -31,6 +31,18 @@ public class JobProductStylesGrid : DynamicDataGrid<JobStyle>, IJobControl, IDat
         base.DoReconfigure(options);
         options.Add(DynamicGridOption.SelectColumns);
     }
+    
+    public override DynamicGridColumns GenerateColumns()
+    {
+        var columns = new DynamicGridColumns();
+        columns.Add<JobStyle, string>(x => x.Style.Code, 150, "", "", Alignment.MiddleCenter);
+        columns.Add<JobStyle, string>(x => x.Style.Description, 0, "", "", Alignment.MiddleLeft);
+        columns.Add<JobStyle, string>(x => x.JobDocumentSet.Description, 0, "Approval Document", "", Alignment.MiddleLeft);
+        columns.Add<JobStyle, string>(x => x.JobDocumentSet.CurrentMileStone.Type.Code, 100, "Stage", "", Alignment.MiddleCenter);
+        columns.Add<JobStyle, string>(x => x.JobDocumentSet.CurrentMileStone.Revision, 50, "Rev", "", Alignment.MiddleCenter);
+        columns.Add<JobStyle, JobDocumentSetMileStoneStatus>(x => x.JobDocumentSet.CurrentMileStone.Status, 100, "Status", "", Alignment.MiddleCenter);
+        return columns;
+    }
 
     private void BuildMenu(DynamicMenuColumn column, CoreRow? row)
     {
@@ -95,7 +107,7 @@ public class JobProductStylesGrid : DynamicDataGrid<JobStyle>, IJobControl, IDat
         var docSet = new JobDocumentSet
         {
             Code = code,
-            Description = row.Get<JobStyle, string>(x => x.Style.Description) + $"\nAttached to Product Style '{code}'"
+            Description = $"{code} Approval".Trim()
         };
         docSet.Job.ID = Job.ID;
         docSet.Folder.ID = dialog.SelectedFolder;

+ 1 - 1
prs.desktop/prsdesktop.iss

@@ -5,7 +5,7 @@
 #pragma verboselevel 9
 
 #define MyAppName "PRS Desktop"
-#define MyAppVersion "7.50"
+#define MyAppVersion "7.51"
 #define MyAppPublisher "PRS Digital"
 #define MyAppURL "https://www.prs-software.com.au"
 #define MyAppExeName "PRSDesktop.exe"

+ 1 - 1
prs.server/PRSServer.iss

@@ -5,7 +5,7 @@
 #pragma verboselevel 9
 
 #define MyAppName "PRS Server"
-#define MyAppVersion "7.50"
+#define MyAppVersion "7.51"
 #define MyAppPublisher "PRS Digital"
 #define MyAppURL "https://www.prs-software.com.au"
 #define MyAppExeName "PRSServer.exe"

+ 2 - 0
prs.shared/PRS.Shared.csproj

@@ -48,4 +48,6 @@
     <PackageReference Include="System.Collections.Immutable" Version="7.0.0" />
   </ItemGroup>
 
+  <Import Project="..\prs.stores\PRSStores.projitems" Label="Shared" />
+
 </Project>