Work on AzDO pipelines to conform to CFS standards (#2009)

* [ProfileMenu] Remove ProfileMenu from demo site header and change examples

- Remove ProfileMenu fro demo site header (#1924)
- Align ProfileMenu examples to end so they display well on mobile

* [Demo site] New Video and PageTitle (#1925)

* Add new Video

* Add PageTitle (part 1)

* Update PageTitle

---------

Co-authored-by: Vincent Baaij <vnbaaij@outlook.com>

* Trying to fix AzDO pipeline errors

* More AzDO fixing

* Update DesignToken example

* Try to get build going with ssc ingnore file (for now)

* Try signed Markdig, remove ignoe file and public feed

* More changes to get build going again

* 🎬12: trying to fix

* Add path to .npmrc

* Change path again

* More path changes

* Try get GH Action to work again

* Fix typo

* Change path

* Change path

* Try adding cache

* Add lock file path

* Try add node install

* Some esproj changes

* Fix Coverlet version used

* Fix core build

* Update NuGet packages

* Try to get core build going again

* Remove package source mapping

* Use official 1ES template for core build
Fix compiler warnings

* Build Core NuGet adjustments

* Add NuGet.config path

---------

Co-authored-by: Denis Voituron <dvoituron@outlook.com>
This commit is contained in:
Vincent Baaij 2024-05-04 16:38:35 +02:00 коммит произвёл GitHub
Родитель 344544a934
Коммит 1f57a51a19
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
16 изменённых файлов: 159 добавлений и 181 удалений

32
.github/workflows/cicd_publish.yml поставляемый
Просмотреть файл

@ -1,19 +1,19 @@
name: Azure Static Web Apps CI/CD
on:
push:
branches:
branches:
- main
paths-ignore:
- '**/*.gitignore'
- '**/*.gitattributes'
pull_request:
types: [opened, synchronize, reopened, closed]
branches: [ main ]
paths-ignore:
- '**/*.gitignore'
- '**/*.gitattributes'
workflow_dispatch:
branches:
- main
@ -23,9 +23,9 @@ on:
jobs:
build_deploy_demo:
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
runs-on: ubuntu-latest
name: Build and deploy Demo site
name: Build and deploy Demo site
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
@ -40,20 +40,28 @@ jobs:
steps:
- name: Checkout source
uses: actions/checkout@v3
- name: .NET Setup SDKs
uses: actions/setup-dotnet@v2
with:
dotnet-version: |
8.0.x
include-prerelease: true
- name: .NET Builld
- name: NPM Install
uses: actions/setup-node@v4
with:
cache: 'npm'
cache-dependency-path: src/Core.Assets/package-lock.json
- run: npm install "src/Core.Assets/"
- name: .NET Builld
run: dotnet build ${{ env.PROJECT }} -c ${{ env.BUILD_CONFIG }} -o publish -f net8.0 -r linux-x64 --self-contained=true -p:BuildNumber=$BUILD_NUMBER -p:SourceRevisionId=$GITHUB_SHA -p:ContinuousIntegrationBuild=true
- name: .NET Publish
- name: .NET Publish
run: dotnet publish ${{ env.PROJECT }} -c ${{ env.BUILD_CONFIG }} -o publish -f net8.0 -r linux-x64 --self-contained=true -p:BuildNumber=$BUILD_NUMBER -p:SourceRevisionId=$GITHUB_SHA -p:ContinuousIntegrationBuild=true
- name: Deploy demo site to new Azure Static Web App
id: builddeploy
uses: Azure/static-web-apps-deploy@v1
@ -71,7 +79,7 @@ jobs:
destroy:
if: github.event_name == 'pull_request' && github.event.action == 'closed'
runs-on: ubuntu-latest
name: Close Pull Request Job
name: Close Pull Request Job
steps:
- name: Close Pull Request on new Azure Static Web App
id: closepullrequest

Просмотреть файл

@ -9,23 +9,23 @@
<!-- For Sample Apps -->
<PackageVersion Include="Microsoft.FluentUI.AspNetCore.Components" Version="4.5.0" />
<PackageVersion Include="Microsoft.FluentUI.AspNetCore.Components.Emoji" Version="4.6.0" />
<PackageVersion Include="Microsoft.FluentUI.AspNetCore.Components.Icons" version="4.6.0" />
<PackageVersion Include="Microsoft.FluentUI.AspNetCore.Components.Icons" version="4.7.0" />
<!-- Build dependencies -->
<PackageVersion Include="Markdig" Version="0.37.0" />
<PackageVersion Include="Microsoft.AspNetCore.Components.Web" Version="8.0.4" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.4" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.4" />
<PackageVersion Include="Markdig.Signed" Version="0.34.0" />
<PackageVersion Include="Microsoft.AspNetCore.Components.Web" Version="$(AspNetCoreVersion)" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly" Version="$(AspNetCoreVersion)" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="$(AspNetCoreVersion)" />
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="$(RuntimeVersion)" />
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0-beta1.23525.2" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.9.2" />
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="8.0.4" />
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="$(EfCoreVersion)" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="$(EfCoreVersion)" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Tools" Version="$(EfCoreVersion)" />
<PackageVersion Include="Microsoft.Extensions.Configuration.CommandLine" Version="$(RuntimeVersion)" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="$(RuntimeVersion)" />
<PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="$(RuntimeVersion)" />
<PackageVersion Include="Microsoft.Extensions.Http" Version="$(RuntimeVersion)" />
<PackageVersion Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.9.28" />
<PackageVersion Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.10.48" />
<PackageVersion Include="Microsoft.VisualStudioEng.MicroBuild.Core" Version="1.0.0" />
<PackageVersion Include="System.Text.Encodings.Web" Version="$(RuntimeVersion)" />
<PackageVersion Include="System.Text.Json" Version="8.0.3" />
@ -35,7 +35,7 @@
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageVersion Include="xunit" Version="2.7.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.7" />
<PackageVersion Include="coverlet.msbuild" Version="6.0.2" />
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
<PackageVersion Include="coverlet.msbuild" Version="6.0.0" />
<PackageVersion Include="coverlet.collector" Version="6.0.0" />
</ItemGroup>
</Project>

Просмотреть файл

@ -65,6 +65,8 @@ extends:
signType: $(SignType)
zipSources: false
feedSource: https://dnceng.pkgs.visualstudio.com/_packaging/MicroBuildToolset/nuget/v3/index.json
env:
TeamName: 'fluentui-blazor'
outputs:
- output: pipelineArtifact
targetPath: '$(Build.ArtifactStagingDirectory)\SignedPackages'
@ -73,99 +75,16 @@ extends:
steps:
# Compute AssemblyVersion and PackageVersion
# -> Update version.yml
- powershell: |
# Example with FileVersion: "1.2.4" and PackageSuffix: "RC.1"
# Build.BuildNumber = 1.2.4.23296.1
# = $(FileVersion).$(Year:yy)$(DayOfYear).$(Rev:r)
# Default values
$branch = "PR"
$package = ""
# To Test?
$toTest = "true"
# BranchName = dev, main, archive or PR
if ("$(Build.SourceBranchName)" -eq "main")
{
$branch = "main"
}
elseif ("$(Build.SourceBranchName)" -eq "dev")
{
$branch = "dev"
}
elseif ("$(Build.SourceBranch)" -like "refs/heads/archives/*")
{
$branch = "archive"
}
else
{
$branch = "PR"
}
# [1, 2, 4, 23296, 1]
$builds = "$(Build.BuildNumber)".Split('.')
# 1.2.4.23296
$assembly = "$($builds[0]).$($builds[1]).$($builds[2]).$($builds[3])"
# Main or Archive without PackageSuffix: 1.2.4
# Main or Archive with PackageSuffix: 1.2.4-rc.1
if ("$branch" -eq "main" -or "$branch" -eq "archive")
{
# Main without PackageSuffix
if ("$(PackageSuffix)" -eq "")
{
$package = "$($builds[0]).$($builds[1]).$($builds[2])"
}
# Main with PackageSuffix
else
{
$package = "$($builds[0]).$($builds[1]).$($builds[2])-$(PackageSuffix)"
}
$toTest = "true"
}
# Dev: 1.2.4-preview-23296-1
elseif ("$branch" -eq "dev")
{
$package = "$($builds[0]).$($builds[1]).$($builds[2])-preview.$($builds[3]).$($builds[4])"
$toTest = "true"
}
# Other branches: 1.2.4-preview-23296-1
else
{
$package = "$($builds[0]).$($builds[1]).$($builds[2])-preview.$($builds[3]).$($builds[4])"
$toTest = "true"
}
if ("${{ parameters.Tests }}" -eq "")
{
$toTest = "false"
}
# Set the output variable for use in other tasks.
Write-Host "##vso[task.setvariable variable=AssemblyVersion]${assembly}"
Write-Host "##vso[task.setvariable variable=PackageVersion]${package}"
Write-Host "##vso[task.setvariable variable=ShouldTest]${toTest}"
displayName: Compute AssemblyVersion and PackageVersion
# Display computed variables
- script: |
echo 🔸 FileVersion = $(FileVersion)
echo 🔸 PackageSuffix = $(PackageSuffix)
echo 🔸 Build.BuildNumber = $(Build.BuildNumber)
echo 🔸 Build.SourceBranch = $(Build.SourceBranch)
echo -----------------------------------------------
echo 🔸 AssemblyVersion = $(AssemblyVersion)
echo 🔸 PackageVersion = $(PackageVersion)
echo -----------------------------------------------
echo 🔸 ShouldTest = $(ShouldTest)
displayName: Display computed variables
- task: PowerShell@2
displayName: 'Compute AssemblyVersion and PackageVersion'
inputs:
targetType: 'filePath'
filePath: $(System.DefaultWorkingDirectory)/eng/pipelines/compute-version-variables.ps1
arguments: > # Use this to avoid newline characters in multiline string
-branchName "$(Build.SourceBranchName)"
-buildNumber "$(Build.BuildNumber)"
-packageSuffix "$(PackageSuffix)"
-testProjects "${{ parameters.Tests }}"
# Install NuGet tools
- task: NuGetToolInstaller@1
@ -195,10 +114,17 @@ extends:
# Install nodejs
- task: NodeTool@0
displayName: 'Install nodejs'
displayName: 'Install NodeJS'
inputs:
versionSpec: '20.x'
# Authenticate to npm
- task: Npm@1
displayName: "NPM install"
inputs:
command: "install"
workingDir: "src/Core.Assets"
# Set version number (exclude some folders)
- task: PowerShell@2
displayName: 'Versioning $(Build.BuildNumber)'

Просмотреть файл

@ -74,7 +74,7 @@ extends:
# For non-production pipelines, use "Unofficial" as defined below.
# For productions pipelines, use "Official".
#template: v1/1ES.Unofficial.PipelineTemplate.yml@1esPipelines
template: azure-pipelines/MicroBuild.1ES.Unofficial.yml@MicroBuildTemplate
template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate
parameters:
# Update the pool with your team's 1ES hosted pool.
pool:
@ -149,10 +149,17 @@ extends:
# Install nodejs
- task: NodeTool@0
displayName: 'Install nodejs'
displayName: 'Install NodeJS'
inputs:
versionSpec: '20.x'
# Authenticate to npm
- task: Npm@1
displayName: "NPM install"
inputs:
command: "install"
workingDir: "src/Core.Assets"
# Set version number (exclude some folders)
- task: PowerShell@2
displayName: 'Versioning $(Build.BuildNumber)'
@ -165,10 +172,17 @@ extends:
-assemblyVersion "$(AssemblyVersion)"
-packageVersion "$(PackageVersion)"
# Install dependencies
# NuGet Authenticate
- task: NuGetAuthenticate@1
displayName: 'Authenticate to AzDO Feeds'
# Restore packages
- task: DotNetCoreCLI@2
displayName: Install dependencies
displayName: Restore packages
inputs:
feedsToUse: config
nugetConfigPath: '$(System.DefaultWorkingDirectory)/NuGet.config'
includeNuGetOrg: false
command: 'restore'
projects: ${{ parameters.Projects }}

Просмотреть файл

@ -1,3 +1,7 @@
// ------------------------------------------------------------------------
// MIT License - Copyright (c) Microsoft Corporation. All rights reserved.
// ------------------------------------------------------------------------
using Markdig.Extensions.GenericAttributes;
using Markdig.Helpers;
using Markdig.Parsers;
@ -10,7 +14,7 @@ namespace FluentUI.Demo.Shared.Components;
/// <summary>
/// Modified version of original markdig CodeBlockRenderer
/// </summary>
/// <see cref="https://github.com/xoofx/markdig/blob/master/src/Markdig/Renderers/Html/CodeBlockRenderer.cs"/>
/// <see href="https://github.com/xoofx/markdig/blob/master/src/Markdig/Renderers/Html/CodeBlockRenderer.cs"/>
internal class MarkdownSectionPreCodeRenderer : HtmlObjectRenderer<CodeBlock>
{
private HashSet<string>? _blocksAsDiv;

Просмотреть файл

@ -4,7 +4,7 @@
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<LangVersion>latest</LangVersion>
<GenerateDocumentationFile>false</GenerateDocumentationFile>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<IsTrimmable>false</IsTrimmable>
<SuppressTrimAnalysisWarnings>false</SuppressTrimAnalysisWarnings>
</PropertyGroup>
@ -28,22 +28,22 @@
<TrimmerRemoveSymbols>true</TrimmerRemoveSymbols>
</PropertyGroup>
<!-- Code Analysis -->
<ItemGroup>
<!--
<PackageReference Include="StyleCop.Analyzers" VersionOverride="1.2.0-beta.556">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
-->
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" VersionOverride="17.8.14">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<!-- Code Analysis -->
<ItemGroup>
<!--
<PackageReference Include="StyleCop.Analyzers" VersionOverride="1.2.0-beta.556">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
-->
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" VersionOverride="17.8.14">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Markdig" />
<ItemGroup>
<PackageReference Include="Markdig.Signed" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" />
<PackageReference Include="Microsoft.FluentUI.AspNetCore.Components.Icons" />
<PackageReference Include="Microsoft.FluentUI.AspNetCore.Components.Emoji" />

Просмотреть файл

@ -1,3 +1,7 @@
// ------------------------------------------------------------------------
// MIT License - Copyright (c) Microsoft Corporation. All rights reserved.
// ------------------------------------------------------------------------
using FluentUI.Demo.Shared.Infrastructure;
using Microsoft.Extensions.DependencyInjection;
@ -9,7 +13,6 @@ public static class ServiceCollectionExtensions
/// Add common client services required by the Fluent UI Web Components for Blazor library
/// </summary>
/// <param name="services">Service collection</param>
/// <param name="configuration">Library configuration</param>
public static IServiceCollection AddFluentUIDemoClientServices(this IServiceCollection services)
{
services.AddSingleton<IAppVersionService, AppVersionService>();
@ -24,7 +27,6 @@ public static class ServiceCollectionExtensions
/// Add common server services required by the Fluent UI Web Components for Blazor library
/// </summary>
/// <param name="services">Service collection</param>
/// <param name="configuration">Library configuration</param>
public static IServiceCollection AddFluentUIDemoServerServices(this IServiceCollection services)
{
services.AddScoped<IAppVersionService, AppVersionService>();

Просмотреть файл

@ -29,12 +29,12 @@
Title = $"Hello {simplePerson.Firstname}",
OnDialogClosing = EventCallback.Factory.Create<DialogInstance>(this, async (instance) =>
{
/**
* Because of the JS code below, this `await` will block until the animation completes or is interrupted.
* Asynchronous code inside the "OnDialogClosing" callback will prevent the dialog from being removed until it has completed.
*
* WARNING: Don't use `eval`, it's dangerous! This is just a proof-of-concept demonstrating the OnDialogClosing/OnDialogOpened EventCallbacks.
*/
//
// * Because of the JS code below, this `await` will block until the animation completes or is interrupted.
// * Asynchronous code inside the "OnDialogClosing" callback will prevent the dialog from being removed until it has completed.
// *
// * WARNING: Don't use `eval`, it's dangerous! This is just a proof-of-concept demonstrating the OnDialogClosing/OnDialogOpened EventCallbacks.
//
await JS.InvokeVoidAsync("eval", $@"
async function func() {{
let dialog = document.getElementById('{instance.Id}')?.dialog;
@ -53,11 +53,11 @@
}),
OnDialogOpened = EventCallback.Factory.Create<DialogInstance>(this, async (instance) =>
{
/**
* Because of the JS code below, this `await` will block until the animation completes or is interrupted.
*
* WARNING: Don't use `eval`, it's dangerous! This is just a proof-of-concept demonstrating the OnDialogClosing/OnDialogOpened EventCallbacks.
*/
//
// * Because of the JS code below, this `await` will block until the animation completes or is interrupted.
// *
// * WARNING: Don't use `eval`, it's dangerous! This is just a proof-of-concept demonstrating the OnDialogClosing/OnDialogOpened EventCallbacks.
//
await JS.InvokeVoidAsync("eval", $@"
async function func() {{
let dialog = document.getElementById('{instance.Id}')?.dialog;
@ -77,4 +77,4 @@
Height = "500px",
});
}
}
}

Просмотреть файл

@ -241,15 +241,17 @@ There are a couple of methods available **per design token** to get or set its v
Given the following `.razor` page fragment:
```cshtml
<FluentButton @ref="ref1" Appearance="Appearance.Filled">A button</FluentButton>
<FluentButton @ref="ref2" Appearance="Appearance.Filled">Another button</FluentButton>
<FluentButton @ref="ref3" Appearance="Appearance.Filled">And one more</FluentButton>
<FluentButton @ref="ref4" Appearance="Appearance.Filled" @onclick=OnClick>Last button</FluentButton>
<FluentButton @ref="ref1">A button</FluentButton>
<FluentButton @ref="ref2" Appearance.Accent>Another button</FluentButton>
<FluentButton @ref="ref3">And one more</FluentButton>
<FluentButton @ref="ref4" @onclick=OnClick>Last button</FluentButton>
```
You can use Design Tokens to manipulate the styles from C# code as follows:
```csharp
@using Microsoft.FluentUI.AspNetCore.Components.DesignTokens
[Inject]
private BaseLayerLuminance BaseLayerLuminance { get; set; } = default!;

Просмотреть файл

@ -1,24 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<config>
<trustedSigners>
<repository name="nuget.org" serviceIndex="https://api.nuget.org/v3/index.json">
<certificate fingerprint="72A23807230618030B3CFC200845CE317AD849BCDB7E1DD0CEDC018A68EFEEE0" hashAlgorithm="SHA256" allowUntrustedRoot="false" />
<certificate fingerprint="F868853A2348B82A9ED4EAF5F7BBB2C901BAECA0E9EC8BAC238CE74624BAC74B" hashAlgorithm="SHA256" allowUntrustedRoot="false" />
<owners>microsoft;fast</owners>
</repository>
</trustedSigners>
</config>
<packageSources>
<clear />
<add key="NuGet" value="https://api.nuget.org/v3/index.json" />
<add key="Packages" value="D:\Source\Packages\" />
<add key="dotnet-public" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json" />
<add key="dotnet-eng" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json" />
<add key="dotnet8" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json" />
<add key="dotnet-tools" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" />
<add key="dotnet-libraries" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-libraries/nuget/v3/index.json" />
<add key="dotnet8-transport" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8-transport/nuget/v3/index.json" />
<!-- Used for the Rich Navigation indexing task -->
<add key="richnav" value="https://pkgs.dev.azure.com/azure-public/vside/_packaging/vs-buildservices/nuget/v3/index.json" />
</packageSources>
<packageSourceMapping>
<packageSource key="NuGet">
<packageSource key="dotnet-public">
<package pattern="*" />
</packageSource>
<packageSource key="dotnet8">
<package pattern="*" />
</packageSource>
<packageSource key="dotnet-libraries">
<package pattern="System.CommandLine" />
</packageSource>
<packageSource key="dotnet-eng">
<package pattern="*" />
</packageSource>
</packageSourceMapping>
</configuration>

2
src/Core.Assets/.npmrc Normal file
Просмотреть файл

@ -0,0 +1,2 @@
registry=https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/
always-auth=true

Просмотреть файл

@ -1,12 +1,9 @@
<Project Sdk="Microsoft.VisualStudio.JavaScript.Sdk/1.0.824748">
<Project Sdk="Microsoft.VisualStudio.JavaScript.Sdk/1.0.949573">
<PropertyGroup>
<DefaultProjectTypeGuid Condition="'$(BuildingInsideVisualStudio)' == 'false'">FAE04EC0-301F-11D3-BF4B-00C04F79EFBC</DefaultProjectTypeGuid>
<DebugAssetsDirectory>dist\</DebugAssetsDirectory>
<StaticWebAssetSourceId>Microsoft.FluentUI.AspNetCore.Components</StaticWebAssetSourceId>
<IsPackable>false</IsPackable>
<BuildCommand>npm run build</BuildCommand>
<CleanCommand>npm run clean</CleanCommand>
</PropertyGroup>
<Target Name="Pack" />
</Project>

Просмотреть файл

@ -54,7 +54,6 @@ public partial class FluentDataGridCell<TGridItem> : FluentComponentBase
.AddStyle("align-content", "center", () => GridContext.Grid.Virtualize && Owner.RowType == DataGridRowType.Default && string.IsNullOrEmpty(Style))
.Build();
protected override void OnInitialized()
{
Owner.Register(this);

Просмотреть файл

@ -35,7 +35,7 @@
}
else if (!Owner.Expanded && Owner.CollapsedChildNavigation && SubMenu != null)
{
<FluentMenuItem Disabled="@Disabled" OnClick="OnClickHandlerAsync" @onmenuchange="async ev => await OnClickHandlerAsync(null)">
<FluentMenuItem Disabled="@Disabled" OnClick="OnClickHandlerAsync" @onmenuchange="async ev => await OnClickHandlerAsync(new MouseEventArgs())">
<NavLink class="@LinkClassValue"
@attributes="@Attributes"
Match="@Match"

Просмотреть файл

@ -1,3 +1,7 @@
// ------------------------------------------------------------------------
// MIT License - Copyright (c) Microsoft Corporation. All rights reserved.
// ------------------------------------------------------------------------
using Bunit;
using Microsoft.AspNetCore.Components;
using Microsoft.Extensions.DependencyInjection;
@ -230,7 +234,9 @@ public class FluentCounterBadgeTests : TestBase
TestContext.Services.AddSingleton(GlobalState);
var cut = TestContext.RenderComponent<FluentCounterBadge>(parameters =>
{
#pragma warning disable CS0618 // Type or member is obsolete
parameters.Add(p => p.ShowZero, true);
#pragma warning restore CS0618 // Type or member is obsolete
parameters.Add(p => p.Count, 0);
parameters.AddChildContent("childcontent");
});
@ -246,7 +252,9 @@ public class FluentCounterBadgeTests : TestBase
TestContext.Services.AddSingleton(GlobalState);
var cut = TestContext.RenderComponent<FluentCounterBadge>(parameters =>
{
#pragma warning disable CS0618 // Type or member is obsolete
parameters.Add(p => p.ShowZero, true);
#pragma warning restore CS0618 // Type or member is obsolete
parameters.Add(p => p.Count, 10);
parameters.AddChildContent("childcontent");
});
@ -351,7 +359,9 @@ public class FluentCounterBadgeTests : TestBase
var cut = TestContext.RenderComponent<FluentCounterBadge>(parameters =>
{
#pragma warning disable CS0618 // Type or member is obsolete
parameters.Add(p => p.BadgeContent, "badgecontent");
#pragma warning restore CS0618 // Type or member is obsolete
parameters.Add(p => p.Count, 1);
});
@ -367,7 +377,9 @@ public class FluentCounterBadgeTests : TestBase
var cut = TestContext.RenderComponent<FluentCounterBadge>(parameters =>
{
#pragma warning disable CS0618 // Type or member is obsolete
parameters.Add(p => p.BadgeContent, "badgecontent");
#pragma warning restore CS0618 // Type or member is obsolete
parameters.Add(p => p.Max, 2);
parameters.Add(p => p.Count, 3);
});
@ -384,7 +396,9 @@ public class FluentCounterBadgeTests : TestBase
var cut = TestContext.RenderComponent<FluentCounterBadge>(parameters =>
{
#pragma warning disable CS0618 // Type or member is obsolete
parameters.Add(p => p.BadgeContent, "badgecontent");
#pragma warning restore CS0618 // Type or member is obsolete
parameters.Add(p => p.Count, 0);
});
@ -400,7 +414,9 @@ public class FluentCounterBadgeTests : TestBase
var cut = TestContext.RenderComponent<FluentCounterBadge>(parameters =>
{
#pragma warning disable CS0618 // Type or member is obsolete
parameters.Add(p => p.BadgeContent, (RenderFragment?)null);
#pragma warning restore CS0618 // Type or member is obsolete
parameters.Add(p => p.Count, 1);
});

Просмотреть файл

@ -1,7 +1,11 @@
using System.Globalization;
// ------------------------------------------------------------------------
// MIT License - Copyright (c) Microsoft Corporation. All rights reserved.
// ------------------------------------------------------------------------
using Bunit;
using Microsoft.AspNetCore.Components;
using Microsoft.Extensions.DependencyInjection;
using System.Globalization;
using Xunit;
namespace Microsoft.FluentUI.AspNetCore.Components.Tests.DateTime;
@ -147,7 +151,7 @@ public class FluentDatePickerTests : TestBase
var textfield = picker.Find("fluent-text-field");
// Assert
Assert.Equal("MMMM yyyy", textfield.Attributes["placeholder"].Value);
Assert.Equal("MMMM yyyy", textfield.Attributes["placeholder"]!.Value);
}
[Fact]
@ -165,11 +169,10 @@ public class FluentDatePickerTests : TestBase
parameters.Add(p => p.View, CalendarViews.Years);
});
var textfield = picker.Find("fluent-text-field");
// Assert
Assert.Equal("yyyy", textfield.Attributes["placeholder"].Value);
}
// Assert
Assert.Equal("yyyy", textfield.Attributes["placeholder"]!.Value);
}
[Fact]
public void FluentCalendar_DisabledDate()