-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Ordering Bug for ClientNoteEdit #312
Fix Ordering Bug for ClientNoteEdit #312
Conversation
The ordering problem still persists. Changing Client.clientNotes from ObservableSet<Note> to LinkedHashSet<Note>will break the GUI's updating after user issues a valid Client Note edit command.
Codecov Report
@@ Coverage Diff @@
## master #312 +/- ##
============================================
- Coverage 87.14% 87.14% -0.01%
- Complexity 928 930 +2
============================================
Files 112 112
Lines 2420 2427 +7
Branches 278 279 +1
============================================
+ Hits 2109 2115 +6
Misses 233 233
- Partials 78 79 +1
Continue to review full report at Codecov.
|
Test added verifies that a previously untagged note will have tag.UNTAGGED removed if the edit adds in a new tag. TagNoteMap had a undetected flaw where the default tag of Tag.UNTAGGED didn't get added to the uniqueTagMap when constructed. This was causing test case failures.
|
||
/** | ||
* Constructor ensures our unique tag map has the UNTAGGED tag. | ||
*/ | ||
public TagNoteMap() { | ||
uniqueTagMap.put(Tag.UNTAGGED, Tag.UNTAGGED); | ||
tagToNotesMap.put(Tag.UNTAGGED, new ArrayList<>()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
took a while to find this 😞
src/test/java/seedu/address/logic/commands/ClientNoteEditCommandTest.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but is it possible to also add in a more informative message for client note edit? Using String.format to show the user which client, the original note content, and the new note content. Can do in a separate PR if you want but imo its a simple enough change to do in this one.
@qwoprocks Merged after doing this: 🏃♂️
|
Description
Changed notes from being part of Sets to being part of lists.
The note kept getting popped to the bottom of the list because editing used to be implemented as a removal of a target note and an insertion of its edited form.
Also added the test
ClientNoteEditCommandTest#execute_editExistingUntaggedNoteToAddTag_discardsDefaultUntaggedTag()
and found a flaw in TagNoteMap initialisation and fixed that.GUI has been updated too.
Fixes #270 Fixes #296
Testing
NIL
Remarks
NIL