Skip to content

Commit

Permalink
Porting Tasks branch to Master branch (#38)
Browse files Browse the repository at this point in the history
* Updated UG and DG for addTask + addDeadline

* Modified aboutUs page: Ks

* Updated UG and DG for viewDate + selectDate

* Updated UG and DG for viewDate + selectDate (#2)

* Modified aboutUs page: Ks

* Updated UG and DG for viewDate + selectDate

* Commands to understand things better (CC)

* changed github account link

* About us - Chan Chun Cheong

* Profile Picture

* Delete profile picture.jpeg

* ChanChunCheong

* Edited About Us to enable the picture

* Edited the User Guide

* Edited the developer guide

* corrected developer guide

* Added user stories

* Added new feature: defer deadline

* Minor modification in DG

* Minor adjustments to DG

* Replaced AB Ui with TB mockup Ui

* Solved Merged conflict

* edited the developer guide

* edited developers guide again to solve merge conflict

* Renamed AddressBook to TaskBook

* Added Tasks + AddTask with some refactoring, still have errors in building

* Added PriorityLevel into Task

* Added Complete Task feature w/o tests

* Changed profile pics to png format

* Added Deadline class + minor edits to License

* Added new "AddMilestoneCommand" feature for TaskBook

* Added Milestone as a subclass of Task

* Copied Khasim's Deadline class and teach the app to accept 'remark' but do nothing

* Teach the app to accept 'defer deadline' but do nothing (include testing)

* Refactored testutils and added unit tests for AddTaskCommand

* Most of the project is able to build with UI. HelpWindow is buggy.

* Modified UI to show Tasks in cardview

* Fixed CompleteTaskCommand + Added CommandParser interface for TaskBookParser

* Fixed checkstyle issues by adding a space before the {

* Updated Milestone class by changing name of Order to Rank instead
Added outline of how AddMilestoneCommand will work

* Tests modified, incomplete

* Added @@author tag for JeremyInElysium

* Added SelectDeadline

* Completed AddMilestoneCommand for v1.2 (add a single milestone only)

* Updated UG Command Summary and Features to include add_milestone feature
Updated DG Use case and User Story to include add_milestone feature

* Fixed checkstyles issues & removed checkstyleTest from travis check

* Modified Jeremy & Kha Sim's code & Moved some folders

* Added comments for better understanding.

* prevent changes in taskbook parser

* With the unrefactored folders + Modified changes for SelectDeadline & AddMilestone

* Trying to resolve Eof error

* Trying to resolve Eof error + some DG changes

* Fixed checkstyle and moved main/java/../unrefactored folder

* Displayed invalid command format. Attempted to modify the model component of DeferDeadlineCommand

* Implemented deferdeadline and changes is reflected on UI

* updated UGDG

* solved

* 0 Checkstyle errors
  • Loading branch information
chel-seyy committed Oct 16, 2018
1 parent 02bcf62 commit 81afea5
Show file tree
Hide file tree
Showing 208 changed files with 5,051 additions and 5,363 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -5,7 +5,7 @@ matrix:

script: >-
./config/travis/run-checks.sh &&
travis_retry ./gradlew clean checkstyleMain checkstyleTest headless allTests coverage coveralls asciidoctor copyDummySearchPage
travis_retry ./gradlew clean checkstyleMain headless nonGuiTests coverage coveralls asciidoctor
deploy:
skip_cleanup: true
Expand Down
21 changes: 9 additions & 12 deletions build.gradle
Expand Up @@ -116,17 +116,17 @@ tasks.coveralls {
onlyIf { System.env.'CI' }
}

task(guiTests)
//task(guiTests)
task(nonGuiTests)

// Run `test` task if `guiTests` or `nonGuiTests` is specified
guiTests.dependsOn test
//guiTests.dependsOn test
nonGuiTests.dependsOn test

task(allTests)

// `allTests` implies both `guiTests` and `nonGuiTests`
allTests.dependsOn guiTests
//allTests.dependsOn guiTests
allTests.dependsOn nonGuiTests

test {
Expand All @@ -148,26 +148,27 @@ test {
}

doFirst {
boolean runGuiTests = gradle.taskGraph.hasTask(guiTests)
// boolean runGuiTests = gradle.taskGraph.hasTask(guiTests)
boolean runNonGuiTests = gradle.taskGraph.hasTask(nonGuiTests)

if (!runGuiTests && !runNonGuiTests) {
runGuiTests = true
if (!runNonGuiTests) {
//!runGuiTests &&
// runGuiTests = true
runNonGuiTests = true
}

if (runNonGuiTests) {
test.include 'seedu/address/**'
}

if (runGuiTests) {
/*if (runGuiTests) {
test.include 'systemtests/**'
test.include 'seedu/address/ui/**'
}
if (!runGuiTests) {
test.exclude 'seedu/address/ui/**'
}
}*/
}
}

Expand Down Expand Up @@ -236,10 +237,6 @@ task deployOfflineDocs(type: Copy) {
}
}

task copyDummySearchPage(type: Copy) {
from 'docs/DummySearchPage.html'
into "${buildDir}/docs/html5"
}

deployOfflineDocs.dependsOn asciidoctor
processResources.dependsOn deployOfflineDocs
Expand Down
160 changes: 87 additions & 73 deletions docs/DeveloperGuide.adoc

Large diffs are not rendered by default.

21 changes: 15 additions & 6 deletions docs/UserGuide.adoc
Expand Up @@ -45,10 +45,8 @@ e.g. typing *`help`* and pressing kbd:[Enter] will open the help window.
====
*Command Format*
* Words in `UPPER_CASE` are the parameters to be supplied by the user e.g. in `add n/NAME`, `NAME` is a parameter which can be used as `add n/John Doe`.
* Items in square brackets are optional e.g `n/NAME [t/TAG]` can be used as `n/John Doe t/friend` or as `n/John Doe`.
* Items with `…`​ after them can be used multiple times including zero times e.g. `[t/TAG]...` can be used as `{nbsp}` (i.e. 0 times), `t/friend`, `t/friend t/family` etc.
* Parameters can be in any order e.g. if the command specifies `n/NAME p/PHONE_NUMBER`, `p/PHONE_NUMBER n/NAME` is also acceptable.
* Words in `UPPER_CASE` are the parameters to be supplied by the user e.g. in `add t/TASK`, `TASK` is a parameter which can be used as `add t/Do homework`.
//* Parameters can be in any order e.g. if the command specifies `n/NAME p/PHONE_NUMBER`, `p/PHONE_NUMBER n/NAME` is also acceptable.
====

=== Viewing help : `help`
Expand All @@ -64,6 +62,15 @@ Examples:

* `add t/Complete 2113 Tutorial d/Wed w/2`

=== Adding a milestone: `add_milestone`

Adds a milestone to selected task from the task book +
Format: `add_milestone t/TASK_TITLE m/MILESTONE r/RANK...`

Examples:

* `add_milestone t/Complete CS2113 W8 LO m/Complete Sections 8.1 to 8.5 r/1`

=== Complete a task: `complete`

Complete a task in the task book +
Expand Down Expand Up @@ -94,11 +101,11 @@ Examples:
=== Deferring a deadline: `deadline`

Defers a deadline for a task +
Format: `defer_deadline t/ACTION w/WEEKS_OF_DEFERMENT`
Format: `defer [INDEX] de/deadline`

Examples:

* `defer_deadline t/Complete 2113 Milestone w/1`
* `defer 1 de/04012018`

=== Removing a deadline : `remove_deadline`

Expand Down Expand Up @@ -214,6 +221,8 @@ _{explain how the user can enable/disable data encryption}_

* *Add* : `add t/ACTION d/DAY [w/WEEK] [m/MONTH]...` +
e.g. `add t/Complete 2113 Tutorial d/Wed w/2`
* *Add Milestone* : `add_milestone t/TASK_TITLE m/MILESTONE r/RANK...` +
e.g. `add_milestone t/Complete CS2113 W8 LO m/Complete Sections 8.1 to 8.5 r/1`
* *Clear* : `clear`
* *Deadline* : `deadline t/ACTION d/DAY [w/WEEK] [m/MONTH]...` +
e.g. `deadline t/Complete 2113 Tutorial d/Wed w/2`
Expand Down
Binary file added docs/images/ChanChunCheong.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/behkhasim.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/jeremyaw.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 14 additions & 16 deletions src/main/java/seedu/address/MainApp.java
Expand Up @@ -5,16 +5,14 @@
import java.util.Optional;
import java.util.logging.Logger;

import com.google.common.eventbus.Subscribe;

import javafx.application.Application;
import javafx.application.Platform;
import javafx.stage.Stage;
import seedu.address.commons.core.Config;
import seedu.address.commons.core.EventsCenter;
import seedu.address.commons.core.LogsCenter;
import seedu.address.commons.core.Version;
import seedu.address.commons.events.ui.ExitAppRequestEvent;
//import seedu.address.commons.events.ui.ExitAppRequestEvent;
import seedu.address.commons.exceptions.DataConversionException;
import seedu.address.commons.util.ConfigUtil;
import seedu.address.commons.util.StringUtil;
Expand All @@ -23,15 +21,15 @@
import seedu.address.model.AddressBook;
import seedu.address.model.Model;
import seedu.address.model.ModelManager;
import seedu.address.model.ReadOnlyAddressBook;
import seedu.address.model.ReadOnlyTaskBook;
import seedu.address.model.UserPrefs;
import seedu.address.model.util.SampleDataUtil;
import seedu.address.storage.AddressBookStorage;
import seedu.address.storage.JsonUserPrefsStorage;
import seedu.address.storage.Storage;
import seedu.address.storage.StorageManager;
import seedu.address.storage.TaskBookStorage;
import seedu.address.storage.UserPrefsStorage;
import seedu.address.storage.XmlAddressBookStorage;
import seedu.address.storage.XmlTaskBookStorage;
import seedu.address.ui.Ui;
import seedu.address.ui.UiManager;

Expand Down Expand Up @@ -62,8 +60,8 @@ public void init() throws Exception {

UserPrefsStorage userPrefsStorage = new JsonUserPrefsStorage(config.getUserPrefsFilePath());
userPrefs = initPrefs(userPrefsStorage);
AddressBookStorage addressBookStorage = new XmlAddressBookStorage(userPrefs.getAddressBookFilePath());
storage = new StorageManager(addressBookStorage, userPrefsStorage);
TaskBookStorage taskBookStorage = new XmlTaskBookStorage(userPrefs.getAddressBookFilePath());
storage = new StorageManager(taskBookStorage, userPrefsStorage);

initLogging(config);

Expand All @@ -82,10 +80,10 @@ public void init() throws Exception {
* or an empty address book will be used instead if errors occur when reading {@code storage}'s address book.
*/
private Model initModelManager(Storage storage, UserPrefs userPrefs) {
Optional<ReadOnlyAddressBook> addressBookOptional;
ReadOnlyAddressBook initialData;
Optional<ReadOnlyTaskBook> addressBookOptional;
ReadOnlyTaskBook initialData;
try {
addressBookOptional = storage.readAddressBook();
addressBookOptional = storage.readTaskBook();
if (!addressBookOptional.isPresent()) {
logger.info("Data file not found. Will be starting with a sample AddressBook");
}
Expand Down Expand Up @@ -196,11 +194,11 @@ public void stop() {
System.exit(0);
}

@Subscribe
public void handleExitAppRequestEvent(ExitAppRequestEvent event) {
logger.info(LogsCenter.getEventHandlingLogMessage(event));
stop();
}
// @Subscribe
// public void handleExitAppRequestEvent(ExitAppRequestEvent event) {
// logger.info(LogsCenter.getEventHandlingLogMessage(event));
// stop();
// }

public static void main(String[] args) {
launch(args);
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/seedu/address/commons/core/Messages.java
Expand Up @@ -7,7 +7,7 @@ public class Messages {

public static final String MESSAGE_UNKNOWN_COMMAND = "Unknown command";
public static final String MESSAGE_INVALID_COMMAND_FORMAT = "Invalid command format! \n%1$s";
public static final String MESSAGE_INVALID_PERSON_DISPLAYED_INDEX = "The person index provided is invalid";
public static final String MESSAGE_PERSONS_LISTED_OVERVIEW = "%1$d persons listed!";
public static final String MESSAGE_INVALID_TASK_DISPLAYED_INDEX = "The task index provided is invalid";
public static final String MESSAGE_TASKS_LISTED_OVERVIEW = "%1$d tasks listed!";

}

This file was deleted.

@@ -0,0 +1,19 @@
package seedu.address.commons.events.model;

import seedu.address.commons.events.BaseEvent;
import seedu.address.model.ReadOnlyTaskBook;

/** Indicates the AddressBook in the model has changed*/
public class TaskBookChangedEvent extends BaseEvent {

public final ReadOnlyTaskBook data;

public TaskBookChangedEvent(ReadOnlyTaskBook data) {
this.data = data;
}

@Override
public String toString() {
return "number of tasks " + data.getTaskList().size();
}
}
@@ -1,17 +1,17 @@
package seedu.address.commons.events.ui;

import seedu.address.commons.events.BaseEvent;
import seedu.address.model.person.Person;
import seedu.address.model.task.Task;

/**
* Represents a selection change in the Person List Panel
*/
public class PersonPanelSelectionChangedEvent extends BaseEvent {


private final Person newSelection;
private final Task newSelection;

public PersonPanelSelectionChangedEvent(Person newSelection) {
public PersonPanelSelectionChangedEvent(Task newSelection) {
this.newSelection = newSelection;
}

Expand All @@ -20,7 +20,7 @@ public String toString() {
return getClass().getSimpleName();
}

public Person getNewSelection() {
public Task getNewSelection() {
return newSelection;
}
}
4 changes: 2 additions & 2 deletions src/main/java/seedu/address/logic/Logic.java
Expand Up @@ -4,7 +4,7 @@
import seedu.address.logic.commands.CommandResult;
import seedu.address.logic.commands.exceptions.CommandException;
import seedu.address.logic.parser.exceptions.ParseException;
import seedu.address.model.person.Person;
import seedu.address.model.task.Task;

/**
* API of the Logic component
Expand All @@ -20,7 +20,7 @@ public interface Logic {
CommandResult execute(String commandText) throws CommandException, ParseException;

/** Returns an unmodifiable view of the filtered list of persons */
ObservableList<Person> getFilteredPersonList();
ObservableList<Task> getFilteredTaskList();

/** Returns the list of input entered by the user, encapsulated in a {@code ListElementPointer} object */
ListElementPointer getHistorySnapshot();
Expand Down
39 changes: 31 additions & 8 deletions src/main/java/seedu/address/logic/LogicManager.java
Expand Up @@ -5,13 +5,25 @@
import javafx.collections.ObservableList;
import seedu.address.commons.core.ComponentManager;
import seedu.address.commons.core.LogsCenter;
import seedu.address.logic.commands.AddTaskCommand;
import seedu.address.logic.commands.ClearCommand;
import seedu.address.logic.commands.Command;
import seedu.address.logic.commands.CommandResult;
import seedu.address.logic.commands.CompleteTaskCommand;
import seedu.address.logic.commands.DeferDeadlineCommand;
import seedu.address.logic.commands.DeleteCommand;
import seedu.address.logic.commands.ExitCommand;
import seedu.address.logic.commands.HelpCommand;
import seedu.address.logic.commands.HistoryCommand;
import seedu.address.logic.commands.ListCommand;
import seedu.address.logic.commands.RedoCommand;
import seedu.address.logic.commands.SelectDeadlineCommand;
import seedu.address.logic.commands.UndoCommand;
import seedu.address.logic.commands.exceptions.CommandException;
import seedu.address.logic.parser.AddressBookParser;
import seedu.address.logic.parser.TaskBookParser;
import seedu.address.logic.parser.exceptions.ParseException;
import seedu.address.model.Model;
import seedu.address.model.person.Person;
import seedu.address.model.task.Task;

/**
* The main LogicManager of the app.
Expand All @@ -21,29 +33,40 @@ public class LogicManager extends ComponentManager implements Logic {

private final Model model;
private final CommandHistory history;
private final AddressBookParser addressBookParser;
private final TaskBookParser taskBookParser;

public LogicManager(Model model) {
this.model = model;
history = new CommandHistory();
addressBookParser = new AddressBookParser();
// need to add the commands into the list<CommandParser> commands in TaskBookParser
taskBookParser = new TaskBookParser(new AddTaskCommand(),
new ClearCommand(),
new CompleteTaskCommand(),
new DeferDeadlineCommand(),
new DeleteCommand(),
new ListCommand(),
new SelectDeadlineCommand(),
new HelpCommand(),
new ExitCommand(),
new HistoryCommand(),
new UndoCommand(),
new RedoCommand());
}

@Override
public CommandResult execute(String commandText) throws CommandException, ParseException {
logger.info("----------------[USER COMMAND][" + commandText + "]");
try {
Command command = addressBookParser.parseCommand(commandText); // Command command = AddCommand(person)
//AddCommand.execute(model, history) which will return CommandResult(String.format(MESSAGE_SUCCESS, toAdd));
Command command = taskBookParser.parseCommand(commandText);
return command.execute(model, history);
} finally {
history.add(commandText);
}
}

@Override
public ObservableList<Person> getFilteredPersonList() {
return model.getFilteredPersonList();
public ObservableList<Task> getFilteredTaskList() {
return model.getFilteredTaskList();
}

@Override
Expand Down

0 comments on commit 81afea5

Please sign in to comment.