From 4712ad4e7b1a563824aa5b7c0215354db2c6f085 Mon Sep 17 00:00:00 2001 From: Mike Phares Date: Fri, 20 Oct 2023 12:31:59 -0700 Subject: [PATCH] Title Kanban --- .gitignore | 2 ++ Adaptation/.kanbn/index.md | 4 +-- Adaptation/.kanbn/tasks/get-all-api.md | 8 +++--- Adaptation/.kanbn/tasks/get-one-api.md | 6 ++--- ...-tab-form-text-area-to-paste-over-excel.md | 6 ++--- .../tasks/list-record-that-are-different.md | 6 ++--- .../list-records-that-are-out-of-sync.md | 6 ++--- ...t-uat-tasks-that-are-no-longer-in-excel.md | 6 ++--- .../nginx-static-html-in-old-school-form.md | 8 +++--- .../.kanbn/tasks/post-one-to-user-story.md | 6 ++--- .../tasks/remove-static-file-controller.md | 8 +++--- .../tasks/switch-to-infragistics-data-grid.md | 6 ++--- Adaptation/FileHandlers/json/ProcessData.cs | 27 +++++++++++++++---- 13 files changed, 59 insertions(+), 40 deletions(-) diff --git a/.gitignore b/.gitignore index e85055c..7ddc337 100644 --- a/.gitignore +++ b/.gitignore @@ -339,3 +339,5 @@ ASALocalRun/ !**/.vscode/tasks.json *.lnk + +Adaptation/.kanbn diff --git a/Adaptation/.kanbn/index.md b/Adaptation/.kanbn/index.md index 08fa124..f800435 100644 --- a/Adaptation/.kanbn/index.md +++ b/Adaptation/.kanbn/index.md @@ -1,7 +1,7 @@ --- type: "kanbn" -created: 2023-07-07T15:37:56.040Z -updated: 2023-07-18T19:52:59.668Z +created: "2023-10-20T05:13:53.986Z" +updated: "2023-10-20T05:13:53.987Z" startedColumns: - 'In Progress' completedColumns: diff --git a/Adaptation/.kanbn/tasks/get-all-api.md b/Adaptation/.kanbn/tasks/get-all-api.md index be859b5..581d922 100644 --- a/Adaptation/.kanbn/tasks/get-all-api.md +++ b/Adaptation/.kanbn/tasks/get-all-api.md @@ -1,10 +1,10 @@ --- -created: 2023-05-27T14:11:17.265Z -updated: 2023-05-27T14:25:10.299Z +created: "2023-06-23T20:27:00.000Z" +updated: "2023-06-23T20:27:00.000Z" assigned: "" progress: 0 -tags: [] -started: 2023-05-27T14:17:47.867Z +started: "2023-05-27T14:17:47.867Z" +type: "note" --- # Get All API diff --git a/Adaptation/.kanbn/tasks/get-one-api.md b/Adaptation/.kanbn/tasks/get-one-api.md index cd8f463..d2abc95 100644 --- a/Adaptation/.kanbn/tasks/get-one-api.md +++ b/Adaptation/.kanbn/tasks/get-one-api.md @@ -1,9 +1,9 @@ --- -created: 2023-05-27T14:12:23.972Z -updated: 2023-05-27T14:18:00.018Z +created: "2023-06-23T20:27:00.000Z" +updated: "2023-06-23T20:27:00.000Z" assigned: "" progress: 0 -tags: [] +type: "note" --- # Get One API diff --git a/Adaptation/.kanbn/tasks/in-tab-form-text-area-to-paste-over-excel.md b/Adaptation/.kanbn/tasks/in-tab-form-text-area-to-paste-over-excel.md index 2f16274..2717dee 100644 --- a/Adaptation/.kanbn/tasks/in-tab-form-text-area-to-paste-over-excel.md +++ b/Adaptation/.kanbn/tasks/in-tab-form-text-area-to-paste-over-excel.md @@ -1,9 +1,9 @@ --- -created: 2023-05-27T14:14:11.591Z -updated: 2023-05-27T14:14:11.582Z +created: "2023-06-23T20:27:00.000Z" +updated: "2023-06-23T20:27:00.000Z" assigned: "" progress: 0 -tags: [] +type: "note" --- # In tab form text area to paste over Excel diff --git a/Adaptation/.kanbn/tasks/list-record-that-are-different.md b/Adaptation/.kanbn/tasks/list-record-that-are-different.md index c771bf4..d76ed59 100644 --- a/Adaptation/.kanbn/tasks/list-record-that-are-different.md +++ b/Adaptation/.kanbn/tasks/list-record-that-are-different.md @@ -1,9 +1,9 @@ --- -created: 2023-05-27T14:14:31.083Z -updated: 2023-05-27T14:14:31.076Z +created: "2023-06-23T20:27:00.000Z" +updated: "2023-06-23T20:27:00.000Z" assigned: "" progress: 0 -tags: [] +type: "note" --- # List record that are different diff --git a/Adaptation/.kanbn/tasks/list-records-that-are-out-of-sync.md b/Adaptation/.kanbn/tasks/list-records-that-are-out-of-sync.md index b99a0f1..ff51298 100644 --- a/Adaptation/.kanbn/tasks/list-records-that-are-out-of-sync.md +++ b/Adaptation/.kanbn/tasks/list-records-that-are-out-of-sync.md @@ -1,9 +1,9 @@ --- -created: 2023-05-27T14:14:43.826Z -updated: 2023-05-27T14:14:43.819Z +created: "2023-06-23T20:27:00.000Z" +updated: "2023-06-23T20:27:00.000Z" assigned: "" progress: 0 -tags: [] +type: "note" --- # List records that are out of sync diff --git a/Adaptation/.kanbn/tasks/list-uat-tasks-that-are-no-longer-in-excel.md b/Adaptation/.kanbn/tasks/list-uat-tasks-that-are-no-longer-in-excel.md index ae8ceb8..95e5609 100644 --- a/Adaptation/.kanbn/tasks/list-uat-tasks-that-are-no-longer-in-excel.md +++ b/Adaptation/.kanbn/tasks/list-uat-tasks-that-are-no-longer-in-excel.md @@ -1,9 +1,9 @@ --- -created: 2023-05-27T14:16:12.555Z -updated: 2023-05-27T14:16:12.547Z +created: "2023-06-23T20:27:00.000Z" +updated: "2023-06-23T20:27:00.000Z" assigned: "" progress: 0 -tags: [] +type: "note" --- # List UAT Tasks that are no longer in Excel diff --git a/Adaptation/.kanbn/tasks/nginx-static-html-in-old-school-form.md b/Adaptation/.kanbn/tasks/nginx-static-html-in-old-school-form.md index 3a75cf0..33ecd48 100644 --- a/Adaptation/.kanbn/tasks/nginx-static-html-in-old-school-form.md +++ b/Adaptation/.kanbn/tasks/nginx-static-html-in-old-school-form.md @@ -1,10 +1,10 @@ --- -created: 2023-05-27T14:13:06.940Z -updated: 2023-05-27T14:17:56.583Z +created: "2023-06-23T20:27:00.000Z" +updated: "2023-06-23T20:27:00.000Z" assigned: "" progress: 0 -tags: [] -started: 2023-05-27T14:17:56.583Z +started: "2023-05-27T14:17:56.583Z" +type: "note" --- # nginx Static HTML in old school form diff --git a/Adaptation/.kanbn/tasks/post-one-to-user-story.md b/Adaptation/.kanbn/tasks/post-one-to-user-story.md index 055281f..ae0b459 100644 --- a/Adaptation/.kanbn/tasks/post-one-to-user-story.md +++ b/Adaptation/.kanbn/tasks/post-one-to-user-story.md @@ -1,9 +1,9 @@ --- -created: 2023-05-27T14:12:09.089Z -updated: 2023-05-27T14:12:09.080Z +created: "2023-06-23T20:27:00.000Z" +updated: "2023-06-23T20:27:00.000Z" assigned: "" progress: 0 -tags: [] +type: "note" --- # Post one to User Story diff --git a/Adaptation/.kanbn/tasks/remove-static-file-controller.md b/Adaptation/.kanbn/tasks/remove-static-file-controller.md index 82a424d..c1aef4e 100644 --- a/Adaptation/.kanbn/tasks/remove-static-file-controller.md +++ b/Adaptation/.kanbn/tasks/remove-static-file-controller.md @@ -1,10 +1,10 @@ --- -created: 2023-05-27T14:29:10.454Z -updated: 2023-05-27T14:32:05.873Z +created: "2023-06-23T20:27:00.000Z" +updated: "2023-06-23T20:27:00.000Z" assigned: "" progress: 1 -tags: [] -completed: 2023-05-27T00:00:00.000Z +completed: "2023-05-27T00:00:00.000Z" +type: "note" --- # Remove StaticFile Controller diff --git a/Adaptation/.kanbn/tasks/switch-to-infragistics-data-grid.md b/Adaptation/.kanbn/tasks/switch-to-infragistics-data-grid.md index fba8c11..6cc4409 100644 --- a/Adaptation/.kanbn/tasks/switch-to-infragistics-data-grid.md +++ b/Adaptation/.kanbn/tasks/switch-to-infragistics-data-grid.md @@ -1,9 +1,9 @@ --- -created: 2023-05-27T14:17:35.499Z -updated: 2023-05-27T14:17:35.492Z +created: "2023-06-23T20:27:00.000Z" +updated: "2023-06-23T20:27:00.000Z" assigned: "" progress: 0 -tags: [] +type: "note" --- # Switch to Infragistics Data Grid diff --git a/Adaptation/FileHandlers/json/ProcessData.cs b/Adaptation/FileHandlers/json/ProcessData.cs index 31355cc..0837e3f 100644 --- a/Adaptation/FileHandlers/json/ProcessData.cs +++ b/Adaptation/FileHandlers/json/ProcessData.cs @@ -199,12 +199,29 @@ public class ProcessData : IProcessData return result; } + private static string GetTitle(FIBacklogMesa fiBacklogMesa) + { + string result = $"{fiBacklogMesa.Req} - {fiBacklogMesa.Subject.Split(new string[] { Environment.NewLine }, StringSplitOptions.None)[0]}"; + if (result.Length > 128) + result = result.Substring(0, 127); + return result; + } + + private static string GetTitle(FIBacklogMesa fiBacklogMesa, ValueWithReq valueWithReq) + { + string result = $"{valueWithReq.Req} - {fiBacklogMesa.Subject.Split(new string[] { Environment.NewLine }, StringSplitOptions.None)[0]}"; + if (result.Length > 128) + result = result.Substring(0, 127); + return result; + } + private static string? GetMappedState(FIBacklogMesa fiBacklogMesa) => fiBacklogMesa.Status == "CMP" ? "Closed" : fiBacklogMesa.Status == "UAT" ? "Resolved" : fiBacklogMesa.Status == "In process" ? "Active" : null; private static void SetSyncTag(WorkItemTrackingHttpClient workItemTrackingHttpClient, ReadOnlyDictionary requestorNameToUser, Dictionary keyToFIBacklogMesa, ReadOnlyCollection valueWithReqCollection) { string key; + string title; int priority; bool isBugFix; string? state; @@ -223,6 +240,7 @@ public class ProcessData : IProcessData if (!keyToFIBacklogMesa.TryGetValue(key, out fiBacklogMesa)) continue; tags = GetTags(fiBacklogMesa); + title = GetTitle(fiBacklogMesa, valueWithReq); isBugFix = fiBacklogMesa.Priority == "0 - BugFix"; _ = requestorNameToUser.TryGetValue(fiBacklogMesa.Requestor, out string? requestorUser); if (!string.IsNullOrEmpty(requestorUser) && (valueWithReq.Value.Fields.SystemAssignedTo is null || !valueWithReq.Value.Fields.SystemAssignedTo.UniqueName.Equals(requestorUser, StringComparison.CurrentCultureIgnoreCase))) @@ -230,7 +248,7 @@ public class ProcessData : IProcessData Update(workItemTrackingHttpClient, sync, valueWithReq); continue; } - if (valueWithReq.Value.Fields.SystemTitle != $"{valueWithReq.Req} - {fiBacklogMesa.Subject}") + if (valueWithReq.Value.Fields.SystemTitle != title) { Update(workItemTrackingHttpClient, sync, valueWithReq); continue; @@ -487,10 +505,11 @@ public class ProcessData : IProcessData JsonPatchDocument result = new(); if (uatWorkItemTask.Result.Id is null) throw new NotSupportedException(); + string title = GetTitle(fiBacklogMesa); AddPatch(result, "/relations/-", new WorkItemRelation() { Rel = "System.LinkTypes.Hierarchy-Forward", Url = uatWorkItemTask.Result.Url }); AddPatch(result, "/fields/System.AreaPath", project); AddPatch(result, "/fields/System.IterationPath", project); - AddPatch(result, "/fields/System.Title", $"{fiBacklogMesa.Req} - {fiBacklogMesa.Subject}"); + AddPatch(result, "/fields/System.Title", title); string? state = GetMappedState(fiBacklogMesa); if (!string.IsNullOrEmpty(state)) AddPatch(result, "/fields/System.State", state); @@ -563,10 +582,8 @@ public class ProcessData : IProcessData JsonPatchDocument result = new(); if (userStoryWorkItemTask?.Result.Id is null) throw new NotSupportedException(); + string title = GetTitle(fiBacklogMesa); int priority = GetPriority(fiBacklogMesa); - string title = $"{fiBacklogMesa.Req} - {fiBacklogMesa.Subject}"; - if (title.Length > 128) - title = title.Substring(0, 127); AddPatch(result, "/relations/-", new WorkItemRelation() { Rel = "System.LinkTypes.Hierarchy-Forward", Url = userStoryWorkItemTask.Result.Url }); AddPatch(result, "/fields/System.AreaPath", project); if (tags.Count > 0)