Skip to content

Commit

Permalink
Merge pull request #265 from MingYiAw/fix-ped-bug
Browse files Browse the repository at this point in the history
Fix PE-D Bugs
  • Loading branch information
The0nlyJuan authored Nov 11, 2024
2 parents 95e79a2 + 11ecfdf commit 760301e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/main/java/seedu/address/logic/Messages.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public class Messages {
public static final String MESSAGE_PERSONS_LISTED_OVERVIEW = "%1$d persons listed!";
public static final String MESSAGE_DUPLICATE_FIELDS =
"Multiple values specified for the following single-valued field(s): ";
public static final String MESSAGE_INVALID_POLICY_NAME = "The policy name format is invalid.";
public static final String MESSAGE_INVALID_POLICY_FORMAT = "The policy name format is invalid.";
public static final String MESSAGE_INVALID_POLICY_DISPLAYED_INDEX = "The policy index provided is invalid";
public static final String MESSAGE_DUPLICATE_POLICY_NAME = "The policy name provided is duplicated";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package seedu.address.logic.commands;

import static java.util.Objects.requireNonNull;
import static seedu.address.logic.Messages.MESSAGE_INVALID_POLICY_FORMAT;
import static seedu.address.logic.Messages.MESSAGE_INVALID_POLICY_NAME;
import static seedu.address.logic.Messages.MESSAGE_SUCCESS_SEARCH_POLICY;
import static seedu.address.logic.parser.CliSyntax.PREFIX_SEARCH_POLICY;

Expand Down Expand Up @@ -33,7 +33,7 @@ public class SearchPolicyCommand extends Command {
public SearchPolicyCommand(String policyName) throws CommandException {
requireNonNull(policyName);
if (!isValidPolicyName(policyName)) {
throw new CommandException(MESSAGE_INVALID_POLICY_FORMAT);
throw new CommandException(MESSAGE_INVALID_POLICY_NAME);
}
this.policyName = policyName;
}
Expand Down
10 changes: 6 additions & 4 deletions src/main/java/seedu/address/logic/parser/ParserUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import static java.util.Objects.requireNonNull;
import static seedu.address.logic.Messages.MESSAGE_DUPLICATE_POLICY_INDEX;
import static seedu.address.logic.Messages.MESSAGE_INVALID_POLICY_FORMAT;
import static seedu.address.logic.Messages.MESSAGE_INVALID_COMMAND_FORMAT;
import static seedu.address.logic.parser.CliSyntax.PREFIX_NEXT_PAYMENT_DATE;
import static seedu.address.logic.parser.CliSyntax.PREFIX_PAYMENT_AMOUNT;
import static seedu.address.logic.parser.CliSyntax.PREFIX_POLICY_END_DATE;
Expand All @@ -18,6 +18,8 @@

import seedu.address.commons.core.index.Index;
import seedu.address.commons.util.StringUtil;
import seedu.address.logic.Messages;
import seedu.address.logic.commands.EditCommand;
import seedu.address.logic.commands.exceptions.CommandException;
import seedu.address.logic.parser.exceptions.ParseException;
import seedu.address.model.person.Address;
Expand Down Expand Up @@ -198,7 +200,7 @@ public static Policy parsePolicy(String policyArgs) throws ParseException {

if (!arePrefixesPresent(argMultimap, PREFIX_POLICY_NAME, PREFIX_POLICY_START_DATE,
PREFIX_POLICY_END_DATE, PREFIX_NEXT_PAYMENT_DATE, PREFIX_PAYMENT_AMOUNT)) {
throw new ParseException(String.format(MESSAGE_INVALID_POLICY_FORMAT));
throw new ParseException(String.format(MESSAGE_INVALID_COMMAND_FORMAT, EditCommand.MESSAGE_USAGE));
}

argMultimap.verifyNoDuplicatePrefixesFor(PREFIX_POLICY_NAME, PREFIX_POLICY_START_DATE,
Expand Down Expand Up @@ -241,9 +243,9 @@ public static Map<Index, Policy> parsePolicies(Collection<String> policies) thro
Index index;

try {
index = ParserUtil.parseIndex(argMultimap.getPreamble());
index = parseIndex(argMultimap.getPreamble());
} catch (ParseException pe) {
throw new ParseException(String.format(MESSAGE_INVALID_POLICY_FORMAT), pe);
throw new ParseException(String.format(Messages.MESSAGE_INVALID_POLICY_DISPLAYED_INDEX), pe);
}

if (toEditIndexSet.contains(index.getZeroBased())) {
Expand Down
4 changes: 4 additions & 0 deletions src/main/resources/view/MainWindow.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Edited from "DarkTheme.css"
*/

.background {
-fx-background-color: white;
background-color: #383838; /* Used in the default.html file */
Expand Down

0 comments on commit 760301e

Please sign in to comment.