Skip to content
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

Add undo command #97

Merged
merged 13 commits into from
Oct 21, 2020
Merged

Conversation

aidoxe-123
Copy link

@aidoxe-123 aidoxe-123 commented Oct 19, 2020

  • Add an undo command that undoes the previous change to the list.
    I think saving the state of the food list only when there is a change is more reasonable because if we save the state whenever a command is called, the app will look like it doesn't react if the user types in a lot of list commands, followed by a list of undo commands

  • Add test cases for this feature

close #74

@aidoxe-123 aidoxe-123 self-assigned this Oct 19, 2020
@aidoxe-123 aidoxe-123 added this to the v1.3 milestone Oct 19, 2020
@aidoxe-123 aidoxe-123 added the type.Enhancement New feature or request (!DELETE ME IF DASHBOARD IS NOT UPDATING) label Oct 19, 2020
Only edit food when the editedFood is different from the original
@codecov-io
Copy link

codecov-io commented Oct 19, 2020

Codecov Report

Merging #97 into master will increase coverage by 0.34%.
The diff coverage is 95.45%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master      #97      +/-   ##
============================================
+ Coverage     73.10%   73.45%   +0.34%     
- Complexity      463      472       +9     
============================================
  Files            78       79       +1     
  Lines          1517     1533      +16     
  Branches        122      122              
============================================
+ Hits           1109     1126      +17     
  Misses          365      365              
+ Partials         43       42       -1     
Impacted Files Coverage Δ Complexity Δ
.../java/jimmy/mcgymmy/logic/commands/TagCommand.java 100.00% <ø> (ø) 5.00 <0.00> (ø)
...ava/jimmy/mcgymmy/logic/commands/UnTagCommand.java 100.00% <ø> (ø) 5.00 <0.00> (ø)
src/main/java/jimmy/mcgymmy/model/Model.java 100.00% <ø> (ø) 1.00 <0.00> (ø)
...jimmy/mcgymmy/storage/JsonSerializableMcGymmy.java 100.00% <ø> (ø) 3.00 <0.00> (-1.00)
...rc/main/java/jimmy/mcgymmy/model/ModelManager.java 98.33% <92.30%> (-1.67%) 27.00 <8.00> (+4.00) ⬇️
...java/jimmy/mcgymmy/logic/commands/EditCommand.java 97.14% <100.00%> (+3.02%) 8.00 <0.00> (+2.00)
...java/jimmy/mcgymmy/logic/commands/UndoCommand.java 100.00% <100.00%> (ø) 3.00 <3.00> (?)
...y/mcgymmy/logic/parser/PrimitiveCommandParser.java 94.11% <100.00%> (+0.08%) 19.00 <0.00> (ø)
src/main/java/jimmy/mcgymmy/model/food/Food.java 97.95% <100.00%> (+2.04%) 24.00 <1.00> (+1.00)
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9da8445...1b67c0b. Read the comment docs.

Copy link

@Jh123x Jh123x left a comment

Choose a reason for hiding this comment

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

LGTM
Might be good to add more assertions for v1.3

@aidoxe-123 aidoxe-123 merged commit 70683d4 into AY2021S1-CS2103T-W17-3:master Oct 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type.Enhancement New feature or request (!DELETE ME IF DASHBOARD IS NOT UPDATING)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Undo Command to undo the changes of database
4 participants