Skip to content

Commit

Permalink
2.1.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
karamem0 committed Aug 18, 2023
1 parent 04be37a commit 395245a
Show file tree
Hide file tree
Showing 19 changed files with 2,116 additions and 1,557 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
- develop

env:
BUILD_VERSION: 2.0.1.${{github.run_number}}
BUILD_VERSION: 2.1.0.${{github.run_number}}
BUILD_CONFIGURATION: Release

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- v*.*.*

env:
BUILD_VERSION: 2.0.1.${{github.run_number}}
BUILD_VERSION: 2.1.0.${{github.run_number}}
BUILD_CONFIGURATION: Release

jobs:
Expand Down
2 changes: 1 addition & 1 deletion manifest/manifest.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.16/MicrosoftTeams.schema.json",
"manifestVersion": "1.16",
"version": "2.0.1",
"version": "2.1.0",
"id": "{{AppId}}",
"packageName": "dev.karamem0.commistant",
"name": {
Expand Down
3,165 changes: 1,789 additions & 1,376 deletions source/client/package-lock.json

Large diffs are not rendered by default.

48 changes: 24 additions & 24 deletions source/client/package.json
Original file line number Diff line number Diff line change
@@ -1,48 +1,48 @@
{
"name": "commistant",
"private": true,
"version": "2.0.1",
"version": "2.1.0",
"dependencies": {
"@automapper/pojos": "^8.7.7",
"@emotion/react": "^11.11.1",
"@fluentui/react-components": "^9.22.0",
"@fluentui/react-icons-mdl2": "^1.3.46",
"@microsoft/applicationinsights-react-js": "^3.4.3",
"@microsoft/applicationinsights-web": "^2.8.14",
"@microsoft/teams-js": "^2.12.0",
"@fluentui/react-components": "^9.29.3",
"@fluentui/react-icons-mdl2": "^1.3.48",
"@microsoft/applicationinsights-react-js": "^17.0.0",
"@microsoft/applicationinsights-web": "^3.0.2",
"@microsoft/teams-js": "^2.14.0",
"axios": "^1.4.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-error-boundary": "^4.0.10",
"react-hook-form": "^7.45.0",
"react-error-boundary": "^4.0.11",
"react-hook-form": "^7.45.4",
"react-intl": "^6.4.4",
"react-router-dom": "^6.13.0",
"react-router-dom": "^6.15.0",
"react-use": "^17.4.0",
"ress": "^5.0.2"
},
"devDependencies": {
"@emotion/babel-plugin": "^11.11.0",
"@formatjs/cli": "^6.1.3",
"@types/react": "^18.2.13",
"@types/react-dom": "^18.2.6",
"@types/react": "^18.2.20",
"@types/react-dom": "^18.2.7",
"@types/react-router-dom": "^5.3.3",
"@typescript-eslint/eslint-plugin": "^5.60.0",
"@typescript-eslint/parser": "^5.60.0",
"@vitejs/plugin-react": "^4.0.1",
"@typescript-eslint/eslint-plugin": "^6.4.0",
"@typescript-eslint/parser": "^6.4.0",
"@vitejs/plugin-react": "^4.0.4",
"babel-plugin-formatjs": "^10.5.3",
"eslint": "^8.43.0",
"eslint": "^8.47.0",
"eslint-config-standard": "^17.1.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-react": "^7.30.0",
"eslint-plugin-import": "^2.28.0",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.4.0",
"postcss": "^8.4.16",
"postcss": "^8.4.28",
"postcss-styled-syntax": "^0.4.0",
"sass": "^1.63.6",
"stylelint": "^15.8.0",
"stylelint-config-recess-order": "^4.2.0",
"stylelint-config-standard-scss": "^9.0.0",
"sass": "^1.66.0",
"stylelint": "^15.10.2",
"stylelint-config-recess-order": "^4.3.0",
"stylelint-config-standard-scss": "^10.0.0",
"typescript": "^4.9.5",
"vite": "^4.3.8"
"vite": "^4.4.9"
},
"scripts": {
"start": "tsc && vite",
Expand All @@ -55,6 +55,6 @@
"formatjs:compile": "formatjs compile 'src/translations/ja.json' --out-file 'src/translations/compiled/ja.json' --ast --format simple"
},
"volta": {
"node": "18.16.0"
"node": "18.17.1"
}
}
67 changes: 42 additions & 25 deletions source/server/Karamem0.Commistant.Bot/Bots/ActivityBot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,40 +84,57 @@ protected override async Task OnMembersRemovedAsync(IList<ChannelAccount> member

protected override async Task OnMessageActivityAsync(ITurnContext<IMessageActivity> turnContext, CancellationToken cancellationToken)
{
var dc = await this.dialogSet.CreateContextAsync(turnContext, cancellationToken);
var command = turnContext.Activity.RemoveRecipientMention();
if (command is null)
var participant = await TeamsInfo.GetMeetingParticipantAsync(
turnContext,
participantId: turnContext.Activity.Recipient.AadObjectId,
cancellationToken: cancellationToken);
if (participant.Meeting.Role == "Organizer")
{
_ = await dc.ContinueDialogAsync(cancellationToken);
}
else
{
var participant = await TeamsInfo.GetMeetingParticipantAsync(
turnContext,
participantId: turnContext.Activity.Recipient.AadObjectId,
cancellationToken: cancellationToken);
if (participant.Meeting.Role == "Organizer")
var dc = await this.dialogSet.CreateContextAsync(turnContext, cancellationToken);
var command = turnContext.Activity.RemoveRecipientMention();
if (command is null)
{
if (dc.ActiveDialog is not null)
if (dc.ActiveDialog is null)
{
_ = await dc.EndDialogAsync(cancellationToken: cancellationToken);
}
_ = command switch
else
{
"会議開始後" => await dc.BeginDialogAsync(nameof(StartMeetingDialog), cancellationToken: cancellationToken),
"会議終了前" => await dc.BeginDialogAsync(nameof(EndMeetingDialog), cancellationToken: cancellationToken),
"会議中" => await dc.BeginDialogAsync(nameof(InMeetingDialog), cancellationToken: cancellationToken),
"初期化" => await dc.BeginDialogAsync(nameof(ResetDialog), cancellationToken: cancellationToken),
_ => await dc.ContinueDialogAsync(cancellationToken)
};
_ = await dc.ContinueDialogAsync(cancellationToken);
}
}
else
{
_ = await turnContext.SendActivityAsync(
"開催者のみが設定を変更できます。",
cancellationToken: cancellationToken);
if (dc.ActiveDialog is null)
{
var result = command switch
{
"会議開始後" => await dc.BeginDialogAsync(nameof(StartMeetingDialog), cancellationToken: cancellationToken),
"会議終了前" => await dc.BeginDialogAsync(nameof(EndMeetingDialog), cancellationToken: cancellationToken),
"会議中" => await dc.BeginDialogAsync(nameof(InMeetingDialog), cancellationToken: cancellationToken),
"初期化" => await dc.BeginDialogAsync(nameof(ResetDialog), cancellationToken: cancellationToken),
_ => null,
};
if (result is null)
{
_ = await turnContext.SendActivityAsync(
"認識できないコマンドです。",
cancellationToken: cancellationToken);
}
}
else
{
_ = await turnContext.SendActivityAsync(
"新しいコマンドを開始する前に中断されたコマンドを完了させてください。",
cancellationToken: cancellationToken);
}
}
}
else
{
_ = await turnContext.SendActivityAsync(
"開催者のみがコマンドを実行できます。",
cancellationToken: cancellationToken);
}
await this.conversationState.SaveChangesAsync(turnContext, cancellationToken: cancellationToken);
}

Expand All @@ -126,7 +143,7 @@ protected override async Task OnTeamsMeetingStartAsync(MeetingStartEventDetails
this.logger.MeetingStarted(turnContext.Activity, meeting.Id);
var propertyAccessor = this.conversationState.CreateProperty<ConversationProperty>(nameof(ConversationProperty));
var property = await propertyAccessor.GetAsync(turnContext, () => new(), cancellationToken);
var meetingInfo = await TeamsInfo.GetMeetingInfoAsync(turnContext);
var meetingInfo = await TeamsInfo.GetMeetingInfoAsync(turnContext, cancellationToken: cancellationToken);
property.InMeeting = true;
property.StartMeetingSended = false;
property.EndMeetingSended = false;
Expand Down
7 changes: 7 additions & 0 deletions source/server/Karamem0.Commistant.Bot/ConfigureServices.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using Karamem0.Commistant.Adapters;
using Karamem0.Commistant.Bots;
using Karamem0.Commistant.Dialogs;
using Karamem0.Commistant.Services;
using Microsoft.Bot.Builder;
using Microsoft.Bot.Builder.Azure.Blobs;
using Microsoft.Bot.Builder.Dialogs;
Expand Down Expand Up @@ -60,6 +61,12 @@ public static IServiceCollection AddDialogs(this IServiceCollection services)
return services;
}

public static IServiceCollection AddServices(this IServiceCollection services)
{
_ = services.AddTransient<QrCodeService>();
return services;
}

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using Karamem0.Commistant.Extensions;
using Karamem0.Commistant.Logging;
using Karamem0.Commistant.Models;
using Karamem0.Commistant.Services;
using Karamem0.Commistant.Validators;
using Microsoft.Bot.Builder;
using Microsoft.Bot.Builder.Dialogs;
Expand All @@ -32,11 +33,17 @@ public class EndMeetingDialog : ComponentDialog

private readonly ConversationState conversationState;

private readonly QrCodeService qrCodeService;

private readonly ILogger logger;

public EndMeetingDialog(ConversationState conversationState, ILogger<EndMeetingDialog> logger)
public EndMeetingDialog(
ConversationState conversationState,
QrCodeService qrCodeService,
ILogger<EndMeetingDialog> logger)
{
this.conversationState = conversationState;
this.qrCodeService = qrCodeService;
this.logger = logger;
}

Expand Down Expand Up @@ -169,6 +176,13 @@ private async Task<DialogTurnResult> AfterConrifmAsync(WaterfallStepContext step
"設定を変更しました。",
cancellationToken: cancellationToken);
}
if (value.Value<string>("Button") == "Cancel")
{
this.logger.SettingsCancelled(stepContext.Context.Activity);
_ = await stepContext.Context.SendActivityAsync(
"キャンセルしました。設定は変更されていません。",
cancellationToken: cancellationToken);
}
if (stepContext.Context.Activity.ReplyToId is not null)
{
var card = new AdaptiveCard("1.3")
Expand Down Expand Up @@ -205,6 +219,17 @@ private async Task<DialogTurnResult> AfterConrifmAsync(WaterfallStepContext step
}
}
};
if (property.EndMeetingUrl is not null)
{
var bytes = await this.qrCodeService.CreateAsync(property.EndMeetingUrl);
var base64 = Convert.ToBase64String(bytes);
card.Body.Add(new AdaptiveImage()
{
AltText = property.EndMeetingUrl,
Size = AdaptiveImageSize.Stretch,
Url = new Uri($"data:image/png;base64,{base64}")
});
}
var activity = MessageFactory.Attachment(new Attachment()
{
ContentType = AdaptiveCard.ContentType,
Expand Down
20 changes: 19 additions & 1 deletion source/server/Karamem0.Commistant.Bot/Dialogs/InMeetingDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using Karamem0.Commistant.Extensions;
using Karamem0.Commistant.Logging;
using Karamem0.Commistant.Models;
using Karamem0.Commistant.Services;
using Karamem0.Commistant.Validators;
using Microsoft.Bot.Builder;
using Microsoft.Bot.Builder.Dialogs;
Expand All @@ -32,11 +33,17 @@ public class InMeetingDialog : ComponentDialog

private readonly ConversationState conversationState;

private readonly QrCodeService qrCodeService;

private readonly ILogger logger;

public InMeetingDialog(ConversationState conversationState, ILogger<InMeetingDialog> logger)
public InMeetingDialog(
ConversationState conversationState,
QrCodeService qrCodeService,
ILogger<InMeetingDialog> logger)
{
this.conversationState = conversationState;
this.qrCodeService = qrCodeService;
this.logger = logger;
}

Expand Down Expand Up @@ -209,6 +216,17 @@ private async Task<DialogTurnResult> AfterConrifmAsync(WaterfallStepContext step
}
}
};
if (property.InMeetingUrl is not null)
{
var bytes = await this.qrCodeService.CreateAsync(property.InMeetingUrl);
var base64 = Convert.ToBase64String(bytes);
card.Body.Add(new AdaptiveImage()
{
AltText = property.InMeetingUrl,
Size = AdaptiveImageSize.Stretch,
Url = new Uri($"data:image/png;base64,{base64}")
});
}
var activity = MessageFactory.Attachment(new Attachment()
{
ContentType = AdaptiveCard.ContentType,
Expand Down
7 changes: 7 additions & 0 deletions source/server/Karamem0.Commistant.Bot/Dialogs/ResetDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,13 @@ private async Task<DialogTurnResult> AfterConrifmAsync(WaterfallStepContext step
"設定を初期化しました。",
cancellationToken: cancellationToken);
}
if (value.Value<string>("Button") == "No")
{
this.logger.SettingsCancelled(stepContext.Context.Activity);
_ = await stepContext.Context.SendActivityAsync(
"キャンセルしました。設定は変更されていません。",
cancellationToken: cancellationToken);
}
if (stepContext.Context.Activity.ReplyToId is not null)
{
var card = new AdaptiveCard("1.3")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using Karamem0.Commistant.Extensions;
using Karamem0.Commistant.Logging;
using Karamem0.Commistant.Models;
using Karamem0.Commistant.Services;
using Karamem0.Commistant.Validators;
using Microsoft.Bot.Builder;
using Microsoft.Bot.Builder.Dialogs;
Expand All @@ -32,11 +33,16 @@ public class StartMeetingDialog : ComponentDialog

private readonly ConversationState conversationState;

private readonly QrCodeService qrCodeService;
private readonly ILogger logger;

public StartMeetingDialog(ConversationState conversationState, ILogger<StartMeetingDialog> logger)
public StartMeetingDialog(
ConversationState conversationState,
QrCodeService qrCodeService,
ILogger<StartMeetingDialog> logger)
{
this.conversationState = conversationState;
this.qrCodeService = qrCodeService;
this.logger = logger;
}

Expand Down Expand Up @@ -169,6 +175,13 @@ private async Task<DialogTurnResult> AfterConrifmAsync(WaterfallStepContext step
"設定を変更しました。",
cancellationToken: cancellationToken);
}
if (value.Value<string>("Button") == "Cancel")
{
this.logger.SettingsCancelled(stepContext.Context.Activity);
_ = await stepContext.Context.SendActivityAsync(
"キャンセルしました。設定は変更されていません。",
cancellationToken: cancellationToken);
}
if (stepContext.Context.Activity.ReplyToId is not null)
{
var card = new AdaptiveCard("1.3")
Expand Down Expand Up @@ -205,6 +218,17 @@ private async Task<DialogTurnResult> AfterConrifmAsync(WaterfallStepContext step
}
}
};
if (property.StartMeetingUrl is not null)
{
var bytes = await this.qrCodeService.CreateAsync(property.StartMeetingUrl);
var base64 = Convert.ToBase64String(bytes);
card.Body.Add(new AdaptiveImage()
{
AltText = property.StartMeetingUrl,
Size = AdaptiveImageSize.Stretch,
Url = new Uri($"data:image/png;base64,{base64}")
});
}
var activity = MessageFactory.Attachment(new Attachment()
{
ContentType = AdaptiveCard.ContentType,
Expand Down
Loading

0 comments on commit 395245a

Please sign in to comment.