Skip to content

Commit

Permalink
Merge branch 'documentation' into update-documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
kthSim authored Mar 15, 2019
2 parents 243fc9b + e6948e7 commit e47bfdd
Show file tree
Hide file tree
Showing 43 changed files with 1,388 additions and 17 deletions.
6 changes: 2 additions & 4 deletions README.adoc
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
= OurTeeth (Morphed from Address Book Level 4)
ifdef::env-github,env-browser[:relfileprefix: docs/]

https://travis-ci.org/se-edu/addressbook-level4[image:https://travis-ci.org/se-edu/addressbook-level4.svg?branch=master[Build Status]]
https://ci.appveyor.com/project/damithc/addressbook-level4[image:https://ci.appveyor.com/api/projects/status/3boko2x2vr5cc3w2?svg=true[Build status]]
https://coveralls.io/github/se-edu/addressbook-level4?branch=master[image:https://coveralls.io/repos/github/se-edu/addressbook-level4/badge.svg?branch=master[Coverage Status]]

https://travis-ci.org/CS2103-AY1819S2-W17-2/main[image:https://travis-ci.org/CS2103-AY1819S2-W17-2/main.svg?branch=master["Build Status", link="https://travis-ci.org/CS2103-AY1819S2-W17-2/main"]]
https://app.netlify.com/sites/cs2103-w17-2/deploys[image:https://api.netlify.com/api/v1/badges/0ed4dd99-3443-483f-94e5-64bb727aa43c/deploy-status[Netlify Status]]

ifdef::env-github[]
image::docs/images/Ui.png[width="600"]
Expand Down
4 changes: 2 additions & 2 deletions docs/AboutUs.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Responsibilities: Records IO
'''

=== Jonathan Choo
image::cchj1995.jpg[width="150", align="left"]
image::cchj1995.png[width="150", align="left"]
{empty}[http://github.com/cchj1995[github]] [<<johndoe#, portfolio>>]

Role: Developer +
Expand All @@ -56,7 +56,7 @@ Responsibilities: Login
'''

=== Wang Debang
image::wsemis.JPG[width="150", aligh="left"]
image::wsemis.png[width="150", aligh="left"]
{empty}[https://github.com/wSemis[github]] [<<johndoe#, portfolio>>]

Role: Developer +
Expand Down
38 changes: 30 additions & 8 deletions docs/DeveloperGuide.adoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
= AddressBook Level 4 - Developer Guide
= OurTeeth - Developer Guide
:site-section: DeveloperGuide
:toc:
:toc-title:
Expand All @@ -15,7 +15,7 @@ ifdef::env-github[]
endif::[]
:repoURL: https://github.com/se-edu/addressbook-level4/tree/master

By: `Team SE-EDU`      Since: `Jun 2016`      Licence: `MIT`
By: `Team W17-2`      Since: `14 Mar 2019`      Licence: `MIT`

== Setting up

Expand Down Expand Up @@ -827,21 +827,43 @@ Priorities: High (must have) - `* * \*`, Medium (nice to have) - `* \*`, Low (un
[width="59%",cols="22%,<23%,<25%,<30%",options="header",]
|=======================================================================
|Priority |As a ... |I want to ... |So that I can...
|`* * *` |new user |see usage instructions |refer to instructions when I forget how to use the App

|`* * *` |user |add a new person |
|`* * *` |user |add a new patient's particulars | know about their situation

|`* * *` |user |delete a person |remove entries that I no longer need
|`* * *` |user |edit my patient's particulars when the situation changes |

|`* * *` |user |find a person by name |locate details of persons without having to go through the entire list
|`* * *` |user |my patients' medical records and teeth data tied to them |know how their situation evolved

|`* *` |user |hide <<private-contact-detail,private contact details>> by default |minimize chance of someone else seeing them by accident
|`* * *` |user |store, edit, and view my dental patients' teeth condition | understand and serve my dental patients'
teeth condition better

|`* * *` |user |add a new task | keep track of what I need to do

|`* * *` |user |delete a task |remove tasks that I have already completed or no longer need to do

|`* * *` |user |edit a task |change details of certains tasks that I have already added

|`* * *` |user | encrypt the imported/exported data | ensure patient information remains confidential

|`* * *` |user | append imported/exported data | work more flexibly with patient information

|`* * *` |user | my imported/exported data supported by multiple file types | work more flexibly with patient information

|`* * *` |user | see a statistics report on each patient's dental history | have an easier time understanding their potential problems

|`* * *` |user | warning to come up when I'm exiting the program if there exists duplicate entries | be reminded to
edit them before exiting.

|`* *` |user | see an overall statistics report on my patients | analyze potential trends

|`* *` |user |copy a person |reduce the time needed to create a new person who has similar records to an existing person in the list

|`* *` |user |export entries into an external file |view certain entries even when I am not using the application

|`* *` |user |import entries from an external file |reduce the time needed to create a person whose information can be already be obtained from an external source
|`* *` |user |import entries from an external file |reduce the time needed to create a person whose information can
be already be obtained from an external source

|`* *` |user |see relevant dentistry tags on my patients' entries | have an overview of my patients' condition

|`*` |user with confidential patient information|log into the application with a password |prevent unauthorized access to the application when I am not around

Expand Down
10 changes: 9 additions & 1 deletion docs/UserGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,13 @@ Universal Numbering System.

==== The Universal Numbering System

image::images/image1.png[image,width=200,height=294]
ifdef::env-github[]
image::image1.png[width="200"]
endif::[]

ifndef::env-github[]
image::image1.png[width="200"]
endif::[]

The uppercase letters A through T are used for primary teeth and the
numbers 1 - 32 are used for permanent teeth. The tooth designated "1" is
Expand Down Expand Up @@ -413,6 +419,8 @@ Saves patient 1 and patient 4 from the current records to "records1.json".
* `export records1.json 1-4` +
Saves patient 1 to patient 4 from the current records to "records1.json".

* `Export records2.json` +
Writes all entries from the address book to records2.json. +

=== List
Shows a list of all personnel or medical stored in the application
Expand Down
File renamed without changes
File renamed without changes
72 changes: 72 additions & 0 deletions docs/team/cchj1995.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
= Jonathan Choo - Project Portfolio
:site-section: AboutUs
:imagesDir: ../images
:stylesDir: ../stylesheets

== PROJECT: AddressBook - Level 4

---

== Overview

AddressBook - Level 4 is a desktop address book application used for teaching Software Engineering principles. 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.

== Summary of contributions

* *Major enhancement*: added *the ability to undo/redo previous commands*
** What it does: allows the user to undo all previous commands one at a time. Preceding undo commands can be reversed by using the redo command.
** Justification: This feature improves the product significantly because a user can make mistakes in commands and the app should provide a convenient way to rectify them.
** Highlights: This enhancement affects existing commands and commands to be added in future. It required an in-depth analysis of design alternatives. The implementation too was challenging as it required changes to existing commands.
** Credits: _{mention here if you reused any code/ideas from elsewhere or if a third-party library is heavily used in the feature so that a reader can make a more accurate judgement of how much effort went into the feature}_

* *Minor enhancement*: added a history command that allows the user to navigate to previous commands using up/down keys.

* *Code contributed*: [https://github.com[Functional code]] [https://github.com[Test code]] _{give links to collated code files}_

* *Other contributions*:

** Project management:
*** Managed releases `v1.3` - `v1.5rc` (3 releases) on GitHub
** Enhancements to existing features:
*** Updated the GUI color scheme (Pull requests https://github.com[#33], https://github.com[#34])
*** Wrote additional tests for existing features to increase coverage from 88% to 92% (Pull requests https://github.com[#36], https://github.com[#38])
** Documentation:
*** Did cosmetic tweaks to existing contents of the User Guide: https://github.com[#14]
** Community:
*** PRs reviewed (with non-trivial review comments): https://github.com[#12], https://github.com[#32], https://github.com[#19], https://github.com[#42]
*** Contributed to forum discussions (examples: https://github.com[1], https://github.com[2], https://github.com[3], https://github.com[4])
*** Reported bugs and suggestions for other teams in the class (examples: https://github.com[1], https://github.com[2], https://github.com[3])
*** Some parts of the history feature I added was adopted by several other class mates (https://github.com[1], https://github.com[2])
** Tools:
*** Integrated a third party library (Natty) to the project (https://github.com[#42])
*** Integrated a new Github plugin (CircleCI) to the team repo

_{you can add/remove categories in the list above}_

== Contributions to the User Guide


|===
|_Given below are sections I contributed to the User Guide. They showcase my ability to write documentation targeting end-users._
|===

include::../UserGuide.adoc[tag=undoredo]

include::../UserGuide.adoc[tag=dataencryption]

== Contributions to the Developer Guide

|===
|_Given below are sections I contributed to the Developer Guide. They showcase my ability to write technical documentation and the technical depth of my contributions to the project._
|===

include::../DeveloperGuide.adoc[tag=undoredo]

include::../DeveloperGuide.adoc[tag=dataencryption]


== PROJECT: PowerPointLabs

---

_{Optionally, you may include other projects in your portfolio.}_
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 5 additions & 0 deletions src/main/java/seedu/address/MainApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,11 @@ public void start(Stage primaryStage) {
@Override
public void stop() {
logger.info("============================ [ Stopping Address Book ] =============================");
if (model.checkNoCopy()) {
logger.info("No copies left");
} else {
logger.info("Unedited copies exist");
}
try {
storage.saveUserPrefs(model.getUserPrefs());
} catch (IOException e) {
Expand Down
62 changes: 62 additions & 0 deletions src/main/java/seedu/address/logic/commands/CopyCommand.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
package seedu.address.logic.commands;

import static java.util.Objects.requireNonNull;
import static seedu.address.model.Model.PREDICATE_SHOW_ALL_PERSONS;

import java.util.List;

import seedu.address.commons.core.Messages;
import seedu.address.commons.core.index.Index;
import seedu.address.logic.CommandHistory;
import seedu.address.logic.commands.exceptions.CommandException;
import seedu.address.model.Model;
import seedu.address.model.person.Person;

/**
* Adds a person to the address book.
*/
public class CopyCommand extends Command {

public static final String COMMAND_WORD = "copy";

public static final String MESSAGE_USAGE = COMMAND_WORD + ": Have a temporary duplicate person in the addressbook. "
+ "Parameters: Index (Must be an integer)"
+ "Example: " + COMMAND_WORD + " 1 ";

public static final String MESSAGE_SUCCESS = "Person copied: %1$s";

private final Index index;

/**
* Creates an AddCommand to add the specified {@code Person}
*/
public CopyCommand(Index index) {
requireNonNull(index);
this.index = index;
}

@Override
public CommandResult execute(Model model, CommandHistory history) throws CommandException {
requireNonNull(model);
List<Person> lastShownList = model.getFilteredPersonList();

if (index.getZeroBased() >= lastShownList.size()) {
throw new CommandException(Messages.MESSAGE_INVALID_PERSON_DISPLAYED_INDEX);
}

Person personToCopy = lastShownList.get(index.getZeroBased());
Person copyPerson = personToCopy.copy();

model.addPerson(copyPerson);
model.updateFilteredPersonList(PREDICATE_SHOW_ALL_PERSONS);
model.commitAddressBook();
return new CommandResult(String.format(MESSAGE_SUCCESS, copyPerson));
}

@Override
public boolean equals(Object other) {
return other == this // short circuit if same object
|| (other instanceof CopyCommand // instanceof handles nulls
&& index.equals(((CopyCommand) other).index));
}
}
5 changes: 5 additions & 0 deletions src/main/java/seedu/address/logic/commands/EditCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ public CommandResult execute(Model model, CommandHistory history) throws Command
}

model.setPerson(personToEdit, editedPerson);

if (personToEdit.isCopy()) {
personToEdit.editCopy();
}

model.updateFilteredPersonList(PREDICATE_SHOW_ALL_PERSONS);
model.commitAddressBook();
return new CommandResult(String.format(MESSAGE_EDIT_PERSON_SUCCESS, editedPerson));
Expand Down
63 changes: 63 additions & 0 deletions src/main/java/seedu/address/logic/commands/ExportCommand.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
package seedu.address.logic.commands;

import static java.util.Objects.requireNonNull;
import static seedu.address.model.Model.PREDICATE_SHOW_ALL_PERSONS;

import java.io.File;
import java.io.IOException;
import java.util.logging.Logger;

import seedu.address.MainApp;
import seedu.address.commons.core.LogsCenter;
import seedu.address.logic.CommandHistory;
import seedu.address.model.Model;
import seedu.address.storage.AddressBookStorage;
import seedu.address.storage.JsonAddressBookStorage;
import seedu.address.storage.StorageManager;

/**
* Exports records to a text file.
*/
public class ExportCommand extends Command {

public static final String COMMAND_WORD = "export";

public static final String MESSAGE_USAGE = COMMAND_WORD
+ ": Exports to text file in the \"data\" folder \n"
+ "Parameters: FILENAME\n"
+ "Example: " + COMMAND_WORD + " records1.json";

public static final String MESSAGE_SUCCESS = "Exported the records!";
private static final String MESSAGE_FAILURE = "Problem while writing to the file.";

private final File file;

public ExportCommand(File file) {
this.file = file;
}

@Override
public CommandResult execute(Model model, CommandHistory history) {
requireNonNull(model);
writeFile(model);
model.updateFilteredPersonList(PREDICATE_SHOW_ALL_PERSONS);
return new CommandResult(MESSAGE_SUCCESS);
}

/**
* writeFile() writes or overwrites a file with the contents of the current address book.
*/
private void writeFile(Model model) {
AddressBookStorage addressBookStorage = new JsonAddressBookStorage(file.toPath());

StorageManager storage = new StorageManager(addressBookStorage, null);

final Logger logger = LogsCenter.getLogger(MainApp.class);

try {
storage.saveAddressBook(model.getAddressBook(), file.toPath());
} catch (IOException e) {
logger.warning(MESSAGE_FAILURE);
}
}
}
Loading

0 comments on commit e47bfdd

Please sign in to comment.