Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.0.0 #1

Merged
merged 15 commits into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[*.cs]

### Code Analysis


### C# style
csharp_style_var_for_built_in_types = true:warning
csharp_style_var_when_type_is_apparent = true:warning
csharp_style_var_elsewhere = true:warning
csharp_using_directive_placement = inside_namespace:warning
csharp_style_prefer_primary_constructors = false

dotnet_style_object_initializer = false

### Visual Studio
24 changes: 24 additions & 0 deletions .github/workflows/github-actions-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Continuous Integration

on:
pull_request:
branches: [ "main" ]
push:
branches: [ "releases/**" ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup .NET 8.x
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.x'

- name: Build
run: dotnet build --property:Configuration=Debug "Communication.UI.Blazor.sln"

- name: Test with the dotnet CLI
run: dotnet test --property:Configuration=Debug "Communication.UI.Blazor.sln"
36 changes: 36 additions & 0 deletions .github/workflows/github-actions-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Release

on:
workflow_dispatch:
inputs:
VersionPrefix:
type: string
description: The version of the library
required: true
default: 1.0.0
VersionSuffix:
type: string
description: The version suffix of the library (for example rc.1)

run-name: ${{ inputs.VersionPrefix }}-${{ inputs.VersionSuffix }}

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup .NET 8.x
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.x'

- name: Build
run: dotnet pack
--property:Configuration=Release
--property:VersionPrefix=${{ github.event.inputs.VersionPrefix }}
--property:VersionSuffix=${{ github.event.inputs.VersionSuffix }}
"src/Communication.UI.Blazor/Communication.UI.Blazor.csproj"

- name: Publish the package to nuget.org
run: dotnet nuget push "src/Communication.UI.Blazor/bin/Release/*.nupkg" --api-key "${{ secrets.NUGET_APIKEY }}" --source https://api.nuget.org/v3/index.json
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -396,3 +396,5 @@ FodyWeavers.xsd

# JetBrains Rider
*.sln.iml

/tests/Communication.UI.Blazor.Demo/wwwroot/appsettings.json
59 changes: 59 additions & 0 deletions CodeCoverage.runsettings
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- File name extension must be .runsettings -->
<RunSettings>
<DataCollectionRunSettings>
<DataCollectors>
<DataCollector friendlyName="Code Coverage" uri="datacollector://Microsoft/CodeCoverage/2.0" assemblyQualifiedName="Microsoft.VisualStudio.Coverage.DynamicCoverageDataCollector, Microsoft.VisualStudio.TraceCollector, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<Configuration>
<CodeCoverage>

<!-- Match assembly file paths: -->
<ModulePaths>
<Include>
<ModulePath>.*\.dll$</ModulePath>
</Include>
<Exclude>
<ModulePath>.*xunit.*</ModulePath>
<ModulePath>.*webjobs.*</ModulePath>
<ModulePath>bunit.*</ModulePath>
<ModulePath>moq.*</ModulePath>
<ModulePath>posinformatique.*</ModulePath>
<ModulePath>.*durabletask.*</ModulePath>
<ModulePath>microsoft.*</ModulePath>
<ModulePath>.*tests\.dll$</ModulePath>
</Exclude>
</ModulePaths>

<Attributes>
<Exclude>
<!-- Exclude generated code from code coverage -->
<Attribute>^System\.CodeDom\.Compiler\.GeneratedCodeAttribute$</Attribute>
<Attribute>^System\.Diagnostics\.CodeAnalysis\.ExcludeFromCodeCoverageAttribute$</Attribute>
</Exclude>
</Attributes>

<Sources>
<Exclude>
<Source>.*\.razor</Source>
<Source>.*\.cshtml</Source>
</Exclude>
</Sources>

<CompanyNames>
<Include>
<CompanyName>.*PosInformatique.*</CompanyName>
</Include>
</CompanyNames>

<!-- We recommend you do not change the following values: -->
<UseVerifiableInstrumentation>True</UseVerifiableInstrumentation>
<AllowLowIntegrityProcesses>True</AllowLowIntegrityProcesses>
<CollectFromChildProcesses>True</CollectFromChildProcesses>
<CollectAspDotNet>False</CollectAspDotNet>

</CodeCoverage>
</Configuration>
</DataCollector>
</DataCollectors>
</DataCollectionRunSettings>
</RunSettings>
73 changes: 73 additions & 0 deletions Communication.UI.Blazor.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.9.34728.123
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Communication.UI.Blazor", "src\Communication.UI.Blazor\Communication.UI.Blazor.csproj", "{80D7D289-D75C-4D90-A7EA-3BC798447F0F}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionItems", "SolutionItems", "{73E898B6-D134-41AC-AB6A-31080EB3BD8D}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
.gitignore = .gitignore
CodeCoverage.runsettings = CodeCoverage.runsettings
Directory.Build.props = Directory.Build.props
Directory.Packages.props = Directory.Packages.props
LICENSE = LICENSE
README.md = README.md
stylecop.json = stylecop.json
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{545F3956-E624-4790-96F1-C5D6F1BE3F90}"
ProjectSection(SolutionItems) = preProject
src\Directory.Build.props = src\Directory.Build.props
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Communication.UI.Blazor.Tests", "tests\Communication.UI.Blazor.Tests\Communication.UI.Blazor.Tests.csproj", "{531291B4-F715-4863-9AE9-ABFEDA378477}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{BA30637F-A11D-4821-99AC-D6DC85311D3C}"
ProjectSection(SolutionItems) = preProject
tests\.editorconfig = tests\.editorconfig
tests\Directory.Build.props = tests\Directory.Build.props
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Communication.UI.Blazor.Demo", "tests\Communication.UI.Blazor.Demo\Communication.UI.Blazor.Demo.csproj", "{0499E905-30D5-451E-BFAE-E900E8227075}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{8A9FB002-346C-4751-A00E-158921926CB6}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Components", "Components", "{796792A1-0557-4BCF-832C-61A698C190DD}"
ProjectSection(SolutionItems) = preProject
docs\Components\CallComposite.md = docs\Components\CallComposite.md
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{80D7D289-D75C-4D90-A7EA-3BC798447F0F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{80D7D289-D75C-4D90-A7EA-3BC798447F0F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{80D7D289-D75C-4D90-A7EA-3BC798447F0F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{80D7D289-D75C-4D90-A7EA-3BC798447F0F}.Release|Any CPU.Build.0 = Release|Any CPU
{531291B4-F715-4863-9AE9-ABFEDA378477}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{531291B4-F715-4863-9AE9-ABFEDA378477}.Debug|Any CPU.Build.0 = Debug|Any CPU
{531291B4-F715-4863-9AE9-ABFEDA378477}.Release|Any CPU.ActiveCfg = Release|Any CPU
{531291B4-F715-4863-9AE9-ABFEDA378477}.Release|Any CPU.Build.0 = Release|Any CPU
{0499E905-30D5-451E-BFAE-E900E8227075}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0499E905-30D5-451E-BFAE-E900E8227075}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0499E905-30D5-451E-BFAE-E900E8227075}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0499E905-30D5-451E-BFAE-E900E8227075}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{545F3956-E624-4790-96F1-C5D6F1BE3F90} = {73E898B6-D134-41AC-AB6A-31080EB3BD8D}
{BA30637F-A11D-4821-99AC-D6DC85311D3C} = {73E898B6-D134-41AC-AB6A-31080EB3BD8D}
{8A9FB002-346C-4751-A00E-158921926CB6} = {73E898B6-D134-41AC-AB6A-31080EB3BD8D}
{796792A1-0557-4BCF-832C-61A698C190DD} = {8A9FB002-346C-4751-A00E-158921926CB6}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {31146DB5-C3BB-4ACA-ADE6-07E17986964F}
EndGlobalSection
EndGlobal
51 changes: 51 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<Project>

<!-- Common properties -->
<PropertyGroup>
<Authors>Gilles TOURREAU</Authors>
<Company>P.O.S Informatique</Company>
<Product>P.O.S Informatique</Product>
<Copyright>Copyright (c) P.O.S Informatique. All rights reserved.</Copyright>
<RepositoryUrl>https://github.com/PosInformatique/PosInformatique.Azure.Communication.UI.Blazor</RepositoryUrl>
<RepositoryType>git</RepositoryType>

<!-- Enable the last version of C# -->
<LangVersion>latest</LangVersion>

<!-- Enable implict usings -->
<ImplicitUsings>enable</ImplicitUsings>

<!-- Disable the Analyzers in Release configuration -->
<RunAnalyzers Condition="'$(Configuration)' == 'Release'">false</RunAnalyzers>

<!-- Disable the StyleCop 'XML comment analysis is disabled due to project configuration' warning. -->
<NoWarn>$(NoWarn);SA0001</NoWarn>

<!-- By default prefix all the assemblies name with PosInformatique.Azure -->
<RootNamespace>PosInformatique.Azure.$(MSBuildProjectName.Replace(" ", "_"))</RootNamespace>
</PropertyGroup>

<ItemGroup>
<AdditionalFiles Include="..\..\stylecop.json">
<Link>stylecop.json</Link>
</AdditionalFiles>
</ItemGroup>

<ItemGroup>
<None Include="..\..\.editorconfig" Link=".editorconfig" />
</ItemGroup>

<!-- Common NuGet packages -->
<ItemGroup>
<PackageReference Include="StyleCop.Analyzers">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<!-- Add the default using directive for all the code -->
<ItemGroup>
<Using Include="System" />
</ItemGroup>

</Project>
21 changes: 21 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="Azure.Communication.Identity" Version="1.3.1" />
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
<PackageVersion Include="FluentAssertions" Version="6.12.0" />
<PackageVersion Include="Microsoft.AspNetCore.Components.Web" Version="8.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageVersion Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.10.48" />
<PackageVersion Include="Moq" Version="4.20.70" />
<PackageVersion Include="PosInformatique.FluentAssertions.Json" Version="1.2.0" />
<PackageVersion Include="PosInformatique.Moq.Analyzers" Version="1.4.0" />
<PackageVersion Include="StyleCop.Analyzers" Version="1.2.0-beta.556" />
<PackageVersion Include="xunit" Version="2.8.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.0" />
</ItemGroup>
</Project>
62 changes: 61 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,62 @@
# PosInformatique.Azure.Communication.UI.Blazor
Azure Communication Services UI Library for Blazor

PosInformatique.Azure.Communication.UI.Blazor is a C# wrapper Blazor library based on the Microsoft
[Azure Communication Services UI Library](https://azure.github.io/communication-ui-library/?path=/story/overview--page).

The [Azure Communication Services UI Library](https://azure.github.io/communication-ui-library/?path=/story/overview--page)
library contains some basic and composites components which use
[Azure Communication Services](https://azure.microsoft.com/fr-fr/products/communication-services) for Chat and Calling
features.

## Demo project
Do not hesitate to run the [tests/Communication.UI.Blazor.Demo](./tests/Communication.UI.Blazor.Demo)
application which contains an example usage of the
[PosInformatique.Azure.Communication.UI.Blazor](https://github.com/PosInformatique/PosInformatique.Azure.Communication.UI.Blazor)
library (I use it for my integration tests ;-)).

### Start the demo application
To start the project:
- Creates and add a JSON file `appsettings.json` in the
[tests/Communication.UI.Blazor.Demo/wwwroot](./tests/Communication.UI.Blazor.Demo/wwwroot) folder:

```json
{
"ACS_CONNECTION_STRING": "<Connection string>"
}
```

With:
- `<Connection string>`: The connection string of the Azure Communication Services ressources which can be retrieved
from the [Azure Portal](https://learn.microsoft.com/en-us/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp#access-your-connection-strings-and-service-endpoints).

### Create or using Azure Communication Services identity
The demo project required to use a Azure Communication Services identity. You can create an user directly
by clicking the `Create` button or by specifing the Communication User Identifier in the `UserID` textbox.

## Components

- [CallComposite](./docs/Components/CallComposite.md): Provides a calling experience that allows users to start or join a call

## Architecture

This library use natively the releases
[Azure Communication Services UI Library](https://azure.github.io/communication-ui-library/?path=/story/overview--page)
which are available in the official [GitHub project](https://github.com/Azure/communication-ui-library/releases).

To simplify dependencies, avoid usage of the composite JavaScript library and include React engine, the
[src/Communication.UI.Blazor/AzureCommunicationReact](./src/Communication.UI.Blazor/AzureCommunicationReact)
folder contains a Webpack project to bundle some NPM dependencies and compile single module library
which is used by Blazor components.

The Webpack project is automatically compiled when compiling the [src/Communication.UI.Blazor](./src/Communication.UI.Blazor)
project and produce the `azure-communication-react-bundle.js` used by the Blazor library.

## Dependencies
This currently library use the last stable release version of the
[Azure Communication Services UI Library](https://azure.github.io/communication-ui-library/?path=/story/overview--page)
library. Currently it is based on the
[v1.14.0](https://github.com/Azure/communication-ui-library/releases/tag/PublicPreview%2F1.14.0)
library.

The library is based on the minimal ASP .NET Core Blazor version which is the 8.0.0 and
can be used for the application based on this version or higher.
Loading
Loading