Skip to content

Commit

Permalink
Merge pull request #16 from AY2324S2-CS2103T-W09-1/revert-15-tutorial…
Browse files Browse the repository at this point in the history
…-adding-command

Revert "Tutorial adding command"
  • Loading branch information
LimZiJia authored Mar 6, 2024
2 parents 8d34c34 + b24538e commit 5e4abde
Show file tree
Hide file tree
Showing 19 changed files with 12 additions and 446 deletions.
4 changes: 1 addition & 3 deletions src/main/java/seedu/address/logic/commands/EditCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import seedu.address.model.person.Name;
import seedu.address.model.person.Person;
import seedu.address.model.person.Phone;
import seedu.address.model.person.Remark;
import seedu.address.model.tag.Tag;

/**
Expand Down Expand Up @@ -100,10 +99,9 @@ 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());
Remark updatedRemark = personToEdit.getRemark(); // edit command does not allow editing remarks
Set<Tag> updatedTags = editPersonDescriptor.getTags().orElse(personToEdit.getTags());

return new Person(updatedName, updatedPhone, updatedEmail, updatedAddress, updatedRemark, updatedTags);
return new Person(updatedName, updatedPhone, updatedEmail, updatedAddress, updatedTags);
}

@Override
Expand Down
96 changes: 0 additions & 96 deletions src/main/java/seedu/address/logic/commands/RemarkCommand.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import seedu.address.model.person.Name;
import seedu.address.model.person.Person;
import seedu.address.model.person.Phone;
import seedu.address.model.person.Remark;
import seedu.address.model.tag.Tag;

/**
Expand All @@ -44,10 +43,9 @@ public AddCommand parse(String args) throws ParseException {
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());
Remark remark = new Remark(""); // add command does not allow adding remarks straight away
Set<Tag> tagList = ParserUtil.parseTags(argMultimap.getAllValues(PREFIX_TAG));

Person person = new Person(name, phone, email, address, remark, tagList);
Person person = new Person(name, phone, email, address, tagList);

return new AddCommand(person);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import seedu.address.logic.commands.FindCommand;
import seedu.address.logic.commands.HelpCommand;
import seedu.address.logic.commands.ListCommand;
import seedu.address.logic.commands.RemarkCommand;
import seedu.address.logic.parser.exceptions.ParseException;

/**
Expand Down Expand Up @@ -69,9 +68,6 @@ public Command parseCommand(String userInput) throws ParseException {
case FindCommand.COMMAND_WORD:
return new FindCommandParser().parse(arguments);

case RemarkCommand.COMMAND_WORD:
return new RemarkCommandParser().parse(arguments);

case ListCommand.COMMAND_WORD:
return new ListCommand();

Expand Down
1 change: 0 additions & 1 deletion src/main/java/seedu/address/logic/parser/CliSyntax.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ public class CliSyntax {
public static final Prefix PREFIX_PHONE = new Prefix("p/");
public static final Prefix PREFIX_EMAIL = new Prefix("e/");
public static final Prefix PREFIX_ADDRESS = new Prefix("a/");
public static final Prefix PREFIX_REMARK = new Prefix("r/");
public static final Prefix PREFIX_TAG = new Prefix("t/");

}
37 changes: 0 additions & 37 deletions src/main/java/seedu/address/logic/parser/RemarkCommandParser.java

This file was deleted.

9 changes: 1 addition & 8 deletions src/main/java/seedu/address/model/person/Person.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,17 @@ public class Person {

// Data fields
private final Address address;
private final Remark remark;
private final Set<Tag> tags = new HashSet<>();

/**
* Every field must be present and not null.
*/
public Person(Name name, Phone phone, Email email, Address address, Remark remark, Set<Tag> tags) {
public Person(Name name, Phone phone, Email email, Address address, Set<Tag> tags) {
requireAllNonNull(name, phone, email, address, tags);
this.name = name;
this.phone = phone;
this.email = email;
this.address = address;
this.remark = remark;
this.tags.addAll(tags);
}

Expand All @@ -51,10 +49,6 @@ public Email getEmail() {
return email;
}

public Remark getRemark() {
return remark;
}

public Address getAddress() {
return address;
}
Expand Down Expand Up @@ -116,7 +110,6 @@ public String toString() {
.add("phone", phone)
.add("email", email)
.add("address", address)
.add("remark", remark)
.add("tags", tags)
.toString();
}
Expand Down
38 changes: 0 additions & 38 deletions src/main/java/seedu/address/model/person/Remark.java

This file was deleted.

16 changes: 6 additions & 10 deletions src/main/java/seedu/address/model/util/SampleDataUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,31 @@
import seedu.address.model.person.Name;
import seedu.address.model.person.Person;
import seedu.address.model.person.Phone;
import seedu.address.model.person.Remark;
import seedu.address.model.tag.Tag;

/**
* Contains utility methods for populating {@code AddressBook} with sample data.
*/
public class SampleDataUtil {

public static final Remark EMPTY_REMARK = new Remark("");

public static Person[] getSamplePersons() {
return new Person[] {
new Person(new Name("Alex Yeoh"), new Phone("87438807"), new Email("[email protected]"),
new Address("Blk 30 Geylang Street 29, #06-40"), EMPTY_REMARK,
new Address("Blk 30 Geylang Street 29, #06-40"),
getTagSet("friends")),
new Person(new Name("Bernice Yu"), new Phone("99272758"), new Email("[email protected]"),
new Address("Blk 30 Lorong 3 Serangoon Gardens, #07-18"), EMPTY_REMARK,
new Address("Blk 30 Lorong 3 Serangoon Gardens, #07-18"),
getTagSet("colleagues", "friends")),
new Person(new Name("Charlotte Oliveiro"), new Phone("93210283"), new Email("[email protected]"),
new Address("Blk 11 Ang Mo Kio Street 74, #11-04"), EMPTY_REMARK,
new Address("Blk 11 Ang Mo Kio Street 74, #11-04"),
getTagSet("neighbours")),
new Person(new Name("David Li"), new Phone("91031282"), new Email("[email protected]"),
new Address("Blk 436 Serangoon Gardens Street 26, #16-43"), EMPTY_REMARK,
new Address("Blk 436 Serangoon Gardens Street 26, #16-43"),
getTagSet("family")),
new Person(new Name("Irfan Ibrahim"), new Phone("92492021"), new Email("[email protected]"),
new Address("Blk 47 Tampines Street 20, #17-35"), EMPTY_REMARK,
new Address("Blk 47 Tampines Street 20, #17-35"),
getTagSet("classmates")),
new Person(new Name("Roy Balakrishnan"), new Phone("92624417"), new Email("[email protected]"),
new Address("Blk 45 Aljunied Street 85, #11-31"), EMPTY_REMARK,
new Address("Blk 45 Aljunied Street 85, #11-31"),
getTagSet("colleagues"))
};
}
Expand Down
6 changes: 1 addition & 5 deletions src/main/java/seedu/address/storage/JsonAdaptedPerson.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import seedu.address.model.person.Name;
import seedu.address.model.person.Person;
import seedu.address.model.person.Phone;
import seedu.address.model.person.Remark;
import seedu.address.model.tag.Tag;

/**
Expand Down Expand Up @@ -103,11 +102,8 @@ public Person toModelType() throws IllegalValueException {
}
final Address modelAddress = new Address(address);

final Remark modelRemark = new Remark(""); //TODO: Implement parsing and marshalling in the storage commit.


final Set<Tag> modelTags = new HashSet<>(personTags);
return new Person(modelName, modelPhone, modelEmail, modelAddress, modelRemark, modelTags);
return new Person(modelName, modelPhone, modelEmail, modelAddress, modelTags);
}

}
4 changes: 0 additions & 4 deletions src/main/java/seedu/address/ui/PersonCard.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ public class PersonCard extends UiPart<Region> {
@FXML
private FlowPane tags;

@FXML
private Label remark;

/**
* Creates a {@code PersonCode} with the given {@code Person} and index to display.
*/
Expand All @@ -54,7 +51,6 @@ public PersonCard(Person person, int displayedIndex) {
name.setText(person.getName().fullName);
phone.setText(person.getPhone().value);
address.setText(person.getAddress().value);
remark.setText(person.getRemark().value);
email.setText(person.getEmail().value);
person.getTags().stream()
.sorted(Comparator.comparing(tag -> tag.tagName))
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/view/PersonListCard.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
<Label fx:id="phone" styleClass="cell_small_label" text="\$phone" />
<Label fx:id="address" styleClass="cell_small_label" text="\$address" />
<Label fx:id="email" styleClass="cell_small_label" text="\$email" />
<Label fx:id="remark" styleClass="cell_small_label" text="\$remark" />
</VBox>
</GridPane>
</HBox>
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ public class CommandTestUtil {
public static final String VALID_EMAIL_BOB = "[email protected]";
public static final String VALID_ADDRESS_AMY = "Block 312, Amy Street 1";
public static final String VALID_ADDRESS_BOB = "Block 123, Bobby Street 3";
public static final String VALID_REMARK_AMY = "Like skiing.";
public static final String VALID_REMARK_BOB = "Favourite pastime: Eating";
public static final String VALID_TAG_HUSBAND = "husband";
public static final String VALID_TAG_FRIEND = "friend";

Expand Down
Loading

0 comments on commit 5e4abde

Please sign in to comment.