Skip to content

Commit

Permalink
Resolve merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
NgChunMan committed Oct 28, 2023
2 parents 1a3dd18 + 83645ae commit 7550f69
Show file tree
Hide file tree
Showing 45 changed files with 718 additions and 561 deletions.
199 changes: 134 additions & 65 deletions docs/DeveloperGuide.md

Large diffs are not rendered by default.

46 changes: 46 additions & 0 deletions docs/diagrams/AddTaskSequence.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
@startuml
!include style.puml
skinparam ArrowFontStyle plain

box Command LOGIC_COLOR_T1
participant ":CreateTodoCommand" as CreateTodoCommand LOGIC_COLOR
end box

box Model MODEL_COLOR_T1
participant ":ModelManager" as ModelManagerStatic MODEL_COLOR
participant "opr:TaskOperation" as TaskOperation MODEL_COLOR
participant "g:Group" as Group MODEL_COLOR
end box

[-> CreateTodoCommand : execute()
activate CreateTodoCommand

CreateTodoCommand -> ModelManagerStatic : taskOperation(new Path("~/grp-001"))
activate ModelManagerStatic

create TaskOperation
ModelManagerStatic -> TaskOperation
activate TaskOperation

TaskOperation --> ModelManagerStatic : opr
deactivate TaskOperation

ModelManagerStatic --> CreateTodoCommand :opr
deactivate ModelManagerStatic

CreateTodoCommand -> TaskOperation : addTask(task)
activate TaskOperation

TaskOperation -> Group : addTask(task)
activate Group

Group --> TaskOperation
deactivate Group

TaskOperation --> CreateTodoCommand

destroy TaskOperation

[<--CreateTodoCommand
destroy CreateTodoCommand
@enduml
40 changes: 10 additions & 30 deletions docs/diagrams/ModelClassDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -5,50 +5,30 @@ skinparam arrowColor MODEL_COLOR
skinparam classBackgroundColor MODEL_COLOR

Package Model as ModelPackage <<Rectangle>>{
Class "<<interface>>\nReadOnlyAddressBook" as ReadOnlyAddressBook
Class "<<interface>>\nReadOnlyUserPrefs" as ReadOnlyUserPrefs
Class "<<interface>>\nModel" as Model
Class AddressBook
Class ModelManager
Class UserPrefs
Class Path
Class ObservableList

Class UniquePersonList
Class Person
Class Address
Class Email
Class Name
Class Phone
Class Tag
Package ProfBook {

}

Class I #FFFFFF
}

Class HiddenOutside #FFFFFF
HiddenOutside ..> Model

AddressBook .up.|> ReadOnlyAddressBook
HiddenOutside ..> Model

ModelManager --> Path
ModelManager --> ProfBook
ModelManager --> ObservableList
ObservableList ..> ProfBook
ModelManager .up.|> Model
Model .right.> ReadOnlyUserPrefs
Model .left.> ReadOnlyAddressBook
ModelManager -left-> "1" AddressBook
ModelManager -right-> "1" UserPrefs
UserPrefs .up.|> ReadOnlyUserPrefs

AddressBook *--> "1" UniquePersonList
UniquePersonList --> "~* all" Person
Person *--> Name
Person *--> Phone
Person *--> Email
Person *--> Address
Person *--> "*" Tag

Person -[hidden]up--> I
UniquePersonList -[hidden]right-> I

Name -[hidden]right-> Phone
Phone -[hidden]right-> Address
Address -[hidden]right-> Email

ModelManager --> "~* filtered" Person
@enduml
51 changes: 51 additions & 0 deletions docs/diagrams/ProfBookClassDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
@startuml
!include style.puml
skinparam arrowThickness 1.1
skinparam arrowColor MODEL_COLOR
skinparam classBackgroundColor MODEL_COLOR

Package ProfBook as ProfBookPackage <<Rectangle>>{
Class "ChildrenManager" as ChildrenManager
Class "TaskListManager" as TaskListManager
Class "<<interface>>\nIChildElement" as IChildElement
Class "{abstract}\nChildrenAndTaskListManager" as ChildrenAndTaskListManager
Class Root
Class Group
Class Student
Class Id
Class Name
Class Address
Class Email
Class Phone

Class I #FFFFFF
}

Class HiddenOutside #FFFFFF

HiddenOutside .down.> ChildrenManager

ChildrenAndTaskListManager .up.|> IChildElement
Student -up-|> TaskListManager
Student .up.|> IChildElement

Group *--> Id
Student *--> Id

Group *--> Name
Student *--> Name

Student *--> Email
Student *--> Address
Student *--> Phone

ChildrenAndTaskListManager -left-> TaskListManager
ChildrenAndTaskListManager -right-> ChildrenManager

TaskListManager -up-> TaskList

Root -up-|> ChildrenManager
Group -up-|> ChildrenAndTaskListManager
Root -left-> "*" Group : Parent of >
Group -left-> "*" Student : Parent of >
@enduml
12 changes: 6 additions & 6 deletions docs/team/mingyuanc.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ Given below are my contributions to the project.
* Implementation were also made generic to allow for future extensions if needed.
* Implementation was challenging as it required modifying the whole flow and structure of the application

* **Streamline state modifications**:
* What it does: Provide a safe way for the command to modify the state
* **Streamline model modifications**:
* What it does: Provide a safe way for the command to modify the model
* Justification:
* Modification of the state should be done through a state manager instead of directly being modified by an
* Modification of the model should be done through a model manager instead of directly being modified by an
external class in accordance with OOP principals
* Allow for the future migration to immutable state
* Allow for the future migration to immutable model
* Highlights:
* Implementation of this required an in-depth analysis of design alternative as there was a need for a generic
way to modify all the current different classes alongside future classes.
Expand Down Expand Up @@ -69,9 +69,9 @@ Given below are my contributions to the project.
* Provides the logic to safely manipulate data stored in Student/Group/Root
* Ensure separation of concern by implementing other two other classes, TaskOperation and ChildOperation,
each handling their own operation.
* Ensure the expected behaviour with regard to manipulating the state
* Ensure the expected behaviour with regard to manipulating the model
* Path given matches the expected outcome
* Commands are unable to directly modify the state
* Commands are unable to directly modify the model

### **Code contributed**:

Expand Down
42 changes: 27 additions & 15 deletions docs/team/nereuswb922.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,42 @@ title: Nereus Ng Wei Bin's Project Portfolio Page

# ProfBook

ProfBook is a desktop address book application used for easy management of tasks, group schedules, and notes for every tutorial slot and group. The user interacts with it using a CLI, and it has a GUI created with JavaFX. It is written in Java, and has about 10 kLoC.
ProfBook is a desktop address book application used for easy management of tasks, group schedules, and notes for every
tutorial slot and group. The user interacts with it using a CLI, and it has a GUI created with JavaFX. It is written in
Java, and has about 10 kLoC.

## RepoSense Report

**Link to my RepoSense Report**: [Code Contributions](https://nus-cs2103-ay2324s1.github.io/tp-dashboard/?search=nereuswb922&breakdown=false&sort=groupTitle%20dsc&sortWithin=title&since=2023-09-22&timeframe=commit&mergegroup=&groupSelect=groupByRepos).
**Link to my RepoSense Report
**: [Code Contributions](https://nus-cs2103-ay2324s1.github.io/tp-dashboard/?search=nereuswb922&breakdown=false&sort=groupTitle%20dsc&sortWithin=title&since=2023-09-22&timeframe=commit&mergegroup=&groupSelect=groupByRepos).

## Code Contributions

In this section, I will outline the code contributions I made to the project. These contributions include enhancements and new features that I implemented.
In this section, I will outline the code contributions I made to the project. These contributions include enhancements
and new features that I implemented.

### Class Enhancements

1. **Introduced `Path` Class :**
- Provided a structured way to manage and manipulate paths in our application.
- This addition assists other classes (e.g. `StateManager`, `Command`) in providing functionality such as navigating between directories and executing commands against specific paths.
- The `AbsolutePath` class represents a full path within our application.
- This addition assists other classes (e.g. `StateManager`, `Command`) in providing functionality such as navigating
between directories and executing commands against specific paths.
- The `AbsolutePath` class represents a full path within our application.
- The `RelativePath` class represents a relative path in relation to the current path.

2. **Introduced `Id` class :**
- Represent unique id of group and student.
- Represent unique id of group and student.

2. **Introduced `Option` class :**
- Similar to the `Prefix` class in AB3.
- Similar to the `Prefix` class in AB3.
- Enables the creation of command options with short-hand and long-hand names.

3. **Updated `ArgumentTokernizer` class :**
- Updated `ArgumentTokenizer` class to adopt command format similar to the Unix command.
- e.g. User can pass in name option using `--name` or `-n`.

### New Features

1. **`cd` Command :**
- The `cd` command allows users to navigate between different directories.
- For example, using `cd ../grp-001` will navigate to the `grp-001` directory.
Expand All @@ -48,32 +54,38 @@ In this section, I will outline the code contributions I made to the project. Th
- For example, `cat grp-001/stu-001` will show the task list of the student with ID `stu-001`.

### GUI Enhancements

1. **Visual Improvements**:
Added a new icon and expanded the color palette to enhance the project's visual appeal.
Added a new icon and expanded the color palette to enhance the project's visual appeal.

2. **Current Directory Display**:
Added a working directory display, similar to a terminal, simplifying navigation and enhancing users' understanding of the application's state.
Added a working directory display, similar to a terminal, simplifying navigation and enhancing users' understanding
of the application's model.

## User Guide Contributions

coming soon

## Developer Guide Contributions

coming soon

## Team-Based Task Contributions

1. **Github Setup**:
- Established our team's **organization** and **repo** on GitHub.
- Setup **GitHub project** to manage issues related to user stories and tasks.
- Setup project **website deployment**.
- Established our team's **organization** and **repo** on GitHub.
- Setup **GitHub project** to manage issues related to user stories and tasks.
- Setup project **website deployment**.

3. **Integration of GitHub Plugins**:
- **Netifly :** Enables automatic deployments of our PR previews.
- **Codecov :** Automate code coverage assessment, ensuring that our project maintains high code quality and identifying areas for improvement.

- **Netifly :** Enables automatic deployments of our PR previews.
- **Codecov :** Automate code coverage assessment, ensuring that our project maintains high code quality and
identifying areas for improvement.

## Review and Mentoring Contributions

Here are the pull requests I reviewed and provided valuable feedback and suggestions:

- **[Pull Request #71](https://github.com/AY2324S1-CS2103T-W15-2/tp/pull/71)**
- **[Pull Request #91](https://github.com/AY2324S1-CS2103T-W15-2/tp/pull/91)**
- **[Pull Request #100](https://github.com/AY2324S1-CS2103T-W15-2/tp/pull/100)**
Expand Down
19 changes: 10 additions & 9 deletions src/main/java/seedu/address/MainApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
import seedu.address.commons.util.StringUtil;
import seedu.address.logic.Logic;
import seedu.address.logic.LogicManager;
import seedu.address.model.Model;
import seedu.address.model.ModelManager;
import seedu.address.model.ReadOnlyUserPrefs;
import seedu.address.model.UserPrefs;
import seedu.address.model.path.AbsolutePath;
import seedu.address.model.path.exceptions.InvalidPathException;
import seedu.address.model.profbook.Root;
import seedu.address.model.statemanager.State;
import seedu.address.model.statemanager.StateManager;
import seedu.address.model.util.SampleProfBook;
import seedu.address.storage.JsonProfBookStorage;
import seedu.address.storage.JsonUserPrefsStorage;
Expand All @@ -43,7 +43,7 @@ public class MainApp extends Application {
protected Ui ui;
protected Logic logic;
protected ProfBookStorage storage;
protected State state;
protected Model model;
protected Config config;

@Override
Expand All @@ -60,8 +60,8 @@ public void init() throws Exception {
ProfBookStorage profBookStorage = new JsonProfBookStorage(userPrefs.getProfBookFilePath());
storage = new ProfBookStorageManager(profBookStorage, userPrefsStorage);

state = initModelManager(userPrefs);
logic = new LogicManager(state, storage);
model = initModelManager(userPrefs);
logic = new LogicManager(model, storage);
ui = new UiManager(logic);
}

Expand All @@ -70,7 +70,7 @@ public void init() throws Exception {
* The data from the sample address book will be used instead if {@code storage}'s address book is not found,
* or an empty address book will be used instead if errors occur when reading {@code storage}'s address book.
*/
private State initModelManager(ReadOnlyUserPrefs userPrefs) throws InvalidPathException {
private Model initModelManager(ReadOnlyUserPrefs userPrefs) throws InvalidPathException {
logger.info("Using data file : " + storage.getProfBookFilePath());
Optional<Root> profBookOptional;
Root initialData;
Expand All @@ -91,7 +91,7 @@ private State initModelManager(ReadOnlyUserPrefs userPrefs) throws InvalidPathEx
}
AbsolutePath currentPath = new AbsolutePath("~/");

return new StateManager(currentPath, initialData, userPrefs);
return new ModelManager(currentPath, initialData, userPrefs);
}

private void initLogging(Config config) {
Expand Down Expand Up @@ -167,6 +167,7 @@ protected UserPrefs initPrefs(UserPrefsStorage storage) {

return initializedPrefs;
}

@Override
public void start(Stage primaryStage) {
logger.info("Starting AddressBook " + MainApp.VERSION);
Expand All @@ -177,8 +178,8 @@ public void start(Stage primaryStage) {
public void stop() {
logger.info("============================ [ Stopping Address Book ] =============================");
try {
storage.saveUserPrefs(state.getUserPrefs());
storage.saveProfBook(state.getRoot());
storage.saveUserPrefs(model.getUserPrefs());
storage.saveProfBook(model.getRoot());
} catch (IOException e) {
logger.severe("Failed to save preferences/ProfBook " + StringUtil.getDetails(e));
}
Expand Down
Loading

0 comments on commit 7550f69

Please sign in to comment.