diff --git a/src/main/java/seedu/address/logic/commands/AddCommand.java b/src/main/java/seedu/address/logic/commands/AddCommand.java index 6298e7cea4f..551f031e21c 100644 --- a/src/main/java/seedu/address/logic/commands/AddCommand.java +++ b/src/main/java/seedu/address/logic/commands/AddCommand.java @@ -4,7 +4,9 @@ import static seedu.address.logic.parser.CliSyntax.PREFIX_ADDRESS; import static seedu.address.logic.parser.CliSyntax.PREFIX_EMAIL; import static seedu.address.logic.parser.CliSyntax.PREFIX_NAME; +import static seedu.address.logic.parser.CliSyntax.PREFIX_NOTE; import static seedu.address.logic.parser.CliSyntax.PREFIX_PHONE; +import static seedu.address.logic.parser.CliSyntax.PREFIX_SKILLS; import static seedu.address.logic.parser.CliSyntax.PREFIX_STATUS; import static seedu.address.logic.parser.CliSyntax.PREFIX_TAG; @@ -21,22 +23,25 @@ public class AddCommand extends Command { public static final String COMMAND_WORD = "add"; - public static final String MESSAGE_USAGE = COMMAND_WORD + ": Adds a person to the address book. " + public static final String MESSAGE_USAGE = COMMAND_WORD + ": Adds a person to the address book. \n" + "Parameters: " + PREFIX_NAME + "NAME " + PREFIX_PHONE + "PHONE " + PREFIX_EMAIL + "EMAIL " + PREFIX_ADDRESS + "ADDRESS " + + PREFIX_SKILLS + "SKILLS " + PREFIX_STATUS + "STATUS " - + "[" + PREFIX_TAG + "TAG]...\n" + + PREFIX_NOTE + "NOTE " + + PREFIX_TAG + "TAG...\n" + "Example: " + COMMAND_WORD + " " + PREFIX_NAME + "John Doe " + PREFIX_PHONE + "98765432 " - + PREFIX_EMAIL + "johnd@example.com " + + PREFIX_EMAIL + "example@example.com " + PREFIX_ADDRESS + "311, Clementi Ave 2, #02-25 " - + PREFIX_STATUS + "Interview Scheduled " - + PREFIX_TAG + "friends " - + PREFIX_TAG + "owesMoney"; + + PREFIX_SKILLS + "Java, Python, C++ " + + PREFIX_STATUS + "Interviewed " + + PREFIX_NOTE + "Super confident " + + PREFIX_TAG + "friends "; public static final String MESSAGE_SUCCESS = "New person added: %1$s"; public static final String MESSAGE_DUPLICATE_PERSON = "This person already exists in the address book"; diff --git a/src/main/java/seedu/address/logic/commands/EditCommand.java b/src/main/java/seedu/address/logic/commands/EditCommand.java index 01f81875c69..e94315c9b26 100644 --- a/src/main/java/seedu/address/logic/commands/EditCommand.java +++ b/src/main/java/seedu/address/logic/commands/EditCommand.java @@ -6,6 +6,7 @@ import static seedu.address.logic.parser.CliSyntax.PREFIX_NAME; import static seedu.address.logic.parser.CliSyntax.PREFIX_NOTE; import static seedu.address.logic.parser.CliSyntax.PREFIX_PHONE; +import static seedu.address.logic.parser.CliSyntax.PREFIX_SKILLS; import static seedu.address.logic.parser.CliSyntax.PREFIX_STATUS; import static seedu.address.logic.parser.CliSyntax.PREFIX_TAG; import static seedu.address.model.Model.PREDICATE_SHOW_ALL_PERSONS; @@ -29,6 +30,7 @@ import seedu.address.model.person.Note; import seedu.address.model.person.Person; import seedu.address.model.person.Phone; +import seedu.address.model.person.Skills; import seedu.address.model.person.Status; import seedu.address.model.tag.Tag; @@ -47,12 +49,17 @@ public class EditCommand extends Command { + "[" + PREFIX_PHONE + "PHONE] " + "[" + PREFIX_EMAIL + "EMAIL] " + "[" + PREFIX_ADDRESS + "ADDRESS] " + + "[" + PREFIX_SKILLS + "SKILLS] " + "[" + PREFIX_STATUS + "STATUS]" + "[" + PREFIX_NOTE + "NOTE] " + "[" + PREFIX_TAG + "TAG]...\n" + "Example: " + COMMAND_WORD + " 1 " + PREFIX_PHONE + "91234567 " - + PREFIX_EMAIL + "johndoe@example.com"; + + PREFIX_EMAIL + "johndoe@example.com" + + PREFIX_ADDRESS + "311, Clementi Ave 2, #02-25 " + + PREFIX_SKILLS + "java, python " + + PREFIX_TAG + "friends"; + public static final String MESSAGE_EDIT_PERSON_SUCCESS = "Edited Person: %1$s"; public static final String MESSAGE_NOT_EDITED = "At least one field to edit must be provided."; @@ -105,11 +112,12 @@ private static Person createEditedPerson(Person personToEdit, EditPersonDescript Phone updatedPhone = editPersonDescriptor.getPhone().orElse(personToEdit.getPhone()); Email updatedEmail = editPersonDescriptor.getEmail().orElse(personToEdit.getEmail()); Address updatedAddress = editPersonDescriptor.getAddress().orElse(personToEdit.getAddress()); + Skills updatedSkills = editPersonDescriptor.getSkills().orElse(personToEdit.getSkills()); Status updatedStatus = editPersonDescriptor.getStatus().orElse(personToEdit.getStatus()); Set updatedTags = editPersonDescriptor.getTags().orElse(personToEdit.getTags()); Note updatedNote = editPersonDescriptor.getNote().orElse(personToEdit.getNote()); - return new Person(updatedName, updatedPhone, updatedEmail, updatedAddress, + return new Person(updatedName, updatedPhone, updatedEmail, updatedAddress, updatedSkills, updatedStatus, updatedNote, updatedTags); } @@ -146,6 +154,7 @@ public static class EditPersonDescriptor { private Phone phone; private Email email; private Address address; + private Skills skills; private Status status; private Note note; private Set tags; @@ -161,6 +170,7 @@ public EditPersonDescriptor(EditPersonDescriptor toCopy) { setPhone(toCopy.phone); setEmail(toCopy.email); setAddress(toCopy.address); + setSkills(toCopy.skills); setStatus(toCopy.status); setNote(toCopy.note); setTags(toCopy.tags); @@ -205,6 +215,14 @@ public Optional
getAddress() { return Optional.ofNullable(address); } + public void setSkills(Skills skills) { + this.skills = skills; + } + + public Optional getSkills() { + return Optional.ofNullable(skills); + } + public void setStatus(Status status) { this.status = status; } @@ -254,6 +272,7 @@ public boolean equals(Object other) { && Objects.equals(phone, otherEditPersonDescriptor.phone) && Objects.equals(email, otherEditPersonDescriptor.email) && Objects.equals(address, otherEditPersonDescriptor.address) + && Objects.equals(skills, otherEditPersonDescriptor.skills) && Objects.equals(status, otherEditPersonDescriptor.status) && Objects.equals(note, otherEditPersonDescriptor.note) && Objects.equals(tags, otherEditPersonDescriptor.tags); @@ -266,6 +285,7 @@ public String toString() { .add("phone", phone) .add("email", email) .add("address", address) + .add("skills", tags) .add("status", status) .add("note", note) .add("tags", tags) diff --git a/src/main/java/seedu/address/logic/commands/NoteCommand.java b/src/main/java/seedu/address/logic/commands/NoteCommand.java index 9a5e685ba40..a08d4fb6985 100644 --- a/src/main/java/seedu/address/logic/commands/NoteCommand.java +++ b/src/main/java/seedu/address/logic/commands/NoteCommand.java @@ -60,8 +60,9 @@ public CommandResult execute(Model model) throws CommandException { personToEdit.getPhone(), personToEdit.getEmail(), personToEdit.getAddress(), + personToEdit.getSkills(), personToEdit.getStatus(), // Add this line to get the status - note, + personToEdit.getNote(), personToEdit.getTags() ); diff --git a/src/main/java/seedu/address/logic/parser/AddCommandParser.java b/src/main/java/seedu/address/logic/parser/AddCommandParser.java index 5dad1cd080f..f8a061ee35b 100644 --- a/src/main/java/seedu/address/logic/parser/AddCommandParser.java +++ b/src/main/java/seedu/address/logic/parser/AddCommandParser.java @@ -6,6 +6,7 @@ import static seedu.address.logic.parser.CliSyntax.PREFIX_NAME; import static seedu.address.logic.parser.CliSyntax.PREFIX_NOTE; import static seedu.address.logic.parser.CliSyntax.PREFIX_PHONE; +import static seedu.address.logic.parser.CliSyntax.PREFIX_SKILLS; import static seedu.address.logic.parser.CliSyntax.PREFIX_STATUS; import static seedu.address.logic.parser.CliSyntax.PREFIX_TAG; @@ -20,6 +21,7 @@ import seedu.address.model.person.Note; import seedu.address.model.person.Person; import seedu.address.model.person.Phone; +import seedu.address.model.person.Skills; import seedu.address.model.person.Status; import seedu.address.model.tag.Tag; @@ -36,21 +38,23 @@ public class AddCommandParser implements Parser { public AddCommand parse(String args) throws ParseException { ArgumentMultimap argMultimap = ArgumentTokenizer.tokenize(args, PREFIX_NAME, PREFIX_PHONE, PREFIX_EMAIL, PREFIX_ADDRESS, + PREFIX_SKILLS, PREFIX_STATUS, PREFIX_NOTE, PREFIX_TAG); if (!arePrefixesPresent(argMultimap, PREFIX_NAME, PREFIX_ADDRESS, PREFIX_PHONE, PREFIX_EMAIL, - PREFIX_STATUS, PREFIX_NOTE) + PREFIX_SKILLS, PREFIX_STATUS, PREFIX_NOTE) || !argMultimap.getPreamble().isEmpty()) { throw new ParseException(String.format(MESSAGE_INVALID_COMMAND_FORMAT, AddCommand.MESSAGE_USAGE)); } argMultimap.verifyNoDuplicatePrefixesFor(PREFIX_NAME, PREFIX_PHONE, PREFIX_EMAIL, PREFIX_ADDRESS, - PREFIX_STATUS, PREFIX_NOTE); + PREFIX_SKILLS, PREFIX_STATUS, PREFIX_NOTE); Name name = ParserUtil.parseName(argMultimap.getValue(PREFIX_NAME).get()); Phone phone = ParserUtil.parsePhone(argMultimap.getValue(PREFIX_PHONE).get()); Email email = ParserUtil.parseEmail(argMultimap.getValue(PREFIX_EMAIL).get()); Address address = ParserUtil.parseAddress(argMultimap.getValue(PREFIX_ADDRESS).get()); + Skills skills = ParserUtil.parseSkills(argMultimap.getValue(PREFIX_SKILLS).get()); Status status = ParserUtil.parseStatus(argMultimap.getValue(PREFIX_STATUS).get()); // Check if note is present and parse it accordingly @@ -62,9 +66,7 @@ public AddCommand parse(String args) throws ParseException { } Set tagList = ParserUtil.parseTags(argMultimap.getAllValues(PREFIX_TAG)); - - Person person = new Person(name, phone, email, address, status, note, tagList); - + Person person = new Person(name, phone, email, address, skills, status, note, tagList); return new AddCommand(person); } diff --git a/src/main/java/seedu/address/logic/parser/CliSyntax.java b/src/main/java/seedu/address/logic/parser/CliSyntax.java index 1639c62098f..765d99c09ee 100644 --- a/src/main/java/seedu/address/logic/parser/CliSyntax.java +++ b/src/main/java/seedu/address/logic/parser/CliSyntax.java @@ -12,6 +12,7 @@ public class CliSyntax { public static final Prefix PREFIX_ADDRESS = new Prefix("a/"); public static final Prefix PREFIX_NOTE = new Prefix("note/"); public static final Prefix PREFIX_TAG = new Prefix("t/"); + public static final Prefix PREFIX_SKILLS = new Prefix("s/"); public static final Prefix PREFIX_STATUS = new Prefix("st/"); } diff --git a/src/main/java/seedu/address/logic/parser/EditCommandParser.java b/src/main/java/seedu/address/logic/parser/EditCommandParser.java index f4d3738544d..23b355cc0ca 100644 --- a/src/main/java/seedu/address/logic/parser/EditCommandParser.java +++ b/src/main/java/seedu/address/logic/parser/EditCommandParser.java @@ -7,6 +7,7 @@ import static seedu.address.logic.parser.CliSyntax.PREFIX_NAME; import static seedu.address.logic.parser.CliSyntax.PREFIX_NOTE; import static seedu.address.logic.parser.CliSyntax.PREFIX_PHONE; +import static seedu.address.logic.parser.CliSyntax.PREFIX_SKILLS; import static seedu.address.logic.parser.CliSyntax.PREFIX_STATUS; import static seedu.address.logic.parser.CliSyntax.PREFIX_TAG; @@ -36,7 +37,7 @@ public EditCommand parse(String args) throws ParseException { requireNonNull(args); ArgumentMultimap argMultimap = ArgumentTokenizer.tokenize(args, PREFIX_NAME, PREFIX_PHONE, PREFIX_EMAIL, PREFIX_ADDRESS, - PREFIX_STATUS, PREFIX_NOTE, PREFIX_TAG); + PREFIX_SKILLS, PREFIX_STATUS, PREFIX_NOTE, PREFIX_TAG); Index index; @@ -47,7 +48,7 @@ public EditCommand parse(String args) throws ParseException { } argMultimap.verifyNoDuplicatePrefixesFor(PREFIX_NAME, PREFIX_PHONE, PREFIX_EMAIL, PREFIX_ADDRESS, - PREFIX_STATUS, PREFIX_NOTE ); + PREFIX_SKILLS, PREFIX_STATUS, PREFIX_NOTE); EditPersonDescriptor editPersonDescriptor = new EditPersonDescriptor(); @@ -64,6 +65,9 @@ public EditCommand parse(String args) throws ParseException { editPersonDescriptor.setAddress(ParserUtil.parseAddress(argMultimap.getValue(PREFIX_ADDRESS).get())); } + if (argMultimap.getValue(PREFIX_SKILLS).isPresent()) { + editPersonDescriptor.setSkills(ParserUtil.parseSkills(argMultimap.getValue(PREFIX_SKILLS).get())); + } if (argMultimap.getValue(PREFIX_STATUS).isPresent()) { editPersonDescriptor.setStatus(ParserUtil.parseStatus(argMultimap.getValue(PREFIX_STATUS).get())); } diff --git a/src/main/java/seedu/address/logic/parser/ParserUtil.java b/src/main/java/seedu/address/logic/parser/ParserUtil.java index 9ee93ec0130..69718dbad8b 100644 --- a/src/main/java/seedu/address/logic/parser/ParserUtil.java +++ b/src/main/java/seedu/address/logic/parser/ParserUtil.java @@ -14,6 +14,7 @@ import seedu.address.model.person.Name; import seedu.address.model.person.Note; import seedu.address.model.person.Phone; +import seedu.address.model.person.Skills; import seedu.address.model.person.Status; import seedu.address.model.tag.Tag; @@ -153,4 +154,19 @@ public static Set parseTags(Collection tags) throws ParseException } return tagSet; } + + /** + * Parses a {@code String skills} into a {@code Skills}. + * Leading and trailing whitespaces will be trimmed. + * + * @throws ParseException if the given {@code skills} is invalid. + */ + public static Skills parseSkills(String skills) throws ParseException { + requireNonNull(skills); + String trimmedSkills = skills.trim(); + if (!Skills.isValidSkillsString(trimmedSkills)) { + throw new ParseException(Skills.MESSAGE_CONSTRAINTS); + } + return new Skills(trimmedSkills); + } } diff --git a/src/main/java/seedu/address/model/person/Person.java b/src/main/java/seedu/address/model/person/Person.java index b291012e742..a0850426eff 100644 --- a/src/main/java/seedu/address/model/person/Person.java +++ b/src/main/java/seedu/address/model/person/Person.java @@ -23,6 +23,8 @@ public class Person { // Data fields private final Address address; + private final Skills skills; + private final Status status; private final Note note; private final Set tags = new HashSet<>(); @@ -30,13 +32,14 @@ public class Person { /** * Every field must be present and not null. */ - public Person(Name name, Phone phone, Email email, Address address, Status status, - Note note, Set tags) { - requireAllNonNull(name, phone, email, address, status, note, tags); + public Person(Name name, Phone phone, Email email, Address address, Skills skills, + Status status, Note note, Set tags) { + requireAllNonNull(name, phone, email, address, skills, status, note, tags); this.name = name; this.phone = phone; this.email = email; this.address = address; + this.skills = skills; // From feature/add-skills this.status = status; // From feature/add-application-status this.note = note; // New feature (Week 8) this.tags.addAll(tags); @@ -58,6 +61,9 @@ public Address getAddress() { return address; } + public Skills getSkills() { + return skills; + } public Status getStatus() { return status; } @@ -107,6 +113,7 @@ public boolean equals(Object other) { && phone.equals(otherPerson.phone) && email.equals(otherPerson.email) && address.equals(otherPerson.address) + && skills.equals(otherPerson.skills) && status.equals(otherPerson.status) && note.equals(otherPerson.note) && tags.equals(otherPerson.tags); @@ -115,7 +122,7 @@ public boolean equals(Object other) { @Override public int hashCode() { // use this method for custom fields hashing instead of implementing your own - return Objects.hash(name, phone, email, address, status, note, tags); + return Objects.hash(name, phone, email, address, skills, status, note, tags); } @Override @@ -125,6 +132,7 @@ public String toString() { .add("phone", phone) .add("email", email) .add("address", address) + .add("skills", skills) .add("status", status) .add("note", note) .add("tags", tags) diff --git a/src/main/java/seedu/address/model/person/Skills.java b/src/main/java/seedu/address/model/person/Skills.java new file mode 100644 index 00000000000..c27752ff7a0 --- /dev/null +++ b/src/main/java/seedu/address/model/person/Skills.java @@ -0,0 +1,61 @@ +package seedu.address.model.person; + +import static java.util.Objects.requireNonNull; +import static seedu.address.commons.util.AppUtil.checkArgument; + +/** + * Represents a Person's skills in the TalentSG + * Guarantees: immutable; is valid as declared in {@link #isValidSkillsString(String)} + */ +public class Skills { + + public static final String MESSAGE_CONSTRAINTS = + "Skills should be a non-empty string consisting of alphabetic characters, separated by commas. " + + "Each skill should be between 1 and 30 characters long"; + public static final String VALIDATION_REGEX = "^[a-zA-Z0-9+]+(, [a-zA-Z0-9+]+)*$"; + public final String value; + + /** + * Constructs a {@code Skills}. + * + * @param skills A valid skills string. + */ + public Skills(String skills) { + requireNonNull(skills); + checkArgument(isValidSkillsString(skills), MESSAGE_CONSTRAINTS); + value = skills; + } + + /** + * Returns true if a given string is a valid skill input. + */ + public static boolean isValidSkillsString(String test) { + return test.matches(VALIDATION_REGEX); + } + + @Override + public String toString() { + return value; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + + // instanceof handles nulls + if (!(other instanceof Skills)) { + return false; + } + + Skills otherSkills = (Skills) other; + return value.equals(otherSkills.value); + } + + @Override + public int hashCode() { + return value.hashCode(); + } + +} diff --git a/src/main/java/seedu/address/model/util/SampleDataUtil.java b/src/main/java/seedu/address/model/util/SampleDataUtil.java index 000b12da854..a36d2064f7d 100644 --- a/src/main/java/seedu/address/model/util/SampleDataUtil.java +++ b/src/main/java/seedu/address/model/util/SampleDataUtil.java @@ -12,6 +12,7 @@ import seedu.address.model.person.Note; import seedu.address.model.person.Person; import seedu.address.model.person.Phone; +import seedu.address.model.person.Skills; import seedu.address.model.person.Status; import seedu.address.model.tag.Tag; @@ -23,22 +24,28 @@ public class SampleDataUtil { public static Person[] getSamplePersons() { return new Person[] { new Person(new Name("Alex Yeoh"), new Phone("87438807"), new Email("alexyeoh@example.com"), - new Address("Blk 30 Geylang Street 29, #06-40"), new Status("Interviewed"), EMPTY_NOTE, + new Address("Blk 30 Geylang Street 29, #06-40"), new Skills("Java, Python, C++"), + new Status("Interviewed"), EMPTY_NOTE, getTagSet("friends")), new Person(new Name("Bernice Yu"), new Phone("99272758"), new Email("berniceyu@example.com"), - new Address("Blk 30 Lorong 3 Serangoon Gardens, #07-18"), new Status("Hired"), EMPTY_NOTE, + new Address("Blk 30 Lorong 3 Serangoon Gardens, #07-18"), new Skills("Java, Python, C++"), + new Status("Hired"), EMPTY_NOTE, getTagSet("colleagues", "friends")), new Person(new Name("Charlotte Oliveiro"), new Phone("93210283"), new Email("charlotte@example.com"), - new Address("Blk 11 Ang Mo Kio Street 74, #11-04"), new Status("Rejected"), EMPTY_NOTE, + new Address("Blk 11 Ang Mo Kio Street 74, #11-04"), new Skills("Java, Python, C++"), + new Status("Rejected"), EMPTY_NOTE, getTagSet("neighbours")), new Person(new Name("David Li"), new Phone("91031282"), new Email("lidavid@example.com"), - new Address("Blk 436 Serangoon Gardens Street 26, #16-43"), new Status("Applied"), EMPTY_NOTE, + new Address("Blk 436 Serangoon Gardens Street 26, #16-43"), new Skills("Java, Python, C++"), + new Status("Applied"), EMPTY_NOTE, getTagSet("family")), new Person(new Name("Irfan Ibrahim"), new Phone("92492021"), new Email("irfan@example.com"), - new Address("Blk 47 Tampines Street 20, #17-35"), new Status("Onboarding"), EMPTY_NOTE, + new Address("Blk 47 Tampines Street 20, #17-35"), new Skills("Java, Python, C++"), + new Status("Onboarding"), EMPTY_NOTE, getTagSet("classmates")), new Person(new Name("Roy Balakrishnan"), new Phone("92624417"), new Email("royb@example.com"), - new Address("Blk 45 Aljunied Street 85, #11-31"), new Status("Screening"), EMPTY_NOTE, + new Address("Blk 45 Aljunied Street 85, #11-31"), new Skills("Java, Python, C++"), + new Status("Screening"), EMPTY_NOTE, getTagSet("colleagues")) }; } diff --git a/src/main/java/seedu/address/storage/JsonAdaptedPerson.java b/src/main/java/seedu/address/storage/JsonAdaptedPerson.java index 76208b2fc90..e6e71582b12 100644 --- a/src/main/java/seedu/address/storage/JsonAdaptedPerson.java +++ b/src/main/java/seedu/address/storage/JsonAdaptedPerson.java @@ -16,6 +16,7 @@ import seedu.address.model.person.Note; import seedu.address.model.person.Person; import seedu.address.model.person.Phone; +import seedu.address.model.person.Skills; import seedu.address.model.person.Status; import seedu.address.model.tag.Tag; @@ -30,6 +31,7 @@ class JsonAdaptedPerson { private final String phone; private final String email; private final String address; + private final String skills; private final String status; private final String note; private final List tags = new ArrayList<>(); @@ -40,12 +42,14 @@ class JsonAdaptedPerson { @JsonCreator public JsonAdaptedPerson(@JsonProperty("name") String name, @JsonProperty("phone") String phone, @JsonProperty("email") String email, @JsonProperty("address") String address, + @JsonProperty("skills") String skills, @JsonProperty("status") String status, @JsonProperty("note") String note, @JsonProperty("tags") List tags) { this.name = name; this.phone = phone; this.email = email; this.address = address; + this.skills = skills; this.status = status; this.note = note; if (tags != null) { @@ -61,6 +65,7 @@ public JsonAdaptedPerson(Person source) { phone = source.getPhone().value; email = source.getEmail().value; address = source.getAddress().value; + skills = source.getSkills().value; status = source.getStatus().value; note = source.getNote().value; tags.addAll(source.getTags().stream() @@ -123,8 +128,17 @@ public Person toModelType() throws IllegalValueException { } final Note modelNote = new Note(note); + if (skills == null) { + throw new IllegalValueException(String.format(MISSING_FIELD_MESSAGE_FORMAT, Skills.class.getSimpleName())); + } + if (!Skills.isValidSkillsString(skills)) { + throw new IllegalValueException(Skills.MESSAGE_CONSTRAINTS); + } + final Skills modelSkills = new Skills(skills); + final Set modelTags = new HashSet<>(personTags); - return new Person(modelName, modelPhone, modelEmail, modelAddress, modelStatus, modelNote, modelTags); + return new Person(modelName, modelPhone, modelEmail, modelAddress, modelSkills, modelStatus, modelNote, + modelTags); } } diff --git a/src/main/java/seedu/address/ui/PersonCard.java b/src/main/java/seedu/address/ui/PersonCard.java index 08dd298527d..5a5696ed31a 100644 --- a/src/main/java/seedu/address/ui/PersonCard.java +++ b/src/main/java/seedu/address/ui/PersonCard.java @@ -39,12 +39,15 @@ public class PersonCard extends UiPart { @FXML private Label email; @FXML + private Label skills; + @FXML private Label status; @FXML private Label note; @FXML private FlowPane tags; + /** * Creates a {@code PersonCode} with the given {@code Person} and index to display. */ @@ -56,6 +59,7 @@ public PersonCard(Person person, int displayedIndex) { phone.setText(person.getPhone().value); address.setText(person.getAddress().value); email.setText(person.getEmail().value); + skills.setText(person.getSkills().value); status.setText(person.getStatus().value); note.setText(person.getNote().value); person.getTags().stream() diff --git a/src/main/resources/view/PersonListCard.fxml b/src/main/resources/view/PersonListCard.fxml index ee015d54a7b..6205737381a 100644 --- a/src/main/resources/view/PersonListCard.fxml +++ b/src/main/resources/view/PersonListCard.fxml @@ -31,6 +31,7 @@