Skip to content

Commit

Permalink
Merge pull request #200 from jrchoo/branch-FixDocumentation
Browse files Browse the repository at this point in the history
Fix documentation and error messages
Badatprogrammiing authored Nov 13, 2023
2 parents bb07e71 + 70aa492 commit 6051601
Showing 15 changed files with 88 additions and 54 deletions.
11 changes: 11 additions & 0 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
@@ -570,6 +570,17 @@ To view internship role parameter information, click [here](#internship-role-par

**Purpose:** Edit the specified parameters of a specified internship role.

<div markdown="block" class="alert alert-info">

**Note:**

- The index refers to the index number in the displayed internship role list. If you want to find out the index of the
internship role you want to edit, you can use ``list-i`` to view all the current internship roles you have.
- While the various parameters `[c/CYCLE] [d/DESCRIPTION] [p/PAY] [o/OUTCOME] [l/LOCATION]` are optional, you need to
include at least one of them or an error message will be displayed.

</div>

**Examples:**
- Use `list-i` to list all the internship information, followed by `edit-i-role i/1 o/rejected`
to edit the outcome of the internship role at **index** 1.
Original file line number Diff line number Diff line change
@@ -43,7 +43,7 @@ public class AddInternshipTaskCommand extends InternshipCommand {
+ "[" + PREFIX_OUTCOME + "awaiting/follow-up/ghosted/rejected/offered" + "]\n"
+ "[" + PREFIX_TAG + "TAG" + "]\n"
+ "Example: " + COMMAND_WORD
+ " add-a n/Assignment 1 d/description e/2023-12-18 19:00 p/2023-08-19 18:00 t/group s/incomplete";
+ " add-i-task i/1 n/Interview e/2023-12-18 19:00 s/incomplete o/follow-up t/group";
public static final String MESSAGE_SUCCESS = "New internship task added: %1$s";
public static final String MESSAGE_DUPLICATE_TASK = "This internship task already exists in the address book";
public static final String MESSAGE_INVALID_ROLE_INDEX = "There is no such internship role with that index";
Original file line number Diff line number Diff line change
@@ -60,12 +60,6 @@ public CommandResult execute(Model model) throws CommandException {
throw new CommandException(MESSAGE_INVALID_TASK);
}

/*if (newOutcome.getTaskOutcome() == Outcome.OFFERED) {
EditInternshipRoleCommand editRoleCommand = new EditInternshipRoleCommand(index,
new ApplicationOutcome(Outcome.OFFERED));
editRoleCommand.execute(model);
}*/

InternshipTask taskWithNewOutcome = taskToEdit.getNewInternshipTaskWithOutcome(newOutcome);
model.setInternshipTask(taskToEdit, taskWithNewOutcome);
return new CommandResult(String.format(MESSAGE_SUCCESS, Messages.format(taskWithNewOutcome)));
Original file line number Diff line number Diff line change
@@ -15,15 +15,15 @@ public class DeleteAssignmentParser implements Parser<DeleteAssignmentCommand> {
/**
* Parses the given {@code String} of arguments in the context of the DeleteCommand
* and returns a DeleteCommand object for execution.
* @throws ParseException if the user input does not conform the expected format
*/
public DeleteAssignmentCommand parse(String args) throws ParseException {
try {
Index index = ParserUtil.parseIndex(args);
return new DeleteAssignmentCommand(index);
} catch (ParseException pe) {
if (args.isEmpty()) {
throw new ParseException(
String.format(MESSAGE_INVALID_COMMAND_FORMAT, DeleteAssignmentCommand.MESSAGE_USAGE), pe);
String.format(MESSAGE_INVALID_COMMAND_FORMAT,
DeleteAssignmentCommand.MESSAGE_USAGE)
);
}
Index index = ParserUtil.parseIndex(args);
return new DeleteAssignmentCommand(index);
}
}
Original file line number Diff line number Diff line change
@@ -15,15 +15,16 @@ public class MarkAssignmentParser implements Parser<MarkAssignmentCommand> {
/**
* Parses the given {@code String} of arguments in the context of the MarkAssignmentCommand
* and returns a MarkAssignmentCommand object for execution.
* @throws ParseException if the user input does not conform the expected format
*
*/
public MarkAssignmentCommand parse(String args) throws ParseException {
try {
Index index = ParserUtil.parseIndex(args);
return new MarkAssignmentCommand(index);
} catch (ParseException parseException) {
if (args.isEmpty()) {
throw new ParseException(
String.format(MESSAGE_INVALID_COMMAND_FORMAT, MarkAssignmentCommand.MESSAGE_USAGE), parseException);
String.format(MESSAGE_INVALID_COMMAND_FORMAT,
MarkAssignmentCommand.MESSAGE_USAGE)
);
}
Index index = ParserUtil.parseIndex(args);
return new MarkAssignmentCommand(index);
}
}
Original file line number Diff line number Diff line change
@@ -15,16 +15,16 @@ public class UnMarkAssignmentParser implements Parser<UnMarkAssignmentCommand> {
/**
* Parses the given {@code String} of arguments in the context of the UnMarkAssignmentCommand
* and returns a UnMarkAssignmentCommand object for execution.
* @throws ParseException if the user input does not conform the expected format
*
*/
public UnMarkAssignmentCommand parse(String args) throws ParseException {
try {
Index index = ParserUtil.parseIndex(args);
return new UnMarkAssignmentCommand(index);
} catch (ParseException parseException) {
if (args.isEmpty()) {
throw new ParseException(
String.format(MESSAGE_INVALID_COMMAND_FORMAT,
UnMarkAssignmentCommand.MESSAGE_USAGE), parseException);
UnMarkAssignmentCommand.MESSAGE_USAGE)
);
}
Index index = ParserUtil.parseIndex(args);
return new UnMarkAssignmentCommand(index);
}
}
Original file line number Diff line number Diff line change
@@ -17,15 +17,15 @@ public class DeleteInternshipRoleParser implements Parser<DeleteInternshipRoleCo
* Parses the given {@code String} of arguments in the context of the DeleteInternshipRoleCommand
* and returns a DeleteInternshipRoleCommand object for execution.
*
* @throws ParseException if the user input does not conform the expected format
*/
public DeleteInternshipRoleCommand parse(String args) throws ParseException {
try {
Index index = ParserUtil.parseIndex(args);
return new DeleteInternshipRoleCommand(index);
} catch (ParseException pe) {
if (args.isEmpty()) {
throw new ParseException(
String.format(MESSAGE_INVALID_COMMAND_FORMAT, DeleteInternshipRoleCommand.MESSAGE_USAGE), pe);
String.format(MESSAGE_INVALID_COMMAND_FORMAT,
DeleteInternshipRoleCommand.MESSAGE_USAGE)
);
}
Index index = ParserUtil.parseIndex(args);
return new DeleteInternshipRoleCommand(index);
}
}
Original file line number Diff line number Diff line change
@@ -17,15 +17,15 @@ public class DeleteInternshipTaskParser implements Parser<DeleteInternshipTaskCo
* Parses the given {@code String} of arguments in the context of the DeleteInternshipTaskCommand
* and returns a DeleteInternshipTaskCommand object for execution.
*
* @throws ParseException if the user input does not conform the expected format
*/
public DeleteInternshipTaskCommand parse(String args) throws ParseException {
try {
Index index = ParserUtil.parseIndex(args);
return new DeleteInternshipTaskCommand(index);
} catch (ParseException pe) {
if (args.isEmpty()) {
throw new ParseException(
String.format(MESSAGE_INVALID_COMMAND_FORMAT, DeleteInternshipTaskCommand.MESSAGE_USAGE), pe);
String.format(MESSAGE_INVALID_COMMAND_FORMAT,
DeleteInternshipTaskCommand.MESSAGE_USAGE)
);
}
Index index = ParserUtil.parseIndex(args);
return new DeleteInternshipTaskCommand(index);
}
}
Original file line number Diff line number Diff line change
@@ -17,16 +17,15 @@ public class MarkInternshipTaskParser implements Parser<MarkInternshipTaskComman
* Parses the given {@code String} of arguments in the context of the MarkInternshipTaskCommand
* and returns a MarkInternshipTaskCommand object for execution.
*
* @throws ParseException if the user input does not conform the expected format
*/
public MarkInternshipTaskCommand parse(String args) throws ParseException {
try {
Index index = ParserUtil.parseIndex(args);
return new MarkInternshipTaskCommand(index);
} catch (ParseException parseException) {
if (args.isEmpty()) {
throw new ParseException(
String.format(MESSAGE_INVALID_COMMAND_FORMAT,
MarkInternshipTaskCommand.MESSAGE_USAGE), parseException);
MarkInternshipTaskCommand.MESSAGE_USAGE)
);
}
Index index = ParserUtil.parseIndex(args);
return new MarkInternshipTaskCommand(index);
}
}
Original file line number Diff line number Diff line change
@@ -17,16 +17,15 @@ public class UnMarkInternshipTaskParser implements Parser<UnMarkInternshipTaskCo
* Parses the given {@code String} of arguments in the context of the UnMarkInternshipTaskCommand
* and returns a UnMarkInternshipTaskCommand object for execution.
*
* @throws ParseException if the user input does not conform the expected format
*/
public UnMarkInternshipTaskCommand parse(String args) throws ParseException {
try {
Index index = ParserUtil.parseIndex(args);
return new UnMarkInternshipTaskCommand(index);
} catch (ParseException parseException) {
if (args.isEmpty()) {
throw new ParseException(
String.format(MESSAGE_INVALID_COMMAND_FORMAT,
UnMarkInternshipTaskCommand.MESSAGE_USAGE), parseException);
UnMarkInternshipTaskCommand.MESSAGE_USAGE)
);
}
Index index = ParserUtil.parseIndex(args);
return new UnMarkInternshipTaskCommand(index);
}
}
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@
import static seedu.address.logic.Messages.MESSAGE_INVALID_COMMAND_FORMAT;
import static seedu.address.logic.parser.CommandParserTestUtil.assertParseFailure;
import static seedu.address.logic.parser.CommandParserTestUtil.assertParseSuccess;
import static seedu.address.logic.parser.ParserUtil.MESSAGE_INVALID_INDEX;
import static seedu.address.testutil.TypicalIndexes.INDEX_FIRST_IN_LIST;

import org.junit.jupiter.api.Test;
@@ -28,7 +29,12 @@ public void parse_validArgs_returnsDeleteCommand() {

@Test
public void parse_invalidArgs_throwsParseException() {
assertParseFailure(parser, "a", String.format(MESSAGE_INVALID_COMMAND_FORMAT,
assertParseFailure(parser, "a", String.format(MESSAGE_INVALID_INDEX));
}

@Test
public void parse_emptyArgs_throwsParseException() {
assertParseFailure(parser, "", String.format(MESSAGE_INVALID_COMMAND_FORMAT,
DeleteAssignmentCommand.MESSAGE_USAGE));
}
}
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@
import static seedu.address.logic.Messages.MESSAGE_INVALID_COMMAND_FORMAT;
import static seedu.address.logic.parser.CommandParserTestUtil.assertParseFailure;
import static seedu.address.logic.parser.CommandParserTestUtil.assertParseSuccess;
import static seedu.address.logic.parser.ParserUtil.MESSAGE_INVALID_INDEX;
import static seedu.address.testutil.TypicalIndexes.INDEX_FIRST_IN_LIST;

import org.junit.jupiter.api.Test;
@@ -27,7 +28,12 @@ public void parse_validArgs_returnsMarkCommand() {

@Test
public void parse_invalidArgs_throwsParseException() {
assertParseFailure(parser, "a", String.format(MESSAGE_INVALID_COMMAND_FORMAT,
assertParseFailure(parser, "a", String.format(MESSAGE_INVALID_INDEX));
}

@Test
public void parse_emptyArgs_throwsParseException() {
assertParseFailure(parser, "", String.format(MESSAGE_INVALID_COMMAND_FORMAT,
MarkAssignmentCommand.MESSAGE_USAGE));
}
}
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@
import static seedu.address.logic.Messages.MESSAGE_INVALID_COMMAND_FORMAT;
import static seedu.address.logic.parser.CommandParserTestUtil.assertParseFailure;
import static seedu.address.logic.parser.CommandParserTestUtil.assertParseSuccess;
import static seedu.address.logic.parser.ParserUtil.MESSAGE_INVALID_INDEX;
import static seedu.address.testutil.TypicalIndexes.INDEX_FIRST_IN_LIST;

import org.junit.jupiter.api.Test;
@@ -27,7 +28,12 @@ public void parse_validArgs_returnsMarkCommand() {

@Test
public void parse_invalidArgs_throwsParseException() {
assertParseFailure(parser, "a", String.format(MESSAGE_INVALID_COMMAND_FORMAT,
assertParseFailure(parser, "a", String.format(MESSAGE_INVALID_INDEX));
}

@Test
public void parse_emptyArgs_throwsParseException() {
assertParseFailure(parser, "", String.format(MESSAGE_INVALID_COMMAND_FORMAT,
UnMarkAssignmentCommand.MESSAGE_USAGE));
}
}
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@
import static seedu.address.logic.Messages.MESSAGE_INVALID_COMMAND_FORMAT;
import static seedu.address.logic.parser.CommandParserTestUtil.assertParseFailure;
import static seedu.address.logic.parser.CommandParserTestUtil.assertParseSuccess;
import static seedu.address.logic.parser.ParserUtil.MESSAGE_INVALID_INDEX;
import static seedu.address.testutil.TypicalIndexes.INDEX_FIRST_IN_LIST;

import org.junit.jupiter.api.Test;
@@ -20,7 +21,12 @@ public void parse_validArgs_returnsDeleteCommand() {

@Test
public void parse_invalidArgs_throwsParseException() {
assertParseFailure(parser, "a", String.format(MESSAGE_INVALID_COMMAND_FORMAT,
assertParseFailure(parser, "a", String.format(MESSAGE_INVALID_INDEX));
}

@Test
public void parse_emptyArgs_throwsParseException() {
assertParseFailure(parser, "", String.format(MESSAGE_INVALID_COMMAND_FORMAT,
DeleteInternshipRoleCommand.MESSAGE_USAGE));
}
}
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@
import static seedu.address.logic.Messages.MESSAGE_INVALID_COMMAND_FORMAT;
import static seedu.address.logic.parser.CommandParserTestUtil.assertParseFailure;
import static seedu.address.logic.parser.CommandParserTestUtil.assertParseSuccess;
import static seedu.address.logic.parser.ParserUtil.MESSAGE_INVALID_INDEX;
import static seedu.address.testutil.TypicalIndexes.INDEX_FIRST_IN_LIST;

import org.junit.jupiter.api.Test;
@@ -19,7 +20,12 @@ public void parse_validArgs_returnsDeleteCommand() {

@Test
public void parse_invalidArgs_throwsParseException() {
assertParseFailure(parser, "a", String.format(MESSAGE_INVALID_COMMAND_FORMAT,
assertParseFailure(parser, "a", String.format(MESSAGE_INVALID_INDEX));
}

@Test
public void parse_emptyArgs_throwsParseException() {
assertParseFailure(parser, "", String.format(MESSAGE_INVALID_COMMAND_FORMAT,
DeleteInternshipTaskCommand.MESSAGE_USAGE));
}
}

0 comments on commit 6051601

Please sign in to comment.