Issue 651#740
Open
MarvinHo64 wants to merge 24 commits intomainfrom
Open
Conversation
# Conflicts: # IntegrationTest/Components/Adaptivity/Dialogues/CreateEditReferenceActionDialogIt.cs # Presentation/Components/ContentFiles/ContentFilesView.razor
…d DeleteMultipleContentConfirmationDialog to new behaviour
…g content is deleted
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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); |
Comment on lines
+56
to
+59
| if (Workspace.LearningContents.FirstOrDefault(x => x.Equals(Content)) is FileContent fileContent) | ||
| { | ||
| fileContent.IsDeleted = false; | ||
| } |
There was a problem hiding this comment.
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); | |
| } | |
# 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.