Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add address to client card #292

Merged
merged 2 commits into from
Nov 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/main/java/seedu/address/ui/ClientDetailedView.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import javafx.scene.layout.Region;
import javafx.scene.layout.VBox;
import seedu.address.commons.core.LogsCenter;
import seedu.address.model.client.Address;
import seedu.address.model.client.Birthday;
import seedu.address.model.client.Client;
import seedu.address.model.client.Email;
Expand All @@ -34,6 +35,9 @@ public class ClientDetailedView extends UiPart<Region> {
@FXML
private Label email;

@FXML
private Label address;

@FXML
private Label birthday;

Expand All @@ -52,6 +56,7 @@ public ClientDetailedView(Client client) {
clientName.setText(client.getName().toString());
phoneNumber.setText(client.getPhone().toString());
email.setText(client.getEmail().map(Email::toString).orElse(""));
address.setText(client.getAddress().map(Address::toString).orElse(""));
Optional<Birthday> clientBirthday = client.getBirthday();
if (clientBirthday.isEmpty()) {
birthday.setText("");
Expand Down
Binary file added src/main/resources/images/address.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 15 additions & 3 deletions src/main/resources/view/ClientDetailedView.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,19 @@
<Insets top="10.0" />
</padding>
</Label>
<Label fx:id="birthday" prefHeight="20.0" prefWidth="263.0" text="\$birthday" GridPane.columnSpan="2" GridPane.rowIndex="2">
<Label fx:id="address" prefHeight="20.0" prefWidth="263.0" text="\$address" GridPane.columnSpan="2" GridPane.rowIndex="2">
<graphic>
<ImageView fitHeight="20.0" fitWidth="20.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@../images/address.png" />
</image>
</ImageView>
</graphic>
<padding>
<Insets top="10.0" />
</padding>
</Label>
<Label fx:id="birthday" prefHeight="20.0" prefWidth="263.0" text="\$birthday" GridPane.columnSpan="2" GridPane.rowIndex="3">
<graphic>
<ImageView fitHeight="20.0" fitWidth="20.0" pickOnBounds="true" preserveRatio="true">
<image>
Expand All @@ -101,12 +113,12 @@
<Insets top="10.0" />
</padding>
</Label>
<FlowPane fx:id="products" prefHeight="200.0" prefWidth="200.0" GridPane.columnSpan="2" GridPane.rowIndex="4">
<FlowPane fx:id="products" prefHeight="200.0" prefWidth="200.0" GridPane.columnSpan="2" GridPane.rowIndex="5">
<padding>
<Insets top="5.0" />
</padding>
</FlowPane>
<Label text="Products:" GridPane.rowIndex="3">
<Label text="Products:" GridPane.rowIndex="4">
<padding>
<Insets top="10.0" />
</padding>
Expand Down