Skip to content

Commit

Permalink
CC v5.2 changes (#817)
Browse files Browse the repository at this point in the history
* CC v5.2 changes

* Updated code and wiki for image size

* Changes to cache the image info
  • Loading branch information
Porkai-Pandian authored Aug 4, 2022
1 parent a45c53d commit 2158df0
Show file tree
Hide file tree
Showing 83 changed files with 4,715 additions and 9,637 deletions.
23 changes: 21 additions & 2 deletions Deployment/azuredeploy.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,22 @@
"description": "The link to the icon for the app. It must resolve to a PNG file."
}
},
"headerText": {
"type": "string",
"defaultValue": "Company Communicator",
"minLength": 1,
"metadata": {
"description": "The header banner text."
}
},
"headerLogoUrl": {
"type": "string",
"minLength": 1,
"defaultValue": "https://raw.githubusercontent.com/OfficeDev/microsoft-teams-company-communicator-app/main/Source/CompanyCommunicator/ClientApp/src/assets/Images/mslogo.png",
"metadata": {
"description": "The link to the logo for the app. It must resolve to a PNG file."
}
},
"tenantId": {
"type": "string",
"defaultValue": "[subscription().tenantId]",
Expand Down Expand Up @@ -610,7 +626,10 @@
"APPINSIGHTS_INSTRUMENTATIONKEY": "[concat('@Microsoft.KeyVault(SecretUri=', reference(variables('AppInsightsSecretResourceId'), '2015-06-01').secretUriWithVersion, ')')]",
"WEBSITE_NODE_DEFAULT_VERSION": "16.13.0",
"KeyVault:Url": "[variables('keyVaultUrl')]",
"DOTNET_ADD_GLOBAL_TOOLS_TO_PATH": "false"
"DOTNET_ADD_GLOBAL_TOOLS_TO_PATH": "false",
"REACT_APP_HEADERTEXT": "[parameters('headerText')]",
"REACT_APP_HEADERIMAGE": "[parameters('headerLogoUrl')]"

}
},
{
Expand Down Expand Up @@ -1315,4 +1334,4 @@
"value": "[if(variables('useFrontDoor'), variables('frontDoorDomain'), concat('Please create a custom domain name for ', variables('botAppDomain'), ' and use that in the manifest'))]"
}
}
}
}
20 changes: 19 additions & 1 deletion Deployment/azuredeploywithcert.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,22 @@
"description": "The link to the icon for the app. It must resolve to a PNG file."
}
},
"headerText": {
"type": "string",
"defaultValue": "Company Communicator",
"minLength": 1,
"metadata": {
"description": "The header banner text."
}
},
"headerLogoUrl": {
"type": "string",
"minLength": 1,
"defaultValue": "https://raw.githubusercontent.com/OfficeDev/microsoft-teams-company-communicator-app/main/Source/CompanyCommunicator/ClientApp/src/assets/Images/mslogo.png",
"metadata": {
"description": "The link to the logo for the app. It must resolve to a PNG file."
}
},
"tenantId": {
"type": "string",
"defaultValue": "[subscription().tenantId]",
Expand Down Expand Up @@ -610,7 +626,9 @@
"APPINSIGHTS_INSTRUMENTATIONKEY": "[concat('@Microsoft.KeyVault(SecretUri=', reference(variables('AppInsightsSecretResourceId'), '2015-06-01').secretUriWithVersion, ')')]",
"WEBSITE_NODE_DEFAULT_VERSION": "16.13.0",
"KeyVault:Url": "[variables('keyVaultUrl')]",
"DOTNET_ADD_GLOBAL_TOOLS_TO_PATH": "false"
"DOTNET_ADD_GLOBAL_TOOLS_TO_PATH": "false",
"REACT_APP_HEADERTEXT": "[parameters('headerText')]",
"REACT_APP_HEADERIMAGE": "[parameters('headerLogoUrl')]"
}
},
{
Expand Down
50 changes: 24 additions & 26 deletions Deployment/deploy.ps1

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions Deployment/parameters.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,14 @@
"Value": "https://raw.githubusercontent.com/OfficeDev/microsoft-teams-company-communicator-app/main/Manifest/color.png",
"Description": "The link to the icon for the app. It must resolve to a PNG file."
},
"headerText": {
"Value": "Company Communicator",
"Description": "The header banner text."
},
"headerLogoUrl": {
"Value": "https://raw.githubusercontent.com/OfficeDev/microsoft-teams-company-communicator-app/main/Source/CompanyCommunicator/ClientApp/src/assets/Images/mslogo.png",
"Description": "The link to the logo for the app. It must resolve to a PNG file."
},
"companyName": {
"Value": "<<value>>",
"Description": "The display name for the company."
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": "5.1.0",
"version": "5.2.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": "5.1.0",
"version": "5.2.0",
"id": "148a66bb-e83d-425a-927d-09f4299a9274",
"packageName": "com.microsoft.teams.companycommunicator",
"developer": {
Expand Down
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Company Communicator App Template

| [Documentation](https://github.com/OfficeDev/microsoft-teams-company-communicator-app/wiki) | [Deployment guide powershell](https://github.com/OfficeDev/microsoft-teams-company-communicator-app/wiki/Deployment-guide-powershell) |[Deployment guide](https://github.com/OfficeDev/microsoft-teams-company-communicator-app/wiki/Deployment-guide) | [Deployment guide certificate](https://github.com/OfficeDev/microsoft-teams-company-communicator-app/wiki/Deployment-guide-certificate) | [Architecture](https://github.com/OfficeDev/microsoft-teams-company-communicator-app/wiki/Solution-overview) |
[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 powershell](https://github.com/OfficeDev/microsoft-teams-company-communicator-app/wiki/Deployment-guide-powershell) |[Deployment guide](https://github.com/OfficeDev/microsoft-teams-company-communicator-app/wiki/Deployment-guide) | [User manual](https://github.com/OfficeDev/microsoft-teams-apps-company-communicator/wiki/User-manual) |
| ---- | ---- | ---- | ---- | ---- |

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 @@ -9,26 +9,29 @@ The app provides an easy interface for designated users to create, preview, coll

![Company Communicator compose message screen](https://github.com/OfficeDev/microsoft-teams-company-communicator-app/wiki/images/CompanyCommunicatorCompose.png)

### Key features
## Key features

* **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.
* **Feedback:** Submit your feedback to the product team.

## 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, you can choose to follow one of the below guides.
* [Deployment guide powershell](https://github.com/OfficeDev/microsoft-teams-company-communicator-app/wiki/Deployment-guide-powershell).
* **Recommended** Use this option to deploy the Company Communicator v5.0 using powershell script. The entire set-up is done by the powershell script.
* **Recommended** Use this option to deploy the Company Communicator v5.2 using powershell script. The entire set-up is done by the powershell script.
* [Deployment guide](https://github.com/OfficeDev/microsoft-teams-company-communicator-app/wiki/Deployment-guide).
* Use this option to deploy the Company Communicator v5.0 with client secrets.
* Use this option to deploy the Company Communicator v5.2 with client secrets.
* [Deployment guide certificate](https://github.com/OfficeDev/microsoft-teams-company-communicator-app/wiki/Deployment-guide-certificate).
* Use this option to deploy the Company Communicator v5.0 with certificates.
* Use this option to deploy the Company Communicator v5.2 with certificates.

## Migration

If you already have older version of Company Communicator installed, then please use this [v5 migration guide](https://github.com/OfficeDev/microsoft-teams-apps-company-communicator/wiki/v5-migration-guide). Please note that deploying the major version update, like Company Communicator version 5.0 involves more than syncing the App Service and Azure Functions, so plan to review the migration guide before migrating to latest.
If you already have older version of Company Communicator installed, then please use this [v5 migration guide](https://github.com/OfficeDev/microsoft-teams-apps-company-communicator/wiki/v5-migration-guide). Please note that deploying the major version update, like Company Communicator version 5.2 involves more than syncing the App Service and Azure Functions, so plan to review the migration guide before migrating to latest.

Migrating to newer versions.

Expand All @@ -39,7 +42,7 @@ Migrating to newer versions.

## Feedback

Thoughts? Questions? Ideas? Share them with us on [Teams UserVoice](https://microsoftteams.uservoice.com/forums/555103-public)!
Thoughts? Questions? Ideas? Share them with us [here](https://aka.ms/M365CCFeedback)

Please report bugs and other code issues [here](https://github.com/OfficeDev/microsoft-teams-company-communicator-app/issues/new).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,12 @@ public interface IStorageClientFactory
/// </summary>
/// <returns>BlobContainerClient instance.</returns>
BlobContainerClient CreateBlobContainerClient();

/// <summary>
/// Create the blob container client instance.
/// </summary>
/// <param name="blobContainerName">Blob container name.</param>
/// <returns>BlobContainerClient instance.</returns>
BlobContainerClient CreateBlobContainerClient(string blobContainerName);
}
}
16 changes: 16 additions & 0 deletions Source/CompanyCommunicator.Common/Clients/StorageClientFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,21 @@ public BlobContainerClient CreateBlobContainerClient()
Constants.BlobContainerName,
options);
}

/// <inheritdoc/>
public BlobContainerClient CreateBlobContainerClient(string blobContainerName)
{
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,
blobContainerName,
options);
}
}
}
10 changes: 10 additions & 0 deletions Source/CompanyCommunicator.Common/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,15 @@ public static class Constants
/// https://docs.microsoft.com/en-us/graph/known-issues#limit-on-batch-size.
/// </summary>
public const int MaximumGraphAPIBatchSize = 15;

/// <summary>
/// prefix for data uri image.
/// </summary>
public const string ImageBase64Format = "data:image/";

/// <summary>
/// cache duration in hours.
/// </summary>
public const int CacheDurationInHours = 6;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<PackageReference Include="Azure.Identity" Version="1.3.0" />
<PackageReference Include="Azure.Messaging.ServiceBus" Version="7.1.2" />
<PackageReference Include="Azure.Security.KeyVault.Certificates" Version="4.2.0" />
<PackageReference Include="Azure.Storage.Blobs" Version="12.8.0" />
<PackageReference Include="Azure.Storage.Blobs" Version="12.8.3" />
<PackageReference Include="Microsoft.Azure.Cosmos.Table" Version="1.0.1" />
<PackageReference Include="Microsoft.Azure.ServiceBus" Version="5.1.3" />
<PackageReference Include="Microsoft.Bot.Builder.Integration.AspNet.Core" Version="4.12.1" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

namespace Microsoft.Teams.Apps.CompanyCommunicator.Common.Repositories.NotificationData
{
using System;
using System.Collections.Generic;
using System.Threading.Tasks;

Expand Down Expand Up @@ -74,5 +75,21 @@ public Task SaveExceptionInNotificationDataEntityAsync(
public Task SaveWarningInNotificationDataEntityAsync(
string notificationDataEntityId,
string warningMessage);

/// <summary>
/// Save image to external storage.
/// </summary>
/// <param name="blobName">Blob name.</param>
/// <param name="base64Image">Image in base64 format without prefix.</param>
/// <returns>Prefix with mime-type, ex: data:image/png;base64,.</returns>
public Task<string> SaveImageAsync(string blobName, string base64Image);

/// <summary>
/// Get image from external storage in base64 format.
/// </summary>
/// <param name="prefix">Prefix with mime-type, ex: data:image/png;base64,.</param>
/// <param name="blobName">Blob name.</param>
/// <returns>Image in base64 format.</returns>
public Task<string> GetImageAsync(string prefix, string blobName);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,33 @@

namespace Microsoft.Teams.Apps.CompanyCommunicator.Common.Repositories.NotificationData
{
using System.Threading.Tasks;

/// <summary>
/// interface for Sending Notification Data Repository.
/// </summary>
public interface ISendingNotificationDataRepository : IRepository<SendingNotificationDataEntity>
{
/// <summary>
/// Get Adaptive Card from external storage.
/// </summary>
/// <param name="blobName">Blob name.</param>
/// <returns>AC in json format.</returns>
public Task<string> GetAdaptiveCardAsync(string blobName);

/// <summary>
/// Save Adaptive Card to external storage.
/// </summary>
/// <param name="blobName">Blob name.</param>
/// <param name="adaptiveCard">Adaptive card in json format.</param>
/// <returns>A <see cref="Task"/> representing the result of the asynchronous operation.</returns>
public Task SaveAdaptiveCardAsync(string blobName, string adaptiveCard);

/// <summary>
/// Get image from external storage.
/// </summary>
/// <param name="blobName">Blob name.</param>
/// <returns>Image in base64 format.</returns>
public Task<string> GetImageAsync(string blobName);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ public class NotificationDataEntity : TableEntity
/// </summary>
public string ImageLink { get; set; }

/// <summary>
/// Gets or sets the blob name for image in base64 format.
/// </summary>
public string ImageBase64BlobName { get; set; }

/// <summary>
/// Gets or sets the summary text of the notification's content.
/// </summary>
Expand Down Expand Up @@ -224,4 +229,4 @@ public IEnumerable<string> Groups
/// </summary>
public string FunctionInstancePayload { get; set; }
}
}
}
Loading

0 comments on commit 2158df0

Please sign in to comment.