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 indicator to vertically truncated lines #222

Merged
merged 4 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/main/java/seedu/address/commons/util/StringUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ public static String truncateText(String s) {
String[] lines = s.split("\n");
for (String line : lines) {
if (lineCount > TRUNCATED_LINE_NUMBER) {
ans.append("...");
break;
}
if (line.length() > TRUNCATED_STRING_LENGTH) {
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/seedu/address/logic/Messages.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@
*/
public class Messages {

public static final String MESSAGE_UNKNOWN_COMMAND = "Unknown command";
public static final String MESSAGE_UNKNOWN_COMMAND = "Unknown command.\n"
+ "Please type 'help' to see the list of available commands.";
public static final String MESSAGE_INVALID_COMMAND_FORMAT = "Invalid command format! \n%1$s";
public static final String MESSAGE_INVALID_CLIENT_DISPLAYED_INDEX = "The client index provided is invalid";
public static final String MESSAGE_INVALID_CLIENT_DISPLAYED_INDEX = "The client index provided is invalid.";
public static final String MESSAGE_CLIENTS_LISTED_OVERVIEW = "%1$d client(s) listed!";
public static final String MESSAGE_DUPLICATE_FIELDS =
"Multiple values specified for the following single-valued field(s): ";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class ListCommand extends Command {

public static final String COMMAND_WORD = "list";

public static final String MESSAGE_SUCCESS = "Listed all clients";
public static final String MESSAGE_SUCCESS = "Listed all clients.";


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

public static final String MESSAGE_CONSTRAINTS = "Addresses can take any values, and it should not be blank";
public static final String MESSAGE_CONSTRAINTS = "Addresses can take any values, and it should not be blank.";

/*
* The first character of the address must not be a whitespace,
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/seedu/address/model/client/Name.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class Name {

public static final String MESSAGE_CONSTRAINTS =
"Names should only contain letters, numbers, spaces, hyphens, apostrophes (no symbols), "
+ "and it should not be blank";
+ "and it should not be blank.";

/*
* The first character of the address must not be a whitespace,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*/
public class IncomeComparisonOperator {
public static final String MESSAGE_CONSTRAINTS = "Please use a valid comparison operator. "
+ "Income comparison operators can only be '=', '>' or '<'";
+ "Income comparison operators can only be '=', '>' or '<'.";

public final String comparisonOperator;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public void truncateText() {
assertFalse(StringUtil.truncateText(longTestString).equals(longTestString));

// Truncated text will truncate if there are more than 3 newline characters
assertTrue(StringUtil.truncateText(fourNewLineTestString).equals(threeNewLineTestString));
assertTrue(StringUtil.truncateText(fourNewLineTestString).equals(threeNewLineTestString + "..."));
}

}