Skip to content

Commit dbb62fe

Browse files
authored
Merge pull request nus-cs2103-AY2021S1#55 from shadowezz/tagging-completion
Display completion status of deliverable as a tag
2 parents 7f2c6dd + 8a0b034 commit dbb62fe

6 files changed

Lines changed: 20 additions & 6 deletions

File tree

src/main/java/seedu/address/model/deliverable/deliverable/Deliverable.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public Deadline getDeadline() {
6161
return deadline;
6262
}
6363

64-
public boolean getCompletionStatus() {
64+
public boolean getIsComplete() {
6565
return isComplete;
6666
}
6767

@@ -101,7 +101,7 @@ public boolean equals(Object other) {
101101
&& otherDeliverable.getDescription().equals(getDescription())
102102
&& otherDeliverable.getDeadline().equals(getDeadline())
103103
&& otherDeliverable.getContacts().equals(getContacts())
104-
&& otherDeliverable.getCompletionStatus() == getCompletionStatus();
104+
&& otherDeliverable.getIsComplete() == getIsComplete();
105105
}
106106

107107
@Override

src/main/java/seedu/address/storage/deliverable/JsonAdaptedDeliverable.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public JsonAdaptedDeliverable(Deliverable source) {
4444
description = source.getDescription().value;
4545
deadline = source.getDeadline().value;
4646
contacts = source.getContacts();
47-
isComplete = Boolean.toString(source.getCompletionStatus());
47+
isComplete = Boolean.toString(source.getIsComplete());
4848
}
4949

5050
/**

src/main/java/seedu/address/ui/DeliverableCard.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,13 @@ public DeliverableCard(Deliverable deliverable, int displayedIndex) {
4949
description.setText("Description: " + deliverable.getDescription().value);
5050
deadline.setText("Deadline: " + deliverable.getDeadline().value);
5151
contacts.setText("Contacts: " + deliverable.getContacts());
52-
isCompleted.setText("Completion status: " + deliverable.getCompletionStatus());
52+
if (deliverable.getIsComplete()) {
53+
isCompleted.setText("completed");
54+
isCompleted.setStyle("-fx-background-color: #32cd32");
55+
} else {
56+
isCompleted.setText("on-going");
57+
isCompleted.setStyle("-fx-background-color: #ffa500");
58+
}
5359
}
5460

5561
@Override

src/main/resources/view/DarkTheme.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,3 +316,11 @@
316316
-fx-background-radius: 2;
317317
-fx-font-size: 11;
318318
}
319+
320+
#isCompleted {
321+
-fx-text-fill: white;
322+
-fx-padding: 1 3 1 3;
323+
-fx-border-radius: 2;
324+
-fx-background-radius: 2;
325+
-fx-font-size: 11;
326+
}

src/main/resources/view/DeliverableListCard.fxml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@
2626
</Label>
2727
<Label fx:id="title" text="\$first" styleClass="cell_big_label" />
2828
</HBox>
29+
<Label fx:id="isCompleted" />
2930
<Label fx:id="description" styleClass="cell_small_label" text="\$description" />
3031
<Label fx:id="deadline" styleClass="cell_small_label" text="\$deadline" />
3132
<Label fx:id="contacts" styleClass="cell_small_label" text="\$contacts" />
32-
<Label fx:id="isCompleted" styleClass="cell_small_label" text="\$isCompleted" />
3333
</VBox>
3434
</GridPane>
3535
</HBox>

src/test/java/seedu/address/testutil/DeliverableBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public DeliverableBuilder(Deliverable deliverableToCopy) {
4141
description = deliverableToCopy.getDescription();
4242
deadline = deliverableToCopy.getDeadline();
4343
contacts = deliverableToCopy.getContacts();
44-
isComplete = deliverableToCopy.getCompletionStatus();
44+
isComplete = deliverableToCopy.getIsComplete();
4545
}
4646

4747
/**

0 commit comments

Comments
 (0)