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

Wrap long remark text in candidate display #244

Merged
merged 5 commits into from
Nov 3, 2021
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
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,24 @@ public class AddCandidateCommand extends Command {

public static final String COMMAND_WORD = "add_c";

public static final String MESSAGE_USAGE = COMMAND_WORD + ": Adds a candidate to the HR Manager. "
public static final String MESSAGE_USAGE = COMMAND_WORD + ": Adds a candidate to the HR Manager.\n"
+ "Parameters: "
+ PREFIX_NAME + "NAME "
+ PREFIX_PHONE + "PHONE "
+ PREFIX_EMAIL + "EMAIL "
+ PREFIX_ADDRESS + "ADDRESS "
+ PREFIX_POSITION + "POSITION... "
+ "[" + PREFIX_STATUS + "STATUS] "
+ "[" + PREFIX_TAG + "TAG]...\n"
+ "[" + PREFIX_POSITION + "POSITION]...\n"
+ "Example: " + COMMAND_WORD + " "
+ PREFIX_NAME + "John Doe "
+ PREFIX_PHONE + "98765432 "
+ PREFIX_EMAIL + "[email protected] "
+ PREFIX_ADDRESS + "311, Clementi Ave 2, #02-25 "
+ PREFIX_POSITION + "Accountant "
+ PREFIX_STATUS + "Scheduled "
+ PREFIX_TAG + "pending "
+ PREFIX_TAG + "reviewRequired "
+ PREFIX_POSITION + "Accountant";
+ PREFIX_TAG + "reviewRequired";

public static final String MESSAGE_SUCCESS = "New candidate added: %1$s";
public static final String MESSAGE_DUPLICATE_PERSON = "This candidate already exists in the HR Manager";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public class EditCandidateCommand extends Command {
+ "[" + PREFIX_EMAIL + "EMAIL] "
+ "[" + PREFIX_ADDRESS + "ADDRESS] "
+ "[" + PREFIX_STATUS + "STATUS] "
+ "[" + PREFIX_TAG + "TAG]...\n"
+ "[" + PREFIX_TAG + "TAG]... "
+ "[" + PREFIX_POSITION + "POSITION]...\n"
+ "Example: " + COMMAND_WORD + " 1 "
+ PREFIX_PHONE + "91234567 "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ public class FindCandidateCommand extends Command {

public static final String MESSAGE_USAGE = COMMAND_WORD + ": Finds all persons that contain any of "
+ "the specified keywords (case-insensitive) and displays them as a list with index numbers.\n"
+ "Parameters:" + PREFIX_NAME + "[NAME]..."
+ PREFIX_ADDRESS + "[ADDRESS]..."
+ PREFIX_EMAIL + "[EMAIL]..."
+ PREFIX_PHONE + "[PHONE]..."
+ PREFIX_POSITION + "[POSITION]..."
+ PREFIX_STATUS + "[STATUS]..."
+ "Parameters:" + PREFIX_NAME + "[NAME]... "
+ PREFIX_ADDRESS + "[ADDRESS]... "
+ PREFIX_EMAIL + "[EMAIL]... "
+ PREFIX_PHONE + "[PHONE]... "
+ PREFIX_POSITION + "[POSITION]... "
+ PREFIX_STATUS + "[STATUS]... "
+ PREFIX_TAG + "[TAG]...\n"
+ "Example: " + COMMAND_WORD + " " + PREFIX_NAME + " alice bob charlie";
+ "Example: " + COMMAND_WORD + " " + PREFIX_NAME + "alice bob charlie";
public static final String MESSAGE_SUCCESS = "Listed all found candidates";

private final FindCandidateCommandPredicate predicate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
public class AddInterviewCommand extends Command {
public static final String COMMAND_WORD = "add_i";

public static final String MESSAGE_USAGE = COMMAND_WORD + ": Adds an interview to the HR Manager. "
public static final String MESSAGE_USAGE = COMMAND_WORD + ": Adds an interview to the HR Manager.\n"
+ "Parameters: "
+ PREFIX_POSITION + "POSITION "
+ PREFIX_CANDIDATE_INDEX + "INDEX (must be a positive integer)... "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class EditInterviewCommand extends Command {
+ "Existing values will be overwritten by the input values.\n"
+ "Parameters: INDEX (must be a positive integer) "
+ "[" + PREFIX_POSITION + "POSITION] "
+ "[" + PREFIX_CANDIDATE_INDEX + "CANDIDATE]...\n"
+ "[" + PREFIX_CANDIDATE_INDEX + "CANDIDATE]... "
+ "[" + PREFIX_DATE + "DATE] "
+ "[" + PREFIX_TIME + "TIME] "
+ "[" + PREFIX_DURATION + "DURATION] "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ public class FindInterviewCommand extends Command {

public static final String MESSAGE_USAGE = COMMAND_WORD + ": Finds all interviews that contain any of "
+ "the specified keywords (case-insensitive) and displays them as a list with index numbers.\n"
+ "Parameters:"
+ PREFIX_POSITION + "[TITLE]..."
+ PREFIX_INTERVIEW_STATUS + "[POSITION STATUS]..."
+ PREFIX_TIME + "[TIME]..."
+ PREFIX_DATE + "[DATE]..."
+ PREFIX_CANDIDATE_INDEX + "[CANDIDATE NAME]..."
+ "Parameters: "
+ PREFIX_POSITION + "[TITLE]... "
+ PREFIX_INTERVIEW_STATUS + "[POSITION STATUS]... "
+ PREFIX_TIME + "[TIME]... "
+ PREFIX_DATE + "[DATE]... "
+ PREFIX_CANDIDATE_INDEX + "[CANDIDATE NAME]...\n"
+ "Example: " + COMMAND_WORD + " " + PREFIX_POSITION + "accountant" + " " + PREFIX_DATE + "21/09/2021";
private final FindInterviewCommandPredicate predicate;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ public class AddPositionCommand extends Command {

public static final String COMMAND_WORD = "add_p";

public static final String MESSAGE_USAGE = COMMAND_WORD + ": Adds a position to the HR Manager. "
public static final String MESSAGE_USAGE = COMMAND_WORD + ": Adds a position to the HR Manager.\n"
+ "Parameters: "
+ PREFIX_TITLE + "TITLE:\n"
+ PREFIX_TITLE + "TITLE\n"
+ "Example: " + COMMAND_WORD + " "
+ PREFIX_TITLE + "Accountant";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ public class FindPositionCommand extends Command {

public static final String MESSAGE_USAGE = COMMAND_WORD + ": Finds all positions that contain any of "
+ "the specified keywords (case-insensitive) and displays them as a list with index numbers.\n"
+ "Parameters:"
+ PREFIX_TITLE + "[TITLE]..."
+ PREFIX_POSITION_STATUS + "[POSITION STATUS]..."
+ "Parameters: "
+ PREFIX_TITLE + "[TITLE]... "
+ PREFIX_POSITION_STATUS + "[POSITION STATUS]...\n"
+ "Example: " + COMMAND_WORD + " " + PREFIX_TITLE + "accountant";
private final FindPositionCommandPredicate predicate;

Expand Down
7 changes: 6 additions & 1 deletion src/main/java/seedu/address/model/person/Person.java
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ public void deletePosition(Position p) {
/**
* Adds an interview into a person's list of interviews, and since the person has the upcoming added interview,
* this method always sets the status as scheduled.
*
* @param i interview object to be added to person
*/
public void addInterview(Interview i) {
Expand All @@ -137,6 +138,7 @@ public void addInterview(Interview i) {
/**
* Delets an interviwe from a person's list of interviews. If the person does not have any upcoming interview
* this method sets the status as applied.
*
* @param i
*/
public void deleteInterview(Interview i) {
Expand Down Expand Up @@ -204,7 +206,6 @@ public String toString() {
.append(getEmail())
.append("; Address: ")
.append(getAddress())
.append(" Remark: ")
.append(getRemark())
.append(" Status: ")
.append(getStatus());
Expand All @@ -215,6 +216,10 @@ public String toString() {
tags.forEach(builder::append);
}

if (!remark.toString().equals("")) {
builder.append("; Remark: ").append(remark);
}

Set<Position> positions = getPositions();
if (!positions.isEmpty()) {
builder.append("; Positions: ");
Expand Down
8 changes: 7 additions & 1 deletion src/main/java/seedu/address/ui/PersonCard.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,17 @@ public PersonCard(Person person, int displayedIndex) {
name.setText(person.getName().fullName);
phone.setText(person.getPhone().value);
address.setText(person.getAddress().value);
address.setWrapText(true);
email.setText(person.getEmail().value);
remark.setText(person.getRemark().value);
status.setText(person.getStatus().toString());

name.setWrapText(true);
phone.setWrapText(true);
address.setWrapText(true);
email.setWrapText(true);
remark.setWrapText(true);
status.setWrapText(true);

person.getTags().stream()
.sorted(Comparator.comparing(tag -> tag.tagName))
.forEach(tag -> tags.getChildren().add(new Label(tag.tagName)));
Expand Down
1 change: 1 addition & 0 deletions src/main/java/seedu/address/ui/ResultDisplay.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public ResultDisplay() {
public void setFeedbackToUser(String feedbackToUser) {
requireNonNull(feedbackToUser);
resultDisplay.setText(feedbackToUser);
resultDisplay.setWrapText(true);
}

}