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 delete commands for internship and application items #140

Merged

Conversation

keanecjy
Copy link

@keanecjy keanecjy commented Oct 7, 2020

No description provided.

@codecov-io
Copy link

Codecov Report

Merging #140 into master will decrease coverage by 27.93%.
The diff coverage is 16.84%.

Impacted file tree graph

@@              Coverage Diff              @@
##             master     #140       +/-   ##
=============================================
- Coverage     70.98%   43.05%   -27.94%     
- Complexity      400      416       +16     
=============================================
  Files            71      131       +60     
  Lines          1251     2137      +886     
  Branches        124      233      +109     
=============================================
+ Hits            888      920       +32     
- Misses          331     1170      +839     
- Partials         32       47       +15     
Impacted Files Coverage Δ Complexity Δ
src/main/java/seedu/address/MainApp.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...n/java/seedu/address/commons/core/GuiSettings.java 69.23% <ø> (ø) 5.00 <0.00> (ø)
...main/java/seedu/address/commons/core/Messages.java 0.00% <ø> (ø) 0.00 <0.00> (ø)
...n/java/seedu/address/commons/core/index/Index.java 100.00% <ø> (ø) 10.00 <0.00> (ø)
...in/java/seedu/address/commons/util/StringUtil.java 78.26% <0.00%> (-16.48%) 8.00 <0.00> (+1.00) ⬇️
...ress/logic/commands/add/AddApplicationCommand.java 0.00% <0.00%> (ø) 0.00 <0.00> (?)
...dress/logic/commands/add/AddInternshipCommand.java 0.00% <0.00%> (ø) 0.00 <0.00> (?)
...ogic/commands/delete/DeleteApplicationCommand.java 0.00% <0.00%> (ø) 0.00 <0.00> (?)
...logic/commands/delete/DeleteInternshipCommand.java 0.00% <0.00%> (ø) 0.00 <0.00> (?)
...ss/logic/commands/exceptions/CommandException.java 50.00% <ø> (-50.00%) 1.00 <0.00> (-1.00)
... and 157 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 68aa246...8858ec1. Read the comment docs.

Copy link

@ZoroarkDarkrai ZoroarkDarkrai left a comment

Choose a reason for hiding this comment

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

Well done! You work really fast!
Just need a clarification.

Copy link

@ZoroarkDarkrai ZoroarkDarkrai left a comment

Choose a reason for hiding this comment

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

LGTM!

@ZoroarkDarkrai ZoroarkDarkrai merged commit cc65b1e into AY2021S1-CS2103T-T15-4:master Oct 8, 2020
applicationList.addItem(applicationItem);
model.setTabName(TabName.APPLICATION);

Choose a reason for hiding this comment

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

Is this supposed to switch the tabs? It doesn't do that at the moment.

Copy link
Author

@keanecjy keanecjy Oct 9, 2020

Choose a reason for hiding this comment

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

Not sure what is the group's consensus on this, so I took the easier path first which is to switch tabs after successful command. Could it be because the command is executed unsuccessfully? Because this should be correct since I took this from @seanjyjy switch tab command.

Choose a reason for hiding this comment

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

okay! I tested on my add and delete commands but it doesn't do anything yet. Is there more to the switching besides setting the model state which I have missed from your implementation? I think you may have to return the multiarg CommandResult as there is a boolean arg to indicate whether to switch ?

Choose a reason for hiding this comment

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

Just tried using the same line of code for the add company command I'm working on and yep, even upon successful addition of a company, this line of code does not switch tabs. Will follow Isaac's observation and see if I can make it work for add company in the time being!

applicationList.addItem(applicationItem);
model.setTabName(TabName.APPLICATION);

return new CommandResult(String.format(MESSAGE_SUCCESS, applicationItem));

Choose a reason for hiding this comment

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

Just tried successfully on my end for add company command, regarding the switching of tabs, changing this to return new CommandResult(String.format(MESSAGE_SUCCESS, applicationItem), false, false, true); will do the trick!

Copy link
Author

@keanecjy keanecjy Oct 9, 2020

Choose a reason for hiding this comment

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

I think we could just set the default value for isSwitchTab in the constructor to be true then?

Choose a reason for hiding this comment

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

This works if all our commands require a switch? At the moment that seems to be the case apart from the help and exit commands if I'm not mistaken. Also, I suppose it depends on how we want our app to behave exactly - do we want it to switch every time a command is executed even if the user is already on the right page, or do we want to switch only if the user is on the wrong page? I suppose this may not be detectable visually unless the switching of tabs introduces its own behavior (for example if switching causes the list of cards to jump to the top of the list, and not switching allows the user to stay at wherever they've scrolled to in the list, then executing a command that always switches vs. one that only switches when necessary will provide different user experiences).

@orzymandias orzymandias modified the milestones: v1.2b, v1.2 Oct 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants