Skip to content

Commit

Permalink
Merge (#19)
Browse files Browse the repository at this point in the history
* Resolve checkstyle errors

* FIx Bug in FindCommand (CS2113-AY1819S2-T08-3#97)

Fix Bug in FindCommand

* Update User Guide documentation (CS2113-AY1819S2-T08-3#98)

* Update User Guide documentation (CS2113-AY1819S2-T08-3#99)

* Planner: Initialize weekType for each Day

* Planner: Fix Codacy issue

* Planner: Update code for initialisation of semester

* Planner: Fix Codacy and checkstyle issues

* Planner: Fix build error

* Planner: Dynamic generation of semester from date

* PlannerTest: Add JUnit test for generateSemester

* Update documentation for view command

* Add view command for monthly calendar view

* Fix Codacy issue

* UserGuide: Update user guide documentation

* UserGuide: Update user guide documentation

* Update UserGuide.adoc  (CS2113-AY1819S2-T08-3#100)

* v1.1

* fix some errors and typos

* Refactor entire project, remove all traces of Addressbook

* Update developer guide for ExportCommandP (CS2113-AY1819S2-T08-3#80)

* Update documentation for view command (CS2113-AY1819S2-T08-3#81)

* Remove remaining Addressbook classes

* Refactor some classes

* fix missing files issue

* Add test cases for add function, Utils and other code enhancements

* fix codacy issues

* fix codacy issues

* Add tests for Utils

* Add diagrams

* Update Ui.png

* fix issue with Ui.png

* Update Codacy Badge link due to reinitialization.

* Enhance ordering of slots printed

* Update User Guide

* Update User Guide

* Update User Guide

* Update User Guide

* Update User Guide

* Update User Guide

* Update User Guide

* Update User Guide

* Update User Guide

* Update User Guide (CS2113-AY1819S2-T08-3#101)

* Merge (#17)

* FIx Bug in FindCommand (CS2113-AY1819S2-T08-3#97)

Fix Bug in FindCommand

* Update User Guide documentation (CS2113-AY1819S2-T08-3#98)

* Update User Guide documentation (CS2113-AY1819S2-T08-3#99)

* Planner: Initialize weekType for each Day

* Planner: Fix Codacy issue

* Planner: Update code for initialisation of semester

* Planner: Fix Codacy and checkstyle issues

* Planner: Fix build error

* Planner: Dynamic generation of semester from date

* PlannerTest: Add JUnit test for generateSemester

* Update documentation for view command

* Add view command for monthly calendar view

* Fix Codacy issue

* UserGuide: Update user guide documentation

* UserGuide: Update user guide documentation

* Update UserGuide.adoc  (CS2113-AY1819S2-T08-3#100)

* v1.1

* fix some errors and typos

* Refactor entire project, remove all traces of Addressbook

* Update developer guide for ExportCommandP (CS2113-AY1819S2-T08-3#80)

* Update documentation for view command (CS2113-AY1819S2-T08-3#81)

* Remove remaining Addressbook classes

* Refactor some classes

* fix missing files issue

* Add test cases for add function, Utils and other code enhancements

* fix codacy issues

* fix codacy issues

* Add tests for Utils

* Add diagrams

* Update Ui.png

* fix issue with Ui.png

* Update Codacy Badge link due to reinitialization.

* Enhance ordering of slots printed

* Update User Guide

* Update User Guide

* Update User Guide

* Update User Guide

* Update User Guide

* Update User Guide

* Update User Guide

* Update User Guide

* Update User Guide

* Add config file for Reposense

* Add config file for Reposense (CS2113-AY1819S2-T08-3#102)

* Move config.json to _reposense folder

* Move config.json to _reposense folder (CS2113-AY1819S2-T08-3#103)

* Edit config file for reposense

* Update User Guide (CS2113-AY1819S2-T08-3#105)

* Update use cases in developer guide

* edit user guide

* add encryption key skeleton

* user guide edits

* Update User Guide (CS2113-AY1819S2-T08-3#106)

* Planner: Initialize weekType for each Day

* Planner: Fix Codacy issue

* Planner: Update code for initialisation of semester

* Planner: Fix Codacy and checkstyle issues

* Planner: Fix build error

* Planner: Dynamic generation of semester from date

* PlannerTest: Add JUnit test for generateSemester

* Update documentation for view command

* Add view command for monthly calendar view

* Fix Codacy issue

* UserGuide: Update user guide documentation

* UserGuide: Update user guide documentation

* Update README.adoc and UserGuide.adoc: change table layouts  (CS2113-AY1819S2-T08-3#110)

* v1.1

* fix some errors and typos

* Refactor entire project, remove all traces of Addressbook

* Update developer guide for ExportCommandP (CS2113-AY1819S2-T08-3#80)

* Update documentation for view command (CS2113-AY1819S2-T08-3#81)

* Remove remaining Addressbook classes

* Refactor some classes

* fix missing files issue

* Add test cases for add function, Utils and other code enhancements

* fix codacy issues

* fix codacy issues

* Add tests for Utils

* Add diagrams

* Update Ui.png

* fix issue with Ui.png

* Update Codacy Badge link due to reinitialization.

* Enhance ordering of slots printed

* Update UserGuide.adoc with feedback from peers

* Update UserGuide.adoc with nicer tables

* Update UserGuide.adoc: fix formatting issues

* UserGuide.adoc Remove potential Netlify breaking code

* README.adoc revert changes

* UserGuide.adoc revert Netlify breakdown test code

* Update User Guide (CS2113-AY1819S2-T08-3#108)

* Planner: Initialize weekType for each Day

* Planner: Fix Codacy issue

* Planner: Update code for initialisation of semester

* Planner: Fix Codacy and checkstyle issues

* Planner: Fix build error

* Planner: Dynamic generation of semester from date

* PlannerTest: Add JUnit test for generateSemester

* Update documentation for view command

* Add view command for monthly calendar view

* Fix Codacy issue

* UserGuide: Update user guide documentation

* UserGuide: Update user guide documentation

* UserGuide: Update user guide documentation

* UserGuide: Update user guide documentation

* UserGuide: Update user guide documentation
  • Loading branch information
marcus-pzj authored Mar 22, 2019
1 parent 58d11e4 commit 3ed1b50
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 14 deletions.
8 changes: 4 additions & 4 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ https://ci.appveyor.com/project/seanieyap/main-r8jp5[image:https://ci.appveyor.c
https://app.netlify.com/sites/planmysem/deploys[image:https://api.netlify.com/api/v1/badges/6c19b45b-dbdd-4eff-afe2-200356d6ebb4/deploy-status[Build Status]]
https://coveralls.io/github/CS2113-AY1819S2-T08-3/main?branch=master[image:https://coveralls.io/repos/github/CS2113-AY1819S2-T08-3/main/badge.svg?branch=master[Coverage Status]]
https://www.codacy.com/app/CS2113T-T08-3/main?utm_source=github.com&utm_medium=referral&utm_content=CS2113-AY1819S2-T08-3/main&utm_campaign=Badge_Grade[image:https://api.codacy.com/project/badge/Grade/90f57d16da5049858ef67b6eaaf692f2[Codacy Badge]]
https://opensource.org/licenses/MIT[image:https://img.shields.io/badge/License-MIT-yellow.svg[License: MIT]]

image::Ui.png[]

PlanMySem is a CLI (Command Line Interface) scheduling/calendar application that targets NUS students and staff who prefer to use a desktop application for managing their schedule/calendar.
PlanMySem automatically creates a planner that is synchronised according to the NUS academic calendar for the current semester and enables easy creation, editing and deleting of items.
Special weeks such as recess week and reading week are taken into account within our unique recursion system.
Items can then be efficiently managed via the intuitive tagging system.
PlanMySem is a CLI (Command Line Interface) scheduling/calendar application that targets NUS students and staff who prefer to use a desktop application for managing their schedule/calendar. PlanMySem automatically creates a planner that is synchronised according to the NUS academic calendar for the current semester and enables easy creation, editing and deleting of items. Special weeks such as recess week and reading week are taken into account within our unique recursion system. Items can then be efficiently managed via the intuitive tagging system.

PlanMySem is optimized for those who prefer to work with a Command Line Interface (CLI) and/or are learning to work more efficiently with CLI tools. Additionally, unlike traditional calendar/scheduling applications, PlanMySem utilizes minimal resources on the user’s machine while still allowing the user to view their schedules swiftly and efficiently.

Expand Down Expand Up @@ -42,3 +40,5 @@ PlanMySem is optimized for those who prefer to work with a Command Line Interfac
* *Bug reports, Suggestions* : Post in our https://github.com/CS2113-AY1819S2-T08-3/main/issues[issue tracker]
if you noticed bugs or have suggestions on how to improve.
* *Contributing* : We welcome pull requests. Follow the process described https://github.com/oss-generic/process[here]

== Licence : link:LICENSE[MIT]
11 changes: 2 additions & 9 deletions src/planmysem/commands/EditCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@
import planmysem.common.Messages;
import planmysem.common.Utils;
import planmysem.data.exception.IllegalValueException;
import planmysem.data.semester.Day;
import planmysem.data.semester.Semester;
import planmysem.data.slot.ReadOnlySlot;
import planmysem.data.slot.Slot;
import planmysem.data.tag.Tag;

/**
Expand Down Expand Up @@ -95,13 +93,8 @@ public CommandResult execute() {
Map<LocalDateTime, ReadOnlySlot> selectedSlots = new TreeMap<>();

if (getTargetIndex() == -1) {
for (Map.Entry<LocalDate, Day> day : planner.getSemester().getDays().entrySet()) {
for (Slot slot : day.getValue().getSlots()) {
if (slot.getTags().containsAll(tags)) {
selectedSlots.put(LocalDateTime.of(day.getKey(), slot.getStartTime()), slot);
}
}
}
planner.getSlots(tags);

if (selectedSlots.size() == 0) {
return new CommandResult(String.format(MESSAGE_SUCCESS_NO_CHANGE,
Messages.craftSelectedMessage(tags)));
Expand Down
1 change: 1 addition & 0 deletions src/planmysem/commands/FindCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public class FindCommand extends Command {
public FindCommand(String keyword) {
this.keyword = keyword;
}

@Override
public CommandResult execute() {
final List<Pair<LocalDate, ? extends ReadOnlySlot>> relevantSlots = new ArrayList<>();
Expand Down
9 changes: 9 additions & 0 deletions src/planmysem/data/Planner.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.time.DayOfWeek;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.temporal.TemporalAdjusters;
import java.time.temporal.WeekFields;
Expand Down Expand Up @@ -291,6 +292,14 @@ public void addDay(LocalDate date, Day day) throws Semester.DuplicateDayExceptio
semester.addDay(date, day);
}

/**
* Get set of slots which contain all specified tags.
*/
public Map<LocalDateTime, ReadOnlySlot> getSlots(Set<Tag> tags) {
return semester.getSlots(tags);
}


/**
* Adds a slot to the Planner.
*
Expand Down
19 changes: 19 additions & 0 deletions src/planmysem/data/semester/Semester.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package planmysem.data.semester;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.TreeMap;

import planmysem.data.exception.DuplicateDataException;
import planmysem.data.exception.IllegalValueException;
Expand Down Expand Up @@ -92,6 +94,23 @@ public void addDay(LocalDate date, Day day) throws DuplicateDayException {
days.put(date, day);
}

/**
* Get set of slots which contain all specified tags.
*/
public Map<LocalDateTime, ReadOnlySlot> getSlots(Set<Tag> tags) {
Map<LocalDateTime, ReadOnlySlot> selectedSlots = new TreeMap<>();

for (Map.Entry<LocalDate, Day> day : days.entrySet()) {
for (Slot slot : day.getValue().getSlots()) {
if (slot.getTags().containsAll(tags)) {
selectedSlots.put(LocalDateTime.of(day.getKey(), slot.getStartTime()), slot);
}
}
}

return selectedSlots;
}

/**
* Adds a Slot to the Semester.
*
Expand Down
40 changes: 40 additions & 0 deletions src/planmysem/storage/KeyStorage.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package planmysem.storage;

import java.io.FileOutputStream;
import java.io.IOException;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.cert.CertificateException;

import javax.crypto.SecretKey;

/**
* Manages key storage and load.
*/
public class KeyStorage {

private char[] pwdArray = "password".toCharArray();

KeyStorage(String password) {
this.pwdArray = password.toCharArray();
}

/**
* Saves the secret key.
*/
private void save(SecretKey key) throws KeyStoreException, IOException, NoSuchAlgorithmException,
CertificateException {
//Initialize keystore.
KeyStore ks = KeyStore.getInstance("JKS");

//Save key.
KeyStore.SecretKeyEntry secret = new KeyStore.SecretKeyEntry(key);
KeyStore.ProtectionParameter password = new KeyStore.PasswordProtection(pwdArray);
ks.setEntry("db-encryption-secret", secret, password);

try (FileOutputStream fos = new FileOutputStream("newKeyStoreFileName.jks")) {
ks.store(fos, pwdArray);
}
}
}
2 changes: 1 addition & 1 deletion src/planmysem/ui/DarkTheme.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
.text-area {
-fx-background-color: black;
-fx-control-inner-background: black;
-fx-font-family: "Lucida Console";
-fx-font-family: "Monospace";
-fx-font-size: 10pt;
-fx-padding: 5 5 5 5;
}

0 comments on commit 3ed1b50

Please sign in to comment.