Skip to content

Commit

Permalink
Merge branch 'master' into Edit-User-Guide-2
Browse files Browse the repository at this point in the history
  • Loading branch information
Plishh authored Nov 11, 2024
2 parents c0238a5 + 8f9b388 commit 8f307dc
Show file tree
Hide file tree
Showing 11 changed files with 50 additions and 10 deletions.
1 change: 1 addition & 0 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* This project is based on the AddressBook-Level3 project created by the [SE-EDU initiative](https://se-education.org).
* The feature Undo, Redo and History (including the code) was reused with minimal changes from [AddressBook-Level4](https://github.com/se-edu/addressbook-level4.git) ([UG](https://se-education.org/addressbook-level4/UserGuide.html), [DG](https://se-education.org/addressbook-level4/DeveloperGuide.html)).
* The feature Import was implemented using the third-party library OpenCSV.
* GitHub CoPilot was used by Ivan Jerrick Koh to write trivial test cases in test files and JavaDocs for trivial methods.

--------------------------------------------------------------------------------------------------------------------

Expand Down
19 changes: 15 additions & 4 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@

---
layout: default.md
title: "User Guide"
pageNav: 3

layout: default.md
title: "User Guide"
pageNav: 3

---

# VolunTier User Guide

--------------------------------------------------------------------------------------------------------------------


<!-- Table of Contents -->
- [VolunTier User Guide](#voluntier-user-guide)

- [Quick start](#quick-start)
- [Installation of application](#installation-of-application)
- [Features](#features)
Expand Down Expand Up @@ -122,10 +126,12 @@ Ctrl + Alt + T
## Features



<box type="tip" seamless>

**Tips:**


* start the app with `java -jar VolunTier.jar` when you are in the folder you put the jar file in.

</box>
Expand Down Expand Up @@ -155,8 +161,10 @@ Ctrl + Alt + T

* If you are using a PDF version of this document, be careful when copying and pasting commands that span multiple lines as space characters surrounding line-breaks may be omitted when copied over to the application.


* For users who have used VolunTier before can jump to [Command Summary](#Command-summary)


</box>


Expand Down Expand Up @@ -201,9 +209,11 @@ Format: `addTutee \n NAME \p PHONE_NUMBER \e EMAIL \a ADDRESS [\h HOURS] [\s SUB

* A person can have any number of subjects (including 0).


</box>



### Adding a Lesson: `addLesson`

Add a lesson in VolunTier between a tutor and tutee. A lesson must have a tutor, a tutee and a subject.
Expand Down Expand Up @@ -259,6 +269,7 @@ Examples:

Finds persons who have any of the SUBJECT(s).


Format: `findSubject SUBJECT [MORE_SUBJECTS]`

* The search is case-insensitive. e.g., `math` will match `Math`
Expand Down
1 change: 1 addition & 0 deletions docs/diagrams/DeleteSequenceDiagram.puml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@startuml
!include style.puml
scale 1.5
skinparam ArrowFontStyle plain

box Logic LOGIC_COLOR_T1
Expand Down
1 change: 1 addition & 0 deletions docs/diagrams/LogicClassDiagram.puml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@startuml
!include style.puml
scale 1.5
skinparam arrowThickness 1.1
skinparam arrowColor LOGIC_COLOR_T4
skinparam classBackgroundColor LOGIC_COLOR
Expand Down
1 change: 1 addition & 0 deletions docs/diagrams/ModelClassDiagram.puml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@startuml
!include style.puml
scale 2
skinparam arrowThickness 1.1
skinparam arrowColor MODEL_COLOR
skinparam classBackgroundColor MODEL_COLOR
Expand Down
1 change: 1 addition & 0 deletions docs/diagrams/StorageClassDiagram.puml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@startuml
!include style.puml
scale 2
skinparam arrowThickness 1.1
skinparam arrowColor STORAGE_COLOR
skinparam classBackgroundColor STORAGE_COLOR
Expand Down
Binary file added docs/images/UiOverview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,14 @@ public FindSubjectCommand parse(String userInput) throws ParseException {
String.format(MESSAGE_INVALID_COMMAND_FORMAT, FindSubjectCommand.MESSAGE_USAGE)
);
}
if (!isValidSubject(trimmedArgs)) {
throw new ParseException(MESSAGE_CONSTRAINTS);

String[] subjectKeywords = trimmedArgs.split("\\s+");
for (String subject : subjectKeywords) {
if (!isValidSubject(subject)) {
throw new ParseException(MESSAGE_CONSTRAINTS);
}
}

String subjectToFind = trimmedArgs;
return new FindSubjectCommand(new PersonHaveSubjectPredicate(subjectToFind));
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/seedu/address/model/person/Address.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class Address {
* The first character of the address must not be a whitespace,
* otherwise " " (a blank string) becomes a valid input.
*/
public static final String VALIDATION_REGEX = "^(.*),\\s?(\\d{6})$";
public static final String VALIDATION_REGEX = "^(\\S+.*),\\s?(\\d{6})$";


public final String value;
Expand Down
23 changes: 21 additions & 2 deletions src/main/java/seedu/address/model/person/Hours.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ public class Hours {

public static final String MESSAGE_CONSTRAINTS =
"Hours should be non-negative integers, with a maximum of 876,000.";
public static final String VALIDATION_REGEX = "^(?:\\d{1,5}|[1-7]\\d{5}|8[0-6]\\d{4}|87[0-5]\\d{3}|876000)$";
public static final String VALIDATION_REGEX =
"^(?:0*([0-9]{1,5}|[1-7][0-9]{5}|8[0-6][0-9]{4}|87[0-5][0-9]{3}|876000))$";
public final String value;

/**
Expand All @@ -22,7 +23,7 @@ public class Hours {
public Hours(String hour) {
requireNonNull(hour);
checkArgument(isValidHours(hour), MESSAGE_CONSTRAINTS);
value = hour;
value = clearLeadingZeroes(hour);
}

public int getHoursInt() {
Expand All @@ -36,6 +37,24 @@ public static boolean isValidHours(String test) {
return test.matches(VALIDATION_REGEX);
}

/**
* Removes leading zeros from the given string representation of a number.
* If the resulting string is empty after removing the zeros, it returns "0".
*
* @param hours the string representation of the number to clean, must not be null
* @return the string with leading zeros removed; if the input consists entirely of zeros,
* returns "0"
*/
public static String clearLeadingZeroes(String hours) {
requireNonNull(hours);
String cleanedString = hours.replaceFirst("^0+", "");
if (cleanedString.isEmpty()) {
return "0";
} else {
return cleanedString;
}
}

@Override
public String toString() {
return value;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/seedu/address/ui/HelpWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class HelpWindow extends UiPart<Stage> {
new String[]{"List", "list"},
new String[]{"Undo", "undo"},
new String[]{"Redo", "redo"},
new String[]{"View", "view"},
new String[]{"View", "view INDEX\n e.g., view 1"},
new String[]{"View Tutor Hours", "vtc"},
new String[]{"Exit", "exit"},
new String[]{"Help", "help"}
Expand Down

0 comments on commit 8f307dc

Please sign in to comment.