Skip to content

Commit

Permalink
Merge pull request #165 from ngchisern/branch-find-bug
Browse files Browse the repository at this point in the history
Message usage & constraint
  • Loading branch information
Tanishq4331 authored Oct 28, 2021
2 parents 878e5e7 + c8c77e2 commit e361408
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class EditTaskCommand extends Command {
+ "Parameters: INDEX (must be a positive integer) "
+ "[" + PREFIX_LABEL + "LABEL] "
+ "[" + PREFIX_DATE + "DATE] "
+ "[" + PREFIX_TASK_TAG + "TASKTAG]...\n"
+ "[" + PREFIX_TASK_TAG + "TASKTAG]\n"
+ "Example: " + COMMAND_WORD + " 1 "
+ PREFIX_LABEL + "Order cloth "
+ PREFIX_DATE + "19 September 2021"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ public class FindOrderCommand extends Command {

public static final String COMMAND_WORD = "findorder";

public static final String MESSAGE_USAGE = COMMAND_WORD + ": Finds all orders whose customer, label, date or id "
public static final String MESSAGE_USAGE = COMMAND_WORD + ": Finds all orders whose "
+ "customer, label, date or sales id "
+ "contain any of the specified keywords (case-insensitive) and "
+ "displays them as a list with index numbers.\n"
+ "Parameters: KEYWORD [MORE_KEYWORDS]...\n"
+ "Example: " + COMMAND_WORD + " 20 August John";
+ "Example: " + COMMAND_WORD + " August John";


private final OrderContainsKeywordsPredicate predicate;

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/seedu/address/model/order/Amount.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
*/
public class Amount implements Comparable<Amount> {
public static final String MESSAGE_CONSTRAINTS =
"Sales order amount should only contain numbers, and optionally, at most one block starting with a dot"
+ "followed by between one or or two numbers";
"Sales order amount should only contain numbers, and optionally, at most one block starting with a dot "
+ "followed by between one or two numbers";
public static final String VALIDATION_REGEX = "^\\d+(\\.?\\d{1,2})?";
public final String amount;

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/seedu/address/model/order/Customer.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/
public class Customer {
public static final String MESSAGE_CONSTRAINTS =
"Customer name should be non-empty, and contain one or more blocks of alphanumeric characters, "
"Customer names should be non-empty, and contain one or more blocks of alphanumeric characters, "
+ "separated by at most one space";
public static final String VALIDATION_REGEX = "\\p{Alnum}+( \\p{Alnum}+)*";
public final String name;
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/seedu/address/model/person/Remark.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
*/
public class Remark {

public static final String MESSAGE_CONSTRAINTS =
"Remarks should only contains alphanumeric alphabets, comma, full stop and whitespace.";
public static final String MESSAGE_CONSTRAINTS = "Remarks should only contain up to 100 "
+ "alphanumeric alphabets, comma, full stop and whitespace in total";
public static final String VALIDATION_REGEX = "[a-zA-Z0-9,. ]*";
public final String value;

Expand All @@ -29,7 +29,7 @@ public Remark(String remark) {
* Returns true if a given string is a valid remark.
*/
public static boolean isValidRemark(String test) {
return test.matches(VALIDATION_REGEX);
return test.matches(VALIDATION_REGEX) && test.length() <= 100;
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/seedu/address/model/tag/TaskTag.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class TaskTag {

public static final String MESSAGE_CONSTRAINTS =
"Task tags names should either be 'General' or "
+ "have prefix 'SO' followed by at least 1 digit.";
+ "have prefix 'SO' followed by at least 1 digit";
public static final String VALIDATION_REGEX = "SO[\\d]+|General";

public final String tagName;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/seedu/address/ui/OrderCard.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ public OrderCard(Order order, int displayedIndex) {
super(FXML);
this.order = order;
index.setText(displayedIndex + ". ");
orderId.setText("(" + order.getDisplayId() + ") ");
customer.setText(order.getCustomer().toString());
orderId.setText(order.getDisplayId());
customer.setText("Customer: " + order.getCustomer().toString());
isComplete.setSelected(order.getIsComplete());
orderLabel.setText(order.getLabel().toString());
date.setText("Deadline: " + order.getDate().toString());
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/view/LightTheme.css
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@
-fx-vgap: 3;
}

#tags .label, #taskTag {
#tags .label, #taskTag, #orderId {
-fx-text-fill: white;
-fx-background-color: #3e7b91;
-fx-padding: 1 3 1 3;
Expand Down
8 changes: 4 additions & 4 deletions src/main/resources/view/OrderCard.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,18 @@
<Region fx:constant="USE_PREF_SIZE" />
</minWidth>
</Label>
<Label fx:id="orderId" styleClass="cell_big_label" text="\$SOXXX" />
<Label fx:id="customer" styleClass="cell_big_label" text="\$Customer" />
<Label fx:id="orderLabel" styleClass="cell_big_label" text="\$label" />
</HBox>
<CheckBox fx:id="isComplete" disable="true" mnemonicParsing="false" selected="true" HBox.hgrow="NEVER" />
</children>
</HBox>
<Label fx:id="orderLabel" text="\$Label" />
<Label fx:id="orderId"/>
<Label fx:id="customer" styleClass="cell_small_label" text="\$Customer" />
<HBox spacing="5.0">
<children>
<HBox alignment="CENTER_LEFT" spacing="10.0" HBox.hgrow="ALWAYS">
<children>
<Label fx:id="date" styleClass="cell_small_label" text="\$date" />
<CheckBox fx:id="isComplete" disable="true" mnemonicParsing="false" selected="true" HBox.hgrow="NEVER" />
</children>
</HBox>
<Label fx:id="amount" text="\$$$" />
Expand Down

0 comments on commit e361408

Please sign in to comment.