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

Not allowing null in EventTime and fix the bug of deleting contact lead to ghost events #85

Conversation

larrywang0701
Copy link

@larrywang0701 larrywang0701 commented Nov 3, 2023

  • Not allowing null in field EventTime.time anymore.
  • Fix the bug of deleting contact does not remove events in the global event list, thus causing ghost events
    • Test it with:
add event -id 1 -en sdfgs -st 2012-10-10
delete contact 1
add event -id 1 -en sdfgs -st 2012-10-10
list events -st 2012-10-10 -et 2032-10-10

Other changes:

  • Remove the unnecessary logic in UniqueEventList::getOverlappingEvent since in AddEventCommand, end time is set to start time if user does not specify an end time
  • Change the logic in Event::getUiText so that when start time equals to end time, end time will be hidden (also add this information to UG)

@larrywang0701 larrywang0701 requested a review from a team November 3, 2023 17:19
Copy link

codecov bot commented Nov 3, 2023

Codecov Report

Merging #85 (690fcfd) into master (0abcaa5) will increase coverage by 0.15%.
The diff coverage is 86.36%.

@@             Coverage Diff              @@
##             master      #85      +/-   ##
============================================
+ Coverage     72.69%   72.85%   +0.15%     
+ Complexity      713      712       -1     
============================================
  Files           113      113              
  Lines          2326     2328       +2     
  Branches        272      277       +5     
============================================
+ Hits           1691     1696       +5     
+ Misses          535      531       -4     
- Partials        100      101       +1     
Files Coverage Δ
...seedu/address/logic/commands/ListEventCommand.java 66.66% <100.00%> (ø)
...du/address/logic/parser/AddEventCommandParser.java 95.00% <100.00%> (+0.55%) ⬆️
...u/address/logic/parser/ListEventCommandParser.java 95.45% <100.00%> (+1.01%) ⬆️
src/main/java/seedu/address/model/AddressBook.java 62.29% <100.00%> (+0.62%) ⬆️
...main/java/seedu/address/model/event/EventTime.java 84.61% <100.00%> (+9.61%) ⬆️
src/main/java/seedu/address/model/event/Event.java 70.00% <0.00%> (ø)
...ava/seedu/address/model/event/UniqueEventList.java 37.50% <0.00%> (+1.13%) ⬆️

... and 1 file with indirect coverage changes

📣 Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today!

Remove the unnecessary logic in `UniqueEventList::getOverlappingEvent` since in AddEventCommand, end time is set to start time if user does not specify an end time
Change the logic in `Event::getUiText` so that when start time equals to end time, end time will be hidden (also add this information to UG)
Copy link

@Nixx162 Nixx162 left a comment

Choose a reason for hiding this comment

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

LGTM

@larrywang0701 larrywang0701 merged commit b7b9c00 into AY2324S1-CS2103T-W16-1:master Nov 4, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants