remove staff role from UI
This commit is contained in:
@@ -71,8 +71,7 @@ public class StaffAccountsController {
|
|||||||
colPhone.setCellValueFactory(data -> new javafx.beans.property.SimpleStringProperty(data.getValue().getPhone()));
|
colPhone.setCellValueFactory(data -> new javafx.beans.property.SimpleStringProperty(data.getValue().getPhone()));
|
||||||
colRole.setCellValueFactory(data -> {
|
colRole.setCellValueFactory(data -> {
|
||||||
String role = data.getValue().getRole() != null ? data.getValue().getRole() : "";
|
String role = data.getValue().getRole() != null ? data.getValue().getRole() : "";
|
||||||
String staffRole = data.getValue().getStaffRole() != null ? " (" + data.getValue().getStaffRole() + ")" : "";
|
return new javafx.beans.property.SimpleStringProperty(role);
|
||||||
return new javafx.beans.property.SimpleStringProperty(role + staffRole);
|
|
||||||
});
|
});
|
||||||
colStatus.setCellValueFactory(data -> new javafx.beans.property.SimpleStringProperty(
|
colStatus.setCellValueFactory(data -> new javafx.beans.property.SimpleStringProperty(
|
||||||
Boolean.TRUE.equals(data.getValue().getActive()) ? "Active" : "Inactive"));
|
Boolean.TRUE.equals(data.getValue().getActive()) ? "Active" : "Inactive"));
|
||||||
@@ -225,8 +224,7 @@ public class StaffAccountsController {
|
|||||||
|| safe(a.getFullName()).contains(q)
|
|| safe(a.getFullName()).contains(q)
|
||||||
|| safe(a.getEmail()).contains(q)
|
|| safe(a.getEmail()).contains(q)
|
||||||
|| safe(a.getPhone()).contains(q)
|
|| safe(a.getPhone()).contains(q)
|
||||||
|| safe(a.getRole()).contains(q)
|
|| safe(a.getRole()).contains(q);
|
||||||
|| safe(a.getStaffRole()).contains(q);
|
|
||||||
boolean active = Boolean.TRUE.equals(a.getActive());
|
boolean active = Boolean.TRUE.equals(a.getActive());
|
||||||
boolean statusMatch = selectedStatus == null || selectedStatus.equals("All Statuses")
|
boolean statusMatch = selectedStatus == null || selectedStatus.equals("All Statuses")
|
||||||
|| (selectedStatus.equals("Active") && active)
|
|| (selectedStatus.equals("Active") && active)
|
||||||
|
|||||||
@@ -44,7 +44,6 @@ public class StaffRegisterDialogController {
|
|||||||
@FXML private PasswordField txtPassword;
|
@FXML private PasswordField txtPassword;
|
||||||
@FXML private PasswordField txtPasswordConfirm;
|
@FXML private PasswordField txtPasswordConfirm;
|
||||||
@FXML private ComboBox<String> cbRole;
|
@FXML private ComboBox<String> cbRole;
|
||||||
@FXML private ComboBox<String> cbStaffRole;
|
|
||||||
@FXML private ComboBox<String> cbActive;
|
@FXML private ComboBox<String> cbActive;
|
||||||
@FXML private ComboBox<DropdownOption> cbStore;
|
@FXML private ComboBox<DropdownOption> cbStore;
|
||||||
@FXML private Label lblError;
|
@FXML private Label lblError;
|
||||||
@@ -64,9 +63,6 @@ public class StaffRegisterDialogController {
|
|||||||
cbRole.setItems(FXCollections.observableArrayList("STAFF", "ADMIN"));
|
cbRole.setItems(FXCollections.observableArrayList("STAFF", "ADMIN"));
|
||||||
cbRole.getSelectionModel().select("STAFF");
|
cbRole.getSelectionModel().select("STAFF");
|
||||||
|
|
||||||
cbStaffRole.setItems(FXCollections.observableArrayList(
|
|
||||||
"STORE_MANAGER", "SALES_ASSOCIATE", "GROOMER", "VETERINARIAN"));
|
|
||||||
cbStaffRole.getSelectionModel().selectFirst();
|
|
||||||
|
|
||||||
cbActive.setItems(FXCollections.observableArrayList("Active", "Inactive"));
|
cbActive.setItems(FXCollections.observableArrayList("Active", "Inactive"));
|
||||||
cbActive.getSelectionModel().select("Active");
|
cbActive.getSelectionModel().select("Active");
|
||||||
@@ -171,10 +167,6 @@ public class StaffRegisterDialogController {
|
|||||||
lblError.setText("Role is required.");
|
lblError.setText("Role is required.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (cbStaffRole.getValue() == null) {
|
|
||||||
lblError.setText("Staff role is required.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (cbStore.getValue() == null) {
|
if (cbStore.getValue() == null) {
|
||||||
lblError.setText("Primary store is required.");
|
lblError.setText("Primary store is required.");
|
||||||
return;
|
return;
|
||||||
@@ -183,7 +175,6 @@ public class StaffRegisterDialogController {
|
|||||||
btnCreate.setDisable(true);
|
btnCreate.setDisable(true);
|
||||||
|
|
||||||
String role = cbRole.getValue();
|
String role = cbRole.getValue();
|
||||||
String staffRole = cbStaffRole.getValue();
|
|
||||||
boolean active = "Active".equals(cbActive.getValue());
|
boolean active = "Active".equals(cbActive.getValue());
|
||||||
Long storeId = cbStore.getValue().getId();
|
Long storeId = cbStore.getValue().getId();
|
||||||
File avatarFile = selectedAvatarFile;
|
File avatarFile = selectedAvatarFile;
|
||||||
@@ -199,7 +190,6 @@ public class StaffRegisterDialogController {
|
|||||||
request.setEmail(email);
|
request.setEmail(email);
|
||||||
request.setPhone(phone);
|
request.setPhone(phone);
|
||||||
request.setRole(role);
|
request.setRole(role);
|
||||||
request.setStaffRole(staffRole);
|
|
||||||
request.setActive(active);
|
request.setActive(active);
|
||||||
request.setPrimaryStoreId(storeId);
|
request.setPrimaryStoreId(storeId);
|
||||||
|
|
||||||
|
|||||||
@@ -113,12 +113,6 @@
|
|||||||
<ComboBox fx:id="cbRole" maxWidth="1.7976931348623157E308" promptText="Select Role" />
|
<ComboBox fx:id="cbRole" maxWidth="1.7976931348623157E308" promptText="Select Role" />
|
||||||
</children>
|
</children>
|
||||||
</VBox>
|
</VBox>
|
||||||
<VBox spacing="6.0" HBox.hgrow="ALWAYS">
|
|
||||||
<children>
|
|
||||||
<Label text="Staff Role" />
|
|
||||||
<ComboBox fx:id="cbStaffRole" maxWidth="1.7976931348623157E308" promptText="Select Staff Role" />
|
|
||||||
</children>
|
|
||||||
</VBox>
|
|
||||||
</children>
|
</children>
|
||||||
</HBox>
|
</HBox>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user