Skip to content

Commit

Permalink
Release 115.0.4330 (#36)
Browse files Browse the repository at this point in the history
* # Patch notes for 115.0.4330

These patch notes summarize the changes from version 114.0.4166.

Changes to data models:
* NotificationDto: Added new field `id`
* NotificationDto: Removed field `notificationId`
* NotificationDto: Removed field `businessId`
* NotificationDto: Removed field `userId`
* ResourcesCreateDto: Added new field `projectIds`
* RiskExportSettingsDto: Added new field `timeZoneOffset`
* RiskExportSettingsDto: Added new field `dueDateFilter`
* RiskExportSettingsDto: Added new field `priorityFilter`
* RiskExportSettingsDto: Added new field `progressFilter`
* RiskExportSettingsDto: Added new field `assignees`
* RiskExportSettingsDto: Added new field `tags`
* TaskDto: Added new field `theme`

* Add WBS sorter

* Modify PR automation script

Let's schedule this to run automatically and fix the body text

---------

Co-authored-by: tspence <[email protected]>
Co-authored-by: Ted Spence <[email protected]>
  • Loading branch information
3 people authored Aug 28, 2024
1 parent d3f31ac commit bba57ea
Show file tree
Hide file tree
Showing 6 changed files with 14,256 additions and 11 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/update.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Check for OpenAPI updates

on:
# schedule:
# - cron: "0 0 * * 0" # Run once per week
schedule:
- cron: "0 0 * * 0" # Run once per week

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand Down Expand Up @@ -43,5 +43,6 @@ jobs:
uses: peter-evans/create-pull-request@v6
with:
commit-message: ${{ steps.patch-notes.outputs.patchnotes }}
body: ${{ steps.patch-notes.outputs.patchnotes }}
title: ${{ steps.patch-notes.outputs.releasename }}
branch: ${{ steps.patch-notes.outputs.branchname }}
9 changes: 3 additions & 6 deletions ProjectManagerClient.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package >
<metadata>
<id>ProjectManager.SDK</id>
<version>115.0.4328</version>
<version>115.0.4330</version>
<title>ProjectManager.SDK</title>
<authors>ProjectManager.com</authors>
<owners>ProjectManager.com, Inc.</owners>
Expand All @@ -14,9 +14,9 @@
<readme>docs/README.md</readme>
<summary>ProjectManager API for DotNet</summary>
<releaseNotes>
# Patch notes for 115.0.4328
# Patch notes for 115.0.4330

These patch notes summarize the changes from version 114.0.4169.
These patch notes summarize the changes from version 114.0.4166.

Changes to data models:
* NotificationDto: Added new field `id`
Expand All @@ -32,9 +32,6 @@
* RiskExportSettingsDto: Added new field `tags`
* TaskDto: Added new field `theme`

Deprecated 1 old APIs:
* TaskMetadata.GetTaskMetadata


</releaseNotes>
<copyright>Copyright 2023 - 2024</copyright>
Expand Down
2 changes: 1 addition & 1 deletion src/IProjectManagerClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* @author ProjectManager.com <[email protected]>
*
* @copyright 2023-2024 ProjectManager.com, Inc.
* @version 115.0.4328
* @version 115.0.4330
* @link https://github.com/projectmgr/projectmanager-sdk-csharp
*/

Expand Down
4 changes: 2 additions & 2 deletions src/ProjectManagerClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* @author ProjectManager.com <[email protected]>
*
* @copyright 2023-2024 ProjectManager.com, Inc.
* @version 115.0.4328
* @version 115.0.4330
* @link https://github.com/projectmgr/projectmanager-sdk-csharp
*/

Expand Down Expand Up @@ -39,7 +39,7 @@ public class ProjectManagerClient : IProjectManagerClient
/// <summary>
/// The version of the SDK
/// </summary>
public const string SdkVersion = "115.0.4328";
public const string SdkVersion = "115.0.4330";

private readonly string _apiUrl;
private readonly HttpClient _client;
Expand Down
89 changes: 89 additions & 0 deletions src/WbsSortHelper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
using System;
using System.Collections.Generic;
using ProjectManager.SDK.Models;

namespace ProjectManager.SDK
{
/// <summary>
/// Use this class to sort TaskDto objects according to their Work Breakdown Structure
/// </summary>
public class WbsSortHelper : IComparer<TaskDto>
{
int IComparer<TaskDto>.Compare(TaskDto t1, TaskDto t2)
{
// Sanity checks for null
if (t1 == null || t2 == null)
{
if (t1 == null && t2 != null)
{
return 1;
}

if (t1 != null && t2 == null)
{
return -1;
}

return 0;
}

try
{
var t1OutlineNumberArray = t1.Wbs.Trim().Split('.');
var t2OutlineNumberArray = t2.Wbs.Trim().Split('.');

for (int i = 0; i < t1OutlineNumberArray.Length; i++)
{
if (i >= t2OutlineNumberArray.Length)
{
return 1; // In this situation = 2.1 > 2 return 1
}
if (int.TryParse(t1OutlineNumberArray[i], out int t1Number) && int.TryParse(t2OutlineNumberArray[i], out int t2Number))
{
if (t1Number == t2Number)
{
continue; // Continue the compare on the next item, e.g 1.1 and 1.2.3 are the same in the first comparison.
}
if (t1Number > t2Number)
{
return 1; // Return 1 if t1 > t2 on the same position like '3'.1 > '1'.1
}
if (t1Number < t2Number)
{
return -1;
}
}
else
{
return -1;
}
}

// t1 length > t2 length e.g. 1.1.5 > 1.1, retrun 1. note it passes the compare above so the position can compare will be the same.
if (t1OutlineNumberArray.Length > t2OutlineNumberArray.Length)
{
return 1;
}
// e.g. 2.2 < 2.2.15, return -1;
if (t1OutlineNumberArray.Length < t2OutlineNumberArray.Length)
{
return -1;
}

// If we cannot get answer from above, use index.
if (t1.Id.HasValue && t2.Id.HasValue)
{
return t1.Id.Value.CompareTo(t2.Id.Value);
}
}
catch
{
if (t1.Id.HasValue && t2.Id.HasValue)
{
return t1.Id.Value.CompareTo(t2.Id.Value);
}
}
return 0;
}
}
}
Loading

0 comments on commit bba57ea

Please sign in to comment.