Skip to content

Commit

Permalink
Merge pull request #5549 from bitfoundation/develop
Browse files Browse the repository at this point in the history
Version 6.1.0 (#5538)
  • Loading branch information
msynk authored Oct 13, 2023
2 parents 4d83b9a + 56c8ca7 commit e697cbe
Show file tree
Hide file tree
Showing 125 changed files with 1,446 additions and 1,751 deletions.
29 changes: 29 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "bit platform",
"hostRequirements": {
"cpus": 4
},
"onCreateCommand": "wget https://download.visualstudio.microsoft.com/download/pr/764f2fec-710d-490d-a341-88636bce1a8d/35fc13fc20161a7d196200d9c2c6a8f0/dotnet-sdk-8.0.100-rc.1.23463.5-linux-x64.tar.gz -O $HOME/dotnet.tar.gz && export DOTNET_ROOT=$HOME/.dotnet && mkdir -p \"$DOTNET_ROOT\" && tar zxf $HOME/dotnet.tar.gz -C \"$DOTNET_ROOT\" && export PATH=$DOTNET_ROOT:$DOTNET_ROOT/tools:$PATH && dotnet dev-certs https --trust && dotnet build src/BlazorUI/Demo/Client/Web/Bit.BlazorUI.Demo.Client.Web.csproj && dotnet build src/Templates/AdminPanel/Bit.AdminPanel/src/Client/Core/AdminPanel.Client.Core.csproj -t:BeforeBuildTasks --no-restore && dotnet build src/Websites/Platform/src/Bit.Websites.Platform.Web/Bit.Websites.Platform.Web.csproj -t:BeforeBuildTasks --no-restore && dotnet build src/Websites/Sales/src/Bit.Websites.Sales.Web/Bit.Websites.Sales.Web.csproj -t:BeforeBuildTasks --no-restore && dotnet build src/Templates/TodoTemplate/Bit.TodoTemplate/src/Client/Core/TodoTemplate.Client.Core.csproj -t:BeforeBuildTasks --no-restore",
"waitFor": "onCreateCommand",
"customizations": {
"codespaces": {
"openFiles": [
"CONTRIBUTING.md"
]
},
"vscode": {
"extensions": [
"ms-dotnettools.vscode-dotnet-runtime",
"kevin-chatham.aspnetcorerazor-html-css-class-completion",
"ms-dotnettools.csharp",
"glenn2223.live-sass"
]
}
},
"forwardPorts": [
4000, 4001, 5000, 5001, 4030, 4031, 4040, 4041, 5030, 5031, 5040, 5041
],
"remoteEnv": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
2 changes: 1 addition & 1 deletion src/Bit.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<PackageProjectUrl>https://github.com/bitfoundation/bitplatform</PackageProjectUrl>
<PackageIconUrl>https://avatars.githubusercontent.com/u/22663390</PackageIconUrl>

<ReleaseVersion>6.0.0</ReleaseVersion>
<ReleaseVersion>6.1.0</ReleaseVersion>

<PackageReleaseNotes>https://github.com/bitfoundation/bitplatform/releases/tag/v-$(ReleaseVersion)</PackageReleaseNotes>
<PackageVersion>$(ReleaseVersion)</PackageVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
.col-sort-desc .sort-indicator:before {
//background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M 2 3.25 L 12 20.75 L 22 3.25 L 12 10 z" /></svg>');
display: inline-block;
font-family: 'Fabric MDL2';
font-family: 'Fabric MDL2 bit BlazorUI' !important;
font-style: normal;
font-weight: normal;
content: "\E96E";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
.go-last:before {
//background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g transform="rotate(90) scale(0.8)" transform-origin="12 12"><path d="m 2,1.5 l 10,17.5 l 10,-17.5 l -10,7.75 l -10,-7.75 z"/><rect height="2" width="20" y="20.5" x="2"/></g></svg>');
display: inline-block;
font-family: 'Fabric MDL2';
font-family: 'Fabric MDL2 bit BlazorUI' !important;
font-style: normal;
font-weight: normal;
content: "\F371";
Expand All @@ -51,7 +51,7 @@
.go-next:before {
//background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g transform="rotate(90)" transform-origin="12 12"><path d="M 2 3.25 L 12 20.75 L 22 3.25 L 12 11 z" /></g></svg>');
display: inline-block;
font-family: 'Fabric MDL2';
font-family: 'Fabric MDL2 bit BlazorUI' !important;
font-style: normal;
font-weight: normal;
content: "\E96F";
Expand Down
67 changes: 35 additions & 32 deletions src/BlazorUI/Bit.BlazorUI.Tests/Sliders/BitSliderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,17 @@ public void BitSliderRangedTest(bool ranged)
}

[DataTestMethod,
DataRow(null, 3),
DataRow(-1000, 3D),
DataRow(2, null),
DataRow(2, 3),
DataRow(null, null)
DataRow(2, 3D),
DataRow(-1000, null)
]
public void BitSliderDefaultLowerValueTest(int? lowerValue, int? defaultLowerValue)
public void BitSliderDefaultLowerValueTest(double lowerValue, double? defaultLowerValue)
{
var hasLowerValue = lowerValue != -1000;
var com = RenderComponent<BitSlider>(parameters =>
{
parameters.Add(p => p.LowerValue, lowerValue);
if (hasLowerValue) parameters.Add(p => p.LowerValue, lowerValue);
parameters.Add(p => p.DefaultLowerValue, defaultLowerValue);
parameters.Add(p => p.ShowValue, true);
parameters.Add(p => p.IsRanged, true);
Expand All @@ -104,21 +105,23 @@ public void BitSliderDefaultLowerValueTest(int? lowerValue, int? defaultLowerVal
// Find first label with valueLabel css class
var label = com.Find(".bit-sld-vlb");

var expectedValue = lowerValue.HasValue ? lowerValue : defaultLowerValue;
var expectedValue = hasLowerValue ? lowerValue : defaultLowerValue;

Assert.AreEqual(expectedValue.GetValueOrDefault().ToString(), label.TextContent);
}

[DataTestMethod,
DataRow(null, 3),
DataRow(-1000, 3D),
DataRow(2, null),
DataRow(2, 3),
DataRow(null, null)
DataRow(2, 3D),
DataRow(-1000, null)
]
public void BitSliderDefaultUpperValueTest(int? upperValue, int? defaultUpperValue)
public void BitSliderDefaultUpperValueTest(double upperValue, double? defaultUpperValue)
{
var hasUpperValue = upperValue != -1000;
var com = RenderComponent<BitSlider>(parameters =>
{
parameters.Add(p => p.UpperValue, upperValue);
if(hasUpperValue) parameters.Add(p => p.UpperValue, upperValue);
parameters.Add(p => p.DefaultUpperValue, defaultUpperValue);
parameters.Add(p => p.ShowValue, true);
parameters.Add(p => p.IsRanged, true);
Expand All @@ -127,17 +130,17 @@ public void BitSliderDefaultUpperValueTest(int? upperValue, int? defaultUpperVal
// Find labels with valueLabel css class
var labels = com.FindAll(".bit-sld-vlb");

var expectedValue = upperValue.HasValue ? upperValue : defaultUpperValue;
var expectedValue = hasUpperValue ? upperValue : defaultUpperValue;

Assert.AreEqual(2, labels.Count);
Assert.AreEqual(expectedValue.GetValueOrDefault().ToString(), labels.Last().TextContent);
Assert.AreEqual(expectedValue.GetValueOrDefault().ToString(), labels[^1].TextContent);
}

[DataTestMethod,
DataRow(null),
DataRow(2)
]
public void BitSliderLowerValueTest(int? lowerValue)
public void BitSliderLowerValueTest(double lowerValue)
{
var com = RenderComponent<BitSlider>(parameters =>
{
Expand All @@ -149,7 +152,7 @@ public void BitSliderLowerValueTest(int? lowerValue)

var label = com.Find(".bit-sld-vlb");

Assert.AreEqual(lowerValue.GetValueOrDefault().ToString(), label.TextContent);
Assert.AreEqual(lowerValue.ToString(), label.TextContent);
}

[DataTestMethod,
Expand All @@ -173,12 +176,10 @@ public void BitSliderUpperValueTest(int? defaultUpperValue)
}

[DataTestMethod,
DataRow(null, null),
DataRow(2, null),
DataRow(null, 6),
DataRow(2, 6)
DataRow(2, 6),
DataRow(0, 10)
]
public void BitSliderLowerAndUpperValueTest(int? lowerValue, int? upperValue)
public void BitSliderLowerAndUpperValueTest(double lowerValue, double upperValue)
{
var com = RenderComponent<BitSlider>(parameters =>
{
Expand All @@ -191,8 +192,8 @@ public void BitSliderLowerAndUpperValueTest(int? lowerValue, int? upperValue)
var labels = com.FindAll(".bit-sld-vlb");

Assert.AreEqual(2, labels.Count);
Assert.AreEqual(lowerValue.GetValueOrDefault().ToString(), labels[0].TextContent);
Assert.AreEqual(upperValue.GetValueOrDefault().ToString(), labels[^1].TextContent);
Assert.AreEqual(lowerValue.ToString(), labels[0].TextContent);
Assert.AreEqual(upperValue.ToString(), labels[^1].TextContent);
}

[DataTestMethod,
Expand Down Expand Up @@ -233,10 +234,10 @@ public void BitSliderVerticalDefaultValueTest(int? defaultValue)
}

[DataTestMethod,
DataRow(null),
DataRow(5),
DataRow(2)
]
public void BitSliderValueTest(int? value)
public void BitSliderValueTest(double value)
{
var com = RenderComponent<BitSlider>(parameters =>
{
Expand All @@ -247,14 +248,14 @@ public void BitSliderValueTest(int? value)
// Find first label with valueLabel css class
var label = com.Find(".bit-sld-vlb");

Assert.AreEqual(value.GetValueOrDefault().ToString(), label.TextContent);
Assert.AreEqual(value.ToString(), label.TextContent);
}

[DataTestMethod,
DataRow(null),
DataRow(5),
DataRow(2)
]
public void BitSliderVerticalValueTest(int? value)
public void BitSliderVerticalValueTest(double value)
{
var com = RenderComponent<BitSlider>(parameters =>
{
Expand All @@ -266,16 +267,16 @@ public void BitSliderVerticalValueTest(int? value)
// Find first label with valueLabel css class
var label = com.Find(".bit-sld-vlb");

Assert.AreEqual(value.GetValueOrDefault().ToString(), label.TextContent);
Assert.AreEqual(value.ToString(), label.TextContent);
}

[DataTestMethod,
DataRow(false, null),
DataRow(true, null),
DataRow(false, 2),
DataRow(true, 2)
DataRow(false, 2D),
DataRow(true, 2D)
]
public void BitSliderStepTest(bool ranged, int? step)
public void BitSliderStepTest(bool ranged, double? step)
{
var com = RenderComponent<BitSlider>(parameters =>
{
Expand All @@ -287,11 +288,13 @@ public void BitSliderStepTest(bool ranged, int? step)
});

var inputs = com.FindAll(".bit-sld input");
var expected = (step ?? com.Instance.Step).ToString();

Assert.AreEqual(ranged ? 2 : 1, inputs.Count);

foreach (var input in inputs)
{
Assert.AreEqual(input.GetAttribute("step"), (step ?? com.Instance.Step).ToString());
Assert.AreEqual(expected, input.GetAttribute("step"));
}
}

Expand Down
18 changes: 2 additions & 16 deletions src/BlazorUI/Bit.BlazorUI.Tests/TextField/BitTextFieldTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,7 @@ public void BitTextFieldShouldTakeValue(bool isMultiline, string value)

var bitTextField = component.Find(".bit-txt-inp");

if (isMultiline)
{
Assert.AreEqual(bitTextField.TextContent, value);
}
else
{
Assert.AreEqual(bitTextField.GetAttribute("value"), value);
}
Assert.AreEqual(bitTextField.GetAttribute("value"), value);
}

[DataTestMethod, DataRow("this is label")]
Expand Down Expand Up @@ -308,14 +301,7 @@ public void BitTextFieldShouldTakeDefaultValue(bool isMultiline, string value, s

var actualValue = string.IsNullOrEmpty(value) ? defaultValue : value;

if (isMultiline)
{
Assert.AreEqual(bitTextField.TextContent, actualValue);
}
else
{
Assert.AreEqual(bitTextField.GetAttribute("value"), actualValue);
}
Assert.AreEqual(bitTextField.GetAttribute("value"), actualValue);
}

[DataTestMethod, DataRow("test description")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
box-sizing: border-box;
font-size: spacing(1.75);
background-color: transparent;
padding: spacing(0.5) spacing(2);
padding: 0 spacing(0.5);
color: $color-foreground-primary;
border-radius: $shape-border-radius;
font-family: $typography-font-family;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ private async Task ToggleCallout()
{
if (IsEnabled is false) return;

await _js.ToggleCallout(_dotnetObj, _Id, _calloutId, _isCalloutOpen, false, BitDropDirection.TopAndBottom, false, "", 0);
await _js.ToggleCallout(_dotnetObj, _Id, _calloutId, _isCalloutOpen, false, BitDropDirection.TopAndBottom, false, "", 0, "", "");
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ private async Task ToggleCallout()
{
if (IsEnabled is false) return;

await _js.ToggleCallout(_dotnetObj, _Id, _calloutId, _isCalloutOpen, false, BitDropDirection.TopAndBottom, false, "", 0);
await _js.ToggleCallout(_dotnetObj, _Id, _calloutId, _isCalloutOpen, false, BitDropDirection.TopAndBottom, false, "", 0, "", "");
}


Expand Down
Loading

0 comments on commit e697cbe

Please sign in to comment.