Skip to content

Commit

Permalink
Merge pull request #254 from EugeneTeu/logging
Browse files Browse the repository at this point in the history
add to sample order util, add showing of Customer Tags
  • Loading branch information
EugeneTeu authored Nov 5, 2019
2 parents 015004d + 8e56701 commit ce65d86
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 2 deletions.
37 changes: 35 additions & 2 deletions src/main/java/seedu/address/model/util/SampleDataUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,28 @@ Capacity.SIZE_256GB, new Colour("Black"), new Cost("$95"),
getTagSet("New")),
new Price("$1200"),
Status.CANCELLED,
Optional.of(sampleSchedule3()), getTagSet("New"))

Optional.of(sampleSchedule3()), getTagSet("New")),
new Order(UUID.randomUUID(),
new Customer(new CustomerName("Tao Nan"), new ContactNumber("12345678"),
new Email("[email protected]"), getTagSet("bigCustomer")),
new Phone(new IdentityNumber("352039475644270"),
new SerialNumber("2ncs89ma"), new PhoneName("Galaxy apollo 20"), new Brand("NotApple"),
Capacity.SIZE_256GB, new Colour("Black"), new Cost("$900.02"),
getTagSet("New")),
new Price("$1911.32"),
Status.COMPLETED,
Optional.of(sampleSchedule4(01, 23)), getTagSet("New")),
new Order(UUID.randomUUID(),
new Customer(new CustomerName("Tao tan"), new ContactNumber("01234323"),
new Email("[email protected]"), getTagSet("smallCustomer")),
new Phone(new IdentityNumber("182043475644270"),
new SerialNumber("2ncs90ma"), new PhoneName("Galaxy apollo 19"), new Brand("NotApple"),
Capacity.SIZE_256GB, new Colour("Black"), new Cost("$800.10"),
getTagSet("New")),
new Price("$2900.32"),
Status.COMPLETED,
Optional.of(sampleSchedule4(04,
15)), getTagSet("New"))
};
}

Expand Down Expand Up @@ -240,6 +260,19 @@ private static Schedule sampleSchedule3() {
getTagSet("New"));
}

/**
*Return sample Schedule object
*/
private static Schedule sampleSchedule4(int month, int day) {
return new Schedule(
UUID.randomUUID(),
new Calendar.Builder().setDate(2019, month, day).build(),
new Venue("test venue"),
getTagSet("New"));
}





public static ReadOnlyDataBook<Order> getSampleOrderBook() {
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/seedu/address/ui/cards/ArchivedOrderCard.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ public class ArchivedOrderCard extends UiPart<Region> {
private FlowPane tags;
@FXML
private FlowPane scheduleTags;
@FXML
private FlowPane customerTags;

public ArchivedOrderCard(Order order, int displayedIndex) {
super(FXML);
Expand Down Expand Up @@ -98,6 +100,11 @@ public ArchivedOrderCard(Order order, int displayedIndex) {
order.getSchedule().get().getTags().stream().sorted(Comparator.comparing(tag -> tag.tagName))
.forEach(tag -> scheduleTags.getChildren().add(new Label(tag.tagName)));
}
if (order.getCustomer() != null) {
order.getCustomer().getTags().stream()
.sorted(Comparator.comparing(tag -> tag.tagName))
.forEach(tag -> customerTags.getChildren().add(new Label(tag.tagName)));
}

order.getTags().stream()
.sorted(Comparator.comparing(tag -> tag.tagName))
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/seedu/address/ui/cards/OrderCard.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ public class OrderCard extends UiPart<Region> {
private FlowPane tags;
@FXML
private FlowPane scheduleTags;
@FXML
private FlowPane customerTags;

public OrderCard(Order order, int displayedIndex) {
super(FXML);
Expand Down Expand Up @@ -92,6 +94,12 @@ public OrderCard(Order order, int displayedIndex) {
order.getSchedule().get().getTags().stream().sorted(Comparator.comparing(tag -> tag.tagName))
.forEach(tag -> scheduleTags.getChildren().add(new Label(tag.tagName)));
}

if (order.getCustomer() != null) {
order.getCustomer().getTags().stream()
.sorted(Comparator.comparing(tag -> tag.tagName))
.forEach(tag -> customerTags.getChildren().add(new Label(tag.tagName)));
}
order.getTags().stream()
.sorted(Comparator.comparing(tag -> tag.tagName))
.forEach(tag -> tags.getChildren().add(new Label(tag.tagName)));
Expand Down
4 changes: 4 additions & 0 deletions src/main/resources/view/ArchivedOrderListCard.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@
<Label text="Order Tags:" styleClass="cell_small_label_header" />
<FlowPane fx:id="tags" />
</HBox>
<HBox>
<Label text="Customer Tags:" styleClass="cell_small_label_header" />
<FlowPane fx:id="customerTags" />
</HBox>
<padding>
<Insets top="5" right="5" bottom="5" left="15" />
</padding>
Expand Down
4 changes: 4 additions & 0 deletions src/main/resources/view/OrderListCard.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@
<Label text="Order Tags:" styleClass="cell_small_label_header" />
<FlowPane fx:id="tags" />
</HBox>
<HBox>
<Label text="Customer Tags:" styleClass="cell_small_label_header" />
<FlowPane fx:id="customerTags" />
</HBox>
<padding>
<Insets top="5" right="5" bottom="5" left="15" />
</padding>
Expand Down
10 changes: 10 additions & 0 deletions src/main/resources/view/SMLTheme.css
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,16 @@
-fx-font-size: 11;
}


#customerTags .label {
-fx-text-fill: white;
-fx-background-color: #6495ED;
-fx-padding: 1 3 1 3;
-fx-border-radius: 2;
-fx-background-radius: 2;
-fx-font-size: 11;
}

.panel-background {
-fx-background-color: #484B95;
}
Expand Down

0 comments on commit ce65d86

Please sign in to comment.