diff --git a/build/Build.cs b/build/Build.cs
index 186deb46..670e7fa8 100644
--- a/build/Build.cs
+++ b/build/Build.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
+using System.Linq;
using Nuke.Common;
using Nuke.Common.CI;
using Nuke.Common.IO;
@@ -11,7 +12,6 @@
using Nuke.Common.Tools.GitVersion;
using Nuke.Common.Utilities.Collections;
using Renci.SshNet;
-using static Nuke.Common.IO.FileSystemTasks;
using static Nuke.Common.Tools.Docker.DockerTasks;
using static Nuke.Common.Tools.DotNet.DotNetTasks;
@@ -52,16 +52,16 @@ public sealed class Build : NukeBuild
[Solution]
private readonly Solution Solution;
- [GitVersion(Framework = "net6.0")]
+ [GitVersion(Framework = "net7.0")]
private readonly GitVersion GitVersion;
Target Clean => _ => _
.Before(Restore)
.Executes(() =>
{
- SourceDirectory.GlobDirectories("**/bin", "**/obj").ForEach(DeleteDirectory);
- TestsDirectory.GlobDirectories("**/bin", "**/obj").ForEach(DeleteDirectory);
- EnsureCleanDirectory(OutputDirectory);
+ SourceDirectory.GlobDirectories("**/bin", "**/obj").ForEach(x => x.DeleteDirectory());
+ TestsDirectory.GlobDirectories("**/bin", "**/obj").ForEach(x => x.DeleteDirectory());
+ OutputDirectory.CreateOrCleanDirectory();
});
Target Restore => _ => _
@@ -95,7 +95,7 @@ public sealed class Build : NukeBuild
.When(IsServerBuild, c => c.EnableUseSourceLink())
.EnableNoRestore()
.EnableNoBuild()
- .CombineWith(Solution.GetProjects("*Tests"), (_, p) => _
+ .CombineWith(Solution.GetAllProjects("*Tests"), (_, p) => _
.SetProjectFile(p)
.SetLoggers($"junit;LogFileName={p.Name}-results.xml;MethodFormat=Class;FailureBodyFormat=Verbose")));
});
@@ -109,7 +109,7 @@ public sealed class Build : NukeBuild
.EnableNoBuild()
.EnableNoRestore()
.CombineWith(ProjectsForPublish, (ss, p) => ss
- .SetProject(Solution.GetProject(p))
+ .SetProject(Solution.GetAllProjects(p).SingleOrDefault())
.SetOutput(OutputDirectory / p)));
});
diff --git a/build/_build.csproj b/build/_build.csproj
index d385a51e..4d01ac82 100644
--- a/build/_build.csproj
+++ b/build/_build.csproj
@@ -1,5 +1,4 @@
-
Exe
net7.0
@@ -9,11 +8,9 @@
..
1
-
-
+
-
diff --git a/src/Inc.TeamAssistant.Appraiser.Application/CommandHandlers/ConnectToAssessmentSession/ConnectToAssessmentSessionCommandHandler.cs b/src/Inc.TeamAssistant.Appraiser.Application/CommandHandlers/ConnectToAssessmentSession/ConnectToAssessmentSessionCommandHandler.cs
index e2775ff3..32e625f9 100644
--- a/src/Inc.TeamAssistant.Appraiser.Application/CommandHandlers/ConnectToAssessmentSession/ConnectToAssessmentSessionCommandHandler.cs
+++ b/src/Inc.TeamAssistant.Appraiser.Application/CommandHandlers/ConnectToAssessmentSession/ConnectToAssessmentSessionCommandHandler.cs
@@ -27,20 +27,27 @@ public Task Handle(
{
if (command is null)
throw new ArgumentNullException(nameof(command));
-
+
var existSessionAssessmentSession = _repository.Find(command.AppraiserId);
- if (existSessionAssessmentSession?.Participants.Any(p => p.Id == command.AppraiserId) == true)
+ if (existSessionAssessmentSession is not null)
{
- var messageId = existSessionAssessmentSession.Id == command.AssessmentSessionId
- ? Messages.AppraiserConnectWithError
- : Messages.AppraiserConnectedToOtherSession;
+ if (existSessionAssessmentSession.Participants.Any(p => p.Id == command.AppraiserId))
+ {
+ var messageId = existSessionAssessmentSession.Id == command.AssessmentSessionId
+ ? Messages.AppraiserConnectWithError
+ : Messages.AppraiserConnectedToOtherSession;
- throw new AppraiserUserException(messageId, command.AppraiserName, existSessionAssessmentSession.Title);
- }
+ throw new AppraiserUserException(messageId, command.AppraiserName, existSessionAssessmentSession.Title);
+ }
+ if (existSessionAssessmentSession.Moderator.Id == command.AppraiserId
+ && existSessionAssessmentSession.Id != command.AssessmentSessionId)
+ throw new AppraiserUserException(Messages.AppraiserConnectedToOtherSession, command.AppraiserName, existSessionAssessmentSession.Title);
+ }
+
+ // TODO: remove nullable check
if (command.AssessmentSessionId is null)
throw new ApplicationException("AssessmentSessionId is empty.");
-
var assessmentSession = _repository
.Find(command.AssessmentSessionId)
.EnsureForAppraiser(command.AppraiserName);
diff --git a/src/Inc.TeamAssistant.Appraiser.Application/CommandHandlers/ConnectToDashboard/ConnectToDashboardCommandHandler.cs b/src/Inc.TeamAssistant.Appraiser.Application/CommandHandlers/ConnectToDashboard/ConnectToDashboardCommandHandler.cs
deleted file mode 100644
index a41681f2..00000000
--- a/src/Inc.TeamAssistant.Appraiser.Application/CommandHandlers/ConnectToDashboard/ConnectToDashboardCommandHandler.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-using Inc.TeamAssistant.Appraiser.Application.Contracts;
-using Inc.TeamAssistant.Appraiser.Model.Commands.ConnectToDashboard;
-using MediatR;
-using Inc.TeamAssistant.Appraiser.Application.Extensions;
-
-namespace Inc.TeamAssistant.Appraiser.Application.CommandHandlers.ConnectToDashboard;
-
-internal sealed class ConnectToDashboardCommandHandler
- : IRequestHandler
-{
- private readonly IAssessmentSessionRepository _repository;
-
- public ConnectToDashboardCommandHandler(IAssessmentSessionRepository repository)
- {
- _repository = repository ?? throw new ArgumentNullException(nameof(repository));
- }
-
- public Task Handle(ConnectToDashboardCommand command, CancellationToken cancellationToken)
- {
- if (command is null)
- throw new ArgumentNullException(nameof(command));
-
- var assessmentSession = _repository
- .Find(command.AppraiserId)
- .EnsureForAppraiser(command.AppraiserName);
-
- return Task.FromResult(new ConnectToDashboardResult(
- assessmentSession.Id,
- assessmentSession.LanguageId,
- assessmentSession.Title));
- }
-}
\ No newline at end of file
diff --git a/src/Inc.TeamAssistant.Appraiser.Application/CommandHandlers/ConnectToDashboard/Validators/ConnectToDashboardCommandValidator.cs b/src/Inc.TeamAssistant.Appraiser.Application/CommandHandlers/ConnectToDashboard/Validators/ConnectToDashboardCommandValidator.cs
deleted file mode 100644
index 2d1a44e3..00000000
--- a/src/Inc.TeamAssistant.Appraiser.Application/CommandHandlers/ConnectToDashboard/Validators/ConnectToDashboardCommandValidator.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-using FluentValidation;
-using Inc.TeamAssistant.Appraiser.Model.Commands.ConnectToDashboard;
-using Inc.TeamAssistant.Appraiser.Model.Common;
-
-namespace Inc.TeamAssistant.Appraiser.Application.CommandHandlers.ConnectToDashboard.Validators;
-
-internal sealed class ConnectToDashboardCommandValidator : AbstractValidator
-{
- public ConnectToDashboardCommandValidator(IValidator appraiserValidator)
- {
- if (appraiserValidator is null)
- throw new ArgumentNullException(nameof(appraiserValidator));
-
- RuleFor(e => e).SetValidator(appraiserValidator);
- }
-}
\ No newline at end of file
diff --git a/src/Inc.TeamAssistant.Appraiser.Application/Contracts/IQuickResponseCodeGenerator.cs b/src/Inc.TeamAssistant.Appraiser.Application/Contracts/IQuickResponseCodeGenerator.cs
index c3d0fd14..21d76c1b 100644
--- a/src/Inc.TeamAssistant.Appraiser.Application/Contracts/IQuickResponseCodeGenerator.cs
+++ b/src/Inc.TeamAssistant.Appraiser.Application/Contracts/IQuickResponseCodeGenerator.cs
@@ -2,5 +2,5 @@ namespace Inc.TeamAssistant.Appraiser.Application.Contracts;
public interface IQuickResponseCodeGenerator
{
- string Generate(string data, int width, int height, bool drawQuietZones);
+ string Generate(string data);
}
\ No newline at end of file
diff --git a/src/Inc.TeamAssistant.Appraiser.Application/Inc.TeamAssistant.Appraiser.Application.csproj b/src/Inc.TeamAssistant.Appraiser.Application/Inc.TeamAssistant.Appraiser.Application.csproj
index 616b79c7..dd75b99d 100644
--- a/src/Inc.TeamAssistant.Appraiser.Application/Inc.TeamAssistant.Appraiser.Application.csproj
+++ b/src/Inc.TeamAssistant.Appraiser.Application/Inc.TeamAssistant.Appraiser.Application.csproj
@@ -4,10 +4,9 @@
-
-
+
+
-
diff --git a/src/Inc.TeamAssistant.Appraiser.Application/Messages.cs b/src/Inc.TeamAssistant.Appraiser.Application/Messages.cs
index 3334f8e0..0989ccf0 100644
--- a/src/Inc.TeamAssistant.Appraiser.Application/Messages.cs
+++ b/src/Inc.TeamAssistant.Appraiser.Application/Messages.cs
@@ -17,7 +17,6 @@ internal static class Messages
public static readonly MessageId ExitFromAssessmentSessionHelp = new(nameof(ExitFromAssessmentSessionHelp));
public static readonly MessageId CreateAssessmentSessionHelp = new(nameof(CreateAssessmentSessionHelp));
public static readonly MessageId AllowUseNameHelp = new(nameof(AllowUseNameHelp));
- public static readonly MessageId ConnectToDashboardHelp = new(nameof(ConnectToDashboardHelp));
public static readonly MessageId ShowParticipantsHelp = new(nameof(ShowParticipantsHelp));
public static readonly MessageId AddStoryToAssessmentSessionHelp = new(nameof(AddStoryToAssessmentSessionHelp));
public static readonly MessageId ChangeLanguageHelp = new(nameof(ChangeLanguageHelp));
diff --git a/src/Inc.TeamAssistant.Appraiser.Application/QueryHandlers/GetLinkForConnect/GetLinkForConnectQueryHandler.cs b/src/Inc.TeamAssistant.Appraiser.Application/QueryHandlers/GetLinkForConnect/GetLinkForConnectQueryHandler.cs
index fdac2451..1768d0a3 100644
--- a/src/Inc.TeamAssistant.Appraiser.Application/QueryHandlers/GetLinkForConnect/GetLinkForConnectQueryHandler.cs
+++ b/src/Inc.TeamAssistant.Appraiser.Application/QueryHandlers/GetLinkForConnect/GetLinkForConnectQueryHandler.cs
@@ -21,7 +21,7 @@ public Task Handle(GetLinkForConnectQuery query, Cancel
throw new ArgumentNullException(nameof(query));
var link = _linkBuilder.BuildLinkMoveToBot();
- var code = _codeGenerator.Generate(link, query.Width, query.Height, query.DrawQuietZones);
+ var code = _codeGenerator.Generate(link);
return Task.FromResult(new GetLinkForConnectResult(code));
}
diff --git a/src/Inc.TeamAssistant.Appraiser.Application/QueryHandlers/GetStoryDetails/GetStoryDetailsQueryHandler.cs b/src/Inc.TeamAssistant.Appraiser.Application/QueryHandlers/GetStoryDetails/GetStoryDetailsQueryHandler.cs
index 2e4ab154..6b10c66f 100644
--- a/src/Inc.TeamAssistant.Appraiser.Application/QueryHandlers/GetStoryDetails/GetStoryDetailsQueryHandler.cs
+++ b/src/Inc.TeamAssistant.Appraiser.Application/QueryHandlers/GetStoryDetails/GetStoryDetailsQueryHandler.cs
@@ -28,22 +28,18 @@ public GetStoryDetailsQueryHandler(
throw new ArgumentNullException(nameof(query));
var assessmentSession = _repository.Find(query.AssessmentSessionId);
-
- var result = assessmentSession is not null
- ? Get(assessmentSession, query.Width, query.Height, query.DrawQuietZones)
- : null;
-
+ var result = assessmentSession is not null ? Get(assessmentSession) : null;
return Task.FromResult(result);
}
- private GetStoryDetailsResult Get(AssessmentSession assessmentSession, int width, int height, bool drawQuietZones)
+ private GetStoryDetailsResult Get(AssessmentSession assessmentSession)
{
if (assessmentSession is null)
throw new ArgumentNullException(nameof(assessmentSession));
var estimateEnded = assessmentSession.EstimateEnded();
var link = _linkBuilder.BuildLinkForConnect(assessmentSession.Id);
- var code = _codeGenerator.Generate(link, width, height, drawQuietZones);
+ var code = _codeGenerator.Generate(link);
var items = assessmentSession.CurrentStory.StoryForEstimates
.Select(e => new StoryForEstimateDto(
diff --git a/src/Inc.TeamAssistant.Appraiser.Application/QueryHandlers/ShowHelp/ShowHelpQueryHandler.cs b/src/Inc.TeamAssistant.Appraiser.Application/QueryHandlers/ShowHelp/ShowHelpQueryHandler.cs
index 82761d4e..881c27b4 100644
--- a/src/Inc.TeamAssistant.Appraiser.Application/QueryHandlers/ShowHelp/ShowHelpQueryHandler.cs
+++ b/src/Inc.TeamAssistant.Appraiser.Application/QueryHandlers/ShowHelp/ShowHelpQueryHandler.cs
@@ -3,7 +3,6 @@
using Inc.TeamAssistant.Appraiser.Model.Commands.AddStoryToAssessmentSession;
using Inc.TeamAssistant.Appraiser.Model.Commands.AllowUseName;
using Inc.TeamAssistant.Appraiser.Model.Commands.ChangeLanguage;
-using Inc.TeamAssistant.Appraiser.Model.Commands.ConnectToDashboard;
using Inc.TeamAssistant.Appraiser.Model.Commands.CreateAssessmentSession;
using Inc.TeamAssistant.Appraiser.Model.Commands.ExitFromAssessmentSession;
using Inc.TeamAssistant.Appraiser.Model.Commands.FinishAssessmentSession;
@@ -60,12 +59,6 @@ public async Task Handle(ShowHelpQuery query, CancellationToken
languageInfo.LanguageId.Value));
}
- var connectToDashboardCommand = _commandProvider.GetCommand(typeof(ConnectToDashboardCommand));
- commandsHelp.Add(await _messageBuilder.Build(
- Messages.ConnectToDashboardHelp,
- query.LanguageId,
- connectToDashboardCommand));
-
var addStoryToAssessmentSessionCommand = _commandProvider.GetCommand(typeof(AddStoryToAssessmentSessionCommand));
commandsHelp.Add(await _messageBuilder.Build(
Messages.AddStoryToAssessmentSessionHelp,
diff --git a/src/Inc.TeamAssistant.Appraiser.Application/ServiceCollectionExtensions.cs b/src/Inc.TeamAssistant.Appraiser.Application/ServiceCollectionExtensions.cs
index 85c53396..58f9460c 100644
--- a/src/Inc.TeamAssistant.Appraiser.Application/ServiceCollectionExtensions.cs
+++ b/src/Inc.TeamAssistant.Appraiser.Application/ServiceCollectionExtensions.cs
@@ -28,7 +28,11 @@ public static IServiceCollection AddApplication(this IServiceCollection services
services
.AddSingleton(addStoryOptions)
- .AddMediatR(c => c.AsScoped(), typeof(AddStoryToAssessmentSessionCommandHandler))
+ .AddMediatR(c =>
+ {
+ c.Lifetime = ServiceLifetime.Scoped;
+ c.RegisterServicesFromAssemblyContaining();
+ })
.AddValidatorsFromAssemblyContaining(
ServiceLifetime.Scoped,
includeInternalTypes: true)
diff --git a/src/Inc.TeamAssistant.Appraiser.Backend/CommandList.cs b/src/Inc.TeamAssistant.Appraiser.Backend/CommandList.cs
index a82df4e3..0c3b7cc1 100644
--- a/src/Inc.TeamAssistant.Appraiser.Backend/CommandList.cs
+++ b/src/Inc.TeamAssistant.Appraiser.Backend/CommandList.cs
@@ -7,7 +7,6 @@ internal static class CommandList
public const string AllowUseName = "/allow_use_name";
public const string CreateAssessmentSession = "/new";
public const string ChangeLanguageForAssessmentSession = "/{0}";
- public const string ConnectToDashboard = "/dashboard";
public const string ShowParticipants = "/users";
public const string AddStoryToAssessmentSession = "/add";
public const string AcceptEstimate = "/accept";
diff --git a/src/Inc.TeamAssistant.Appraiser.Backend/Controllers/AssessmentSessionsController.cs b/src/Inc.TeamAssistant.Appraiser.Backend/Controllers/AssessmentSessionsController.cs
index 223e4570..4deb026f 100644
--- a/src/Inc.TeamAssistant.Appraiser.Backend/Controllers/AssessmentSessionsController.cs
+++ b/src/Inc.TeamAssistant.Appraiser.Backend/Controllers/AssessmentSessionsController.cs
@@ -15,19 +15,10 @@ public AssessmentSessionsController(IAssessmentSessionsService service)
}
[HttpGet("story/{assessmentSessionId}")]
- public async Task GetStoryDetails(
- Guid assessmentSessionId,
- int width,
- int height,
- bool drawQuietZones,
- CancellationToken cancellationToken)
- => Ok(await _service.GetStoryDetails(new(assessmentSessionId), width, height, drawQuietZones, cancellationToken));
+ public async Task GetStoryDetails(Guid assessmentSessionId, CancellationToken cancellationToken)
+ => Ok(await _service.GetStoryDetails(new(assessmentSessionId), cancellationToken));
[HttpGet("link-for-connect")]
- public async Task LinkForConnect(
- int width,
- int height,
- bool drawQuietZones,
- CancellationToken cancellationToken)
- => Ok(await _service.GetLinkForConnect(width, height, drawQuietZones, cancellationToken));
+ public async Task LinkForConnect(CancellationToken cancellationToken)
+ => Ok(await _service.GetLinkForConnect(cancellationToken));
}
\ No newline at end of file
diff --git a/src/Inc.TeamAssistant.Appraiser.Backend/Inc.TeamAssistant.Appraiser.Backend.csproj b/src/Inc.TeamAssistant.Appraiser.Backend/Inc.TeamAssistant.Appraiser.Backend.csproj
index d516e2b7..1109cd7f 100644
--- a/src/Inc.TeamAssistant.Appraiser.Backend/Inc.TeamAssistant.Appraiser.Backend.csproj
+++ b/src/Inc.TeamAssistant.Appraiser.Backend/Inc.TeamAssistant.Appraiser.Backend.csproj
@@ -14,12 +14,13 @@
-
-
-
-
-
-
+
+
+
+
+
+
+
diff --git a/src/Inc.TeamAssistant.Appraiser.Backend/Pages/_Host.cshtml b/src/Inc.TeamAssistant.Appraiser.Backend/Pages/_Host.cshtml
index d39068c9..d4197173 100644
--- a/src/Inc.TeamAssistant.Appraiser.Backend/Pages/_Host.cshtml
+++ b/src/Inc.TeamAssistant.Appraiser.Backend/Pages/_Host.cshtml
@@ -156,7 +156,10 @@
-
+
+