Skip to content

Commit e697cbe

Browse files
authored
Merge pull request #5549 from bitfoundation/develop
Version 6.1.0 (#5538)
2 parents 4d83b9a + 56c8ca7 commit e697cbe

File tree

125 files changed

+1446
-1751
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+1446
-1751
lines changed

.devcontainer/devcontainer.json

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"name": "bit platform",
3+
"hostRequirements": {
4+
"cpus": 4
5+
},
6+
"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",
7+
"waitFor": "onCreateCommand",
8+
"customizations": {
9+
"codespaces": {
10+
"openFiles": [
11+
"CONTRIBUTING.md"
12+
]
13+
},
14+
"vscode": {
15+
"extensions": [
16+
"ms-dotnettools.vscode-dotnet-runtime",
17+
"kevin-chatham.aspnetcorerazor-html-css-class-completion",
18+
"ms-dotnettools.csharp",
19+
"glenn2223.live-sass"
20+
]
21+
}
22+
},
23+
"forwardPorts": [
24+
4000, 4001, 5000, 5001, 4030, 4031, 4040, 4041, 5030, 5031, 5040, 5041
25+
],
26+
"remoteEnv": {
27+
"ASPNETCORE_ENVIRONMENT": "Development"
28+
}
29+
}

src/Bit.Build.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<PackageProjectUrl>https://github.com/bitfoundation/bitplatform</PackageProjectUrl>
2626
<PackageIconUrl>https://avatars.githubusercontent.com/u/22663390</PackageIconUrl>
2727

28-
<ReleaseVersion>6.0.0</ReleaseVersion>
28+
<ReleaseVersion>6.1.0</ReleaseVersion>
2929

3030
<PackageReleaseNotes>https://github.com/bitfoundation/bitplatform/releases/tag/v-$(ReleaseVersion)</PackageReleaseNotes>
3131
<PackageVersion>$(ReleaseVersion)</PackageVersion>

src/BlazorUI/Bit.BlazorUI.Extras/Components/DataGrid/BitDataGrid.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
.col-sort-desc .sort-indicator:before {
3131
//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>');
3232
display: inline-block;
33-
font-family: 'Fabric MDL2';
33+
font-family: 'Fabric MDL2 bit BlazorUI' !important;
3434
font-style: normal;
3535
font-weight: normal;
3636
content: "\E96E";

src/BlazorUI/Bit.BlazorUI.Extras/Components/DataGrid/Pagination/BitDataGridPaginator.scss

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
.go-last:before {
4242
//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>');
4343
display: inline-block;
44-
font-family: 'Fabric MDL2';
44+
font-family: 'Fabric MDL2 bit BlazorUI' !important;
4545
font-style: normal;
4646
font-weight: normal;
4747
content: "\F371";
@@ -51,7 +51,7 @@
5151
.go-next:before {
5252
//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>');
5353
display: inline-block;
54-
font-family: 'Fabric MDL2';
54+
font-family: 'Fabric MDL2 bit BlazorUI' !important;
5555
font-style: normal;
5656
font-weight: normal;
5757
content: "\E96F";

src/BlazorUI/Bit.BlazorUI.Tests/Sliders/BitSliderTests.cs

+35-32
Original file line numberDiff line numberDiff line change
@@ -86,16 +86,17 @@ public void BitSliderRangedTest(bool ranged)
8686
}
8787

8888
[DataTestMethod,
89-
DataRow(null, 3),
89+
DataRow(-1000, 3D),
9090
DataRow(2, null),
91-
DataRow(2, 3),
92-
DataRow(null, null)
91+
DataRow(2, 3D),
92+
DataRow(-1000, null)
9393
]
94-
public void BitSliderDefaultLowerValueTest(int? lowerValue, int? defaultLowerValue)
94+
public void BitSliderDefaultLowerValueTest(double lowerValue, double? defaultLowerValue)
9595
{
96+
var hasLowerValue = lowerValue != -1000;
9697
var com = RenderComponent<BitSlider>(parameters =>
9798
{
98-
parameters.Add(p => p.LowerValue, lowerValue);
99+
if (hasLowerValue) parameters.Add(p => p.LowerValue, lowerValue);
99100
parameters.Add(p => p.DefaultLowerValue, defaultLowerValue);
100101
parameters.Add(p => p.ShowValue, true);
101102
parameters.Add(p => p.IsRanged, true);
@@ -104,21 +105,23 @@ public void BitSliderDefaultLowerValueTest(int? lowerValue, int? defaultLowerVal
104105
// Find first label with valueLabel css class
105106
var label = com.Find(".bit-sld-vlb");
106107

107-
var expectedValue = lowerValue.HasValue ? lowerValue : defaultLowerValue;
108+
var expectedValue = hasLowerValue ? lowerValue : defaultLowerValue;
109+
108110
Assert.AreEqual(expectedValue.GetValueOrDefault().ToString(), label.TextContent);
109111
}
110112

111113
[DataTestMethod,
112-
DataRow(null, 3),
114+
DataRow(-1000, 3D),
113115
DataRow(2, null),
114-
DataRow(2, 3),
115-
DataRow(null, null)
116+
DataRow(2, 3D),
117+
DataRow(-1000, null)
116118
]
117-
public void BitSliderDefaultUpperValueTest(int? upperValue, int? defaultUpperValue)
119+
public void BitSliderDefaultUpperValueTest(double upperValue, double? defaultUpperValue)
118120
{
121+
var hasUpperValue = upperValue != -1000;
119122
var com = RenderComponent<BitSlider>(parameters =>
120123
{
121-
parameters.Add(p => p.UpperValue, upperValue);
124+
if(hasUpperValue) parameters.Add(p => p.UpperValue, upperValue);
122125
parameters.Add(p => p.DefaultUpperValue, defaultUpperValue);
123126
parameters.Add(p => p.ShowValue, true);
124127
parameters.Add(p => p.IsRanged, true);
@@ -127,17 +130,17 @@ public void BitSliderDefaultUpperValueTest(int? upperValue, int? defaultUpperVal
127130
// Find labels with valueLabel css class
128131
var labels = com.FindAll(".bit-sld-vlb");
129132

130-
var expectedValue = upperValue.HasValue ? upperValue : defaultUpperValue;
133+
var expectedValue = hasUpperValue ? upperValue : defaultUpperValue;
131134

132135
Assert.AreEqual(2, labels.Count);
133-
Assert.AreEqual(expectedValue.GetValueOrDefault().ToString(), labels.Last().TextContent);
136+
Assert.AreEqual(expectedValue.GetValueOrDefault().ToString(), labels[^1].TextContent);
134137
}
135138

136139
[DataTestMethod,
137140
DataRow(null),
138141
DataRow(2)
139142
]
140-
public void BitSliderLowerValueTest(int? lowerValue)
143+
public void BitSliderLowerValueTest(double lowerValue)
141144
{
142145
var com = RenderComponent<BitSlider>(parameters =>
143146
{
@@ -149,7 +152,7 @@ public void BitSliderLowerValueTest(int? lowerValue)
149152

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

152-
Assert.AreEqual(lowerValue.GetValueOrDefault().ToString(), label.TextContent);
155+
Assert.AreEqual(lowerValue.ToString(), label.TextContent);
153156
}
154157

155158
[DataTestMethod,
@@ -173,12 +176,10 @@ public void BitSliderUpperValueTest(int? defaultUpperValue)
173176
}
174177

175178
[DataTestMethod,
176-
DataRow(null, null),
177-
DataRow(2, null),
178-
DataRow(null, 6),
179-
DataRow(2, 6)
179+
DataRow(2, 6),
180+
DataRow(0, 10)
180181
]
181-
public void BitSliderLowerAndUpperValueTest(int? lowerValue, int? upperValue)
182+
public void BitSliderLowerAndUpperValueTest(double lowerValue, double upperValue)
182183
{
183184
var com = RenderComponent<BitSlider>(parameters =>
184185
{
@@ -191,8 +192,8 @@ public void BitSliderLowerAndUpperValueTest(int? lowerValue, int? upperValue)
191192
var labels = com.FindAll(".bit-sld-vlb");
192193

193194
Assert.AreEqual(2, labels.Count);
194-
Assert.AreEqual(lowerValue.GetValueOrDefault().ToString(), labels[0].TextContent);
195-
Assert.AreEqual(upperValue.GetValueOrDefault().ToString(), labels[^1].TextContent);
195+
Assert.AreEqual(lowerValue.ToString(), labels[0].TextContent);
196+
Assert.AreEqual(upperValue.ToString(), labels[^1].TextContent);
196197
}
197198

198199
[DataTestMethod,
@@ -233,10 +234,10 @@ public void BitSliderVerticalDefaultValueTest(int? defaultValue)
233234
}
234235

235236
[DataTestMethod,
236-
DataRow(null),
237+
DataRow(5),
237238
DataRow(2)
238239
]
239-
public void BitSliderValueTest(int? value)
240+
public void BitSliderValueTest(double value)
240241
{
241242
var com = RenderComponent<BitSlider>(parameters =>
242243
{
@@ -247,14 +248,14 @@ public void BitSliderValueTest(int? value)
247248
// Find first label with valueLabel css class
248249
var label = com.Find(".bit-sld-vlb");
249250

250-
Assert.AreEqual(value.GetValueOrDefault().ToString(), label.TextContent);
251+
Assert.AreEqual(value.ToString(), label.TextContent);
251252
}
252253

253254
[DataTestMethod,
254-
DataRow(null),
255+
DataRow(5),
255256
DataRow(2)
256257
]
257-
public void BitSliderVerticalValueTest(int? value)
258+
public void BitSliderVerticalValueTest(double value)
258259
{
259260
var com = RenderComponent<BitSlider>(parameters =>
260261
{
@@ -266,16 +267,16 @@ public void BitSliderVerticalValueTest(int? value)
266267
// Find first label with valueLabel css class
267268
var label = com.Find(".bit-sld-vlb");
268269

269-
Assert.AreEqual(value.GetValueOrDefault().ToString(), label.TextContent);
270+
Assert.AreEqual(value.ToString(), label.TextContent);
270271
}
271272

272273
[DataTestMethod,
273274
DataRow(false, null),
274275
DataRow(true, null),
275-
DataRow(false, 2),
276-
DataRow(true, 2)
276+
DataRow(false, 2D),
277+
DataRow(true, 2D)
277278
]
278-
public void BitSliderStepTest(bool ranged, int? step)
279+
public void BitSliderStepTest(bool ranged, double? step)
279280
{
280281
var com = RenderComponent<BitSlider>(parameters =>
281282
{
@@ -287,11 +288,13 @@ public void BitSliderStepTest(bool ranged, int? step)
287288
});
288289

289290
var inputs = com.FindAll(".bit-sld input");
291+
var expected = (step ?? com.Instance.Step).ToString();
292+
290293
Assert.AreEqual(ranged ? 2 : 1, inputs.Count);
291294

292295
foreach (var input in inputs)
293296
{
294-
Assert.AreEqual(input.GetAttribute("step"), (step ?? com.Instance.Step).ToString());
297+
Assert.AreEqual(expected, input.GetAttribute("step"));
295298
}
296299
}
297300

src/BlazorUI/Bit.BlazorUI.Tests/TextField/BitTextFieldTests.cs

+2-16
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,7 @@ public void BitTextFieldShouldTakeValue(bool isMultiline, string value)
5454

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

57-
if (isMultiline)
58-
{
59-
Assert.AreEqual(bitTextField.TextContent, value);
60-
}
61-
else
62-
{
63-
Assert.AreEqual(bitTextField.GetAttribute("value"), value);
64-
}
57+
Assert.AreEqual(bitTextField.GetAttribute("value"), value);
6558
}
6659

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

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

311-
if (isMultiline)
312-
{
313-
Assert.AreEqual(bitTextField.TextContent, actualValue);
314-
}
315-
else
316-
{
317-
Assert.AreEqual(bitTextField.GetAttribute("value"), actualValue);
318-
}
304+
Assert.AreEqual(bitTextField.GetAttribute("value"), actualValue);
319305
}
320306

321307
[DataTestMethod, DataRow("test description")]

src/BlazorUI/Bit.BlazorUI/Components/Buttons/BitActionButton/BitActionButton.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
box-sizing: border-box;
1010
font-size: spacing(1.75);
1111
background-color: transparent;
12-
padding: spacing(0.5) spacing(2);
12+
padding: 0 spacing(0.5);
1313
color: $color-foreground-primary;
1414
border-radius: $shape-border-radius;
1515
font-family: $typography-font-family;

src/BlazorUI/Bit.BlazorUI/Components/Buttons/BitMenuButton/BitMenuButton.razor.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ private async Task ToggleCallout()
417417
{
418418
if (IsEnabled is false) return;
419419

420-
await _js.ToggleCallout(_dotnetObj, _Id, _calloutId, _isCalloutOpen, false, BitDropDirection.TopAndBottom, false, "", 0);
420+
await _js.ToggleCallout(_dotnetObj, _Id, _calloutId, _isCalloutOpen, false, BitDropDirection.TopAndBottom, false, "", 0, "", "");
421421
}
422422

423423

src/BlazorUI/Bit.BlazorUI/Components/Buttons/BitSplitButton/BitSplitButton.razor.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ private async Task ToggleCallout()
508508
{
509509
if (IsEnabled is false) return;
510510

511-
await _js.ToggleCallout(_dotnetObj, _Id, _calloutId, _isCalloutOpen, false, BitDropDirection.TopAndBottom, false, "", 0);
511+
await _js.ToggleCallout(_dotnetObj, _Id, _calloutId, _isCalloutOpen, false, BitDropDirection.TopAndBottom, false, "", 0, "", "");
512512
}
513513

514514

0 commit comments

Comments
 (0)