From 6d14a0b0cdda659e4b96b420eaaa26ec20d4ca2d Mon Sep 17 00:00:00 2001 From: jessica2828 Date: Tue, 29 Oct 2024 16:24:24 +0800 Subject: [PATCH 01/18] Update DeleteCommandTest to test the behaviour of delete by module --- .../logic/commands/DeleteCommandTest.java | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/test/java/seedu/address/logic/commands/DeleteCommandTest.java b/src/test/java/seedu/address/logic/commands/DeleteCommandTest.java index 8c93b162633..3714535784a 100644 --- a/src/test/java/seedu/address/logic/commands/DeleteCommandTest.java +++ b/src/test/java/seedu/address/logic/commands/DeleteCommandTest.java @@ -185,4 +185,33 @@ public void execute_invalidStudentIdWithModule_throwsCommandException() { deleteCommand, model, String.format(DeleteCommand.MESSAGE_PERSON_NOT_FOUND, invalidStudentId)); } + @Test + public void execute_validStudentIdAndModule_success() { + Person personWithModule = model.getFilteredPersonList().get(INDEX_FIRST_PERSON.getZeroBased()); + StudentId studentIdToDelete = personWithModule.getStudentId(); + Module moduleToDelete = personWithModule.getModules().get(0); // Assuming this person has at least one module + + DeleteCommand deleteCommand = new DeleteCommand(studentIdToDelete, moduleToDelete); + String expectedMessage = String.format(DeleteCommand.MESSAGE_DELETE_MODULE_SUCCESS, moduleToDelete); + + ModelManager expectedModel = new ModelManager(model.getEduContacts(), new UserPrefs()); + expectedModel.deleteModule(personWithModule, moduleToDelete); + + assertCommandSuccess(deleteCommand, model, expectedMessage, expectedModel); + } + + @Test + public void execute_validModuleDeletionAndCheckModuleList() { + Person personWithModules = model.getFilteredPersonList().get(INDEX_FIRST_PERSON.getZeroBased()); + StudentId studentIdToDelete = personWithModules.getStudentId(); + Module moduleToDelete = personWithModules.getModules().get(0); + + DeleteCommand deleteCommand = new DeleteCommand(studentIdToDelete, moduleToDelete); + + String expectedMessage = String.format(DeleteCommand.MESSAGE_DELETE_MODULE_SUCCESS, moduleToDelete); + assertCommandSuccess(deleteCommand, model, expectedMessage, model); + + Person updatedPerson = model.getFilteredPersonList().get(INDEX_FIRST_PERSON.getZeroBased()); + assertFalse(updatedPerson.getModules().contains(moduleToDelete)); // Check the updated person + } } From e319b376c730fbe2b70c352ac9c6f89cc0e7807f Mon Sep 17 00:00:00 2001 From: jessica2828 Date: Tue, 29 Oct 2024 16:42:55 +0800 Subject: [PATCH 02/18] Fix DeleteCommand message usage formatting --- src/main/java/seedu/address/logic/commands/DeleteCommand.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/seedu/address/logic/commands/DeleteCommand.java b/src/main/java/seedu/address/logic/commands/DeleteCommand.java index 4be12c252e3..2304298a825 100644 --- a/src/main/java/seedu/address/logic/commands/DeleteCommand.java +++ b/src/main/java/seedu/address/logic/commands/DeleteCommand.java @@ -25,9 +25,9 @@ public class DeleteCommand extends Command { + "Parameters: " + "ID\n" + "or: " - + "ID MODULE_KEYWORD" + + "ID MODULE_KEYWORD\n" + "Example: " + COMMAND_WORD + " " - + "12345678" + + "12345678\n" + "or: " + COMMAND_WORD + " " + "12345678 m/CS2103T"; From fa2ae5512da834bd4f83420d3ef178d973353df7 Mon Sep 17 00:00:00 2001 From: jessica2828 Date: Wed, 6 Nov 2024 11:42:52 +0800 Subject: [PATCH 03/18] Update filter command such that it cannot accept 2 or more prefixes --- .../logic/parser/FilterCommandParser.java | 32 +++++++++++++------ 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/src/main/java/seedu/address/logic/parser/FilterCommandParser.java b/src/main/java/seedu/address/logic/parser/FilterCommandParser.java index 06fa7c4b6f7..8722f50bbbb 100644 --- a/src/main/java/seedu/address/logic/parser/FilterCommandParser.java +++ b/src/main/java/seedu/address/logic/parser/FilterCommandParser.java @@ -1,9 +1,7 @@ package seedu.address.logic.parser; import static seedu.address.logic.Messages.MESSAGE_INVALID_COMMAND_FORMAT; -import static seedu.address.logic.parser.CliSyntax.PREFIX_COURSE; -import static seedu.address.logic.parser.CliSyntax.PREFIX_MODULE; -import static seedu.address.logic.parser.CliSyntax.PREFIX_NAME; +import static seedu.address.logic.parser.CliSyntax.*; import java.util.Arrays; import java.util.List; @@ -27,6 +25,7 @@ public class FilterCommandParser implements Parser { public FilterCommand parse(String args) throws ParseException { ArgumentMultimap argMultimap = ArgumentTokenizer.tokenize(args, PREFIX_NAME, PREFIX_MODULE, PREFIX_COURSE); + argMultimap.verifyNoDuplicatePrefixesFor(PREFIX_NAME, PREFIX_MODULE, PREFIX_COURSE); validateArguments(argMultimap); if (argMultimap.getValue(PREFIX_NAME).isPresent()) { @@ -42,12 +41,27 @@ public FilterCommand parse(String args) throws ParseException { private void validateArguments(ArgumentMultimap argMultimap) throws ParseException { if (!argMultimap.getPreamble().isEmpty() - || argMultimap.getValue(PREFIX_NAME).isPresent() - && argMultimap.getValue(PREFIX_NAME).get().isEmpty() - || argMultimap.getValue(PREFIX_MODULE).isPresent() - && argMultimap.getValue(PREFIX_MODULE).get().isEmpty() - || argMultimap.getValue(PREFIX_COURSE).isPresent() - && argMultimap.getValue(PREFIX_COURSE).get().isEmpty()) { + || (argMultimap.getValue(PREFIX_NAME).isPresent() + && argMultimap.getValue(PREFIX_NAME).get().isEmpty()) + || (argMultimap.getValue(PREFIX_MODULE).isPresent() + && argMultimap.getValue(PREFIX_MODULE).get().isEmpty()) + || (argMultimap.getValue(PREFIX_COURSE).isPresent() + && argMultimap.getValue(PREFIX_COURSE).get().isEmpty())) { + throw new ParseException(String.format(MESSAGE_INVALID_COMMAND_FORMAT, FilterCommand.MESSAGE_USAGE)); + } + + int prefixCount = 0; + if (argMultimap.getValue(PREFIX_NAME).isPresent()) { + prefixCount++; + } + if (argMultimap.getValue(PREFIX_MODULE).isPresent()) { + prefixCount++; + } + if (argMultimap.getValue(PREFIX_COURSE).isPresent()) { + prefixCount++; + } + + if (prefixCount > 1) { throw new ParseException(String.format(MESSAGE_INVALID_COMMAND_FORMAT, FilterCommand.MESSAGE_USAGE)); } } From bca1e520b05611bc1f4e9675085f0f7baba15a9c Mon Sep 17 00:00:00 2001 From: jessica2828 Date: Wed, 6 Nov 2024 11:43:17 +0800 Subject: [PATCH 04/18] Update tests for filter according to new behaviour --- .../address/logic/parser/FilterCommandParserTest.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/test/java/seedu/address/logic/parser/FilterCommandParserTest.java b/src/test/java/seedu/address/logic/parser/FilterCommandParserTest.java index cb81b5cf775..dcb0a1b5e7a 100644 --- a/src/test/java/seedu/address/logic/parser/FilterCommandParserTest.java +++ b/src/test/java/seedu/address/logic/parser/FilterCommandParserTest.java @@ -1,6 +1,7 @@ package seedu.address.logic.parser; import static seedu.address.logic.Messages.MESSAGE_INVALID_COMMAND_FORMAT; +import static seedu.address.logic.parser.CliSyntax.PREFIX_NAME; import static seedu.address.logic.parser.CommandParserTestUtil.assertParseFailure; import static seedu.address.logic.parser.CommandParserTestUtil.assertParseSuccess; @@ -9,6 +10,7 @@ import org.junit.jupiter.api.Test; +import seedu.address.logic.Messages; import seedu.address.logic.commands.FilterCommand; import seedu.address.model.person.NameContainsKeywordsPredicate; @@ -48,4 +50,12 @@ public void parse_invalidArgs_throwsParseException() { assertParseFailure(parser, " x/alice", String.format(MESSAGE_INVALID_COMMAND_FORMAT, FilterCommand.MESSAGE_USAGE)); } + + @Test + public void parse_multiplePrefixes_throwsParseException() { + assertParseFailure(parser, " n/alice m/CS2103", + String.format(MESSAGE_INVALID_COMMAND_FORMAT, FilterCommand.MESSAGE_USAGE)); + assertParseFailure(parser, " n/alex n/alice", + Messages.getErrorMessageForDuplicatePrefixes(PREFIX_NAME)); + } } From c699939dadac9b5b780029c96bfd3c4e29547545 Mon Sep 17 00:00:00 2001 From: jessica2828 Date: Wed, 6 Nov 2024 12:29:25 +0800 Subject: [PATCH 05/18] Update UG --- docs/UserGuide.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/UserGuide.md b/docs/UserGuide.md index 9cd7c6c71a9..8c574bf2a8e 100644 --- a/docs/UserGuide.md +++ b/docs/UserGuide.md @@ -26,6 +26,7 @@ EduContacts is a **desktop app for Educators in Tertiary Institution to manage c - [Listing students by certain attributes : `filter`](#listing-students-by-certain-attributes-filter) - [Adding a module to a student: `module`](#adding-a-module-to-a-student-module) - [Deleting a person : `delete`](#deleting-a-person-delete) + - [Finding a person: `find`](#finding-a-person--find) - [Clearing all entries : `clear`](#clearing-all-entries-clear) - [Exiting the program : `exit`](#exiting-the-program-exit) 3. [FAQ](#faq) @@ -239,6 +240,15 @@ Examples: * `filter n/alex david` returns `Alex Yeoh`, `David Li` ![result for 'find alex david'](images/filterAlexDavidResult.png) +
+ + + +**Note:** After using `filter`, only the persons displayed in the filtered list can be edited or deleted, and persons not shown in this truncated list cannot be modified. + +To return to display the full list of persons, use `list` command. + + ### Adding a module to a student: `module` @@ -277,7 +287,7 @@ Format: `find ID` * Finds student with the specified `ID`. Examples: -* `find 12345678` will find student contact with `ID: 12345678` and display their details. +* `find 12345678` will find student contact with `ID: 12345678` and display their details ### Clearing all entries : `clear` From 9f85df399543a938194707b0b8d9053f723aa687 Mon Sep 17 00:00:00 2001 From: jessica2828 Date: Wed, 6 Nov 2024 12:29:42 +0800 Subject: [PATCH 06/18] Update deletecommand message usage --- src/main/java/seedu/address/logic/commands/DeleteCommand.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/seedu/address/logic/commands/DeleteCommand.java b/src/main/java/seedu/address/logic/commands/DeleteCommand.java index 4be12c252e3..2304298a825 100644 --- a/src/main/java/seedu/address/logic/commands/DeleteCommand.java +++ b/src/main/java/seedu/address/logic/commands/DeleteCommand.java @@ -25,9 +25,9 @@ public class DeleteCommand extends Command { + "Parameters: " + "ID\n" + "or: " - + "ID MODULE_KEYWORD" + + "ID MODULE_KEYWORD\n" + "Example: " + COMMAND_WORD + " " - + "12345678" + + "12345678\n" + "or: " + COMMAND_WORD + " " + "12345678 m/CS2103T"; From 5719b812857cdff2ffa333dfae629adaae7f8fdb Mon Sep 17 00:00:00 2001 From: jessica2828 Date: Wed, 6 Nov 2024 22:54:10 +0800 Subject: [PATCH 07/18] Update error message: delete and find command --- src/main/java/seedu/address/logic/Messages.java | 4 ++-- src/main/java/seedu/address/logic/commands/DeleteCommand.java | 3 ++- src/main/java/seedu/address/logic/commands/FindCommand.java | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/seedu/address/logic/Messages.java b/src/main/java/seedu/address/logic/Messages.java index eb0220ac86d..6c315814f94 100644 --- a/src/main/java/seedu/address/logic/Messages.java +++ b/src/main/java/seedu/address/logic/Messages.java @@ -14,8 +14,8 @@ public class Messages { public static final String MESSAGE_UNKNOWN_COMMAND = "Unknown command"; public static final String MESSAGE_INVALID_COMMAND_FORMAT = "Invalid command format! \n%1$s"; - public static final String MESSAGE_INVALID_PERSON_DISPLAYED_INDEX = "The person index provided is invalid"; - public static final String MESSAGE_INVALID_PERSON_DISPLAYED_STUDENTID = "The person studentID provided is invalid"; + public static final String MESSAGE_INVALID_PERSON_DISPLAYED_STUDENTID = + "No student with this Student ID is currently being displayed"; public static final String MESSAGE_PERSONS_LISTED_OVERVIEW = "%1$d persons listed!"; public static final String MESSAGE_DUPLICATE_FIELDS = "Multiple values specified for the following single-valued field(s): "; diff --git a/src/main/java/seedu/address/logic/commands/DeleteCommand.java b/src/main/java/seedu/address/logic/commands/DeleteCommand.java index 2304298a825..658acb38988 100644 --- a/src/main/java/seedu/address/logic/commands/DeleteCommand.java +++ b/src/main/java/seedu/address/logic/commands/DeleteCommand.java @@ -34,7 +34,8 @@ public class DeleteCommand extends Command { public static final String MESSAGE_DELETE_PERSON_SUCCESS = "Deleted Student: %1$s"; public static final String MESSAGE_DELETE_MODULE_SUCCESS = "Deleted Module: %1$s"; - public static final String MESSAGE_PERSON_NOT_FOUND = "No student is found with Student ID: %1$s"; + public static final String MESSAGE_PERSON_NOT_FOUND = + "No student with Student ID: %1$s is currently being displayed"; public static final String MESSAGE_MODULE_NOT_FOUND = "No module is found for this student: %1$s"; private final StudentId studentId; private final Module module; diff --git a/src/main/java/seedu/address/logic/commands/FindCommand.java b/src/main/java/seedu/address/logic/commands/FindCommand.java index 51590108c68..f2343115282 100644 --- a/src/main/java/seedu/address/logic/commands/FindCommand.java +++ b/src/main/java/seedu/address/logic/commands/FindCommand.java @@ -26,7 +26,8 @@ public class FindCommand extends Command { + "12345678"; public static final String MESSAGE_FIND_PERSON_SUCCESS = "Found Student: %1$s"; - public static final String MESSAGE_PERSON_NOT_FOUND = "No student is found with Student ID: %1$s"; + public static final String MESSAGE_PERSON_NOT_FOUND = + "No student with Student ID: %1$s is currently being displayed"; private final StudentId studentId; /** From 9943a26c11cfcef45985f96858804616f64e00c0 Mon Sep 17 00:00:00 2001 From: jessica2828 Date: Wed, 6 Nov 2024 22:54:37 +0800 Subject: [PATCH 08/18] Fix address can take random characters --- src/main/java/seedu/address/model/person/Address.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/seedu/address/model/person/Address.java b/src/main/java/seedu/address/model/person/Address.java index 7a2b7be5c34..c04c4c6027f 100644 --- a/src/main/java/seedu/address/model/person/Address.java +++ b/src/main/java/seedu/address/model/person/Address.java @@ -9,13 +9,15 @@ */ 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 only take any alphabets, numbers, or these following characters\n" + + " # , - and it should not be blank"; /* * The first character of the address must not be a whitespace, * otherwise " " (a blank string) becomes a valid input. */ - public static final String VALIDATION_REGEX = "[^\\s].*"; + public static final String VALIDATION_REGEX = "^[A-Za-z0-9#,'-]+.*$"; public final String value; From 003c6d39ee76c5d1a899ff7406d3240587c183af Mon Sep 17 00:00:00 2001 From: jessica2828 Date: Wed, 6 Nov 2024 23:04:47 +0800 Subject: [PATCH 09/18] Update parser logic --- .../address/logic/parser/FilterCommandParser.java | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/main/java/seedu/address/logic/parser/FilterCommandParser.java b/src/main/java/seedu/address/logic/parser/FilterCommandParser.java index 8722f50bbbb..194b2aac71c 100644 --- a/src/main/java/seedu/address/logic/parser/FilterCommandParser.java +++ b/src/main/java/seedu/address/logic/parser/FilterCommandParser.java @@ -5,6 +5,7 @@ import java.util.Arrays; import java.util.List; +import java.util.stream.Stream; import seedu.address.logic.commands.FilterCommand; import seedu.address.logic.parser.exceptions.ParseException; @@ -50,16 +51,9 @@ private void validateArguments(ArgumentMultimap argMultimap) throws ParseExcepti throw new ParseException(String.format(MESSAGE_INVALID_COMMAND_FORMAT, FilterCommand.MESSAGE_USAGE)); } - int prefixCount = 0; - if (argMultimap.getValue(PREFIX_NAME).isPresent()) { - prefixCount++; - } - if (argMultimap.getValue(PREFIX_MODULE).isPresent()) { - prefixCount++; - } - if (argMultimap.getValue(PREFIX_COURSE).isPresent()) { - prefixCount++; - } + long prefixCount = Stream.of(PREFIX_NAME, PREFIX_MODULE, PREFIX_COURSE) + .filter(prefix -> argMultimap.getValue(prefix).isPresent()) + .count(); if (prefixCount > 1) { throw new ParseException(String.format(MESSAGE_INVALID_COMMAND_FORMAT, FilterCommand.MESSAGE_USAGE)); From 141770b5cf9b083230fea11b3f35db12ec71ad0c Mon Sep 17 00:00:00 2001 From: jessica2828 Date: Wed, 6 Nov 2024 23:06:02 +0800 Subject: [PATCH 10/18] Update UG --- docs/UserGuide.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/UserGuide.md b/docs/UserGuide.md index 8c574bf2a8e..581bd7d95a9 100644 --- a/docs/UserGuide.md +++ b/docs/UserGuide.md @@ -108,6 +108,9 @@ EduContacts is a **desktop app for Educators in Tertiary Institution to manage c **Notes about the command format:**
+* All command words should be in lowercase. + + * Words in `UPPER_CASE` are the parameters to be supplied by the user.
e.g. in `add n/NAME`, `NAME` is a parameter which can be used as `add n/John Doe`. From c4ed14a6a8a207a348f9094c1b1cd04208646828 Mon Sep 17 00:00:00 2001 From: jessica2828 Date: Wed, 6 Nov 2024 23:46:06 +0800 Subject: [PATCH 11/18] Add assertion --- .../java/seedu/address/logic/parser/FilterCommandParser.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/seedu/address/logic/parser/FilterCommandParser.java b/src/main/java/seedu/address/logic/parser/FilterCommandParser.java index 194b2aac71c..838e9b6e5ce 100644 --- a/src/main/java/seedu/address/logic/parser/FilterCommandParser.java +++ b/src/main/java/seedu/address/logic/parser/FilterCommandParser.java @@ -61,16 +61,19 @@ private void validateArguments(ArgumentMultimap argMultimap) throws ParseExcepti } private FilterCommand createFilterCommandByName(ArgumentMultimap argMultimap) { + assert argMultimap.getValue(PREFIX_NAME).isPresent() : "PREFIX_NAME should be present"; List nameKeywords = Arrays.asList(argMultimap.getValue(PREFIX_NAME).get().split("\\s+")); return new FilterCommand(new NameContainsKeywordsPredicate(nameKeywords)); } private FilterCommand createFilterCommandByModule(ArgumentMultimap argMultimap) { + assert argMultimap.getValue(PREFIX_MODULE).isPresent() : "PREFIX_MODULE should be present"; String moduleKeyword = argMultimap.getValue(PREFIX_MODULE).get(); return new FilterCommand(new ModuleContainsKeywordsPredicate(moduleKeyword)); } private FilterCommand createFilterCommandByCourse(ArgumentMultimap argMultimap) { + assert argMultimap.getValue(PREFIX_COURSE).isPresent() : "PREFIX_COURSE should be present"; List courseKeywords = Arrays.asList(argMultimap.getValue(PREFIX_COURSE).get().split("\\s+")); return new FilterCommand(new CourseContainsKeywordsPredicate(courseKeywords)); } From cb31e977fa7966c1ef8569c6ba57db69473d785b Mon Sep 17 00:00:00 2001 From: jessica2828 Date: Thu, 7 Nov 2024 08:36:48 +0800 Subject: [PATCH 12/18] Fix checkstyle issue --- .../java/seedu/address/logic/parser/FilterCommandParser.java | 4 +++- src/main/java/seedu/address/model/person/Address.java | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/seedu/address/logic/parser/FilterCommandParser.java b/src/main/java/seedu/address/logic/parser/FilterCommandParser.java index 838e9b6e5ce..ddd55433bf4 100644 --- a/src/main/java/seedu/address/logic/parser/FilterCommandParser.java +++ b/src/main/java/seedu/address/logic/parser/FilterCommandParser.java @@ -1,7 +1,9 @@ package seedu.address.logic.parser; import static seedu.address.logic.Messages.MESSAGE_INVALID_COMMAND_FORMAT; -import static seedu.address.logic.parser.CliSyntax.*; +import static seedu.address.logic.parser.CliSyntax.PREFIX_COURSE; +import static seedu.address.logic.parser.CliSyntax.PREFIX_MODULE; +import static seedu.address.logic.parser.CliSyntax.PREFIX_NAME; import java.util.Arrays; import java.util.List; diff --git a/src/main/java/seedu/address/model/person/Address.java b/src/main/java/seedu/address/model/person/Address.java index c04c4c6027f..e94c14ebd4b 100644 --- a/src/main/java/seedu/address/model/person/Address.java +++ b/src/main/java/seedu/address/model/person/Address.java @@ -10,8 +10,8 @@ public class Address { public static final String MESSAGE_CONSTRAINTS = - "Addresses can only take any alphabets, numbers, or these following characters\n" + - " # , - and it should not be blank"; + "Addresses can only take any alphabets, numbers, or these following characters\n" + + " # , - and it should not be blank"; /* * The first character of the address must not be a whitespace, From d7c59e4ef61a1ed8a15378d9781bab48af0a1329 Mon Sep 17 00:00:00 2001 From: jessica2828 Date: Thu, 7 Nov 2024 09:09:44 +0800 Subject: [PATCH 13/18] Edit address message constraints --- src/main/java/seedu/address/model/person/Address.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/seedu/address/model/person/Address.java b/src/main/java/seedu/address/model/person/Address.java index e94c14ebd4b..71320bbee3b 100644 --- a/src/main/java/seedu/address/model/person/Address.java +++ b/src/main/java/seedu/address/model/person/Address.java @@ -11,7 +11,7 @@ public class Address { public static final String MESSAGE_CONSTRAINTS = "Addresses can only take any alphabets, numbers, or these following characters\n" - + " # , - and it should not be blank"; + + " # , - ' and it should not be blank"; /* * The first character of the address must not be a whitespace, From 550f0146c8868387d6e04d7b2929482db9d748df Mon Sep 17 00:00:00 2001 From: JYL27 <143570280+JYL27@users.noreply.github.com> Date: Thu, 7 Nov 2024 16:52:55 +0800 Subject: [PATCH 14/18] Update src/test/java/seedu/address/logic/commands/DeleteCommandTest.java --- .../java/seedu/address/logic/commands/DeleteCommandTest.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/test/java/seedu/address/logic/commands/DeleteCommandTest.java b/src/test/java/seedu/address/logic/commands/DeleteCommandTest.java index bb9bcb9836f..c2a5885133c 100644 --- a/src/test/java/seedu/address/logic/commands/DeleteCommandTest.java +++ b/src/test/java/seedu/address/logic/commands/DeleteCommandTest.java @@ -272,4 +272,5 @@ public void execute_deleteGradedModule_success() { assertCommandSuccess(deleteCommand, model, expectedMessage, expectedModel); } + } From 773bf774b78973c0c432bd551d3ee15385cfe39e Mon Sep 17 00:00:00 2001 From: jessica2828 Date: Thu, 7 Nov 2024 19:30:59 +0800 Subject: [PATCH 15/18] Fix checkstyle trailing whitespace --- README.md | 16 ++++++++-------- docs/DeveloperGuide.md | 22 +++++++++++----------- docs/UserGuide.md | 30 +++++++++++++++--------------- 3 files changed, 34 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index 91fc721873c..30c4fc5be7e 100644 --- a/README.md +++ b/README.md @@ -5,17 +5,17 @@ # EduContacts -**EduContacts** is a desktop application designed for **tertiary teachers and educators** to manage contacts with +**EduContacts** is a desktop application designed for **tertiary teachers and educators** to manage contacts with students, parents, and faculty across multiple classes or educational years. -- It is optimized for those who prefer to work with a **Command Line Interface** (CLI) while still having the +- It is optimized for those who prefer to work with a **Command Line Interface** (CLI) while still having the - benefits of a **Graphical User Interface** (GUI). -- It helps educators keep communication organized, track academic progress, and support parent-teacher interactions +- It helps educators keep communication organized, track academic progress, and support parent-teacher interactions - efficiently, often across large groups. ## Value Proposition -An address book tailored for educators simplifies student and parent contact management, enhances communication +An address book tailored for educators simplifies student and parent contact management, enhances communication tracking, and integrates progress reports, helping teachers save time and foster effective collaboration across the school community. ## Features @@ -23,13 +23,13 @@ tracking, and integrates progress reports, helping teachers save time and foster - **Class/Group-Based Contact Management**: Organize contacts by class, subject, or school year for easy access. - **Parent-Teacher Communication Tracking**: Keep a history of messages or meetings with parents and faculty. - **Student Progress and Grade Tracking**: Link contact information with student records and academic performance. -- **Event Scheduling and Reminders**: Integrate with school calendars to manage parent-teacher meetings, +- **Event Scheduling and Reminders**: Integrate with school calendars to manage parent-teacher meetings, report deadlines, or school events. -- **Group Messaging**: Enable teachers to send messages to an entire class or group of parents at once, +- **Group Messaging**: Enable teachers to send messages to an entire class or group of parents at once, streamlining communication. -- **Custom Fields**: Add notes for individual students (e.g., learning accommodations, +- **Custom Fields**: Add notes for individual students (e.g., learning accommodations, behavioral issues, or special needs). -- **Integration with School Management Systems**: Sync with platforms like Google Classroom or +- **Integration with School Management Systems**: Sync with platforms like Google Classroom or school LMS (Learning Management Systems). ## Getting Started diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index 901d22c5d15..9d2aa842dee 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -71,11 +71,11 @@ The **API** of this component is specified in [`Ui.java`](https://github.com/se- -The UI is managed by the `UiManager` class, which serves as the main controller for managing the UI in EduContacts. +The UI is managed by the `UiManager` class, which serves as the main controller for managing the UI in EduContacts. It serves as the interface layer between the application's backend logic and the JavaFX UI components, ensuring a smooth and consistent user experience. -The UI consists of a `MainWindow` that is made up of the following parts: +The UI consists of a `MainWindow` that is made up of the following parts: * `CommandBox` * Where the user types in his desired command * `ResultDisplay` @@ -84,17 +84,17 @@ The UI consists of a `MainWindow` that is made up of the following parts: * The panel which holds the list of persons in EduContacts, each person represented by a `PersonCard` * `StatusBarFooter` * Designed to show the save location of EduContacts' data -* `PersonDetails` +* `PersonDetails` * A section of the UI that renders when a `FindCommand` is run, showing the resulting person's full details * `PersonCard` * Shows simple and brief details about a person * `HelpWindow` * Displayed by clicking the "Help" button at the top right hand of the screen -All these, including the `MainWindow`, inherit from the abstract `UiPart` class which captures the commonalities between +All these, including the `MainWindow`, inherit from the abstract `UiPart` class which captures the commonalities between classes that represent parts of the visible GUI. -The `UI` component uses the JavaFx UI framework. The layout of these UI parts are defined in matching `.fxml` files that +The `UI` component uses the JavaFx UI framework. The layout of these UI parts are defined in matching `.fxml` files that are in the `src/main/resources/view` folder. For example, the layout of the [`MainWindow`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/java/seedu/address/ui/MainWindow.java) is specified in [`MainWindow.fxml`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/resources/view/MainWindow.fxml) The `UI` component, @@ -547,7 +547,7 @@ Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unli * 2b1. EduContacts overwrites the old grade with the new grade. Use case ends. - + **Use case: UC08 - Add contacts of next-of-kins of a student** **MSS** @@ -653,7 +653,7 @@ testers are expected to do more *exploratory* testing. 1. Download the jar file and copy into an empty folder. - 2. Double-click the jar file.
+ 2. Double-click the jar file.
Expected: Shows the GUI with a set of sample contacts. The window size may not be optimum. 2. Saving window preferences @@ -683,17 +683,17 @@ testers are expected to do more *exploratory* testing. 2. Deleting a person while only one person is being shown 1. Prerequisites: Filter persons using the `filter` command until only one person remains. Multiple persons in the list. Person that remains has Student ID `12345678`. One person in the list has Student ID `11111111` - + 2. Test case: `delete 12345678`
Expected: Person with Student ID `12345678` is deleted. Details of the deleted contact shown in the status message. Timestamp in the status bar is updated. List of persons shown is now blank. - + 3. Test case: `delete 11111111`
Expected: No person is deleted. Error details shown in the status message. Status bar remains the same. 3. Deleting a person while no persons are in the list 1. Prerequisites: Delete all persons in the list using the `clear` command. - + 2. Test case: `delete 12345678`
Expected: No person is deleted. Error details shown in the status message. Status bar remains the same. @@ -704,7 +704,7 @@ testers are expected to do more *exploratory* testing. 1. Dealing with missing data files 1. To simulate a missing file, in the same folder as the jar file, navigate to the `data` folder and delete the `address.json` file in the folder. - + 2. Launch EduContacts by double-clicking the jar file.
Expected: EduContacts is populated by a set of default list of persons. A new `address.json` file will be created in the `data` folder after closing the app or executing a command. diff --git a/docs/UserGuide.md b/docs/UserGuide.md index 90ef0bf4c36..1f9b1abb9c8 100644 --- a/docs/UserGuide.md +++ b/docs/UserGuide.md @@ -8,7 +8,7 @@ # EduContacts User Guide -
+
EduContacts is a **desktop app for Educators in Tertiary Institution to manage contacts, optimized for use via a Command Line Interface** (CLI) while still having the benefits of a Graphical User Interface (GUI). If you can type fast, AB3 can get your contact management tasks done faster than traditional GUI apps. For educators who may be less experienced with command-based tools, EduContacts also includes user-friendly and intuitive features and guidance, making it accessible for all users. @@ -57,7 +57,7 @@ EduContacts is a **desktop app for Educators in Tertiary Institution to manage c ```bash cd ~/Desktop/EduContacts ``` - + and use the following command to run the application: ```bash @@ -71,17 +71,17 @@ EduContacts is a **desktop app for Educators in Tertiary Institution to manage c 1. Type the command in the command box and press Enter to execute it. e.g. typing **`help`** and pressing Enter will open the help window.
Some example commands you can try: - ```bash - list + ```bash + list ``` Lists all contacts. - ```bash + ```bash add 12345678 n/John Doe p/99999999 e/johndoe@example.com a/123 Jane Doe Road c/Computer Science t/Student - ``` + ``` Adds a contact named `John Doe` to EduContacts. - - ```bash + + ```bash delete 12345678 ``` Deletes a student contact with StudentID `12345678`. @@ -126,7 +126,7 @@ EduContacts is a **desktop app for Educators in Tertiary Institution to manage c Shows a message explaining how to access the help page. Format: -```bash +```bash help ``` ![help message](images/helpMessage.png) @@ -136,7 +136,7 @@ help Adds a person contact to the EduContacts. -Format: +Format: ```bash add ID n/NAME p/PHONE e/EMAIL a/ADDRESS c/COURSE t/TAG ``` @@ -150,7 +150,7 @@ Examples: Shows a list of all persons in EduContacts. -Format: +Format: ```bash list ``` @@ -200,7 +200,7 @@ filter [KEYWORD_PREFIX] [MORE_KEYWORDS] * **For filtering by Course:** * Use prefix `c/` - * Partial matching is supported, but the first keyword must match the beginning of the course name. + * Partial matching is supported, but the first keyword must match the beginning of the course name. e.g `Engineer` will match courses like "Engineering" but not "Civil Engineering". @@ -210,7 +210,7 @@ filter [KEYWORD_PREFIX] [MORE_KEYWORDS] Examples: * ```filter n/John``` returns `john` and `John Doe` -* `filter m/CS2103T` returns a list of all students with module CS2103T. +* `filter m/CS2103T` returns a list of all students with module CS2103T. * `filter c/Computer Science` returns a list of all students with course Computer Science.
* `filter n/alex david` returns `Alex Yeoh`, `David Li` @@ -220,7 +220,7 @@ Examples: Deletes the specified person from EduContacts. -Format: +Format: ```bash delete ID ``` @@ -234,7 +234,7 @@ Examples: Clears all entries from EduContacts. -Format: +Format: ```bash clear ``` From 2354c9beb600534866ac2af0131f9ad49be95636 Mon Sep 17 00:00:00 2001 From: jessica2828 Date: Thu, 7 Nov 2024 19:38:01 +0800 Subject: [PATCH 16/18] Fix checkstyle trailing whitespace --- docs/DeveloperGuide.md | 6 +++--- .../seedu/address/logic/commands/DeleteCommandTest.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index 70c1a9e11f9..cb83a4ed127 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -106,8 +106,8 @@ The `UI` component uses the JavaFx UI framework. The layout of these UI parts ar <<<<<<< HEAD are in the `src/main/resources/view` folder. For example, the layout of the [`MainWindow`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/java/seedu/address/ui/MainWindow.java) is specified in [`MainWindow.fxml`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/resources/view/MainWindow.fxml) ======= -are in the `src/main/resources/view` folder. For example, the layout of the -[`MainWindow`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/java/seedu/address/ui/MainWindow.java) +are in the `src/main/resources/view` folder. For example, the layout of the +[`MainWindow`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/java/seedu/address/ui/MainWindow.java) is specified in [`MainWindow.fxml`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/resources/view/MainWindow.fxml) >>>>>>> 550f0146c8868387d6e04d7b2929482db9d748df @@ -117,7 +117,7 @@ is specified in [`MainWindow.fxml`](https://github.com/se-edu/addressbook-level3 * listens for changes to `Model` data so that the UI can be updated with the modified data. * keeps a reference to the `Logic` component, because the `UI` relies on the `Logic` to execute commands. * depends on some classes in the `Model` component, as it displays `Person` object residing in the `Model`. - + #### `CommandHistory` Integration The `CommandHistory` class, located in `seedu.address.ui.util`, is responsible for tracking user-entered commands. diff --git a/src/test/java/seedu/address/logic/commands/DeleteCommandTest.java b/src/test/java/seedu/address/logic/commands/DeleteCommandTest.java index c2a5885133c..655ef0254a2 100644 --- a/src/test/java/seedu/address/logic/commands/DeleteCommandTest.java +++ b/src/test/java/seedu/address/logic/commands/DeleteCommandTest.java @@ -186,7 +186,7 @@ public void execute_invalidStudentIdWithModule_throwsCommandException() { assertCommandFailure( deleteCommand, model, String.format(DeleteCommand.MESSAGE_PERSON_NOT_FOUND, invalidStudentId)); } - + @Test public void execute_validStudentIdAndModule_success() { Person personWithModule = model.getFilteredPersonList().get(INDEX_FIRST_PERSON.getZeroBased()); From 5d9099197dd8643b9135cb738e09caeda17b2235 Mon Sep 17 00:00:00 2001 From: jessica2828 Date: Thu, 7 Nov 2024 19:42:16 +0800 Subject: [PATCH 17/18] Fix checkstyle --- docs/DeveloperGuide.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index cb83a4ed127..b5b381b7019 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -186,7 +186,6 @@ The `Model` component, ### Storage component **API** : [`Storage.java`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/java/seedu/address/storage/Storage.java) - The `Storage` component has a key role in persisting data across user sessions. Specifically, it, From 7bc3e130edb03271a92bd0b1bfaca00bc7533030 Mon Sep 17 00:00:00 2001 From: jessica2828 Date: Thu, 7 Nov 2024 19:58:55 +0800 Subject: [PATCH 18/18] Resolve conflicts --- docs/DeveloperGuide.md | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index b5b381b7019..f88f74e04c6 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -85,15 +85,9 @@ The UI consists of a `MainWindow` that is made up of the following parts: * `PersonListPanel` * The panel which holds the list of persons in EduContacts, each person represented by a `PersonCard` * `StatusBarFooter` -<<<<<<< HEAD - * Designed to show the save location of EduContacts' data -* `PersonDetails` - * A section of the UI that renders when a `FindCommand` is run, showing the resulting person's full details -======= * Designed to show the save location of EduContacts' data * `PersonDetails` * A section of the UI that renders when a `FindCommand` is run, showing the resulting person's full details ->>>>>>> 550f0146c8868387d6e04d7b2929482db9d748df * `PersonCard` * Shows simple and brief details about a person * `HelpWindow` @@ -103,13 +97,9 @@ All these, including the `MainWindow`, inherit from the abstract `UiPart` class classes that represent parts of the visible GUI. The `UI` component uses the JavaFx UI framework. The layout of these UI parts are defined in matching `.fxml` files that -<<<<<<< HEAD -are in the `src/main/resources/view` folder. For example, the layout of the [`MainWindow`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/java/seedu/address/ui/MainWindow.java) is specified in [`MainWindow.fxml`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/resources/view/MainWindow.fxml) -======= are in the `src/main/resources/view` folder. For example, the layout of the [`MainWindow`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/java/seedu/address/ui/MainWindow.java) is specified in [`MainWindow.fxml`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/resources/view/MainWindow.fxml) ->>>>>>> 550f0146c8868387d6e04d7b2929482db9d748df **The `UI` component,** @@ -168,8 +158,8 @@ How the parsing works: The `Model` component, * stores the contact data i.e., all `Person` objects (which are contained in a `UniquePersonList` object). - * a `Person` object stores `StudentId`, `Name`, `Address`, `Phone`, `Email`, `Role`, `Course` objects. - * contains an ArrayList of `Module` objects which is optional. + * a `Person` object stores `StudentId`, `Name`, `Address`, `Phone`, `Email`, `Role`, `Course` objects. + * contains an ArrayList of `Module` objects which is optional. * stores the currently 'selected' `Person` objects (e.g., results of a search query) as a separate _filtered_ list which is exposed to outsiders as an unmodifiable `ObservableList` that can be 'observed' e.g. the UI can be bound to this list so that the UI automatically updates when the data in the list change. * stores a `UserPref` object that represents the user’s preferences. This is exposed to the outside as a `ReadOnlyUserPref` objects. * is intentionally designed to be independent of other components (e.g., UI, Logic, Storage) to maintain a clean separation of concerns. This ensures that the Model layer is solely responsible for managing data and that data structures make sense on their own. This independence enables easier maintenance, testing, and adaptability of the data structures, as changes in one component (e.g., UI) do not affect the Model. @@ -186,6 +176,7 @@ The `Model` component, ### Storage component **API** : [`Storage.java`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/java/seedu/address/storage/Storage.java) + The `Storage` component has a key role in persisting data across user sessions. Specifically, it, @@ -753,10 +744,10 @@ _{to work on in the future}_ * Description: Allow users to move inactive or irrelevant entries to an archive. * Benefits: - * Reduces clutter in the main data set, making it easier to manage and navigate active records without losing historical data. - * Lower the load on real-time data processing by isolating inactive records. - * Retain archived data for historical records or compliance requirements. - * Provide a safe way to store inactive data without risking deletion or loss. + * Reduces clutter in the main data set, making it easier to manage and navigate active records without losing historical data. + * Lower the load on real-time data processing by isolating inactive records. + * Retain archived data for historical records or compliance requirements. + * Provide a safe way to store inactive data without risking deletion or loss. ### Importing contact data @@ -776,4 +767,3 @@ _{to work on in the future}_ * Enable users to share their contact lists with others. * Allow users to organize and manipulate their contact data externally. * Help users comply with data export regulations or organizational policies. -