Skip to content

Commit

Permalink
Update README.md (#435)
Browse files Browse the repository at this point in the history
* Refactoring application version title

* Update README.md
  • Loading branch information
albertospelta authored Jun 4, 2022
1 parent 773cd7e commit 6817f26
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 10 deletions.
13 changes: 4 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ Bravo is free and open-source. The codebase is C# and TypeScript. However, you c
Bravo is in public preview. We plan to write documentation and more instructions about the code before the final release (1.0).

### Installation Requirements
Bravo requires a 64-bit Windows operating system. You can install Bravo on the following Windows platforms:
- Windows 11
- Windows 10 version 1809 (build 17763) or higher
- Windows Server 2019 or higher
Bravo requires a 64-bit Windows operating system and can run on all OS versions supported by Power BI Desktop ([Windows 8.1 / Windows Server 2012 R2, or later](https://docs.microsoft.com/en-us/power-bi/fundamentals/desktop-get-the-desktop#minimum-requirements)).
Bravo could also run on Windows 7 SP1 and Windows Server 2012, even though it is not supported and not tested by the development team.

### How to Help with Translations

Expand All @@ -32,8 +30,5 @@ You can copy the `en.ts` file into another language (use the ISO code) and trans
In case you are adding a translation for a new language then you must also to include it among the existing languages in the https://github.com/sql-bi/Bravo/blob/main/src/Scripts/model/i18n/locales.ts file.

#### Dates Template Translations
You can [fork the Dax Template](https://github.com/sql-bi/DaxTemplate/fork) repository and create a pull request adding or updating a file containing the strings used in the Dates templates.
The strings used in the Dates templates are here in another repository and folder: https://github.com/sql-bi/DaxTemplate/tree/main/src/Dax.Template.TestUI/Templates.
Please use the [DaxTemplate repository](https://github.com/sql-bi/DaxTemplate) to make any change to the Dates templates, we will apply differences and copy them to the Bravo repository.

After the 1.0 release of Bravo we will maintain also the Bravo templates file directly in the Bravo repository.
You can [fork the Bravo repository](https://github.com/sql-bi/Bravo/fork) and create a pull request updating a file containing the strings used in the Dates templates.
This folder contains the files used in the Dates templates: https://github.com/sql-bi/Bravo/tree/main/src/Assets/ManageDates/Templates.
2 changes: 1 addition & 1 deletion src/Infrastructure/AppWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ private void OnFormLoad(object? sender, EventArgs e)
{
ThemeHelper.InitializeTheme(Handle, UserPreferences.Current.Theme);

Text = $"{ AppEnvironment.ApplicationMainWindowTitle } - v{ string.Join('-', AppEnvironment.ApplicationProductVersion.Split('-').Take(4)) }";
Text = AppEnvironment.ApplicationMainWindowTitle.AppendApplicationVersion();
BackgroundImageLayout = ImageLayout.Center;
BackColor = _startupThemeColor;

Expand Down
16 changes: 16 additions & 0 deletions src/Infrastructure/Extensions/StringExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Text.RegularExpressions;
Expand All @@ -14,6 +15,21 @@ internal static class StringExtensions
private static Regex? _invalidFileNameCharsRegex;
private static Regex? _invalidPathCharsRegex;

public static string AppendApplicationVersion(this string value)
{
var valueAndVersion = $"{value} - v{GetVersionParts(AppEnvironment.ApplicationProductVersion, parts: 4)}";
return valueAndVersion;
}

public static string GetVersionParts(this string? version, int parts)
{
if (version.IsNullOrWhiteSpace())
return string.Empty;

var versionParts = string.Join('-', version.Split('-').Take(parts));
return versionParts;
}

public static bool IsPBIDesktopMainWindowTitle(this string windowTitle)
{
return windowTitle.EndsWith(AppEnvironment.PBIDesktopMainWindowTitleSuffix);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,34 @@ public void NormalizeDax_EolTrailingCharacterTest(string expression, string expe
Assert.Equal(expectedExpression, actualExpression);
Assert.Equal(DaxLineBreakStyle.None, actualLineBreakStyle);
}

[Fact]
public void AppendApplicationVersion_Test()
{
var actual = "Bravo for Power BI".AppendApplicationVersion();

Assert.NotNull(actual);
Assert.StartsWith("Bravo for Power BI", actual);
}

[Theory]
[InlineData(null, "", 4)]
[InlineData("", "", 4)]
[InlineData("0.0.0.999-DEV", "0.0.0.999-DEV", 4)]
[InlineData("0.9.4", "0.9.4", 4)]
[InlineData("0.9.4-internal", "0.9.4-internal", 4)]
[InlineData("0.9.4-internal-20220531.2-main-cf160fee710b983bbfb739e5eb1edd542a72b8b5 (0.9.8186.35439)", "0.9.4-internal-20220531.2-main", 4)]
[InlineData("0.9.4-internal-20220531.2-main-cf160fee710b983bbfb739e5eb1edd542a72b8b5 (0.9.8186.35439)", "0.9.4-internal-20220531.2", 3)]
[InlineData("0.9.4-internal-20220531.2-main-cf160fee710b983bbfb739e5eb1edd542a72b8b5 (0.9.8186.35439)", "0.9.4-internal", 2)]
[InlineData("0.9.4-internal-20220531.2-main-cf160fee710b983bbfb739e5eb1edd542a72b8b5 (0.9.8186.35439)", "0.9.4", 1)]
[InlineData("0.9.4-internal-20220531.2-main-cf160fee710b983bbfb739e5eb1edd542a72b8b5 (0.9.8186.35439)", "", 0)]
[InlineData("0.9.4-internal-20220531.2-main-cf160fee710b983bbfb739e5eb1edd542a72b8b5 (0.9.8186.35439)", "", -1)]
public void GetVersionParts_Test(string? value, string expected, int parts)
{
var actual = value.GetVersionParts(parts);

Assert.NotNull(actual);
Assert.Equal(expected, actual);
}
}
}

0 comments on commit 6817f26

Please sign in to comment.