diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index 879d75c5139..b29495929df 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -72,7 +72,7 @@ The **API** of this component is specified in [`Ui.java`](https://github.com/se- ![Structure of the UI Component](images/UiClassDiagram.png) -The UI consists of a `MainWindow` that is made up of parts e.g.`CommandBox`, `ResultDisplay`, `PersonListPanel`, `StatusBarFooter` etc. All these, including the `MainWindow`, inherit from the abstract `UiPart` class which captures the commonalities between classes that represent parts of the visible GUI. +The UI consists of a `MainWindow` that is made up of parts e.g.`CommandBox`, `ResultDisplay`, `PersonListPanel`, `RoleListPanel`, `StatusBarFooter` etc. All these, including the `MainWindow`, inherit from the abstract `UiPart` class which captures the commonalities between classes that represent parts of the visible GUI. The `UI` component uses the JavaFx UI framework. The layout of these UI parts are defined in matching `.fxml` files that are in the `src/main/resources/view` folder. For example, the layout of the [`MainWindow`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/java/seedu/address/ui/MainWindow.java) is specified in [`MainWindow.fxml`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/resources/view/MainWindow.fxml) @@ -175,7 +175,7 @@ to maximize the benefits of inheritance. * In the `JsonAdaptedPerson` class, subtype declarators are used to declare the inheritance relationship between person and applicant, hence it can store and differentiate applicants from person when retrieved. * There is also an input checker reminding users to not declare `/stage` (if they did) as newly added applicants are -assumed to be at the `'initial_application'` stage. +assumed to be at the `'Initial Application'` stage. * Instance check are done for `Applicant` at `personListPanel` to ensure the applicant card gets displayed and `JsonSerializableAddressBook` class to ensure the person objects that are `Applicant` are casted accordingly. @@ -186,6 +186,12 @@ assumed to be at the `'initial_application'` stage. ### \[Developed\] Edit applicant feature The `edit` command gives users the ability to edit the applicants' details. The details that can be edited include `Name`, `Phone`, `Email`, `Address`, `Stage`, `Role`, `Note` and `Tag`. Note that at least one field has to be chosen. +#### How the feature is implemented +* The `edit` is implemented using the `EditApplicantCommand`, `EditApplicantDescriptor` and `EditApplicantCommandParser` classes. +* The `EditApplicantCommand` receives an index of the applicant to be edited and an EditApplicantDescriptor class which consists of the updated fields of the applicant. +* Note that checks will be done on the fields that the user want to input to ensure is valid. For example, `Stage` can only be one of the four forms `Initial Application`, `Technical Assessment`, `Interview`, `Decision & Offer`. Hence, if user was to input `edit 1 /stage WaitListed`, this will not be possible and the applicant will not be edited. +* Similarly, a check will be done to ensure that the index is valid. + ![EditSequenceDiagram](images/EditSequenceDiagram.png) ### \[Developed\] Note feature diff --git a/docs/diagrams/EditSequenceDiagram.puml b/docs/diagrams/EditSequenceDiagram.puml index bab3c2af115..609f44fdd75 100644 --- a/docs/diagrams/EditSequenceDiagram.puml +++ b/docs/diagrams/EditSequenceDiagram.puml @@ -14,10 +14,10 @@ box Model MODEL_COLOR_T1 participant "m:Model" as Model MODEL_COLOR end box -[-> LogicManager : execute("edit 2 /stage waitlisted") +[-> LogicManager : execute("edit 2 /stage Interview") activate LogicManager -LogicManager -> AddressBookParser : parseCommand("edit 2 /stage waitlisted") +LogicManager -> AddressBookParser : parseCommand("edit 2 /stage Interview") activate AddressBookParser create EditApplicantCommandParser @@ -27,7 +27,7 @@ activate EditApplicantCommandParser EditApplicantCommandParser --> AddressBookParser deactivate EditApplicantCommandParser -AddressBookParser -> EditApplicantCommandParser : parse("2 /stage waitlisted"") +AddressBookParser -> EditApplicantCommandParser : parse("2 /stage Interview"") activate EditApplicantCommandParser create EditApplicantCommand diff --git a/docs/diagrams/UiClassDiagram.puml b/docs/diagrams/UiClassDiagram.puml index b422efff870..7af6394d98f 100644 --- a/docs/diagrams/UiClassDiagram.puml +++ b/docs/diagrams/UiClassDiagram.puml @@ -13,6 +13,8 @@ Class HelpWindow Class ResultDisplay Class PersonListPanel Class PersonCard +Class RoleListPanel +Class RoleCard Class ApplicantCard Class StatusBarFooter Class CommandBox @@ -34,11 +36,13 @@ UiManager -down-> "1" MainWindow MainWindow *-down-> "1" CommandBox MainWindow *-down-> "1" ResultDisplay MainWindow *-down-> "1" PersonListPanel +MainWindow *-down-> "1" RoleListPanel MainWindow *-down-> "1" StatusBarFooter MainWindow --> "0..1" HelpWindow PersonListPanel -down-> "*" PersonCard PersonListPanel -down-> "*" ApplicantCard +RoleListPanel -down-> "*" RoleCard MainWindow -left-|> UiPart @@ -46,14 +50,18 @@ ResultDisplay --|> UiPart CommandBox --|> UiPart PersonListPanel --|> UiPart PersonCard --|> UiPart +RoleListPanel --|> UiPart +RoleCard --|> UiPart ApplicantCard --|> UiPart StatusBarFooter --|> UiPart HelpWindow --|> UiPart PersonCard ..> Model ApplicantCard ..> Model +RoleCard ..> Model UiManager -right-> Logic MainWindow -left-> Logic +RoleListPanel -left-> Logic PersonListPanel -[hidden]left- HelpWindow HelpWindow -[hidden]left- CommandBox diff --git a/docs/images/EditSequenceDiagram.png b/docs/images/EditSequenceDiagram.png index f20c2307ad4..7c3e98a231f 100644 Binary files a/docs/images/EditSequenceDiagram.png and b/docs/images/EditSequenceDiagram.png differ diff --git a/docs/images/UiClassDiagram.png b/docs/images/UiClassDiagram.png index 76945995e05..2f020ed6a41 100644 Binary files a/docs/images/UiClassDiagram.png and b/docs/images/UiClassDiagram.png differ