Skip to content

Commit

Permalink
Merge pull request #292 from EugeneTeu/ppp
Browse files Browse the repository at this point in the history
phone tag
  • Loading branch information
zhixianggg authored Nov 11, 2019
2 parents cbef34a + 6c760df commit 5f9f361
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/UserGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -864,10 +864,10 @@ This behaviour is intentional and not a bug.
* Date range starts from 1970 onwards
** Date of year input starts from 1970 onwards. This is enough to fit our use case. Anything lower will be rejected.

* Auto truncation of labels
* Auto truncation of labels and values
** the X-axis labels will adjust automatically based on the range of inputs. This is intended to give users the
flexibility with regards to the range of dates to be inputted. Above a certain range the interval between x-axis data
will decrease e.g 2 months
will decrease e.g 2 months. Above a certain values, labels will be replaced by standard notation e.g 9999999E8

* Stats window data not updating
** If you already have a stats window open and you complete an order,
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 @@ -65,6 +65,8 @@ public class ArchivedOrderCard extends UiPart<Region> {
private FlowPane scheduleTags;
@FXML
private FlowPane customerTags;
@FXML
private FlowPane phoneTags;


public ArchivedOrderCard(Order order, int displayedIndex) {
Expand Down Expand Up @@ -107,6 +109,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))
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/seedu/address/ui/cards/OrderCard.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ public class OrderCard extends UiPart<Region> {
private FlowPane scheduleTags;
@FXML
private FlowPane customerTags;
@FXML
private FlowPane phoneTags;

public OrderCard(Order order, int displayedIndex) {
super(FXML);
Expand Down Expand Up @@ -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)));
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 @@ -95,6 +95,10 @@
<Label text="Customer Tags: " styleClass="cell_small_label_header" />
<FlowPane fx:id="customerTags" />
</HBox>
<HBox>
<Label text="Phone Tags: " styleClass="cell_small_label_header" />
<FlowPane fx:id="phoneTags" />
</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 @@ -99,6 +99,10 @@
<Label text="Customer Tags: " styleClass="cell_small_label_header" />
<FlowPane fx:id="customerTags" />
</HBox>
<HBox>
<Label text="Phone Tags: " styleClass="cell_small_label_header" />
<FlowPane fx:id="phoneTags" />
</HBox>
<padding>
<Insets top="5" right="5" bottom="5" left="15" />
</padding>
Expand Down
9 changes: 9 additions & 0 deletions src/main/resources/view/SMLTheme.css
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,15 @@
-fx-font-size: 11;
}

#phoneTags .label {
-fx-text-fill: white;
-fx-background-color: #85ED;
-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 5f9f361

Please sign in to comment.