Skip to content

Commit

Permalink
Company Communicator v4.1 (#346)
Browse files Browse the repository at this point in the history
  • Loading branch information
priyank29 authored Mar 18, 2021
1 parent 6b4a79c commit 9c9c715
Show file tree
Hide file tree
Showing 378 changed files with 23,549 additions and 11,690 deletions.
13 changes: 13 additions & 0 deletions Build/UserExclusion.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<PoliCheckExclusions>
<!--Each of these exclusions is a folder name -if \[name]\exists in the file path, it will be skipped -->
<Exclusion Type="FolderPathFull">NODE_MODULES|BUILD</Exclusion>

<!--Each of these exclusions is a folder name -if any folder or file starts with "\[name]", it will be skipped -->
<!--<Exclusion Type="FolderPathStart">ABC|XYZ</Exclusion>-->

<!--Each of these file types will be completely skipped for the entire scan -->
<!--<Exclusion Type="FileType">.ABC|.XYZ</Exclusion>-->

<!--The specified file names will be skipped during the scan regardless which folder they are in -->
<!--<Exclusion Type="FileName">ABC.TXT|XYZ.CS</Exclusion>-->
</PoliCheckExclusions>
28 changes: 21 additions & 7 deletions Deployment/azuredeploy.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,18 @@
"DefaultCulture": {
"defaultValue": "en-US",
"allowedValues": [
"en-US"
"ar-SA",
"de-DE",
"en-US",
"es-ES",
"fr-FR",
"he-IL",
"ja-JP",
"ko-KR",
"pt-BR",
"ru-RU",
"zh-CN",
"zh-TW"
],
"minLength": 1,
"type": "String",
Expand All @@ -73,7 +84,7 @@
}
},
"SupportedCultures": {
"defaultValue": "en-US",
"defaultValue": "ar-SA,de-DE,en-US,es-ES,fr-FR,he-IL,ja-JP,ko-KR,pt-BR,ru-RU,zh-CN,zh-TW",
"minLength": 1,
"type": "String",
"metadata": {
Expand Down Expand Up @@ -258,7 +269,7 @@
"appSettings": [
{
"name": "PROJECT",
"value": "Source/Microsoft.Teams.Apps.CompanyCommunicator/Microsoft.Teams.Apps.CompanyCommunicator.csproj"
"value": "Source/CompanyCommunicator/Microsoft.Teams.Apps.CompanyCommunicator.csproj"
},
{
"name": "SITE_ROLE",
Expand Down Expand Up @@ -585,12 +596,13 @@
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('hostingPlanName'))]",
"hostingEnvironment": "",
"clientAffinityEnabled": false,
"httpsOnly": true,
"siteConfig": {
"alwaysOn": "[not(variables('isSharedPlan'))]",
"appSettings": [
{
"name": "PROJECT",
"value": "Source\\Microsoft.Teams.Apps.CompanyCommunicator.Prep.Func\\Microsoft.Teams.Apps.CompanyCommunicator.Prep.Func.csproj"
"value": "Source\\CompanyCommunicator.Prep.Func\\Microsoft.Teams.Apps.CompanyCommunicator.Prep.Func.csproj"
},
{
"name": "SITE_ROLE",
Expand Down Expand Up @@ -704,12 +716,13 @@
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('hostingPlanName'))]",
"hostingEnvironment": "",
"clientAffinityEnabled": false,
"httpsOnly": true,
"siteConfig": {
"alwaysOn": "[not(variables('isSharedPlan'))]",
"appSettings": [
{
"name": "PROJECT",
"value": "Source\\Microsoft.Teams.Apps.CompanyCommunicator.Send.Func\\Microsoft.Teams.Apps.CompanyCommunicator.Send.Func.csproj"
"value": "Source\\CompanyCommunicator.Send.Func\\Microsoft.Teams.Apps.CompanyCommunicator.Send.Func.csproj"
},
{
"name": "SITE_ROLE",
Expand Down Expand Up @@ -807,12 +820,13 @@
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('hostingPlanName'))]",
"hostingEnvironment": "",
"clientAffinityEnabled": false,
"httpsOnly": true,
"siteConfig": {
"alwaysOn": "[not(variables('isSharedPlan'))]",
"appSettings": [
{
"name": "PROJECT",
"value": "Source\\Microsoft.Teams.Apps.CompanyCommunicator.Data.Func\\Microsoft.Teams.Apps.CompanyCommunicator.Data.Func.csproj"
"value": "Source\\CompanyCommunicator.Data.Func\\Microsoft.Teams.Apps.CompanyCommunicator.Data.Func.csproj"
},
{
"name": "SITE_ROLE",
Expand Down Expand Up @@ -1039,7 +1053,7 @@
"type": "string",
"value": "[parameters('authorClientId')]"
},
"userBotId": {
"userBotId": {
"type": "string",
"value": "[parameters('userClientId')]"
},
Expand Down
2 changes: 1 addition & 1 deletion Deployment/parameters.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"Description": "Default culture."
},
"supportedCultures": {
"Value": "en-US",
"Value": "ar-SA,de-DE,en-US,es-ES,fr-FR,he-IL,ja-JP,ko-KR,pt-BR,ru-RU,zh-CN,zh-TW",
"Description": "Comma-delimited list of the supported cultures."
},
"hostingPlanSku": {
Expand Down
2 changes: 1 addition & 1 deletion Manifest/manifest_authors.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.5/MicrosoftTeams.schema.json",
"manifestVersion": "1.5",
"version": "4.0.0",
"version": "4.1.0",
"id": "1c07cd26-a088-4db8-8928-ace382fa219f",
"packageName": "com.microsoft.teams.companycommunicator.authors",
"developer": {
Expand Down
2 changes: 1 addition & 1 deletion Manifest/manifest_users.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.5/MicrosoftTeams.schema.json",
"manifestVersion": "1.5",
"version": "4.0.0",
"version": "4.1.0",
"id": "148a66bb-e83d-425a-927d-09f4299a9274",
"packageName": "com.microsoft.teams.companycommunicator",
"developer": {
Expand Down
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Company Communicator App Template

| [Documentation](https://github.com/OfficeDev/microsoft-teams-company-communicator-app/wiki) | [Deployment guide](https://github.com/OfficeDev/microsoft-teams-company-communicator-app/wiki/Deployment-guide) | [Architecture](https://github.com/OfficeDev/microsoft-teams-company-communicator-app/wiki/Solution-overview) |
| ---- | ---- | ---- |
| [Documentation](https://github.com/OfficeDev/microsoft-teams-company-communicator-app/wiki) | [Deployment guide](https://github.com/OfficeDev/microsoft-teams-company-communicator-app/wiki/Deployment-guide) | [Deployment guide powershell](https://github.com/OfficeDev/microsoft-teams-company-communicator-app/wiki/Deployment-guide-powershell) | [Architecture](https://github.com/OfficeDev/microsoft-teams-company-communicator-app/wiki/Solution-overview) |
| ---- | ---- | ---- | ---- |

Company Communicator is a custom Teams app that enables corporate teams to create and send messages intended for multiple teams or large number of employees over chat allowing organization to reach employees right where they collaborate. Use this template for multiple scenarios, such as new initiative announcements, employee onboarding, modern learning and development, or organization-wide broadcasts.

Expand All @@ -13,12 +13,15 @@ The app provides an easy interface for designated users to create, preview, coll
* **Message creation:** Easily create messages by using a team tab where team members who are permissioned can collaborate and create messages.
* **Audience selection:** Pick from four options to target audience. Send to general channel of selected teams, send in 1:1 chat to members of selected teams, send to all users who have the app installed or send to M365 groups, distribution lists or security groups.
* **Message metrics:** Export messages delivery report.
* **Localization:** Supports multiple locales.
## Get started

Begin with the [Solution overview](https://github.com/OfficeDev/microsoft-teams-company-communicator-app/wiki/Solution-overview) to read about what the app does and how it works.

When you're ready to try out Company Communicator, or to use it in your own organization, follow the steps in the [Deployment guide](https://github.com/OfficeDev/microsoft-teams-company-communicator-app/wiki/Deployment-guide).

When you're ready to try out Company Communicator, or to use it in your own organization, you can choose to follow one of the below guides.
* [Deployment guide](https://github.com/OfficeDev/microsoft-teams-company-communicator-app/wiki/Deployment-guide).
* [Deployment guide powershell](https://github.com/OfficeDev/microsoft-teams-company-communicator-app/wiki/Deployment-guide-powershell).

## Feedback

Thoughts? Questions? Ideas? Share them with us on [Teams UserVoice](https://microsoftteams.uservoice.com/forums/555103-public)!
Expand Down
36 changes: 36 additions & 0 deletions Source/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/azds.yaml
**/bin
**/charts
**/docker-compose*
**/Dockerfile*
**/node_modules
**/build
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml

# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config
# NuGet v3's project.json files produces more ignoreable files
*.nuget.props
*.nuget.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// <copyright file="CCBotFrameworkHttpAdapter.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
// </copyright>

namespace Microsoft.Teams.Apps.CompanyCommunicator.Common.Adapter
{
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Bot.Builder;
using Microsoft.Bot.Builder.Integration.AspNet.Core;
using Microsoft.Bot.Connector.Authentication;
using Microsoft.Bot.Schema;

/// <summary>
/// Bot framework http adapter instance.
/// </summary>
public class CCBotFrameworkHttpAdapter : BotFrameworkHttpAdapter, ICCBotFrameworkHttpAdapter
{
private readonly ICredentialProvider credentialProvider;

/// <summary>
/// Initializes a new instance of the <see cref="CCBotFrameworkHttpAdapter"/> class.
/// </summary>
/// <param name="credentialProvider">credential provider.</param>
public CCBotFrameworkHttpAdapter(ICredentialProvider credentialProvider)
: base(credentialProvider)
{
this.credentialProvider = credentialProvider;
}

/// <inheritdoc/>
public override Task CreateConversationAsync(string channelId, string serviceUrl, MicrosoftAppCredentials credentials, ConversationParameters conversationParameters, BotCallbackHandler callback, CancellationToken cancellationToken)
{
return base.CreateConversationAsync(channelId, serviceUrl, credentials, conversationParameters, callback, cancellationToken);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// <copyright file="ICCBotFrameworkHttpAdapter.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
// </copyright>

namespace Microsoft.Teams.Apps.CompanyCommunicator.Common.Adapter
{
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Bot.Builder;
using Microsoft.Bot.Builder.Integration;
using Microsoft.Bot.Connector.Authentication;
using Microsoft.Bot.Schema;

/// <summary>
/// Bot Framework Http Adapter interface.
/// </summary>
public interface ICCBotFrameworkHttpAdapter : IAdapterIntegration
{
/// <summary>
/// Creates a conversation on the specified channel.
/// </summary>
/// <param name="channelId">The ID for the channel.</param>
/// <param name="serviceUrl">The channel's service URL endpoint.</param>
/// <param name="credentials">The application credentials for the bot.</param>
/// <param name="conversationParameters">The conversation information to use to create the conversation.</param>
/// <param name="callback">The method to call for the resulting bot turn.</param>
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <returns>A task that represents the work queued to execute.</returns>
Task CreateConversationAsync(string channelId, string serviceUrl, MicrosoftAppCredentials credentials, ConversationParameters conversationParameters, BotCallbackHandler callback, CancellationToken cancellationToken);
}
}
21 changes: 21 additions & 0 deletions Source/CompanyCommunicator.Common/Clients/IStorageClientFactory.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// <copyright file="IStorageClientFactory.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
// </copyright>

namespace Microsoft.Teams.Apps.CompanyCommunicator.Common.Clients
{
using global::Azure.Storage.Blobs;

/// <summary>
/// Storage client factory.
/// </summary>
public interface IStorageClientFactory
{
/// <summary>
/// Create the blob container client instance.
/// </summary>
/// <returns>BlobContainerClient instance.</returns>
BlobContainerClient CreateBlobContainerClient();
}
}
46 changes: 46 additions & 0 deletions Source/CompanyCommunicator.Common/Clients/StorageClientFactory.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// <copyright file="StorageClientFactory.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
// </copyright>

namespace Microsoft.Teams.Apps.CompanyCommunicator.Common.Clients
{
using System;
using global::Azure.Core;
using global::Azure.Storage.Blobs;
using Microsoft.Extensions.Options;
using Microsoft.Teams.Apps.CompanyCommunicator.Common.Repositories;

/// <summary>
/// Storage client factory.
/// </summary>
public class StorageClientFactory : IStorageClientFactory
{
private readonly string storageConnectionString;

/// <summary>
/// Initializes a new instance of the <see cref="StorageClientFactory"/> class.
/// </summary>
/// <param name="repositoryOptions">User data repository.</param>
public StorageClientFactory(IOptions<RepositoryOptions> repositoryOptions)
{
this.storageConnectionString = repositoryOptions.Value.StorageAccountConnectionString;
}

/// <inheritdoc/>
public BlobContainerClient CreateBlobContainerClient()
{
var options = new BlobClientOptions();

// configure retries
options.Retry.MaxRetries = 5; // default is 3
options.Retry.Mode = RetryMode.Exponential; // default is fixed retry policy
options.Retry.Delay = TimeSpan.FromSeconds(1); // default is 0.8s

return new BlobContainerClient(
this.storageConnectionString,
Constants.BlobContainerName,
options);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// <copyright file="Constants.cs" company="Microsoft">
// Copyright (c) Microsoft. All rights reserved.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
// </copyright>

namespace Microsoft.Teams.Apps.CompanyCommunicator.Common
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// <copyright file="EnumerableExtensions.cs" company="Microsoft">
// Copyright (c) Microsoft. All rights reserved.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
// </copyright>

namespace Microsoft.Teams.Apps.CompanyCommunicator.Common.Extensions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// <copyright file="NotificationDataExtensions.cs" company="Microsoft">
// Copyright (c) Microsoft. All rights reserved.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
// </copyright>

namespace Microsoft.Teams.Apps.CompanyCommunicator.Common.Extensions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// <copyright file="SendQueueMessageContentExtension.cs" company="Microsoft">
// Copyright (c) Microsoft. All rights reserved.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
// </copyright>

namespace Microsoft.Teams.Apps.CompanyCommunicator.Common.Extensions
Expand Down
Loading

0 comments on commit 9c9c715

Please sign in to comment.