Skip to content

Commit

Permalink
Merge pull request #187 from Badatprogrammiing/bug-fix
Browse files Browse the repository at this point in the history
PED Bug Fix and PPP
  • Loading branch information
seewhyjay authored Nov 13, 2023
2 parents e2fcee4 + ee96b37 commit 86ccbfe
Show file tree
Hide file tree
Showing 13 changed files with 112 additions and 49 deletions.
48 changes: 25 additions & 23 deletions docs/UserGuide.md

Large diffs are not rendered by default.

34 changes: 28 additions & 6 deletions docs/team/badatprogrammiing.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,41 @@ CampusCompanion - your all-in-one solution to manage your university life.
* **Code contributed**: [RepoSense link](https://nus-cs2103-ay2324s1.github.io/tp-dashboard/?search=Badatprogrammiing&breakdown=true)

* **Enhancements implemented**:
* To be added
* Models
* Implement models for Assignment, InternshipRoles, InternshipsTasks.
* Created fields for the relevant model.
* Refactor UniquePersonList to a generic class to reduce code duplication.
* Add Assignment Command
* Allows user to add assignments.
* Add InternshipRole Command
* Allows user to add internship roles.
* Calendar UI
* Calendar that display all its related tasks.
* Calendar navigation by month.
* Calendar will display tasks based on the selected tab.
* UI
* Hook up assignment and internship with the UI.
* Enhance the look of the GUI, and make the entire app relatively responsive using FXML and CSS.
* Tabs switching and verification between assignments and internships.
* Storage
* Properly serialises and de-serialises InternshipRoles and Assignment for permanent storage.

* **Documentation**:
* User Guide:
* To be added
* Yes
* Developer Guide:
* To be added
* UI, Model Diagrams.
* Update section related to UI.

* **Team-based tasks**:
* To be added
* Set up group repo.
* Maintaining issue tracker.
* Managed releases.

* **Review and mentoring**:
* To be added
* Notable PRs reviewed: [PR](https://github.com/AY2324S1-CS2103T-T12-3/tp/pull/131)

* **Community**:
* To be added
* Contributions during the PE-D to provide bug reports to other groups.


4 changes: 2 additions & 2 deletions src/main/java/seedu/address/commons/core/GuiSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
*/
public class GuiSettings implements Serializable {

private static final double DEFAULT_HEIGHT = 600;
private static final double DEFAULT_WIDTH = 740;
private static final double DEFAULT_HEIGHT = 700;
private static final double DEFAULT_WIDTH = 800;

private final double windowWidth;
private final double windowHeight;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ public class AddAssignmentCommand extends AssignmentCommand {
+ ": Adds an assignment to the app. "
+ "Parameters: "
+ PREFIX_NAME + "NAME "
+ PREFIX_ENDDATE + "YYYY-MM-DD HH:mm "
+ "[" + PREFIX_DESCRIPTION + "DESCRIPTION" + "]"
+ "[" + PREFIX_STATUS + "STATUS " + "]\n"
+ "[" + PREFIX_PLANNEDFINISHDATE + "YYYY-MM-DD HH:mm" + "]"
+ PREFIX_ENDDATE + "YYYY-MM-DD [HH:mm] "
+ "[" + PREFIX_DESCRIPTION + "DESCRIPTION" + "] "
+ "[" + PREFIX_STATUS + "STATUS" + "]\n"
+ "[" + PREFIX_PLANNEDFINISHDATE + "YYYY-MM-DD [HH:mm]" + "] "
+ "[" + PREFIX_TAG + "TAG" + "]\n"
+ "Example: " + COMMAND_WORD
+ " add-a n/Assignment 1 d/description e/2023-12-18 19:00 p/2023-08-19 18:00 t/group s/incomplete";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class EditAssignmentCommand extends AssignmentCommand {
+ "Parameters: "
+ "[" + PREFIX_INDEX + "INDEX (must be a positive integer)" + "]\n"
+ "[" + PREFIX_DESCRIPTION + "DESCRIPTION" + "]\n"
+ "Example: " + COMMAND_WORD + "i/ 1" + " /d This is the new description";
+ "Example: " + COMMAND_WORD + " i/1" + " /d This is the new description";

public static final String MESSAGE_SUCCESS = "Assignment has been edited: %1$s";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
public class AddInternshipRoleCommand extends InternshipCommand {
public static final String COMMAND_WORD = "add-i-role";

public static final String MESSAGE_USAGE = "add-i-role n/<name of company> r/<role name> c/<cycle> "
+ "[d/<description>] [p/<pay>] [o/<outcome>] [l/<location>]";
public static final String MESSAGE_USAGE = "add-i-role n/NAME r/ROLE c/CYCLE "
+ "[d/DESCRIPTION] [p/PAY] [o/awaiting/follow-up/ghosted/rejected/offered/accepted] [l/LOCATION] [t/TAG]";

public static final String MESSAGE_SUCCESS = "New internship role added: %1$s";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ public class AddInternshipTaskCommand extends InternshipCommand {
+ "Parameters: "
+ PREFIX_TASK_NAME + "NAME "
+ PREFIX_INDEX + "INDEX OF INTERNSHIP ROLE "
+ PREFIX_DEADLINE + "YYYY-MM-DD HH:mm "
+ "[" + PREFIX_STATUS + "STATUS " + "]\n"
+ PREFIX_DEADLINE + "YYYY-MM-DD [HH:mm] "
+ "[" + PREFIX_STATUS + "STATUS" + "]\n"
+ "[" + PREFIX_OUTCOME + "awaiting/follow-up/ghosted/rejected/offered" + "]\n"
+ "[" + PREFIX_TAG + "TAG" + "]\n"
+ "Example: " + COMMAND_WORD
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
Expand Down Expand Up @@ -70,6 +71,9 @@ public JsonAdaptedInternshipRole(InternshipRole source) {
this.pay = source.getPay().getPay().orElse(null);
this.outcome = source.getApplicationOutcome().getApplicationOutcome();
this.location = source.getLocation().toString();
tags.addAll(source.getTags().stream()
.map(JsonAdaptedTag::new)
.collect(Collectors.toList()));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
Expand Down Expand Up @@ -63,6 +64,9 @@ public JsonAdaptedInternshipTask(InternshipTask source) {
this.status = source.getStatus().isCompleted();
this.outcome = source.getOutcome().getTaskOutcome();
this.internshipRole = new JsonAdaptedInternshipRole(source.getInternshipRole());
tags.addAll(source.getTags().stream()
.map(JsonAdaptedTag::new)
.collect(Collectors.toList()));
}

/**
Expand Down
11 changes: 10 additions & 1 deletion src/main/java/seedu/address/ui/AssignmentCard.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,15 @@ public AssignmentCard(Assignment assignment, int displayedIndex) {
plannedFinishDate.setText("Plan to finish by: " + assignment.getPlannedFinishDate().toString());
assignment.getTags().stream()
.sorted(Comparator.comparing(tag -> tag.tagName))
.forEach(tag -> tags.getChildren().add(new Label(tag.tagName)));
.forEach(tag -> {
HBox container = new HBox();
Label l = new Label(tag.tagName);
container.getChildren().add(l);
l.setWrapText(true);
cardPane.widthProperty().addListener((obs, oldVal, newVal) -> {
l.setMaxWidth(newVal.doubleValue() - 25);
});
tags.getChildren().add(container);
});
}
}
17 changes: 15 additions & 2 deletions src/main/java/seedu/address/ui/InternshipRoleCard.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import javafx.fxml.FXML;
import javafx.scene.control.Label;
import javafx.scene.layout.FlowPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Region;
import seedu.address.model.internship.role.InternshipRole;

Expand Down Expand Up @@ -37,6 +38,10 @@ public class InternshipRoleCard extends UiPart<Region> {
@FXML
private FlowPane tags;

@FXML
private HBox cardPane;


/**
* Represents an internship role gui card
* @param internshipRole to display
Expand All @@ -53,8 +58,16 @@ public InternshipRoleCard(InternshipRole internshipRole, int displayedIndex) {
internLocation.setText("Location: " + this.internshipRole.getLocation().toString());
internshipRole.getTags().stream()
.sorted(Comparator.comparing(tag -> tag.tagName))
.forEach(tag -> tags.getChildren().add(new Label(tag.tagName)));
.forEach(tag -> {
HBox container = new HBox();
Label l = new Label(tag.tagName);
container.getChildren().add(l);
l.setWrapText(true);
cardPane.widthProperty().addListener((obs, oldVal, newVal) -> {
l.setMaxWidth(newVal.doubleValue() - 25);
});
tags.getChildren().add(container);
});
}


}
15 changes: 14 additions & 1 deletion src/main/java/seedu/address/ui/InternshipTaskCard.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import javafx.fxml.FXML;
import javafx.scene.control.Label;
import javafx.scene.layout.FlowPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Region;
import seedu.address.model.internship.task.InternshipTask;

Expand Down Expand Up @@ -37,6 +38,9 @@ public class InternshipTaskCard extends UiPart<Region> {
@FXML
private FlowPane tags;

@FXML
private HBox cardPane;

/**
* Crates an InternshipTask card with the given task
* @param task to be displayed
Expand All @@ -53,6 +57,15 @@ public InternshipTaskCard(InternshipTask task, int displayedIndex) {
outcome.setText("Outcome: " + task.getOutcome().toString());
task.getTags().stream()
.sorted(Comparator.comparing(tag -> tag.tagName))
.forEach(tag -> tags.getChildren().add(new Label(tag.tagName)));
.forEach(tag -> {
HBox container = new HBox();
Label l = new Label(tag.tagName);
container.getChildren().add(l);
l.setWrapText(true);
cardPane.widthProperty().addListener((obs, oldVal, newVal) -> {
l.setMaxWidth(newVal.doubleValue() - 25);
});
tags.getChildren().add(container);
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,7 @@ private AddressBook getAddressBook() {
}

private void editRolesAndTask(InternshipRole roleToBeEdited, InternshipRole editedRole, ModelManager model) {
for (InternshipRole r : model.getFilteredInternshipRoleList()) {
if (r.equals(roleToBeEdited)) {
model.setInternshipRole(r, editedRole);
}
}
model.setInternshipRole(roleToBeEdited, editedRole);

for (InternshipTask t : model.getUnfilteredInternshipTaskList()) {
if (t.getInternshipRole().equals(roleToBeEdited)) {
Expand Down

0 comments on commit 86ccbfe

Please sign in to comment.