diff --git a/docs/UserGuide.md b/docs/UserGuide.md index 13ccded716d..e29258b42ee 100644 --- a/docs/UserGuide.md +++ b/docs/UserGuide.md @@ -476,9 +476,10 @@ Format: `edit-developer INDEX [n/NAME] [p/PHONE_NUMBER] [e/EMAIL] [a/ADDRESS] [d * Existing values will be updated to the input values. * When editing projects, the existing assigned projects of the developer will be removed i/e. adding of projects is not cumulative. -* You can remove all the developer's projects by typing `p/` without specifying any project name after it. -* `NAME` cannot be the same as another existing developer's name in the address book. -* `PROJECT_NAME` should be the name of an existing project. +* You can remove all the developer's projects by typing `pr/` without specifying any project name after it. +* `NAME` cannot be the same as another existing developer's name in the address book. Checks are case-insensitive. +* You can, however, edit the casing of an existing developer's `NAME`. +* `PROJECT_NAME` should be the exact name of an existing project. Example of usage: `edit-developer 2 p/98989898 pr/Project2 pr/Project3` @@ -508,7 +509,10 @@ Format: `edit-client INDEX [n/NAME] [p/PHONE_NUMBER] [e/EMAIL] [a/ADDRESS] [pr/P * Existing values will be updated to the input values. * When editing projects, the existing assigned projects of the client will be removed i/e. adding of projects is not cumulative. -* You can remove all the client's projects by typing `p/` without specifying any project name after it. +* You can remove all the client's projects by typing `pr/` without specifying any project name after it. +* `NAME` cannot be the same as another existing client's name in the address book. Checks are case-insensitive. +* You can, however, edit the casing of an existing client's `NAME`. +* `PROJECT_NAME` should be the exact name of an existing project. Example of usage: `edit-client 3 e/bob@gmail.com` @@ -530,13 +534,13 @@ Projects: ProjectA Edits the details of an existing project in the address book. -Format: `edit-project INDEX [desc/DESCRIPTION] [d/DEADLINE]...` +Format: `edit-project INDEX [desc/DESCRIPTION] [dl/DEADLINE]...` * Edits the project at the specified `INDEX` in the currently displayed project list. * At least one of the optional fields must be provided. * Existing values will be updated to the input values. -* When editing deadlines, the existing deadlines will be removed i.e. adding of projects is not cumulative. -* You can remove all the current deadlines by typing `d/` without specifying any deadline. +* When editing deadlines, the existing deadlines will be removed ie. adding of projects is not cumulative. +* You can remove all the current deadlines by typing `dl/` without specifying any deadline. * The name of a project cannot be edited. Example of usage: `edit-project 1 dl/19-12-2023,Design backend,HIGH,0` diff --git a/docs/team/emzm2023.md b/docs/team/emzm2023.md index 9d137e218c3..7c353c17efb 100644 --- a/docs/team/emzm2023.md +++ b/docs/team/emzm2023.md @@ -10,18 +10,42 @@ CLI, and it has a GUI created with JavaFX. It is written in Java, and has about Given below are my contributions to the project. -* **New Feature**: FEATURE1 - * What it does: - * Justification: - * Highlights: - * Credits: *{mention here if you reused any code/ideas from elsewhere or if a third-party library is heavily used in - the feature so that a reader can make a more accurate judgement of how much effort went into the feature}* +* **New Feature**: `mark-deadline` and `unmark-deadline` + * What it does: Gives users the ability to mark project deadlines as done or undone. + * Justification: One basic job of project managers is to manage deadlines, so having a mark and unmark feature + allows them to update the status of the project and project deadlines accordingly. + * Highlights: Deadline fields had to be updated to ensure that an index is saved when a deadline for a project is + created. Further methods also had to be implemented to toggle the `isDone` status of a deadline between `true` and + `false`. Additional changes to the existing GUI were made to reflect deadline numbers to allow users to mark and + unmark deadlines according to the index. This involved adding a new column to the table of deadlines that displayed + deadline indexes. + + +* **Enhancement to existing features**: `edit-developer`, `edit-client`, `edit-project` + * What it does: Allows users to edit the fields of existing developers, clients, and projects. + * Justification: This gives project managers the flexibility and freedom to change and update the details if + necessary. Aside from keeping contact details accurate, this is also especially important as it allows for the + reassignment of developers to new projects and the updating of project deadlines after milestones. + * Highlights: Edits are done according to the object's index in the displayed list in the relevant tab. Making + edits to objects automatically switches the tab on the GUI to the relevant one. Various code changes to the existing + `edit` function had to be made to account for the different fields of the object to edit, as well as various + implemented restrictions on fields that could and could not be changed. The respective Parser and Command classes + were extended to account for each additional field, and thorough checks were implemented to ensure that users are + unable to access prefixes that are meant for other objects. * **Enhancements to existing features**: - * Updated the GUI color scheme (Pull requests [\#33](), [\#34]()) - * Wrote additional tests for existing features to increase coverage from 88% to 92% (Pull - requests [\#36](), [\#38]()) + * Updated the GUI project table columns and CSS (Pull requests [\#142]()) + * Wrote additional tests for existing features to increase coverage (Pull requests ) + + +* **Other significant code contributions**: + * Initially implemented edit command with behaviour varying in response to access rights, but undid changes due to + shift in project direction (Pull request [\#59](), [\#66]()) + * Implemented Project and Project relevant classes (eg. Deadline, Priority, Description) for use by team (Pull + request [\#73]()) + * Implemented project validation checks used in `add-client`, `add-developer`, `edit-client`, and `edit-developer` to + ensure assigned projects exist in the address book (Pull request [\#159]()) * **Code contributed @@ -31,27 +55,31 @@ Given below are my contributions to the project. * **Project management (team-based tasks contributions)**: * Set up project schedule tracking with milestones and issues for `v1.1` * Updated Developer Guide with project notes for `v1.1` + * Add screenshots of UI and managed the collaboration group document for tutorial checks + * Create and release JAR file for `v1.3` + * Assign labels and assignees to bug issues in post-PED * **Documentation Contributions**: * User Guide Contributions: - * Added documentation for the features `delete` and `find` [\#72]() - * Did cosmetic tweaks to existing documentation of features `clear`, `exit`: [\#74]() + * Added documentation for the features `edit-developer`, `edit-client`, `edit-project`, `mark-deadline` + , and `unmark-deadline` (Pull requests [\#104](), [/#151](), [/#163]()) + * Created template format for other team members to follow for their portion of the User Guide (Pull request + [\#151]()) + * Did cosmetic tweaks to existing documentation for standardisation * Developer Guide Contributions: - * Added implementation details of the `delete` feature. - + * Added all user stories and several use cases for initial iteration, but undid changes due to shift in project + direction (Pull request [\#35]()) + * Added implementation details of the features `edit-developer`, `edit-client`, `edit-project`, `mark-deadline` + , and `unmark-deadline` (Pull request [\#109]()) -* **Community (Review/mentoring contributions)**: - * PRs reviewed (with non-trivial review comments): [\#12](), [\#32](), [\#19](), [\#42]() - * Contributed to forum discussions (examples: [1](), [2](), [3](), [4]()) - * Reported bugs and suggestions for other teams in the class (examples: [1](), [2](), [3]()) - * Some parts of the history feature I added was adopted by several other class mates ([1](), [2]()) +* **Community (Review/mentoring contributions)**: + * Helped to modify add command parsers with part of my implementation for edit command parsers to ensure more + thorough and bug-free parsing of user inputs (Pull request [\#127]()) * **Contributions beyond the project team**: - * NOTHING + * Reported bugs and suggestions for other teams in the cohort -* **Tools**: - * Integrated a third party library (Natty) to the project ([\#42]()) - * Integrated a new Github plugin (CircleCI) to the team repo +**Contributions to the Developer Guide (Extracts)**: \ No newline at end of file diff --git a/src/main/java/seedu/address/logic/commands/add/AddProjectCommand.java b/src/main/java/seedu/address/logic/commands/add/AddProjectCommand.java index 3dd2312da2f..fc95413d369 100644 --- a/src/main/java/seedu/address/logic/commands/add/AddProjectCommand.java +++ b/src/main/java/seedu/address/logic/commands/add/AddProjectCommand.java @@ -35,7 +35,7 @@ public class AddProjectCommand extends Command { + PREFIX_DEADLINE + "25-12-2023,Design frontend,MEDIUM,0 "; public static final String MESSAGE_SUCCESS = "New project added: %1$s"; - public static final String MESSAGE_DUPLICATE_PROJECT = "This project already exists in the address book"; + public static final String MESSAGE_DUPLICATE_PROJECT = "This project already exists in the address book!"; private final Project toAdd; diff --git a/src/main/java/seedu/address/logic/commands/edit/EditClientCommand.java b/src/main/java/seedu/address/logic/commands/edit/EditClientCommand.java index 3aae672af5d..2a584614c7c 100644 --- a/src/main/java/seedu/address/logic/commands/edit/EditClientCommand.java +++ b/src/main/java/seedu/address/logic/commands/edit/EditClientCommand.java @@ -43,7 +43,9 @@ public class EditClientCommand extends Command { public static final String MESSAGE_EDIT_CLIENT_SUCCESS = "Edited Client: %1$s"; public static final String MESSAGE_NOT_EDITED = "At least one field to edit must be provided."; public static final String MESSAGE_DUPLICATE_CLIENT = - "The details of the client in the address book are already as given."; + "There is already a client with that name!"; + public static final String MESSAGE_UNEDITED_CLIENT = + "The details of the client to edit are already as such!"; public static final String MESSAGE_USAGE = COMMAND_WORD + ": Edits the details of the client identified " + "by the index number used in the displayed client list. " @@ -109,7 +111,10 @@ public CommandResult execute(Model model) throws CommandException { Client clientToEdit = lastShownList.get(index.getZeroBased()); Client editedClient = createEditedClient(clientToEdit, editClientDescriptor); - if (!clientToEdit.isSamePerson(editedClient) && model.hasClient(editedClient)) { + if (clientToEdit.equals(editedClient)) { + throw new CommandException(MESSAGE_UNEDITED_CLIENT); + } + if (!clientToEdit.isSameClient(editedClient) && model.hasClient(editedClient)) { throw new CommandException(MESSAGE_DUPLICATE_CLIENT); } String res = model.areProjectsValid(editedClient); diff --git a/src/main/java/seedu/address/logic/commands/edit/EditDeveloperCommand.java b/src/main/java/seedu/address/logic/commands/edit/EditDeveloperCommand.java index 153b2e23342..592f103312f 100644 --- a/src/main/java/seedu/address/logic/commands/edit/EditDeveloperCommand.java +++ b/src/main/java/seedu/address/logic/commands/edit/EditDeveloperCommand.java @@ -48,7 +48,9 @@ public class EditDeveloperCommand extends Command { public static final String MESSAGE_EDIT_DEVELOPER_SUCCESS = "Edited Developer: %1$s"; public static final String MESSAGE_NOT_EDITED = "At least one field to edit must be provided."; public static final String MESSAGE_DUPLICATE_DEVELOPER = - "The details of the developer in the address book are already as given."; + "There is already a developer with that name!"; + public static final String MESSAGE_UNEDITED_DEVELOPER = + "The details of the developer to edit are already as such!"; public static final String MESSAGE_USAGE = COMMAND_WORD + ": Edits the details of the developer identified " + "by the index number used in the displayed developer list. " @@ -118,6 +120,9 @@ public CommandResult execute(Model model) throws CommandException { Developer developerToEdit = lastShownList.get(index.getZeroBased()); Developer editedDeveloper = createEditedDeveloper(developerToEdit, editDeveloperDescriptor); + if (developerToEdit.equals(editedDeveloper)) { + throw new CommandException(MESSAGE_UNEDITED_DEVELOPER); + } if (!developerToEdit.isSameDeveloper(editedDeveloper) && model.hasDeveloper(editedDeveloper)) { throw new CommandException(MESSAGE_DUPLICATE_DEVELOPER); } diff --git a/src/main/java/seedu/address/logic/commands/edit/EditProjectCommand.java b/src/main/java/seedu/address/logic/commands/edit/EditProjectCommand.java index 3fc30cef03e..4cfad732075 100644 --- a/src/main/java/seedu/address/logic/commands/edit/EditProjectCommand.java +++ b/src/main/java/seedu/address/logic/commands/edit/EditProjectCommand.java @@ -33,7 +33,9 @@ public class EditProjectCommand extends Command { public static final String MESSAGE_EDIT_PROJECT_SUCCESS = "Edited Project: %1$s"; public static final String MESSAGE_NOT_EDITED = "At least one field to edit must be provided."; public static final String MESSAGE_DUPLICATE_PROJECT = - "The details of the project in the address book are already as given."; + "There is already a project with that name!"; + public static final String MESSAGE_UNEDITED_PROJECT = + "The details of the project to edit are already as such!"; public static final String MESSAGE_USAGE = COMMAND_WORD + ": Edits the details of the project identified " + "by the index number used in the displayed project list. " @@ -91,6 +93,9 @@ public CommandResult execute(Model model) throws CommandException { Project projectToEdit = lastShownList.get(index.getZeroBased()); Project editedProject = createEditedProject(projectToEdit, editProjectDescriptor); + if (projectToEdit.equals(editedProject)) { + throw new CommandException(MESSAGE_UNEDITED_PROJECT); + } if (!projectToEdit.isSameProject(editedProject) && model.hasProject(editedProject)) { throw new CommandException(MESSAGE_DUPLICATE_PROJECT); } diff --git a/src/main/java/seedu/address/logic/parser/ParserUtil.java b/src/main/java/seedu/address/logic/parser/ParserUtil.java index 4b692c567b5..5eb665bea6d 100644 --- a/src/main/java/seedu/address/logic/parser/ParserUtil.java +++ b/src/main/java/seedu/address/logic/parser/ParserUtil.java @@ -262,7 +262,7 @@ public static Rating parseRating(String rating) throws ParseException { requireNonNull(rating); String trimmedRating = rating.trim(); if (!Rating.isValidRating(trimmedRating)) { - throw new ParseException(Salary.MESSAGE_CONSTRAINTS); + throw new ParseException(Rating.MESSAGE_CONSTRAINTS); } return new Rating(trimmedRating); } diff --git a/src/main/java/seedu/address/logic/parser/add/AddProjectCommandParser.java b/src/main/java/seedu/address/logic/parser/add/AddProjectCommandParser.java index 20107b78719..68f4e817ac9 100644 --- a/src/main/java/seedu/address/logic/parser/add/AddProjectCommandParser.java +++ b/src/main/java/seedu/address/logic/parser/add/AddProjectCommandParser.java @@ -57,7 +57,7 @@ public AddProjectCommand parse(String args) throws ParseException { PREFIX_ADDRESS, PREFIX_PROJECT, PREFIX_DATEJOINED, PREFIX_ROLE, PREFIX_SALARY, PREFIX_GITHUBID, PREFIX_RATING, PREFIX_ORGANISATION, PREFIX_DOCUMENT, PREFIX_DESCRIPTION, PREFIX_DEADLINE); - if (!arePrefixesPresent(argMultimap, PREFIX_NAME, PREFIX_DESCRIPTION, PREFIX_DEADLINE) + if (!arePrefixesPresent(argMultimap, PREFIX_NAME, PREFIX_DESCRIPTION) || !argMultimap.getPreamble().isEmpty()) { throw new ParseException(String.format(MESSAGE_INVALID_COMMAND_FORMAT, AddProjectCommand.MESSAGE_USAGE)); } @@ -69,14 +69,13 @@ public AddProjectCommand parse(String args) throws ParseException { } } - argMultimap.verifyNoDuplicatePrefixesFor(PREFIX_NAME, PREFIX_PHONE, PREFIX_EMAIL, PREFIX_ADDRESS); + argMultimap.verifyNoDuplicatePrefixesFor(PREFIX_NAME, PREFIX_DESCRIPTION); Name name = ParserUtil.parseName(argMultimap.getValue(PREFIX_NAME).get()); Description desc = ParserUtil.parseDescription(argMultimap.getValue(PREFIX_DESCRIPTION).get()); List deadlineList = argMultimap.getAllValues(PREFIX_DEADLINE); List deadlines = ParserUtil.parseDeadlines(deadlineList); Project project = new Project(name, desc, deadlines); - return new AddProjectCommand(project); } } diff --git a/src/main/java/seedu/address/model/project/Project.java b/src/main/java/seedu/address/model/project/Project.java index 9568ca2fc75..6aae8ae9e4e 100644 --- a/src/main/java/seedu/address/model/project/Project.java +++ b/src/main/java/seedu/address/model/project/Project.java @@ -178,7 +178,7 @@ public boolean isSameProject(Project otherProject) { } return otherProject != null - && otherProject.getName().equals(getName()); + && otherProject.getName().toLowerCase().equals(getName().toLowerCase()); } public boolean isSameProject(String projectName) {