Skip to content

Commit

Permalink
add upgrades for Typescript 4.1 and CombinedUserChartPart
Browse files Browse the repository at this point in the history
  • Loading branch information
olmobrutall committed Nov 24, 2020
1 parent c8f5aa5 commit ef0eee9
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Signum.Upgrade/CodeFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ private void AssertExtension(params string[] extension)
throw new InvalidOperationException("");
}

public void UpgradeNpmPackage(string packageName, string version)
public void UpdateNpmPackage(string packageName, string version)
{
AssertExtension(".json");
this.ReplaceLine(condition: a => a.Contains(@$"""{packageName}"""),
Expand Down
6 changes: 3 additions & 3 deletions Signum.Upgrade/Upgrades/Upgrade_20201110_DotNet5.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ public override void Execute(UpgradeContext uctx)

uctx.ChangeCodeFile($@"Southwind.React/package.json", file =>
{
file.UpgradeNpmPackage("@types/react", "file:../Framework/Signum.React/node_modules/@types/react");
file.UpgradeNpmPackage("node-sass", "5.0.0");
file.UpgradeNpmPackage("sass-loader", "10.1.0");
file.UpdateNpmPackage("@types/react", "file:../Framework/Signum.React/node_modules/@types/react");
file.UpdateNpmPackage("node-sass", "5.0.0");
file.UpdateNpmPackage("sass-loader", "10.1.0");
});

uctx.ChangeCodeFile($@"Southwind.React/Dockerfile", file =>
Expand Down
37 changes: 37 additions & 0 deletions Signum.Upgrade/Upgrades/Upgrade_20201123_Typescript41.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading.Tasks;

namespace Signum.Upgrade.Upgrades
{
class Upgrade_20201123_Typescript41 : CodeUpgradeBase
{
public override string Description => "Update to Typescript 4.1";

public override string SouthwindCommitHash => "60d43b2f94249ff9ef0ee36eaecc1b7fc8f65c71";

public override void Execute(UpgradeContext uctx)
{
uctx.ChangeCodeFile("Southwind.React/package.json", file =>
{
file.UpdateNpmPackage("ts-loader", "8.0.11");
file.UpdateNpmPackage("typescript", "4.1.2");
});

uctx.ChangeCodeFile("Southwind.React/Southwind.React.csproj", file =>
{
file.UpdateNugetReference("Microsoft.TypeScript.MSBuild", "4.1.2");
});

uctx.ChangeCodeFile("Southwind.React/tsconfig.json", file =>
{
file.RemoveAllLines(a => a.Contains(@"""baseUrl"": ""."","));
file.Replace("*", "./*");
});
}
}
}
27 changes: 27 additions & 0 deletions Signum.Upgrade/Upgrades/Upgrade_20201124_CombinedUserChartPart.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading.Tasks;

namespace Signum.Upgrade.Upgrades
{
class Upgrade_20201124_CombinedUserChartPart : CodeUpgradeBase
{
public override string Description => "CombinedUserChartPart";

public override string SouthwindCommitHash => "5d87563412c238710d184528853d65f67848d03c";

public override void Execute(UpgradeContext uctx)
{
uctx.ChangeCodeFile("Southwind.Logic/Starter.cs", file =>
{
file.Replace(
"typeof(UserChartPartEntity),",
"typeof(UserChartPartEntity), typeof(CombinedUserChartPartEntity),");
});
}
}
}

4 comments on commit ef0eee9

@olmobrutall
Copy link
Collaborator Author

@olmobrutall olmobrutall commented on ef0eee9 Nov 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Presenting CombinedUserChartPart

Since Charting module is optimized to design a chart and build the query to fill the data at the same time, it was never able to combine data from different sources like this one made in Excel:

image

Changing the interactive ChartViewer control to work with N different queries is a big undertake, and will complicate the UI a lot, but thanks to CombinedUserChartPart we can now combine multiple UserCharts and visualize such a combination in a Dashboard:

image

image

The result when visualizing the dashboard is:

image

Each UserChart is free to use his own queryName, filters or parameters. In case of conflicting parameters (like the label margins) the parameters from the first user chart will be taken.

Currently you can combine any number of ChartScripts as long as they are of type Line and Column. If more than one Column UserChart is selected, they split the available space like in the image.

Also by checking Use same scale the same vertical scale will be used for all the UserCharts, considering the values of all the charts, but configured following the parameters of the first one.

Just run Upgrade_20201124_CombinedUserChartPart to get this new feature!

@JesusFrancesGarcia
Copy link
Contributor

@JesusFrancesGarcia JesusFrancesGarcia commented on ef0eee9 Nov 24, 2020 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MehdyKarimpour
Copy link
Contributor

@MehdyKarimpour MehdyKarimpour commented on ef0eee9 Nov 24, 2020 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rezanos
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! That's a great and very useful feature! 👏

Please sign in to comment.