Skip to content

Issue 651#740

Open
MarvinHo64 wants to merge 24 commits intomainfrom
issue-651
Open

Issue 651#740
MarvinHo64 wants to merge 24 commits intomainfrom
issue-651

Conversation

@MarvinHo64
Copy link
Copy Markdown
Member

No description provided.

# Conflicts:
#	IntegrationTest/Components/Adaptivity/Dialogues/CreateEditReferenceActionDialogIt.cs
#	Presentation/Components/ContentFiles/ContentFilesView.razor
…d DeleteMultipleContentConfirmationDialog to new behaviour
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 67 out of 67 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

BusinessLogic/Commands/Content/AddLearningContent.cs:47

  • The Undo method only addresses FileContent when setting IsDeleted to true. This may be insufficient if Content is of a different type (e.g. ILinkContent). Ensure that all ILearningContent types are properly handled in Undo.
if (Workspace.LearningContents.FirstOrDefault(x => x.Equals(Content)) is FileContent fileContent)

Comment on lines +31 to +34
if(existingContent is FileContent fileContent)
{
fileContent.IsDeleted = false;
Logger.LogTrace("Set LearningContent.IsDeleted {ContentName} to false", Content.Name);
Copy link

Copilot AI Apr 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The AddLearningContent command only checks for an instance of FileContent. Consider handling other implementations of ILearningContent (e.g. ILinkContent) to ensure consistent behavior.

Suggested change
if(existingContent is FileContent fileContent)
{
fileContent.IsDeleted = false;
Logger.LogTrace("Set LearningContent.IsDeleted {ContentName} to false", Content.Name);
if (existingContent != null)
{
existingContent.Restore();
Logger.LogTrace("Restored LearningContent {ContentName}", Content.Name);

Copilot uses AI. Check for mistakes.
Comment on lines +56 to +59
if (Workspace.LearningContents.FirstOrDefault(x => x.Equals(Content)) is FileContent fileContent)
{
fileContent.IsDeleted = false;
}
Copy link

Copilot AI Apr 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Redo method mirrors the Undo method by only handling FileContent. Consider extending support to other ILearningContent implementations to ensure the redo operation is consistent.

Suggested change
if (Workspace.LearningContents.FirstOrDefault(x => x.Equals(Content)) is FileContent fileContent)
{
fileContent.IsDeleted = false;
}
var existingContent = Workspace.LearningContents.FirstOrDefault(x => x.Equals(Content));
if (existingContent is FileContent fileContent)
{
fileContent.IsDeleted = false;
Logger.LogTrace("Set LearningContent.IsDeleted {ContentName} to false", Content.Name);
}
else if (existingContent == null)
{
Workspace.LearningContents.Add(Content);
Logger.LogTrace("Re-added LearningContent {ContentName} to Workspace.LearningContents", Content.Name);
}

Copilot uses AI. Check for mistakes.
# Conflicts:
#	AuthoringToolTest/Mapping/ViewModelEntityMappingProfileUt.cs
#	ElectronWrapper/ElectronWrapper.csproj
#	Presentation/Resources/View/HeaderBar.de.resx
#	Presentation/Resources/View/HeaderBar.en.resx
#	Presentation/Resources/View/HeaderBar.resx
#	Presentation/View/HeaderBar.razor
@coveralls
Copy link
Copy Markdown

coveralls commented Apr 15, 2025

Pull Request Test Coverage Report for Build 14470457845

Details

  • 114 of 197 (57.87%) changed or added relevant lines in 23 files are covered.
  • 52 unchanged lines in 8 files lost coverage.
  • Overall coverage decreased (-0.006%) to 94.054%

Changes Missing Coverage Covered Lines Changed/Added Lines %
BusinessLogic/Commands/BatchCommandFactory.cs 0 1 0.0%
Presentation/Components/ContentFiles/ContentFilesView.razor 19 20 95.0%
Presentation/PresentationLogic/API/PresentationLogic.cs 53 54 98.15%
BusinessLogic/Commands/Content/ContentCommandFactory.cs 0 6 0.0%
BusinessLogic/ErrorManagement/PresentationLogic/ContentNotExistingInWorkspaceException.cs 0 6 0.0%
BusinessLogic/Commands/Content/DeleteLearningContent.cs 0 33 0.0%
BusinessLogic/Commands/Content/AddLearningContent.cs 0 35 0.0%
Files with Coverage Reduction New Missed Lines %
Presentation/Components/ContentFiles/ContentFilesView.razor 1 97.22%
Presentation/PresentationLogic/AuthoringToolWorkspace/AuthoringToolWorkspacePresenter.cs 1 95.56%
Presentation/PresentationLogic/AuthoringToolWorkspace/AuthoringToolWorkspaceViewModel.cs 1 94.44%
Presentation/Components/ContentFiles/ContentFilesAdd.razor 2 75.0%
Presentation/Components/Forms/Models/FileContentFormModel.cs 3 78.26%
Presentation/View/MyLearningWorlds/MyLearningWorldsOverview.razor 6 86.36%
AuthoringTool/Startup.cs 15 77.25%
Presentation/View/HeaderBar.razor 23 86.01%
Totals Coverage Status
Change from base Build 14399538752: -0.006%
Covered Lines: 17242
Relevant Lines: 18332

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants