From ac9294a6a0fcbbf822b1bd3687c3d103eca77802 Mon Sep 17 00:00:00 2001 From: eugene teu Date: Mon, 11 Nov 2019 15:35:54 +0800 Subject: [PATCH 1/2] add phone tag --- .../java/seedu/address/ui/cards/ArchivedOrderCard.java | 7 +++++++ src/main/java/seedu/address/ui/cards/OrderCard.java | 7 +++++++ src/main/resources/view/ArchivedOrderListCard.fxml | 4 ++++ src/main/resources/view/OrderListCard.fxml | 4 ++++ src/main/resources/view/SMLTheme.css | 9 +++++++++ 5 files changed, 31 insertions(+) diff --git a/src/main/java/seedu/address/ui/cards/ArchivedOrderCard.java b/src/main/java/seedu/address/ui/cards/ArchivedOrderCard.java index ef7aeed0761..41b90d7c9cc 100644 --- a/src/main/java/seedu/address/ui/cards/ArchivedOrderCard.java +++ b/src/main/java/seedu/address/ui/cards/ArchivedOrderCard.java @@ -65,6 +65,8 @@ public class ArchivedOrderCard extends UiPart { private FlowPane scheduleTags; @FXML private FlowPane customerTags; + @FXML + private FlowPane phoneTags; public ArchivedOrderCard(Order order, int displayedIndex) { @@ -109,6 +111,11 @@ public ArchivedOrderCard(Order order, int displayedIndex) { .sorted(Comparator.comparing(tag -> tag.tagName)) .forEach(tag -> customerTags.getChildren().add(new Label(tag.tagName))); } + if (order.getPhone() != null) { + order.getPhone().getTags().stream() + .sorted(Comparator.comparing(tag -> tag.tagName)) + .forEach(tag -> phoneTags.getChildren().add(new Label(tag.tagName))); + } order.getTags().stream() .sorted(Comparator.comparing(tag -> tag.tagName)) diff --git a/src/main/java/seedu/address/ui/cards/OrderCard.java b/src/main/java/seedu/address/ui/cards/OrderCard.java index 5068648d15d..e6f71d361ac 100644 --- a/src/main/java/seedu/address/ui/cards/OrderCard.java +++ b/src/main/java/seedu/address/ui/cards/OrderCard.java @@ -62,6 +62,8 @@ public class OrderCard extends UiPart { private FlowPane scheduleTags; @FXML private FlowPane customerTags; + @FXML + private FlowPane phoneTags; public OrderCard(Order order, int displayedIndex) { super(FXML); @@ -100,6 +102,11 @@ public OrderCard(Order order, int displayedIndex) { .sorted(Comparator.comparing(tag -> tag.tagName)) .forEach(tag -> customerTags.getChildren().add(new Label(tag.tagName))); } + if (order.getPhone() != null) { + order.getPhone().getTags().stream() + .sorted(Comparator.comparing(tag -> tag.tagName)) + .forEach(tag -> phoneTags.getChildren().add(new Label(tag.tagName))); + } order.getTags().stream() .sorted(Comparator.comparing(tag -> tag.tagName)) .forEach(tag -> tags.getChildren().add(new Label(tag.tagName))); diff --git a/src/main/resources/view/ArchivedOrderListCard.fxml b/src/main/resources/view/ArchivedOrderListCard.fxml index 47eb6bb356e..19f773b3f1b 100644 --- a/src/main/resources/view/ArchivedOrderListCard.fxml +++ b/src/main/resources/view/ArchivedOrderListCard.fxml @@ -95,6 +95,10 @@