From f08cd331e6ecaf029af72c8fb1fe7567538dbc0f Mon Sep 17 00:00:00 2001 From: Sam Chris Date: Mon, 9 Nov 2020 18:33:14 +0800 Subject: [PATCH 01/24] Added javadoc for storage --- .../java/seedu/ezmanager/storage/Storage.java | 29 ++++++++++++++----- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/src/main/java/seedu/ezmanager/storage/Storage.java b/src/main/java/seedu/ezmanager/storage/Storage.java index 2c8c304f10..f3d7cd1245 100644 --- a/src/main/java/seedu/ezmanager/storage/Storage.java +++ b/src/main/java/seedu/ezmanager/storage/Storage.java @@ -15,6 +15,10 @@ import java.util.NoSuchElementException; import java.util.Scanner; + +/** + * Class that saves and loads the data that is used in EZ Manager. + */ public class Storage { private static File f; private static ArrayList temp = new ArrayList<>(); @@ -23,13 +27,12 @@ public Storage(String filePath) { f = new File(filePath); } - /* - protected String projectName; - protected boolean isDone; - private ArrayList tasks; - private String projectDescription; - private LocalDate projectDeadline; - private static ArrayList members; + /** + * Loads the projects from the ezmanager.txt file + * + * @param members ArrayList of TeamMember. + * @return projects ArrayList of Projects that have been added to EZ Manager previously. + * @throws EzExceptions When cannot access the file will throw "Open File" EzException */ public static ArrayList loadProjects(ArrayList members) throws EzExceptions { try { @@ -187,6 +190,11 @@ public static ArrayList loadProjects(ArrayList members) thr return temp; } + /** + * Loads the team members from the ezmanager.txt file + * + * @return members ArrayList of TeamMember that have been added to EZ Manager previously. + */ public ArrayList loadTeamMembers() { try { Scanner s = new Scanner(f); @@ -220,6 +228,13 @@ public static TeamMember getMember(String name, ArrayList members) { return null; } + /** + * Saves the data to the text file. + * + * @param projects ArrayList of Project. + * @param members ArrayList of TeamMember. + * @throws IOException When encountering errors when saving files. + */ public static void save(ArrayList projects, ArrayList members) throws IOException { // empty current saved items; FileWriter clear = new FileWriter(f); From 295b5131ca1002f29d6a27e3528bf9fcff1b6edc Mon Sep 17 00:00:00 2001 From: Sam Chris Date: Mon, 9 Nov 2020 19:22:17 +0800 Subject: [PATCH 02/24] Test for Storage --- ezmanager.txt | 11 ---- .../java/seedu/ezmanager/storage/Storage.java | 2 +- .../java/seedu/ezmanager/StorageTest.java | 66 +++++++++++++++++++ test_ezmanager.txt | 28 ++++++++ 4 files changed, 95 insertions(+), 12 deletions(-) delete mode 100644 ezmanager.txt create mode 100644 src/test/java/seedu/ezmanager/StorageTest.java create mode 100644 test_ezmanager.txt diff --git a/ezmanager.txt b/ezmanager.txt deleted file mode 100644 index 702a263a12..0000000000 --- a/ezmanager.txt +++ /dev/null @@ -1,11 +0,0 @@ -Members - -Project asd -status false -projectDescription -projectDeadline null -startTasks -endTasks -pMS -pME - diff --git a/src/main/java/seedu/ezmanager/storage/Storage.java b/src/main/java/seedu/ezmanager/storage/Storage.java index f3d7cd1245..7e163aa416 100644 --- a/src/main/java/seedu/ezmanager/storage/Storage.java +++ b/src/main/java/seedu/ezmanager/storage/Storage.java @@ -195,7 +195,7 @@ public static ArrayList loadProjects(ArrayList members) thr * * @return members ArrayList of TeamMember that have been added to EZ Manager previously. */ - public ArrayList loadTeamMembers() { + public static ArrayList loadTeamMembers() { try { Scanner s = new Scanner(f); String currentLine = s.nextLine(); diff --git a/src/test/java/seedu/ezmanager/StorageTest.java b/src/test/java/seedu/ezmanager/StorageTest.java new file mode 100644 index 0000000000..fbd701bd18 --- /dev/null +++ b/src/test/java/seedu/ezmanager/StorageTest.java @@ -0,0 +1,66 @@ +package seedu.ezmanager; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.io.File; +import java.nio.file.Path; +import java.time.LocalDate; +import java.util.ArrayList; + +import org.junit.jupiter.api.Test; + +import seedu.ezmanager.member.TeamMember; +import seedu.ezmanager.project.Project; +import seedu.ezmanager.storage.Storage; +import seedu.ezmanager.task.Task; + +public class StorageTest { + + public Path testFolder; + + private String filePath = "test_ezmanager.txt"; + private Storage storage = new Storage(filePath); + + @Test + void loadData() throws EzExceptions { + ArrayList actualLoadedMembers = storage.loadTeamMembers(); + ArrayList expectedMembers = new ArrayList<>(); + TeamMember onePerson = new TeamMember("one person"); + TeamMember anotherPerson = new TeamMember("another person"); + expectedMembers.add(onePerson); + expectedMembers.add(anotherPerson); + assertTrue(expectedMembers.size() == actualLoadedMembers.size()); + + Project oneProject = new Project("one"); + oneProject.addProjectDeadline(LocalDate.parse("2020-10-20")); + oneProject.addTeamMemberToProject(onePerson); + oneProject.addTeamMemberToProject(anotherPerson); + Task oneTask = new Task("one task"); + oneTask.setMember(onePerson); + Task anotherTask = new Task("another task"); + oneProject.addTask(oneTask); + oneProject.addTask(anotherTask); + + ArrayList actualProjects = storage.loadProjects(actualLoadedMembers); + + for (Project actualProject : actualProjects) { + ArrayList actualTasks = actualProject.getTaskList(); + for (Task actualTask : actualTasks) { + boolean inListOne = containsTask(actualTask.getDescription(), oneProject.getTaskList()); + assertTrue(inListOne); + } + } + + } + + boolean containsTask(String taskName, ArrayList tasks) { + for (Task task : tasks) { + if (taskName.equals(task.getDescription())) { + return true; + } + } + return false; + } + +} \ No newline at end of file diff --git a/test_ezmanager.txt b/test_ezmanager.txt new file mode 100644 index 0000000000..0713d20394 --- /dev/null +++ b/test_ezmanager.txt @@ -0,0 +1,28 @@ +Members +one person +another person + +Project one +status false +projectDescription +projectDeadline 2020-10-20 +startTasks +one task | tS 0 tE | pS 0 pE +another task | tS 0 tE | pS 0 pE +tMS +one person +tME +endTasks +pMS +one person +pME + +Project two +status false +projectDescription +projectDeadline null +startTasks +endTasks +pMS +pME + From 02c25ac8174337dcda661957e585a83cd2ebc496 Mon Sep 17 00:00:00 2001 From: Sam Chris Date: Mon, 9 Nov 2020 19:26:19 +0800 Subject: [PATCH 03/24] Added INFO log messages for Storage --- src/main/java/seedu/ezmanager/storage/Storage.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/seedu/ezmanager/storage/Storage.java b/src/main/java/seedu/ezmanager/storage/Storage.java index 7e163aa416..2ada04aedb 100644 --- a/src/main/java/seedu/ezmanager/storage/Storage.java +++ b/src/main/java/seedu/ezmanager/storage/Storage.java @@ -1,6 +1,7 @@ package seedu.ezmanager.storage; import seedu.ezmanager.EzExceptions; +import seedu.ezmanager.EzLogger; import seedu.ezmanager.member.TeamMember; import seedu.ezmanager.project.Project; import seedu.ezmanager.task.Task; @@ -14,6 +15,7 @@ import java.util.ArrayList; import java.util.NoSuchElementException; import java.util.Scanner; +import java.util.logging.Level; /** @@ -36,9 +38,11 @@ public Storage(String filePath) { */ public static ArrayList loadProjects(ArrayList members) throws EzExceptions { try { + Scanner s = new Scanner(f); // create a Scanner using the File as the source ArrayList projects = new ArrayList<>(); String currentLine; + EzLogger.log(Level.INFO, "Begin loading projects"); while (s.hasNext()) { currentLine = s.nextLine(); if (currentLine.contains("Project")) { @@ -182,6 +186,7 @@ public static ArrayList loadProjects(ArrayList members) thr */ } + EzLogger.log(Level.INFO, "Done loading projects"); return projects; } catch (FileNotFoundException | EzExceptions e) { //System.out.println("Creating file..."); @@ -213,6 +218,7 @@ public static ArrayList loadTeamMembers() { return members; } catch (FileNotFoundException | NoSuchElementException e) { + EzLogger.log(Level.INFO, "Creating file for storage..."); System.out.println("Creating file..."); } return new ArrayList<>(); @@ -237,6 +243,7 @@ public static TeamMember getMember(String name, ArrayList members) { */ public static void save(ArrayList projects, ArrayList members) throws IOException { // empty current saved items; + EzLogger.log(Level.INFO, "Begin saving items..."); FileWriter clear = new FileWriter(f); clear.write(""); clear.close(); @@ -254,6 +261,7 @@ public static void save(ArrayList projects, ArrayList membe } fw.close(); + EzLogger.log(Level.INFO, "Done saving items..."); } } From 934b4186cd84e8cc540f0f0c6ab9b3dcf6acd631 Mon Sep 17 00:00:00 2001 From: Sam Chris Date: Mon, 9 Nov 2020 19:43:51 +0800 Subject: [PATCH 04/24] PPP in progress --- docs/team/samuelpaulchristopher.md | 61 ++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 docs/team/samuelpaulchristopher.md diff --git a/docs/team/samuelpaulchristopher.md b/docs/team/samuelpaulchristopher.md new file mode 100644 index 0000000000..f909c29e65 --- /dev/null +++ b/docs/team/samuelpaulchristopher.md @@ -0,0 +1,61 @@ +# Samuel Paul Christopher - Project Portfolio Page + +## Project: EzManager +EZ Manager is a simple and efficient project management tool for software project managers. +EZ Manager is a desktop application with the user interacting with the CLI +(Command Line Interface) to manage projects, tasks and team members. + +### Summary of Contributions +Given below are my contributions to the project. + +* **Code contributed**: [RepoSense Link](https://nus-cs2113-ay2021s1.github.io/tp-dashboard/#breakdown=true&search=samuelchristopher) + +* **Features Added**: + * **Project View**: Allows the user to have an overview of all the tasks and members in the project. + * **Create Member (In home view)**: Allows the user to add a member to program. + * **Delete Project (In home view)**: Allows the user to remove a specified project from the program. + * **Mark Project As Completed**: Allows the user to mark a new project as completed. + * **Mark Tasks As Completed**: Allows the user to mark a project as completed. + * **Storage**: Allows the data on EZ Manager to be persisted. + +* **Noteworthy Features**: + +1. Added Project View feature. + * What it does: Allows the user to have an overview of all the tasks and members in the project. + This includes important information such as: + - status of the task (is it done or not?) + - description + - deadline + - priority of the task + - estimated hours to spend on the task + - actual time spent on the task + - members involved with the task + * Justification: This feature allows our project managers to get a glance of the projects all in one command. + Features like this one are essential to allow the project manager to determine of the project is on track. + +2. Data persistance +* **Enhancement to existing feature** + * Extracted printing elements to Ui class. (Pull Request #50) + * Show correct assigned members in each project. (Pull Request #90) + * List of projects in home view sorted by their deadlines as default view. (Pull Request #76) + * Assign command does not allow assignment of repeated projects and tasks (Pull Request #179) + +* **Documentation**: + * User Guide: + * Added documentation for the features `remove`, `project`, `description`, `deadline` and `list`. + * Developer Guide: + * Design section: Model Component + * Home view + * Add deadlines to projects + * Add description to projects + * Delete a specified project + * Mark project as done + * Remove members + * Appendix A Product Scope: User Stories + +* **Contributions to reviewing/mentoring**: + * Our project had about 70 closed pull requests as of 8/11/2020. I reviewed, commented and approved about 20 of those PRs. + In those reviews, I provided extensive problem recognitions to those codes that were not suitable and provided explanations + to my teammates in parts of the codes that they did not understand. + + From e4ecd1a75db3a98a71ac839374d27756856ac60d Mon Sep 17 00:00:00 2001 From: thatseant <46109197+thatseant@users.noreply.github.com> Date: Mon, 9 Nov 2020 22:10:45 +0800 Subject: [PATCH 05/24] Update DeveloperGuide.md --- docs/DeveloperGuide.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index 7aadfdd00a..43872942d5 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -66,7 +66,7 @@ Developers are welcome to contribute by submitting issues or pull requests on ou ### **Consideration (Sean Tan)** Eazy was developed via a breadth first iterative approach with new commands progressively added. An n-tier architecture ensured separation of concern between various layers of the architecture but much of the program’s logic remained in the Command classes. This design architecture ensured minimal changes to the codebase when new commands were added. Often, new commands or feature addition required changes to only a single data class and addition of a new independent command class. -### **Overall Architecture (Sean)** +### **Overall Architecture (Sean Tan)** Ez Manager consists of 4 main layers: * Ui: Handles the output of the app * Logic: Command parser and executor @@ -429,6 +429,23 @@ The following sequence diagram shows how the “Assign member to task” command
+### **Hours Worked By Worker Command (Sean Tan)** +This command allows project managers to view the total hours worked by a worker +The logic for this command is primarily written in TeamMemberHoursCommand class. It extends from the abstract Command class. +The steps below show how such a class is initialized and used to execute the command. + +Step 1: Parser initializes TeamMemberHoursCommand by passing a hashmap of input parameters together with projectIndex into its constructor. +Step 2: Parse() method of TeamMemberDeleteCommand extracts the index of the member to be retrieved from the hashmap. +Step 3: ExecuteCommand() method of TeamMemberDeleteCommand is called by Duke main class, which passes it the program’s arraylist of members. +* The method getTasks() of the specific member is called which retrieves all the tasks the member was assigned. +* The method getActual() of each of these tasks is called which retrieves the actual time taken to complete these tasks. +* The total hours of these tasks are then summed up. +* The Ui class then prints the total number of hours worked by these workers. + +The following sequence diagram shows how the “Hours Worked by worker” command works: + +
+ ### **Removing a member (Sean Tan)** This command allows project managers to remove members from the main members list. From dd550d12428b6a88e5bb41f2fb412d4f5a155285 Mon Sep 17 00:00:00 2001 From: Sam Chris Date: Mon, 9 Nov 2020 22:18:09 +0800 Subject: [PATCH 06/24] update PPP --- docs/team/samuelpaulchristopher.md | 34 ++++++++++++++++-------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/docs/team/samuelpaulchristopher.md b/docs/team/samuelpaulchristopher.md index f909c29e65..9fc018d5a6 100644 --- a/docs/team/samuelpaulchristopher.md +++ b/docs/team/samuelpaulchristopher.md @@ -33,28 +33,30 @@ Given below are my contributions to the project. * Justification: This feature allows our project managers to get a glance of the projects all in one command. Features like this one are essential to allow the project manager to determine of the project is on track. -2. Data persistance -* **Enhancement to existing feature** - * Extracted printing elements to Ui class. (Pull Request #50) - * Show correct assigned members in each project. (Pull Request #90) - * List of projects in home view sorted by their deadlines as default view. (Pull Request #76) - * Assign command does not allow assignment of repeated projects and tasks (Pull Request #179) +2. Data persistence + * Allows the data on the system to be saved and loaded in after each session. This makes it convinent for + the user and brings the EZ Manager application to life as the user can store the data in a safe and reliable manner. + + * **Documentation**: * User Guide: - * Added documentation for the features `remove`, `project`, `description`, `deadline` and `list`. + * Added documentation for the features `member`, `delete`, `done`, `list [for Project View]`, `Storage` * Developer Guide: - * Design section: Model Component - * Home view - * Add deadlines to projects - * Add description to projects - * Delete a specified project - * Mark project as done - * Remove members - * Appendix A Product Scope: User Stories + * Storage + * Add member + * View member + * Assign member to Project + * Assign member to Task + * Project view + * Running Tests + * Dev Ops + * Appendix B: Command Summary + * Generic Sections (Table of Contents, Introduction) + * **Contributions to reviewing/mentoring**: - * Our project had about 70 closed pull requests as of 8/11/2020. I reviewed, commented and approved about 20 of those PRs. + * Our project had about 95 closed pull requests as of 9/11/2020. I reviewed, commented and approved 28 of those PRs. In those reviews, I provided extensive problem recognitions to those codes that were not suitable and provided explanations to my teammates in parts of the codes that they did not understand. From 01ad8f40be6bc804be4eaaf28914daff5eecaa42 Mon Sep 17 00:00:00 2001 From: Sam Chris Date: Mon, 9 Nov 2020 22:19:33 +0800 Subject: [PATCH 07/24] update exception message to warning --- src/main/java/seedu/ezmanager/storage/Storage.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/seedu/ezmanager/storage/Storage.java b/src/main/java/seedu/ezmanager/storage/Storage.java index 2ada04aedb..5e914ba3ef 100644 --- a/src/main/java/seedu/ezmanager/storage/Storage.java +++ b/src/main/java/seedu/ezmanager/storage/Storage.java @@ -218,7 +218,7 @@ public static ArrayList loadTeamMembers() { return members; } catch (FileNotFoundException | NoSuchElementException e) { - EzLogger.log(Level.INFO, "Creating file for storage..."); + EzLogger.log(Level.WARNING, "Creating file for storage..."); System.out.println("Creating file..."); } return new ArrayList<>(); From b62ad2b925622d864451a25200fecec57b10d1a0 Mon Sep 17 00:00:00 2001 From: Sam Chris Date: Mon, 9 Nov 2020 22:32:19 +0800 Subject: [PATCH 08/24] Display home view when project opens up --- src/main/java/seedu/ezmanager/EzManager.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/seedu/ezmanager/EzManager.java b/src/main/java/seedu/ezmanager/EzManager.java index 05cbe226df..da60c07647 100644 --- a/src/main/java/seedu/ezmanager/EzManager.java +++ b/src/main/java/seedu/ezmanager/EzManager.java @@ -43,6 +43,10 @@ public static void run() { Ui ui = new Ui(); ui.printWelcome(); + if (projects.size() > 0) { + System.out.println(ui.printHomeView(projects, teamMembers)); + } + EzLogger.setup(); Scanner in = new Scanner(System.in); From ac2e9d791fcad0c6aa8a7ab4b2c29853b542064a Mon Sep 17 00:00:00 2001 From: shreytheshreyas Date: Mon, 9 Nov 2020 22:34:51 +0800 Subject: [PATCH 09/24] finished PPP --- docs/team/shreyaskumar.md | 52 +++++++++++++++++++++++++++++++++++++++ ezmanager.txt | 23 ++++++++++++++++- 2 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 docs/team/shreyaskumar.md diff --git a/docs/team/shreyaskumar.md b/docs/team/shreyaskumar.md new file mode 100644 index 0000000000..ee97dd9af4 --- /dev/null +++ b/docs/team/shreyaskumar.md @@ -0,0 +1,52 @@ +# Shreyas Kumar- Project Portfolio Page + +## Project: EzManager +Ez Manager is a simple and efficient project management tool for software project managers. +Ez Manager is a desktop application with the user interacting with the CLI +(Command Line Interface) to manage projects, tasks and team members. + +### Summary of Contributions +Given below are my contributions to the project. + +* **Code contributed**: [RepoSense Link](https://nus-cs2113-ay2021s1.github.io/tp-dashboard/#breakdown=true&search=shreytheshreyas) + +* **Features Added**: + * **Remove member (Initial implementation)**: Allows the user to remove a specified member from the program entirely. + * **Assign a member to a project**: Allows the user to add a new project to the program. + * **Sort tasks in Project-View**: Allows the user to sort tasks in the Project-View by a specified parameter. + * **Exceptions Class**: Implemented a class so that my team members can include different types of exceptions that might occur + in out application. +* **Noteworthy Feature**: Task-Sort functionality (Pull Request #86) + * What it does: Allows the user to sort tasks in a paritcular project according to deadline, + * Justification: This functionality allows the user to organise the tasks in the project view according the to the + that is the most relevant to them. + +* **Enhancement to existing feature** + * Helped my teammates in applying SLAP(Single-Layer of Abstraction) to the parser class during the initial stages + of development of that particular class. + + **Tests Written** + * **Remove member test (initial test)** + * **Assign member to a project test** + * **sort command test** +* **Documentation**: + * User Guide: + Added documentation for the features: + + - `remove`(intial functionality) + - `list`(for members) + - `list`(for tasks) + - `task-sorting` + * Developer Guide: + - Explained about Add Task feature + - Explained about View list of tasks feature + - Explained about Mark task as done feature + - Explained about sorting tasks feature + - Wrote Manual Test Cases feature + +* **Contributions to reviewing/mentoring**: + * Our project had about 97 closed pull requests as of 9/11/2020. I reviewed, commented and approved about 21 of those PRs. + I did my best to provide help my teammates by asking them if they could enhance certain features they themselves have already + implemented. + + diff --git a/ezmanager.txt b/ezmanager.txt index 702a263a12..54b8873b67 100644 --- a/ezmanager.txt +++ b/ezmanager.txt @@ -1,6 +1,27 @@ Members -Project asd +Project p1 +status false +projectDescription +projectDeadline null +startTasks +task1 | tS 0 tE | dS 2020-12-03dE | pS 0 pE +tsk2 | tS 0 tE | pS 1 pE +task3 | tS 0 tE | pS 0 pE +endTasks +pMS +pME + +Project p2 +status false +projectDescription +projectDeadline null +startTasks +endTasks +pMS +pME + +Project p3 status false projectDescription projectDeadline null From c153ab5f1ed98bf156f6f434091c884f9180328a Mon Sep 17 00:00:00 2001 From: shreytheshreyas <59922045+shreytheshreyas@users.noreply.github.com> Date: Mon, 9 Nov 2020 22:39:29 +0800 Subject: [PATCH 10/24] Delete Ui.java --- src/main/java/seedu/duke/ui/Ui.java | 394 ---------------------------- 1 file changed, 394 deletions(-) delete mode 100644 src/main/java/seedu/duke/ui/Ui.java diff --git a/src/main/java/seedu/duke/ui/Ui.java b/src/main/java/seedu/duke/ui/Ui.java deleted file mode 100644 index 90e0a26e4f..0000000000 --- a/src/main/java/seedu/duke/ui/Ui.java +++ /dev/null @@ -1,394 +0,0 @@ -package seedu.duke.ui; - -import seedu.ezmanager.member.TeamMember; -import seedu.ezmanager.project.Project; -import seedu.ezmanager.task.Task; -import java.time.LocalDate; -import java.time.LocalDateTime; -import java.time.format.DateTimeFormatter; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Date; -import java.time.Period; - -public class Ui { - - - private static final String MESSAGE_SINGLE_LINE = "_________________________________________" - + "____________________________________________"; - private static final String MESSAGE_WELCOME = "Hello from EzManager!\n" - + "What can I do for you?"; - private static final String MESSAGE_GOODBYE = "See you again!"; - private static final String MESSAGE_LOGO = " _____ ___ ___\n" - + "| ___| | \\ / |\n" - + "| |___ _____ | \\/ | ______ ______ ______ ______ ______ _____ _____\n" - + "| ___||___ / | |\\ /| || __ | | __ || __ | | __ || __ | / ___ \\| ___|\n" - + "| |___ / /_ | | \\/ | || |__| |_ | | | || |__| |_ | | | || |__| || ___/| |\n" - + "|_____| /____||__| |__||________||_| |_||________||_| |_||____ ||______||__|\n" - + " | |\n" - + " ____| |\n" - + " |______|\n"; - - public void printWelcome() { - System.out.println(MESSAGE_SINGLE_LINE); - System.out.println(MESSAGE_LOGO); - System.out.println(MESSAGE_WELCOME); - System.out.println(MESSAGE_SINGLE_LINE); - } - - public static String printGoodbyeMessage() { - return MESSAGE_GOODBYE; - } - - public void printLine() { - System.out.println(MESSAGE_SINGLE_LINE); - } - - public static void printOutput(String output) { - System.out.println(output); - } - - public static String printMemberAddedMessage(String name) { - return "Team member \"" + name + "\" has been added"; - } - - public static String printMemberRemovedInHomeViewMessage(String name) { - return "Team member \"" + name + "\" has been removed from program entirely"; - } - - public static String printMemberRemovedInProjectViewMessage(String name, String projectName) { - return "Team member \"" + name + "\" has been removed from Project \"" + projectName + "\""; - } - - public static String printProjectDeletedMessage(Project project) { - return "Project \"" + project.getProjectName() + "\" deleted"; - } - - public static String printProjectListMessage(ArrayList projects) { - String output = ""; - output += "List of Projects:"; - for (int i = 0; i < projects.size(); i++) { - output += "\n " + (i + 1) + "." + projects.get(i).getProjectName(); - if (projects.get(i).getProjectDeadline() != null) { - output += " (" + projects.get(i).getProjectDeadline() + ") "; - } - } - return output; - } - - public static String printTaskListMessage(Project project) { - - project.sortTasksList(); - int numberOfTasks = project.getTaskList().size(); - - String output = "List of Tasks:"; - - for (int i = 0; i < numberOfTasks; i++) { - - output += "\n " + (i + 1) + "." + project.getTask(i) - + ((project.getTask(i).getPriority() != 0) ? "|" - + "priority: " + project.getTask(i).getPriority() : ""); - } - - return output; - } - - public static String printProjectCreatedMessage(String projectName) { - return "Project \"" + projectName + "\" created!"; - } - - public static String printProjectDescriptionAddedMessage(Project project) { - return "Project description added \"" + project.getDescription() + "\"."; - } - - public static String printProjectDoneMessage(String projectName) { - return "Project \"" + projectName + "\" is done!"; - } - - public static String printProjectDeadlineAddedMessage(ArrayList projects, Project project, - LocalDate date, ArrayList members) { - String output = "Deadline " + date.format(DateTimeFormatter.ofPattern("dd/MM/yyyy")) - + " added to Project " + project.getProjectName() + "\n\n"; - output += printHomeView(projects, members); - return output; - } - - public static String printTaskCreatedMessage(String taskName) { - return "Task \"" + taskName + "\" created!"; - } - - public static String printEstimateAddedMessage(String taskName, int hours, int minutes) { - return "Task \"" + taskName + "\" has estimated time of " + hours + " hours and " + minutes + " minutes"; - } - - public static String printActualDurationAddedMessage(String taskName, int hours, int minutes) { - return "Task \"" + taskName + "\" took " + hours + " hours and " + minutes + " minutes to be completed."; - } - - public static String printTaskDoneMessage(String taskName) { - return "Task \"" + taskName + "\" is done!"; - } - - public static String printTaskDeletedMessage(String taskName) { - return "Task \"" + taskName + "\" removed!"; - } - - public static String printHomeView(ArrayList projects, ArrayList teamMembers) { - String output = "EZ Manager Home View\n"; - output += "\n ----------------------"; - output += "\n| PROJECT LIST |"; - output += "\n ----------------------\n"; - output += "\nIndex Status Project Name Project Description " - + "Deadline Tasks Completed Remarks"; - output += "\n---------------------------------------------------------------------------" - + "---------------------------------------------------------------------------"; - int projectIndex = 1; - String paddedProjectIndex; - String paddedProjectStatus; - String paddedProjectName; - String paddedProjectDescription; - String paddedProjectDeadline; - String paddedTaskCompleted; - for (Project project : projects) { - paddedProjectIndex = String.format("%-8s", projectIndex + "."); - String projectStatus; - if (project.isProjectDone()) { - projectStatus = "Y"; - } else { - projectStatus = "N"; - } - paddedProjectStatus = String.format("%-9s", projectStatus); - String projectName = project.getProjectName(); - if (projectName.length() >= 25) { - projectName = projectName.substring(0, 21) + "..."; - } - paddedProjectName = String.format("%-25s", projectName); - if (!project.getDescription().equals("")) { - String projectDescription = project.getDescription(); - if (projectDescription.length() >= 35) { - projectDescription = projectDescription.substring(0, 31) + "..."; - } - paddedProjectDescription = String.format("%-35s", projectDescription); - } else { - paddedProjectDescription = String.format("%-35s", "-"); - } - if (project.getProjectDeadline() != null) { - String projectDeadline = project.getProjectDeadline().format(DateTimeFormatter.ofPattern("dd/MM/yyyy")); - paddedProjectDeadline = String.format("%-13s", projectDeadline); - } else { - paddedProjectDeadline = String.format("%-13s", "-"); - } - String taskCompleted = project.getNumberOfFinishedTask() + "/" - + project.getNumberOfTask(); - paddedTaskCompleted = String.format("%-20s", taskCompleted); - String remarks = "-"; - LocalDate dateOfTaskWithNearestDeadline = null; - Task taskWithNearestDeadline = null; - if (!project.getTaskList().isEmpty()) { - ArrayList tasks = project.getTaskList(); - for (Task task : tasks) { - LocalDate deadlineOfTask = task.getDeadline(); - if (deadlineOfTask == null) { - continue; - } else if (dateOfTaskWithNearestDeadline == null) { - dateOfTaskWithNearestDeadline = deadlineOfTask; - taskWithNearestDeadline = task; - } else if (deadlineOfTask.compareTo(dateOfTaskWithNearestDeadline) < 0) { - dateOfTaskWithNearestDeadline = deadlineOfTask; - taskWithNearestDeadline = task; - } - } - LocalDate currentDate = LocalDate.now(); - if (dateOfTaskWithNearestDeadline != null && !taskWithNearestDeadline.getStatus()) { - //find the difference in the number of days from current days to deadline - Period period = Period.between(currentDate, dateOfTaskWithNearestDeadline); - if (period.getDays() <= 5 && period.getMonths() == 0 && period.getYears() == 0) { - remarks = "!!!WARNING!!! Task \"" + taskWithNearestDeadline.getDescription() - + "\" has " + period.getDays() + " day(s) before deadline and still not done!!"; - } else { - remarks = "Task \"" + taskWithNearestDeadline.getDescription() - + "\" has an upcoming deadline at " + taskWithNearestDeadline.getDateString() - + " and still not done!!"; - } - } - } - output += "\n" + paddedProjectIndex + paddedProjectStatus + paddedProjectName + paddedProjectDescription - + paddedProjectDeadline + paddedTaskCompleted + remarks; - projectIndex++; - } - output += "\n\n ----------------------"; - output += "\n| MEMBERS LIST |"; - output += "\n ----------------------\n"; - output += "\nIndex Member Name Projects Involved"; - output += "\n-----------------------------------------------------------------------------"; - int memberIndex = 1; - for (TeamMember member : teamMembers) { - String paddedMemberIndex = String.format("%-8s", memberIndex + "."); - String memberName = member.getName(); - if (member.getName().length() >= 30) { - memberName = member.getName().substring(0, 26) + "..."; - } - String paddedMemberName = String.format("%-30s", memberName); - output += "\n" + paddedMemberIndex + paddedMemberName; - if (!member.getAssignedProjects().isEmpty()) { - for (int i = 0; i < member.getAssignedProjects().size(); i++) { - String assignedProjectName = member.getAssignedProjects().get(i).getProjectName(); - if (i == 0) { - output += "1. " + assignedProjectName; - } else { - output += "\n " - + (i + 1) + ". " + assignedProjectName; - } - } - } else { - output += "-"; - } - output += System.lineSeparator(); - memberIndex++; - } - return output; - } - - public static String printTaskSelectedMessage(String taskName) { - return "Selected Task: " + taskName; - } - - public static String printTaskDeadlineMessage(LocalDate date, String taskName) { - return "Deadline " + date.format(DateTimeFormatter.ofPattern("dd/MM/yyyy")) - + " added to Task " + taskName; - } - - public static String printTaskNameUpdatedMessage(String oldTaskName, String newTaskName) { - return "Task " + "\"" + oldTaskName + "\" has been updated to \"" + newTaskName + "\""; - } - - public static String printInHomeViewMessage() { - return "Already in Home View!"; - } - - public static String printSwitchedToHomeViewMessage() { - return "Switched to Home View"; - } - - public static String projectViewMessage(Project project) { - try { - String projectTitle = "Project \"" + project.getProjectName() + "\""; - String projectDescription = "\n" + "Description:" + "\n" + project.getDescription(); - String taskListTitle = "\n ---------------------\n| TASK LIST |\n ---------------------"; - String membersListTitle = "\n ---------------------\n| MEMBERS LIST |\n ---------------------"; - String indexSpaces = " "; // 6 - String statusSpaces = " "; // 6 - String descriptionSpaces = " "; // 19 - String deadlineSpaces = " "; // 16 - String prioritySpaces = " "; // 11 - String expectedSpaces = " "; // 18 - String actualSpaces = " "; // 13 - String membersSpaces = " "; // 16 - String tableLabel = "Index Status Description " - + "Deadline Priority Expected Hrs Actual Hrs | Members Involved\n" - + "------------------------------------------------" - + "-----------------------------------------------|------------------"; - Integer extra = 0; - Integer i = 0; - int index; - String currentTaskLine = ""; - String taskLines = "\n"; - if (project.getTaskList().size() > 0) { - for (; i < project.getTaskList().size(); i++) { - index = i + 1; - Task currentTask = project.getTaskList().get(i); - String status = currentTask.isDone() ? "(Y)" : "(N)"; - String description = currentTask.getTaskDescription(); - String deadline = currentTask.getDateString(); - - currentTaskLine = index + indexSpaces + status + statusSpaces + description - + (descriptionSpaces.substring(0, descriptionSpaces.length() - description.length())); - if (deadline.length() > 0) { - currentTaskLine += (deadline); - } else { - currentTaskLine += "-"; - } - - currentTaskLine += (deadlineSpaces.substring(0, deadlineSpaces.length() - deadline.length())); - - int priority = currentTask.getPriority(); - if (priority > 0) { - currentTaskLine += (priority); - } else { - currentTaskLine += "-"; - } - currentTaskLine += (prioritySpaces.substring(0, prioritySpaces.length() - 1)); - - Integer estimate = currentTask.getEstimate(); - if (estimate > 1) { - currentTaskLine += (estimate / 60); - extra = estimate.toString().length() - 1; - } else { - currentTaskLine += "-"; - extra = 0; - } - currentTaskLine += (expectedSpaces.substring(0, expectedSpaces.length() - - estimate.toString().length() + extra)); - - Integer actual = currentTask.getActual(); - if (actual > 1) { - currentTaskLine += (actual / 60); - } else { - currentTaskLine += "-"; - } - - extra = actual.toString().length() - 1; - currentTaskLine += (actualSpaces.substring(0, actualSpaces.length() - - actual.toString().length() + extra)); - - String memberName = null; - ArrayList members = currentTask.getMembers(); - currentTaskLine += "|"; - memberName = "|"; - for (TeamMember member : members) { - currentTaskLine += member.getName() + "|"; - memberName = member.getName(); - } - //currentTaskLine += (membersSpaces.substring(0, membersSpaces.length() - memberName.length())); - taskLines += (currentTaskLine + "\n"); - } - } else { - taskLines += "No tasks have been added to this project."; - } - - ArrayList members = project.getTeamMembers(); - String membersListLines = ""; - if (members.size() > 0) { - for (int j = 0; j < members.size(); j++) { - membersListLines += (j + 1) + ". " + members.get(j).getName() + "\n"; - } - } else { - membersListLines += "No team members have been assigned to this project."; - } - - return projectTitle + "\n" + projectDescription + "\n" + taskListTitle + "\n" - + (project.getTaskList().size() > 0 ? tableLabel : "") + taskLines - + "\n \n" + membersListTitle + "\n" + membersListLines; - } catch (Error e) { - System.out.println(e.getMessage()); - } - return "hi"; - } - - public static String printMemberAssignedToTaskMessage(String memberName, String taskName) { - return "Member \"" + memberName + "\" has been assigned to \"" + taskName + "\""; - } - - public static String printMemberAssignedToProjectMessage(String memberName, String projectName) { - return memberName + " assigned to Project \"" + projectName + "\""; - } - - public static String printPriorityAssignedToTaskMessage(int priority, String taskName) { - return "Priority \"" + priority + "\" has been assigned to \"" + taskName + "\""; - } - - public static String printHoursWorkedMessage(String memberName, double hoursWorked) { - return memberName + " worked for " + String.format("%.1f", hoursWorked) + " hours."; - } - -} From 3502c711d1a09426c639fe363bcf259303e6ee8a Mon Sep 17 00:00:00 2001 From: shreytheshreyas <59922045+shreytheshreyas@users.noreply.github.com> Date: Mon, 9 Nov 2020 22:43:46 +0800 Subject: [PATCH 11/24] Update shreyaskumar.md --- docs/team/shreyaskumar.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/team/shreyaskumar.md b/docs/team/shreyaskumar.md index ee97dd9af4..2a61d2c2f8 100644 --- a/docs/team/shreyaskumar.md +++ b/docs/team/shreyaskumar.md @@ -43,8 +43,9 @@ Given below are my contributions to the project. - Explained about Mark task as done feature - Explained about sorting tasks feature - Wrote Manual Test Cases feature + - Contributed in the conversion of PDF version to the markdown version -* **Contributions to reviewing/mentoring**: +* **Contributions to reviewing**: * Our project had about 97 closed pull requests as of 9/11/2020. I reviewed, commented and approved about 21 of those PRs. I did my best to provide help my teammates by asking them if they could enhance certain features they themselves have already implemented. From 881b97c5ff1b1febea35e956233bc2572a7bc82b Mon Sep 17 00:00:00 2001 From: Samuel Christopher Date: Mon, 9 Nov 2020 22:44:59 +0800 Subject: [PATCH 12/24] Update samuelpaulchristopher.md --- docs/team/samuelpaulchristopher.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/team/samuelpaulchristopher.md b/docs/team/samuelpaulchristopher.md index 9fc018d5a6..1488bfbca8 100644 --- a/docs/team/samuelpaulchristopher.md +++ b/docs/team/samuelpaulchristopher.md @@ -56,8 +56,8 @@ Given below are my contributions to the project. * **Contributions to reviewing/mentoring**: - * Our project had about 95 closed pull requests as of 9/11/2020. I reviewed, commented and approved 28 of those PRs. - In those reviews, I provided extensive problem recognitions to those codes that were not suitable and provided explanations - to my teammates in parts of the codes that they did not understand. + * Our project had about 95 closed pull requests as of 9/11/2020. I reviewed 28 of those Pull Requests. + Throughout the review, I tried my best to understand the code and provide feedback as neccessary while + conciously considering the phrasing of my sentences to ensure clarity, brevity and politeness. From c224a7dd4a66437e23ad531b9bbcfc96ac3e01bf Mon Sep 17 00:00:00 2001 From: Samuel Christopher Date: Mon, 9 Nov 2020 22:47:20 +0800 Subject: [PATCH 13/24] Update samuelpaulchristopher.md --- docs/team/samuelpaulchristopher.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/team/samuelpaulchristopher.md b/docs/team/samuelpaulchristopher.md index 1488bfbca8..2edc201c07 100644 --- a/docs/team/samuelpaulchristopher.md +++ b/docs/team/samuelpaulchristopher.md @@ -55,9 +55,12 @@ Given below are my contributions to the project. * Generic Sections (Table of Contents, Introduction) -* **Contributions to reviewing/mentoring**: +* **Contributions to reviewing**: * Our project had about 95 closed pull requests as of 9/11/2020. I reviewed 28 of those Pull Requests. Throughout the review, I tried my best to understand the code and provide feedback as neccessary while conciously considering the phrasing of my sentences to ensure clarity, brevity and politeness. + +* **Testing**: + * I wrote the JUnit tests for the features above. From 6bc47cc6fb43bcc782d7d3073d5c52e841908ab2 Mon Sep 17 00:00:00 2001 From: Samuel Christopher Date: Mon, 9 Nov 2020 22:47:39 +0800 Subject: [PATCH 14/24] Update samuellleow.md --- docs/team/samuellleow.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/team/samuellleow.md b/docs/team/samuellleow.md index 9c39cce261..52ce4480b9 100644 --- a/docs/team/samuellleow.md +++ b/docs/team/samuellleow.md @@ -52,3 +52,5 @@ Given below are my contributions to the project. to my teammates in parts of the codes that they did not understand. +* **Testing**: + * I wrote the JUnit tests for the features above. From 1aa71b52bc71910b7d9dc27b524586c075e60f57 Mon Sep 17 00:00:00 2001 From: thatseant <46109197+thatseant@users.noreply.github.com> Date: Mon, 9 Nov 2020 23:02:23 +0800 Subject: [PATCH 15/24] Update UserGuide.md --- docs/UserGuide.md | 71 ++++++++++++++++++++++++++++++++++------------- 1 file changed, 51 insertions(+), 20 deletions(-) diff --git a/docs/UserGuide.md b/docs/UserGuide.md index d7726851bd..312dc83a5a 100644 --- a/docs/UserGuide.md +++ b/docs/UserGuide.md @@ -1,13 +1,40 @@ # User Guide -This user guide will explain how to use the software tool, -EZ Manager. You can navigate to the different sections of -this guide using the Table of Content. Each content is linked -to its respective sections. +## 1. Introduction +Welcome to EZ Manager! -## Introduction -EZ Manager is a CLI (Command Line Interface) software tool -for Software Engineering Project Managers to manage their -projects, tasks and team members all in one app. +EZ Manager is a CLI (Command Line Interface) software tool for Software Engineering Project Managers like yourself to manage your projects, tasks and team members in an all in one app. + +With Ez Manager's command line interface, you can easily make changes and updates with a few simple keystrokes! Our app also conveniently presents the most important information at a glance with just two main views: Home View and Project View. + +### 1.1 How to use this guide +This guide provides a documentation of the commands in EZ Manager. + +These commands are categorised into the two main views they can be called from: Home View and Project View. + +Click on any of the links on the Table of Contents to go directly to the specific commands you want to call. + +At the end of the document, the command summary section provides a helpful summary of all of EZ Manager's commands. + +**:warning:**: This refers to any formatting issues to look out for +when keying in the commands. + +**:exclamation:**: This refers to any other constraints to look out for +besides formatting issues. + +**:bulb:**: This refers to any helpful tips that might prove helpful to you. + +### 1.2 Structure +Under each command, a description of what the command does is provided. + +Then the format of the command is specified in a `code snippet`. + +You can see an example usage of the command followed by the expected output. + +``` +command PARAMETER_TYPE/VALUE +________________________________ +example output +``` ## Table of Contents 1. [Quick Start](#quick-start) @@ -48,10 +75,11 @@ projects, tasks and team members all in one app. ## Quick Start 1. Ensure that you have Java 11 or above installed. -1. Download the latest version of `EZ Manager` from [here](https://github.com/AY2021S1-CS2113T-T09-1/tp/releases). -1. Copy the JAR file into an empty new folder. Take note of the file path -1. Open Command Prompt (on Windows) or Terminal (on Mac) and type -java -jar {file path}/ezManager.jar +2. Download the latest version of `EZ Manager` from [here](https://github.com/AY2021S1-CS2113T-T09-1/tp/releases). +3. Copy the JAR file into an empty new folder. +4. Open Command Prompt (on Windows) or Terminal (on Mac) and cd into the new folder. +5. Then type java -jar ezManager.jar to run EZ Manager. + ## Terminologies - **Home View**: Refers to the state of the program in Home View. @@ -78,18 +106,19 @@ all tasks by using the `list` command in Project View a positive integer. Hence, the MEMBER_INDEX refers to this positive integer. You can retrieve the MEMBER_INDEXes of Members by using the `list` command in Home View or in Project View -- **warning**: This refers to any formatting issues to look out for -when keying in the commands -- **exclamation**: This refers to any other constraints to look out for -besides formatting issues + > :warning: Project Index, Task Index and Member Index must be positive integers. ## Home View -The Home View displays the full list of projects and members that are under a manager's purview. -The manager can add and edit projects and members from this view. +The Home View displays the full list of projects and members that are under your purview. + +At a glance, see the most important details about your project including its status, deadline and number of tasks completed. + +The Home View also conveniently provides warnings for uncompleted tasks with imminent deadlines. + Remarks shown for each project depends on the deadline of its tasks. 1. Task not done and has an upcoming deadline due in 5 days or less - `!!!Warning!!!` and countdown to deadline shown. @@ -158,7 +187,7 @@ ____________________________________________________________ ### Viewing the updated Home View: `list` -Displays the updated Home View to user. +After any changes, immediately see the updated view with the `list` command. Format: `list` @@ -405,6 +434,8 @@ Team member "Mike" has been removed from program entirely ### View hours worked by member: `hours` View the total hours worked by a worker across all tasks assigned in all projects. +Now, you know which of your workers are overworked and be a better manager by shifting work to members who are more free! + > :exclamation: ​The member must exist before hours worked can be viewed. Format: `hours m/MEMBER_INDEX` @@ -491,7 +522,7 @@ Task "Deploy Version 2.0" created! ``` ### Editing a task name: `edit` -Updates an existing task name with the new name +Updates an existing task name with the new name. Format: `edit t/TASK_INDEX n/NEW_TASK_NAME` From 51f364641c9a995a1b3d4afd13131fe1bc79d1f7 Mon Sep 17 00:00:00 2001 From: thatseant <46109197+thatseant@users.noreply.github.com> Date: Mon, 9 Nov 2020 23:16:05 +0800 Subject: [PATCH 16/24] Update UserGuide.md --- docs/UserGuide.md | 136 +++++++++++++++++++++++----------------------- 1 file changed, 67 insertions(+), 69 deletions(-) diff --git a/docs/UserGuide.md b/docs/UserGuide.md index 312dc83a5a..25a42f5bbd 100644 --- a/docs/UserGuide.md +++ b/docs/UserGuide.md @@ -1,12 +1,12 @@ # User Guide -## 1. Introduction +## Introduction Welcome to EZ Manager! EZ Manager is a CLI (Command Line Interface) software tool for Software Engineering Project Managers like yourself to manage your projects, tasks and team members in an all in one app. With Ez Manager's command line interface, you can easily make changes and updates with a few simple keystrokes! Our app also conveniently presents the most important information at a glance with just two main views: Home View and Project View. -### 1.1 How to use this guide +### How to use this guide This guide provides a documentation of the commands in EZ Manager. These commands are categorised into the two main views they can be called from: Home View and Project View. @@ -23,7 +23,7 @@ besides formatting issues. **:bulb:**: This refers to any helpful tips that might prove helpful to you. -### 1.2 Structure +### Structure Under each command, a description of what the command does is provided. Then the format of the command is specified in a `code snippet`. @@ -37,43 +37,41 @@ example output ``` ## Table of Contents -1. [Quick Start](#quick-start) +1. [Quick Start](#1-quick-start) 2. [Terminologies](#terminologies) 3. [Home View](#home-view) - 1. [Accessing Home View](#accessing-home-view) - 2. [Commands](#home-view-commands) - 1. [List: Viewing the updated Home View](#viewing-the-updated-home-view-list) - 2. [Project: Adding a project](#adding-a-project-project) - 3. [Select: Selecting a project](#selecting-a-project-select) - 4. [Done: Marking a project as done](#marking-a-project-as-done-done) - 5. [Deadline: Adding a deadline to a project](#adding-a-deadline-to-a-project-deadline) - 6. [Description: Adding a description to a project](#adding-a-description-to-a-project-description) - 7. [Delete: Deleting a project](#deleting-a-project-delete) - 8. [Member: Adding a member](#adding-a-member-member) - 9. [Assign: Assigning a member to a project](#assigning-a-member-to-a-project-assign) - 10. [Remove: Removing a member](#removing-a-member-remove) - 11. [Hours: Hours worked by member](#view-hours-worked-by-member-hours) - 12. [Bye: Exit Program](#exiting-ez-Manager-bye) + 1. [Commands](#31-home-view-commands) + 1. [List: Viewing the updated Home View](#311-viewing-the-updated-home-view-list) + 2. [Project: Adding a project](#312-adding-a-project-project) + 3. [Select: Selecting a project](#313-selecting-a-project-select) + 4. [Done: Marking a project as done](#314-marking-a-project-as-done-done) + 5. [Deadline: Adding a deadline to a project](#315-adding-a-deadline-to-a-project-deadline) + 6. [Description: Adding a description to a project](#316-adding-a-description-to-a-project-description) + 7. [Delete: Deleting a project](#317-deleting-a-project-delete) + 8. [Member: Adding a member](#318-adding-a-member-member) + 9. [Assign: Assigning a member to a project](#319-assigning-a-member-to-a-project-assign) + 10. [Remove: Removing a member](#3110-removing-a-member-remove) + 11. [Hours: Hours worked by member](#3111-view-hours-worked-by-member-hours) + 12. [Bye: Exit Program](#3112-exiting-ez-Manager-bye) 4. [Project View](#project-view) - 1. [Accessing Project View](#accessing-project-view) - 2. [Commands](#project-view-commands) - 1. [List: Viewing the updated Project View](#viewing-the-updated-project-view-list) - 2. [Task: Adding a task](#adding-a-task-task) - 3. [Edit: Editing a task name](#editing-a-task-name-edit) - 4. [Done: Marking a task as done](#marking-a-task-as-done-done) - 5. [Deadline: Adding a deadline to a task](#adding-a-deadline-to-a-task-deadline) - 6. [Priority: Adding a priority to a task](#adding-a-priority-to-a-task-deadline) - 7. [Delete: Deleting a task](#deleting-a-task-delete) - 8. [Assign: Assigning a member to a task](#assigning-a-member-to-a-task-assign) - 9. [Estimate: Adding estimated time to a task](#add-estimated-time-estimate) - 10. [Actual: Adding actual time to a task](#add-actual-time-taken-actual) - 11. [Sort: Sort tasks](#sort-tasks-sort) - 11. [Bye: Exit Program](#exiting-ez-manager-bye) -5. [Exiting EZ Manager](#exiting-ez-manager) -6. [FAQ](#faq) -7. [Command Summary](#command-summary) - -## Quick Start + 1. [Commands](#project-view-commands) + 1. [List: Viewing the updated Project View](#41-viewing-the-updated-project-view-list) + 2. [Task: Adding a task](#42-adding-a-task-task) + 3. [Edit: Editing a task name](#43-editing-a-task-name-edit) + 4. [Done: Marking a task as done](#44-marking-a-task-as-done-done) + 5. [Deadline: Adding a deadline to a task](#45-adding-a-deadline-to-a-task-deadline) + 6. [Priority: Adding a priority to a task](#46-adding-a-priority-to-a-task-deadline) + 7. [Delete: Deleting a task](#47-deleting-a-task-delete) + 8. [Assign: Assigning a member to a task](#48-assigning-a-member-to-a-task-assign) + 9. [Estimate: Adding estimated time to a task](#49-add-estimated-time-estimate) + 10. [Actual: Adding actual time to a task](#410-add-actual-time-taken-actual) + 11. [Sort: Sort tasks](#411-sort-tasks-sort) + 12. [Bye: Exit Program](#412-exiting-ez-manager-bye) + 13. [Exiting EZ Manager](#413-exiting-ez-manager) +5. [FAQ](#faq) +6. [Command Summary](#command-summary) + +## 1. Quick Start 1. Ensure that you have Java 11 or above installed. 2. Download the latest version of `EZ Manager` from [here](https://github.com/AY2021S1-CS2113T-T09-1/tp/releases). 3. Copy the JAR file into an empty new folder. @@ -81,7 +79,7 @@ example output 5. Then type java -jar ezManager.jar to run EZ Manager. -## Terminologies +## 2. Terminologies - **Home View**: Refers to the state of the program in Home View. In this view, you can execute project and member commands but you cannot execute task commands. @@ -112,7 +110,7 @@ Members by using the `list` command in Home View or in Project View -## Home View +## 3. Home View The Home View displays the full list of projects and members that are under your purview. At a glance, see the most important details about your project including its status, deadline and number of tasks completed. @@ -165,7 +163,7 @@ ____________________________________________________________ -## Home View Commands +## 3.1. Home View Commands > ### Command Format > @@ -185,7 +183,7 @@ ____________________________________________________________ -### Viewing the updated Home View: `list` +### 3.1.1. Viewing the updated Home View: `list` After any changes, immediately see the updated view with the `list` command. @@ -193,7 +191,7 @@ Format: `list` -### Adding a project: `project` +### 3.1.2. Adding a project: `project` Adds a new project to the project list. Format: `project n/PROJECT_NAME` @@ -212,7 +210,7 @@ Project "Web Development" created! -### Selecting a project: `select` +### 3.1.3. Selecting a project: `select` Select a new project from the project list and brings user to Project View of specified project. @@ -230,7 +228,7 @@ select p/1 -### Marking a project as done: `done` +### 3.1.4. Marking a project as done: `done` Marks an existing project as done. > :exclamation: The project must exist before it can be marked as done. @@ -250,7 +248,7 @@ ____________________________________________________________ -### Adding a deadline to a project: `deadline` +### 3.1.5. Adding a deadline to a project: `deadline` Adds a deadline to an existing project then sorts the projects in the list according to deadline. > :exclamation: The project must exist before a deadline can be added. @@ -334,7 +332,7 @@ ____________________________________________________________ -### Adding a description to a project: `description` +### 3.1.6. Adding a description to a project: `description` Adds a description to an existing project. >:exclamation: The project must exist before a description can be added. @@ -355,7 +353,7 @@ Project description added "This is my Software Engineering Module.". -### Deleting a project: `delete` +### 3.1.7. Deleting a project: `delete` Delete a project from the project list. @@ -374,7 +372,7 @@ Project "Home Improvement" deleted ____________________________________________________________ ``` -### Adding a member: `member` +### 3.1.8. Adding a member: `member` Adds a new member to the member list. Format: `member n/MEMBER_NAME` @@ -391,7 +389,7 @@ Team member "John Doe" has been added -### Assigning a member to a project: `assign` +### 3.1.9. Assigning a member to a project: `assign` Assigns an existing member to an existing project. > :exclamation: The project must exist before it can be assigned a member. @@ -412,7 +410,7 @@ Tom assigned to Project "CS2113T" -### Removing a member: `remove` +### 3.1.10. Removing a member: `remove` Removes an existing member from the member list as well as every project and task the member is assigned to. > :exclamation: The member must exist before they can be removed. @@ -431,7 +429,7 @@ Team member "Mike" has been removed from program entirely -### View hours worked by member: `hours` +### 3.1.11. View hours worked by member: `hours` View the total hours worked by a worker across all tasks assigned in all projects. Now, you know which of your workers are overworked and be a better manager by shifting work to members who are more free! @@ -448,14 +446,14 @@ hours m/1 John worked for 2.5 hours. ``` -### Exiting EZ Manager: `bye` +### 3.1.12. Exiting EZ Manager: `bye` You can exit the program with the `bye` command. Format: `bye` -## Project View +## 4. Project View The Project View displays the full list of tasks and members in a particular project. The manager can add and edit tasks and assign members to tasks. @@ -497,14 +495,14 @@ ____________________________________________________________ -## Project View Commands +## 4.1. Project View Commands -### Viewing the updated Project View: `list` +### 4.1.1. Viewing the updated Project View: `list` Displays the updated Project View to user. Format: `list` -### Adding a task: `task` +### 4.1.2. Adding a task: `task` Adds a new task to the task list. Format: `task n/TASK_NAME` @@ -521,7 +519,7 @@ ____________________________________________________________ Task "Deploy Version 2.0" created! ``` -### Editing a task name: `edit` +### 4.1.3. Editing a task name: `edit` Updates an existing task name with the new name. Format: `edit t/TASK_INDEX n/NEW_TASK_NAME` @@ -544,7 +542,7 @@ Task "Read documentation" has been updated to "Update documentation" ``` -### Marking a task as done: `done` +### 4.1.4. Marking a task as done: `done` Marks an existing task as done. > :exclamation: The task must exist before it can be selected. @@ -561,7 +559,7 @@ ____________________________________________________________ Task "Coding" is done! ``` -### Adding a deadline to a task: `deadline` +### 4.1.5. Adding a deadline to a task: `deadline` Adds a deadline to an existing task. Format: `deadline t/TASK_INDEX d/DATE` @@ -583,7 +581,7 @@ Deadline 25/10/2020 added to Task Coding -### Adding a priority to a task: `priority` +### 4.1.6. Adding a priority to a task: `priority` Adds a priority to an existing task. > :bulb: 1 denotes the highest priority. @@ -606,7 +604,7 @@ Priority "1" has been assigned to "Coding" -### Deleting a task: `delete` +### 4.1.7. Deleting a task: `delete` Deletes a task from the task list. > :exclamation: The task must exist in the task list before it can be deleted. @@ -623,7 +621,7 @@ ____________________________________________________________ Task "Coding" removed! ``` -### Assigning a member to a task: `assign` +### 4.1.8. Assigning a member to a task: `assign` Assigns an existing member to an existing task. > :exclamation: Members must belong to a project before they can be assigned tasks. @@ -646,7 +644,7 @@ Member "Tom" has been assigned to "Code Review" -### Removing a member: `remove` +### 4.1.9. Removing a member: `remove` Removes an existing member from the current project as well as the tasks assigned. > :exclamation: The member must exist before they can be removed. @@ -665,7 +663,7 @@ Team member "Mike" has been removed from Project "CS2113T" -### Add estimated time: `estimate` +### 4.1.10. Add estimated time: `estimate` Add estimated time taken for task to complete. Format: `estimate t/TASK_INDEX h/HOURS m/MINUTES` @@ -683,7 +681,7 @@ Task "New Task" has estimated time of 12 hours and 30 minutes ``` -### Add actual time taken: `actual` +### 4.1.11. Add actual time taken: `actual` Add actual time taken for task to complete. > :exclamation: Task must be marked as done before actual time taken can be added. @@ -703,7 +701,7 @@ Task "New Task" took 12 hours and 30 minutes to be completed. ``` -### Sort tasks: `sort` +### 4.1.12. Sort tasks: `sort` Sort tasks by priority, deadline or actual time taken. @@ -727,13 +725,13 @@ ____________________________________________________________ Task List sorted based on deadline ``` -### Exiting EZ Manager: `bye` +### 4.1.13. Exiting EZ Manager: `bye` You can exit the program with the `bye` command. Format: `bye` -## FAQ +## 5. FAQ **Q**: Does the program saves the data entered when I terminate the program abruptly? @@ -749,7 +747,7 @@ even if the program is terminated abruptly. **A**: Once you have the JAR file downloaded, you can run `java -jar ezmanager.jar` in the terminal at the specific folder the JAR file is stored and you have begun. -## Command Summary +## 6. Command Summary Home View Commands | Commands | Action | Examples | From 99100aad0526d99836a1f6d45380cf507fbf3dac Mon Sep 17 00:00:00 2001 From: thatseant <46109197+thatseant@users.noreply.github.com> Date: Mon, 9 Nov 2020 23:17:52 +0800 Subject: [PATCH 17/24] Update UserGuide.md --- docs/UserGuide.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/UserGuide.md b/docs/UserGuide.md index 25a42f5bbd..8fdd6fec18 100644 --- a/docs/UserGuide.md +++ b/docs/UserGuide.md @@ -55,19 +55,19 @@ example output 12. [Bye: Exit Program](#3112-exiting-ez-Manager-bye) 4. [Project View](#project-view) 1. [Commands](#project-view-commands) - 1. [List: Viewing the updated Project View](#41-viewing-the-updated-project-view-list) - 2. [Task: Adding a task](#42-adding-a-task-task) - 3. [Edit: Editing a task name](#43-editing-a-task-name-edit) - 4. [Done: Marking a task as done](#44-marking-a-task-as-done-done) - 5. [Deadline: Adding a deadline to a task](#45-adding-a-deadline-to-a-task-deadline) - 6. [Priority: Adding a priority to a task](#46-adding-a-priority-to-a-task-deadline) - 7. [Delete: Deleting a task](#47-deleting-a-task-delete) - 8. [Assign: Assigning a member to a task](#48-assigning-a-member-to-a-task-assign) - 9. [Estimate: Adding estimated time to a task](#49-add-estimated-time-estimate) - 10. [Actual: Adding actual time to a task](#410-add-actual-time-taken-actual) - 11. [Sort: Sort tasks](#411-sort-tasks-sort) - 12. [Bye: Exit Program](#412-exiting-ez-manager-bye) - 13. [Exiting EZ Manager](#413-exiting-ez-manager) + 1. [List: Viewing the updated Project View](#411-viewing-the-updated-project-view-list) + 2. [Task: Adding a task](#412-adding-a-task-task) + 3. [Edit: Editing a task name](#413-editing-a-task-name-edit) + 4. [Done: Marking a task as done](#414-marking-a-task-as-done-done) + 5. [Deadline: Adding a deadline to a task](#415-adding-a-deadline-to-a-task-deadline) + 6. [Priority: Adding a priority to a task](#416-adding-a-priority-to-a-task-deadline) + 7. [Delete: Deleting a task](#417-deleting-a-task-delete) + 8. [Assign: Assigning a member to a task](#418-assigning-a-member-to-a-task-assign) + 9. [Estimate: Adding estimated time to a task](#419-add-estimated-time-estimate) + 10. [Actual: Adding actual time to a task](#4110-add-actual-time-taken-actual) + 11. [Sort: Sort tasks](#4111-sort-tasks-sort) + 12. [Bye: Exit Program](#4112-exiting-ez-manager-bye) + 13. [Exiting EZ Manager](#4113-exiting-ez-manager) 5. [FAQ](#faq) 6. [Command Summary](#command-summary) From 4266fde8a0ccc083c17075fba2d439cb17130935 Mon Sep 17 00:00:00 2001 From: Samuel Christopher Date: Mon, 9 Nov 2020 23:21:17 +0800 Subject: [PATCH 18/24] Update DeveloperGuide.md --- docs/DeveloperGuide.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index 43872942d5..0e083c70fd 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -4,10 +4,8 @@ ![EZ Manager Welcome](https://i.ibb.co/n7zphMR/ezmanagerterminal.png) ## **Changelog** -Identifier | Changes | Date ----------- | ------------------- | ---- -A | Incorporated feedback from CS2101 review
  • Include table of content
  • Include preface for sections
  • Add introductory sections
  • Address the reader directly – “You”
| 29 October 2020 -B | final developer guide for CS2113T Team project
  • Include table of content
  • Included updated command summary
  • Converted DG to Markdown
  • Included sequence diagrams
| 09 November 2020 +![EZ Manager Changelog](https://i.ibb.co/NNcdxnh/changelog.png) + --- ## **Table of Contents** @@ -17,7 +15,7 @@ B | final developer guide for CS2113T Team project
  • Include table of conte - [Implementation](#implementation) - [Testing](#running-tests) - Dev Ops - - [Making A Release](#devops---making-a-release) + - [Making A Release](#devops) - Appendices - [Appendix A: Product Scope](#Appendix-A-Product-Scope-Samuel-Leow) - [Appendix B: Commands Summary](#Appendix-B-Command-Summary-Samuel-Paul-Christopher) @@ -724,7 +722,7 @@ There are two ways to run tests for EZ manager. - On Windows, run the command `gradlew clean allTests` in a terminal - On Mac or Linux, run the command `./gradlew clean allTests` in a terminal -## **DevOps - Making a Release (Samuel Paul Christopher)** +## **DevOps (Samuel Paul Christopher)** Here are the steps to create a new release. 1. Update the version number in Duke.java 2. Generate a JAR file using Gradle From a06e8afa081563b55c904e536187c4ecd9f416d0 Mon Sep 17 00:00:00 2001 From: thatseant <46109197+thatseant@users.noreply.github.com> Date: Mon, 9 Nov 2020 23:23:02 +0800 Subject: [PATCH 19/24] Update UserGuide.md --- docs/UserGuide.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/UserGuide.md b/docs/UserGuide.md index 8fdd6fec18..74a55c9a4f 100644 --- a/docs/UserGuide.md +++ b/docs/UserGuide.md @@ -63,11 +63,11 @@ example output 6. [Priority: Adding a priority to a task](#416-adding-a-priority-to-a-task-deadline) 7. [Delete: Deleting a task](#417-deleting-a-task-delete) 8. [Assign: Assigning a member to a task](#418-assigning-a-member-to-a-task-assign) - 9. [Estimate: Adding estimated time to a task](#419-add-estimated-time-estimate) - 10. [Actual: Adding actual time to a task](#4110-add-actual-time-taken-actual) - 11. [Sort: Sort tasks](#4111-sort-tasks-sort) - 12. [Bye: Exit Program](#4112-exiting-ez-manager-bye) - 13. [Exiting EZ Manager](#4113-exiting-ez-manager) + 9. [Remove: Removing a member from the project](#419-removing-a-member-remove) + 10. [Estimate: Adding estimated time to a task](#4110-add-estimated-time-estimate) + 11. [Actual: Adding actual time to a task](#4111-add-actual-time-taken-actual) + 12. [Sort: Sort tasks](#4112-sort-tasks-sort) + 13. [Bye: Exit Program](#4113-exiting-ez-manager-bye) 5. [FAQ](#faq) 6. [Command Summary](#command-summary) From a3b175b008fb583e0c93febd42fb2d115aefedce Mon Sep 17 00:00:00 2001 From: Sam Chris Date: Mon, 9 Nov 2020 23:26:35 +0800 Subject: [PATCH 20/24] Removed Duke UI --- src/main/java/seedu/duke/ui/Ui.java | 394 ---------------------------- 1 file changed, 394 deletions(-) delete mode 100644 src/main/java/seedu/duke/ui/Ui.java diff --git a/src/main/java/seedu/duke/ui/Ui.java b/src/main/java/seedu/duke/ui/Ui.java deleted file mode 100644 index 90e0a26e4f..0000000000 --- a/src/main/java/seedu/duke/ui/Ui.java +++ /dev/null @@ -1,394 +0,0 @@ -package seedu.duke.ui; - -import seedu.ezmanager.member.TeamMember; -import seedu.ezmanager.project.Project; -import seedu.ezmanager.task.Task; -import java.time.LocalDate; -import java.time.LocalDateTime; -import java.time.format.DateTimeFormatter; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Date; -import java.time.Period; - -public class Ui { - - - private static final String MESSAGE_SINGLE_LINE = "_________________________________________" - + "____________________________________________"; - private static final String MESSAGE_WELCOME = "Hello from EzManager!\n" - + "What can I do for you?"; - private static final String MESSAGE_GOODBYE = "See you again!"; - private static final String MESSAGE_LOGO = " _____ ___ ___\n" - + "| ___| | \\ / |\n" - + "| |___ _____ | \\/ | ______ ______ ______ ______ ______ _____ _____\n" - + "| ___||___ / | |\\ /| || __ | | __ || __ | | __ || __ | / ___ \\| ___|\n" - + "| |___ / /_ | | \\/ | || |__| |_ | | | || |__| |_ | | | || |__| || ___/| |\n" - + "|_____| /____||__| |__||________||_| |_||________||_| |_||____ ||______||__|\n" - + " | |\n" - + " ____| |\n" - + " |______|\n"; - - public void printWelcome() { - System.out.println(MESSAGE_SINGLE_LINE); - System.out.println(MESSAGE_LOGO); - System.out.println(MESSAGE_WELCOME); - System.out.println(MESSAGE_SINGLE_LINE); - } - - public static String printGoodbyeMessage() { - return MESSAGE_GOODBYE; - } - - public void printLine() { - System.out.println(MESSAGE_SINGLE_LINE); - } - - public static void printOutput(String output) { - System.out.println(output); - } - - public static String printMemberAddedMessage(String name) { - return "Team member \"" + name + "\" has been added"; - } - - public static String printMemberRemovedInHomeViewMessage(String name) { - return "Team member \"" + name + "\" has been removed from program entirely"; - } - - public static String printMemberRemovedInProjectViewMessage(String name, String projectName) { - return "Team member \"" + name + "\" has been removed from Project \"" + projectName + "\""; - } - - public static String printProjectDeletedMessage(Project project) { - return "Project \"" + project.getProjectName() + "\" deleted"; - } - - public static String printProjectListMessage(ArrayList projects) { - String output = ""; - output += "List of Projects:"; - for (int i = 0; i < projects.size(); i++) { - output += "\n " + (i + 1) + "." + projects.get(i).getProjectName(); - if (projects.get(i).getProjectDeadline() != null) { - output += " (" + projects.get(i).getProjectDeadline() + ") "; - } - } - return output; - } - - public static String printTaskListMessage(Project project) { - - project.sortTasksList(); - int numberOfTasks = project.getTaskList().size(); - - String output = "List of Tasks:"; - - for (int i = 0; i < numberOfTasks; i++) { - - output += "\n " + (i + 1) + "." + project.getTask(i) - + ((project.getTask(i).getPriority() != 0) ? "|" - + "priority: " + project.getTask(i).getPriority() : ""); - } - - return output; - } - - public static String printProjectCreatedMessage(String projectName) { - return "Project \"" + projectName + "\" created!"; - } - - public static String printProjectDescriptionAddedMessage(Project project) { - return "Project description added \"" + project.getDescription() + "\"."; - } - - public static String printProjectDoneMessage(String projectName) { - return "Project \"" + projectName + "\" is done!"; - } - - public static String printProjectDeadlineAddedMessage(ArrayList projects, Project project, - LocalDate date, ArrayList members) { - String output = "Deadline " + date.format(DateTimeFormatter.ofPattern("dd/MM/yyyy")) - + " added to Project " + project.getProjectName() + "\n\n"; - output += printHomeView(projects, members); - return output; - } - - public static String printTaskCreatedMessage(String taskName) { - return "Task \"" + taskName + "\" created!"; - } - - public static String printEstimateAddedMessage(String taskName, int hours, int minutes) { - return "Task \"" + taskName + "\" has estimated time of " + hours + " hours and " + minutes + " minutes"; - } - - public static String printActualDurationAddedMessage(String taskName, int hours, int minutes) { - return "Task \"" + taskName + "\" took " + hours + " hours and " + minutes + " minutes to be completed."; - } - - public static String printTaskDoneMessage(String taskName) { - return "Task \"" + taskName + "\" is done!"; - } - - public static String printTaskDeletedMessage(String taskName) { - return "Task \"" + taskName + "\" removed!"; - } - - public static String printHomeView(ArrayList projects, ArrayList teamMembers) { - String output = "EZ Manager Home View\n"; - output += "\n ----------------------"; - output += "\n| PROJECT LIST |"; - output += "\n ----------------------\n"; - output += "\nIndex Status Project Name Project Description " - + "Deadline Tasks Completed Remarks"; - output += "\n---------------------------------------------------------------------------" - + "---------------------------------------------------------------------------"; - int projectIndex = 1; - String paddedProjectIndex; - String paddedProjectStatus; - String paddedProjectName; - String paddedProjectDescription; - String paddedProjectDeadline; - String paddedTaskCompleted; - for (Project project : projects) { - paddedProjectIndex = String.format("%-8s", projectIndex + "."); - String projectStatus; - if (project.isProjectDone()) { - projectStatus = "Y"; - } else { - projectStatus = "N"; - } - paddedProjectStatus = String.format("%-9s", projectStatus); - String projectName = project.getProjectName(); - if (projectName.length() >= 25) { - projectName = projectName.substring(0, 21) + "..."; - } - paddedProjectName = String.format("%-25s", projectName); - if (!project.getDescription().equals("")) { - String projectDescription = project.getDescription(); - if (projectDescription.length() >= 35) { - projectDescription = projectDescription.substring(0, 31) + "..."; - } - paddedProjectDescription = String.format("%-35s", projectDescription); - } else { - paddedProjectDescription = String.format("%-35s", "-"); - } - if (project.getProjectDeadline() != null) { - String projectDeadline = project.getProjectDeadline().format(DateTimeFormatter.ofPattern("dd/MM/yyyy")); - paddedProjectDeadline = String.format("%-13s", projectDeadline); - } else { - paddedProjectDeadline = String.format("%-13s", "-"); - } - String taskCompleted = project.getNumberOfFinishedTask() + "/" - + project.getNumberOfTask(); - paddedTaskCompleted = String.format("%-20s", taskCompleted); - String remarks = "-"; - LocalDate dateOfTaskWithNearestDeadline = null; - Task taskWithNearestDeadline = null; - if (!project.getTaskList().isEmpty()) { - ArrayList tasks = project.getTaskList(); - for (Task task : tasks) { - LocalDate deadlineOfTask = task.getDeadline(); - if (deadlineOfTask == null) { - continue; - } else if (dateOfTaskWithNearestDeadline == null) { - dateOfTaskWithNearestDeadline = deadlineOfTask; - taskWithNearestDeadline = task; - } else if (deadlineOfTask.compareTo(dateOfTaskWithNearestDeadline) < 0) { - dateOfTaskWithNearestDeadline = deadlineOfTask; - taskWithNearestDeadline = task; - } - } - LocalDate currentDate = LocalDate.now(); - if (dateOfTaskWithNearestDeadline != null && !taskWithNearestDeadline.getStatus()) { - //find the difference in the number of days from current days to deadline - Period period = Period.between(currentDate, dateOfTaskWithNearestDeadline); - if (period.getDays() <= 5 && period.getMonths() == 0 && period.getYears() == 0) { - remarks = "!!!WARNING!!! Task \"" + taskWithNearestDeadline.getDescription() - + "\" has " + period.getDays() + " day(s) before deadline and still not done!!"; - } else { - remarks = "Task \"" + taskWithNearestDeadline.getDescription() - + "\" has an upcoming deadline at " + taskWithNearestDeadline.getDateString() - + " and still not done!!"; - } - } - } - output += "\n" + paddedProjectIndex + paddedProjectStatus + paddedProjectName + paddedProjectDescription - + paddedProjectDeadline + paddedTaskCompleted + remarks; - projectIndex++; - } - output += "\n\n ----------------------"; - output += "\n| MEMBERS LIST |"; - output += "\n ----------------------\n"; - output += "\nIndex Member Name Projects Involved"; - output += "\n-----------------------------------------------------------------------------"; - int memberIndex = 1; - for (TeamMember member : teamMembers) { - String paddedMemberIndex = String.format("%-8s", memberIndex + "."); - String memberName = member.getName(); - if (member.getName().length() >= 30) { - memberName = member.getName().substring(0, 26) + "..."; - } - String paddedMemberName = String.format("%-30s", memberName); - output += "\n" + paddedMemberIndex + paddedMemberName; - if (!member.getAssignedProjects().isEmpty()) { - for (int i = 0; i < member.getAssignedProjects().size(); i++) { - String assignedProjectName = member.getAssignedProjects().get(i).getProjectName(); - if (i == 0) { - output += "1. " + assignedProjectName; - } else { - output += "\n " - + (i + 1) + ". " + assignedProjectName; - } - } - } else { - output += "-"; - } - output += System.lineSeparator(); - memberIndex++; - } - return output; - } - - public static String printTaskSelectedMessage(String taskName) { - return "Selected Task: " + taskName; - } - - public static String printTaskDeadlineMessage(LocalDate date, String taskName) { - return "Deadline " + date.format(DateTimeFormatter.ofPattern("dd/MM/yyyy")) - + " added to Task " + taskName; - } - - public static String printTaskNameUpdatedMessage(String oldTaskName, String newTaskName) { - return "Task " + "\"" + oldTaskName + "\" has been updated to \"" + newTaskName + "\""; - } - - public static String printInHomeViewMessage() { - return "Already in Home View!"; - } - - public static String printSwitchedToHomeViewMessage() { - return "Switched to Home View"; - } - - public static String projectViewMessage(Project project) { - try { - String projectTitle = "Project \"" + project.getProjectName() + "\""; - String projectDescription = "\n" + "Description:" + "\n" + project.getDescription(); - String taskListTitle = "\n ---------------------\n| TASK LIST |\n ---------------------"; - String membersListTitle = "\n ---------------------\n| MEMBERS LIST |\n ---------------------"; - String indexSpaces = " "; // 6 - String statusSpaces = " "; // 6 - String descriptionSpaces = " "; // 19 - String deadlineSpaces = " "; // 16 - String prioritySpaces = " "; // 11 - String expectedSpaces = " "; // 18 - String actualSpaces = " "; // 13 - String membersSpaces = " "; // 16 - String tableLabel = "Index Status Description " - + "Deadline Priority Expected Hrs Actual Hrs | Members Involved\n" - + "------------------------------------------------" - + "-----------------------------------------------|------------------"; - Integer extra = 0; - Integer i = 0; - int index; - String currentTaskLine = ""; - String taskLines = "\n"; - if (project.getTaskList().size() > 0) { - for (; i < project.getTaskList().size(); i++) { - index = i + 1; - Task currentTask = project.getTaskList().get(i); - String status = currentTask.isDone() ? "(Y)" : "(N)"; - String description = currentTask.getTaskDescription(); - String deadline = currentTask.getDateString(); - - currentTaskLine = index + indexSpaces + status + statusSpaces + description - + (descriptionSpaces.substring(0, descriptionSpaces.length() - description.length())); - if (deadline.length() > 0) { - currentTaskLine += (deadline); - } else { - currentTaskLine += "-"; - } - - currentTaskLine += (deadlineSpaces.substring(0, deadlineSpaces.length() - deadline.length())); - - int priority = currentTask.getPriority(); - if (priority > 0) { - currentTaskLine += (priority); - } else { - currentTaskLine += "-"; - } - currentTaskLine += (prioritySpaces.substring(0, prioritySpaces.length() - 1)); - - Integer estimate = currentTask.getEstimate(); - if (estimate > 1) { - currentTaskLine += (estimate / 60); - extra = estimate.toString().length() - 1; - } else { - currentTaskLine += "-"; - extra = 0; - } - currentTaskLine += (expectedSpaces.substring(0, expectedSpaces.length() - - estimate.toString().length() + extra)); - - Integer actual = currentTask.getActual(); - if (actual > 1) { - currentTaskLine += (actual / 60); - } else { - currentTaskLine += "-"; - } - - extra = actual.toString().length() - 1; - currentTaskLine += (actualSpaces.substring(0, actualSpaces.length() - - actual.toString().length() + extra)); - - String memberName = null; - ArrayList members = currentTask.getMembers(); - currentTaskLine += "|"; - memberName = "|"; - for (TeamMember member : members) { - currentTaskLine += member.getName() + "|"; - memberName = member.getName(); - } - //currentTaskLine += (membersSpaces.substring(0, membersSpaces.length() - memberName.length())); - taskLines += (currentTaskLine + "\n"); - } - } else { - taskLines += "No tasks have been added to this project."; - } - - ArrayList members = project.getTeamMembers(); - String membersListLines = ""; - if (members.size() > 0) { - for (int j = 0; j < members.size(); j++) { - membersListLines += (j + 1) + ". " + members.get(j).getName() + "\n"; - } - } else { - membersListLines += "No team members have been assigned to this project."; - } - - return projectTitle + "\n" + projectDescription + "\n" + taskListTitle + "\n" - + (project.getTaskList().size() > 0 ? tableLabel : "") + taskLines - + "\n \n" + membersListTitle + "\n" + membersListLines; - } catch (Error e) { - System.out.println(e.getMessage()); - } - return "hi"; - } - - public static String printMemberAssignedToTaskMessage(String memberName, String taskName) { - return "Member \"" + memberName + "\" has been assigned to \"" + taskName + "\""; - } - - public static String printMemberAssignedToProjectMessage(String memberName, String projectName) { - return memberName + " assigned to Project \"" + projectName + "\""; - } - - public static String printPriorityAssignedToTaskMessage(int priority, String taskName) { - return "Priority \"" + priority + "\" has been assigned to \"" + taskName + "\""; - } - - public static String printHoursWorkedMessage(String memberName, double hoursWorked) { - return memberName + " worked for " + String.format("%.1f", hoursWorked) + " hours."; - } - -} From 1b5adf55d6d49ca3fe57ee39e59068e540956d97 Mon Sep 17 00:00:00 2001 From: thatseant <46109197+thatseant@users.noreply.github.com> Date: Mon, 9 Nov 2020 23:29:51 +0800 Subject: [PATCH 21/24] Update thatseant.md --- docs/team/thatseant.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/team/thatseant.md b/docs/team/thatseant.md index d2b5585c75..af9cc8a27d 100644 --- a/docs/team/thatseant.md +++ b/docs/team/thatseant.md @@ -46,6 +46,7 @@ My contributions were the following: - Restructured UG so commands were grouped by Home View and Project View - Added expected output to all UG commands. - Added warnings and tips so users knew what to take note of when using the app. +- Added documentation for the above classes. @@ -58,6 +59,7 @@ My contributions were the following: - Assign actual duration for tasks - Assign estimated duration for tasks. +## **Additional enhancements to codebase** ## **Contributions to Team-Based Tasks** @@ -70,4 +72,4 @@ My contributions were the following: Of the 71 closed pull requests as of 7th November, I reviewed 34. In many of these pull requests, I looked through the code line-by-line and noted down issues or areas where the new code did not fit in well with the rest of the codebase. -https://docs.google.com/document/d/1bKq28FjPE9JTeszGBGBwi5R1I_JmIS6Zhv00lq6c6ik/edit +https://github.com/AY2021S1-CS2113T-T09-1/tp/pulls?q=is%3Apr+is%3Aclosed+reviewed-by%3Athatseant From 491867662a4305eeaf4bd585d77897f910cd4e4b Mon Sep 17 00:00:00 2001 From: thatseant <46109197+thatseant@users.noreply.github.com> Date: Mon, 9 Nov 2020 23:33:55 +0800 Subject: [PATCH 22/24] Update thatseant.md --- docs/team/thatseant.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/team/thatseant.md b/docs/team/thatseant.md index af9cc8a27d..fa881b6013 100644 --- a/docs/team/thatseant.md +++ b/docs/team/thatseant.md @@ -59,7 +59,11 @@ My contributions were the following: - Assign actual duration for tasks - Assign estimated duration for tasks. -## **Additional enhancements to codebase** +## **Major Additional enhancements to codebase** +#16 - Added project pointer to keep track of currently selected project +#49 - Reduced task coupling by eliminating the need for a separate class to contain tasks. +#167 - Reduced user confusion by having list command display home and project view instead of separate lists for managers and tasks. +#208 - Added Javadocs to Task Classes ## **Contributions to Team-Based Tasks** From 49681dbe578a23940625d337fff31397314790fe Mon Sep 17 00:00:00 2001 From: thatseant <46109197+thatseant@users.noreply.github.com> Date: Mon, 9 Nov 2020 23:34:17 +0800 Subject: [PATCH 23/24] Update thatseant.md --- docs/team/thatseant.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/team/thatseant.md b/docs/team/thatseant.md index fa881b6013..75e21a38bb 100644 --- a/docs/team/thatseant.md +++ b/docs/team/thatseant.md @@ -61,8 +61,11 @@ My contributions were the following: ## **Major Additional enhancements to codebase** #16 - Added project pointer to keep track of currently selected project + #49 - Reduced task coupling by eliminating the need for a separate class to contain tasks. + #167 - Reduced user confusion by having list command display home and project view instead of separate lists for managers and tasks. + #208 - Added Javadocs to Task Classes From 5d5a8b07720cbda10319d0a4c3502071506c62ec Mon Sep 17 00:00:00 2001 From: Samuel Christopher Date: Mon, 9 Nov 2020 23:36:33 +0800 Subject: [PATCH 24/24] Update UserGuide.md --- docs/UserGuide.md | 33 ++------------------------------- 1 file changed, 2 insertions(+), 31 deletions(-) diff --git a/docs/UserGuide.md b/docs/UserGuide.md index 74a55c9a4f..07de97b3cf 100644 --- a/docs/UserGuide.md +++ b/docs/UserGuide.md @@ -750,36 +750,7 @@ at the specific folder the JAR file is stored and you have begun. ## 6. Command Summary Home View Commands -| Commands | Action | Examples | -| -------- | ------ | -------- | -| project | Creates a new project in the project list in Home View | `project n/Web Development Project` | -| member | Creates a new member in the member list | `member n/John Doe` | -| list | Displays the updated Home View | `list` | -| select | Selects the specified project and program enters ProjectView | `select p/1` | -| done | Marks the specified project as done | `done p/1` | -| delete | Deletes the specified project | `delete p/1` | -| description | Assigns a description to the specified project | `description p/1 d/Project for Company X` | -| deadline | Assigns a deadline to the specified project | `deadline p/1 d/2020-10-25` | -| assign | Assigns member to specified project | `assign p/1 m/1` | -| remove | Removes specified member from the member list | `remove m/1` | -| hours | View hours worked by a specific worker across all projects | `hours m/1` | -| bye | Exit EZ Manager | `bye` | +![Command Summary One](https://i.ibb.co/GMgn96K/cs1.png) Project View Commands -| Commands | Action | Examples | -| -------- | ------ | -------- | -| task | Creates a new task in the task list in Project View| `task n/Deploy Version 2.0` | -| edit | Edits an existing task name in the task list in Project View| `edit t/1 n/Update documentation` | -| list | Displays the updated Project View | `list` | -| select | Selects the specified task | `select t/1` | -| done | Marks the specified task as done | `done t/1` | -| delete | Deletes the specified task | `delete t/1` | -| deadline | Assigns a deadline to the specified task | `deadline t/1 d/2020-10-25` | -| priority | Assigns a priority to the specified task | `priority t/1 p/1` | -| home | Switches from ProjectView to HomeView | `home` | -| assign | Assigns member to specified task | `assign t/1 m/1` | -| remove | Removes specified member from current project | `remove m/1` | -| estimate | Add estimated time taken for task to complete | `estimate t/1 h/3 m/20` | -| actual | Add actual time taken for task to complete | `actual t/1 h/3 m/20` | -| sort | Sort tasks based on sorting type | `sort s/p` | -| bye | Exit EZ Manager | `bye` | +![Command Summary Two](https://i.ibb.co/P4z4vV4/cs2.png)