Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ public class BaseController {

@Autowired
private DocumentScanController documentScanController;

protected ApplicationContext applicationContext = ApplicationContext.getInstance();

public Text getScanningMsg() {
Expand Down Expand Up @@ -600,7 +600,7 @@ public void goToHomePage() {
generateAlert(RegistrationConstants.ERROR, RegistrationUIConstants.getMessageLanguageSpecific(RegistrationUIConstants.UNABLE_LOAD_HOME_PAGE));
}
}

/**
* Opens the home page screen.
*/
Expand Down Expand Up @@ -1043,7 +1043,7 @@ public void handle(WorkerStateEvent workerStateEvent) {
protected void getCurrentPage(Pane pageId, String notTosShow, String show) {
LOGGER.info("Pane : {}, Navigating from current page {} to show : {}",
pageId == null ? "null" : pageId.getId(), notTosShow, show);

if (pageId != null) {
if (notTosShow != null) {
((Pane) pageId.lookup(RegistrationConstants.HASH + notTosShow)).setVisible(false);
Expand All @@ -1052,7 +1052,7 @@ protected void getCurrentPage(Pane pageId, String notTosShow, String show) {
((Pane) pageId.lookup(RegistrationConstants.HASH + show)).setVisible(true);
}
}

LOGGER.info("Navigated to next page >> {}", show);
}

Expand Down Expand Up @@ -1335,7 +1335,7 @@ protected List<String> getContainsAllElements(List<String> source, List<String>
}

protected void updateByAttempt(double qualityScore, Image streamImage, double thresholdScore,
ImageView streamImagePane, Label qualityText, ProgressBar progressBar, Label progressQualityScore) {
ImageView streamImagePane, Label qualityText, ProgressBar progressBar) {

String qualityScoreLabelVal = getQualityScoreText(qualityScore);

Expand All @@ -1349,9 +1349,6 @@ protected void updateByAttempt(double qualityScore, Image streamImage, double th
// Progress Bar
progressBar.setProgress(qualityScore / 100);

// Progress Bar Quality Score
progressQualityScore.setText(qualityScoreLabelVal);

if (qualityScore >= thresholdScore) {
progressBar.getStyleClass().removeAll(RegistrationConstants.PROGRESS_BAR_RED);
progressBar.getStyleClass().add(RegistrationConstants.PROGRESS_BAR_GREEN);
Expand Down Expand Up @@ -1491,7 +1488,7 @@ protected List<GenericDto> getConfiguredLanguages() {
}
return languages;
}

protected List<GenericDto> getConfiguredLanguagesForLogin() {
List<GenericDto> languages = new ArrayList<>();
for (String langCode : getConfiguredLangCodes()) {
Expand Down Expand Up @@ -1522,8 +1519,8 @@ protected List<String> getConfiguredLangCodes() {
}
return Collections.EMPTY_LIST;
}


public void setImage(ImageView imageView, String imageName) {

if (imageView != null) {
Expand All @@ -1548,13 +1545,13 @@ public Image getImage(String imageName, boolean canDefault) throws RegBaseChecke
}


try {
try {

return getImage(getImageFilePath(getConfiguredFolder(),imageName));
} catch (RegBaseCheckedException exception) {

if(canDefault) {
return getImage(getImageFilePath(RegistrationConstants.IMAGES,imageName));
return getImage(getImageFilePath(RegistrationConstants.IMAGES,imageName));
} else {
throw exception;
}
Expand All @@ -1564,7 +1561,7 @@ public Image getImage(String imageName, boolean canDefault) throws RegBaseChecke
}

private Image getImage(String uri) throws RegBaseCheckedException {
try {
try {
return new Image(getClass().getResourceAsStream(uri));
} catch (Exception exception) {
LOGGER.error("Exception while Getting Image "+ uri, exception);
Expand All @@ -1580,14 +1577,14 @@ public String getImageFilePath(String configFolder,String imageName) {
String[] names = imageName.split("\\/|\\\\");
return String.format(TEMPLATE, configFolder, String.join("/", names));
}

public String getImagePath(String imageName, boolean canDefault) throws RegBaseCheckedException {
if (imageName == null || imageName.isEmpty()) {
throw new RegBaseCheckedException();
}
return getImageFilePath(getConfiguredFolder(),imageName);
}

public void changeNodeOrientation(Node node) {
if (node != null && applicationContext.isPrimaryLanguageRightToLeft()) {
node.setNodeOrientation(NodeOrientation.RIGHT_TO_LEFT);
Expand All @@ -1607,7 +1604,7 @@ public Image getImage(BufferedImage bufferedImage) {
}
return wr;
}

/**
* This method will remove the auth method from list
*
Expand All @@ -1623,11 +1620,11 @@ protected void removeAuthModes(List<String> authList, String flag, String authCo
authList.removeIf(auth -> authList.size() > 1 && RegistrationConstants.DISABLE.equalsIgnoreCase(flag)
&& auth.equalsIgnoreCase(authCode));
}

protected boolean haveToSaveAuthToken(String userId) {
return SessionContext.userId().equals(userId);
}

/**
* to capture and validate the fingerprint for authentication
*
Expand All @@ -1649,7 +1646,7 @@ protected boolean captureAndValidateFP(String userId, boolean isPacketAuth, bool
.getIntValueFromApplicationMap(RegistrationConstants.CAPTURE_TIME_OUT),
1, io.mosip.registration.context.ApplicationContext.getIntValueFromApplicationMap(
RegistrationConstants.FINGERPRINT_AUTHENTICATION_THRESHOLD));

List<BiometricsDto> biometrics = bioService.captureModalityForAuth(mdmRequestDto);
boolean fpMatchStatus = authenticationService.authValidator(userId, SingleType.FINGER.value(), biometrics);
if (fpMatchStatus && isPacketAuth) {
Expand Down Expand Up @@ -1707,7 +1704,7 @@ protected boolean captureAndValidateFace(String userId, boolean isPacketAuth, bo
}
return match;
}

private void addOperatorBiometrics(List<BiometricsDto> biometrics, boolean isReviewer) {
if (isReviewer) {
RegistrationDTO registrationDTO = (RegistrationDTO) SessionContext.getInstance().getMapObject()
Expand All @@ -1719,15 +1716,15 @@ private void addOperatorBiometrics(List<BiometricsDto> biometrics, boolean isRev
registrationDTO.addOfficerBiometrics(biometrics);
}
}

protected void showAlertAndLogout() {
/* Generate alert */
Alert logoutAlert = createAlert(AlertType.INFORMATION, RegistrationUIConstants.getMessageLanguageSpecific(RegistrationUIConstants.SYNC_SUCCESS),RegistrationUIConstants.getMessageLanguageSpecific(RegistrationUIConstants.ALERT_NOTE_LABEL),
RegistrationUIConstants.getMessageLanguageSpecific(RegistrationUIConstants.LOGOUT_ALERT),
RegistrationConstants.OK_MSG, null);

logoutAlert.show();
Rectangle2D screenSize = Screen.getPrimary().getVisualBounds();
Rectangle2D screenSize = Screen.getPrimary().getVisualBounds();
Double xValue = screenSize.getWidth()/2 - logoutAlert.getWidth() + 250;
Double yValue = screenSize.getHeight()/2 - logoutAlert.getHeight();
logoutAlert.hide();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
import java.util.TreeMap;
import java.util.stream.Collectors;

import javafx.beans.binding.Bindings;
import javafx.geometry.Insets;
import javafx.scene.layout.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

Expand Down Expand Up @@ -73,12 +76,6 @@
import javafx.scene.control.TabPane;
import javafx.scene.control.TextField;
import javafx.scene.control.Tooltip;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.ColumnConstraints;
import javafx.scene.layout.FlowPane;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.RowConstraints;
import javafx.scene.web.WebView;
import javafx.stage.Stage;
import lombok.SneakyThrows;
Expand Down Expand Up @@ -195,17 +192,22 @@ private HBox getPreRegistrationFetchComponent() {
hBox.setSpacing(20);
hBox.setPrefHeight(100);
hBox.setPrefWidth(200);
hBox.getStyleClass().add(RegistrationConstants.DEMOGRAPHIC_GROUP);
hBox.setPadding(new Insets(20, 0, 20, 0));

Label label = new Label();
label.getStyleClass().add(LABEL_CLASS);
label.setId("preRegistrationLabel");
label.setText(ApplicationContext.getBundle(langCode, RegistrationConstants.LABELS)
.getString("applicationId"));
label.getStyleClass().add(RegistrationConstants.DEMOGRAPHIC_GROUP_LABEL);
label.setPadding(new Insets(0, 0, 0, 55));
hBox.getChildren().add(label);

TextField textField = new TextField();
textField.setId("preRegistrationId");
textField.getStyleClass().add(TEXTFIELD_CLASS);
hBox.getChildren().add(textField);

Button button = new Button();
button.setId("fetchBtn");
button.getStyleClass().add("demoGraphicPaneContentButton");
Expand Down Expand Up @@ -742,22 +744,53 @@ public void populateScreens() throws Exception {
}

for(Entry<String, List<UiFieldDTO>> groupEntry : screenFieldGroups.entrySet()) {
FlowPane groupFlowPane = new FlowPane();
GridPane groupFlowPane = new GridPane();
groupFlowPane.prefWidthProperty().bind(gridPane.widthProperty());
groupFlowPane.setHgap(20);
groupFlowPane.setVgap(20);

if(screenDTO.getName().equals("DemographicDetails")) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should not hardcode the screen name @Rediket, lets discuss on this

groupFlowPane.getStyleClass().add(RegistrationConstants.DEMOGRAPHIC_GROUP);
groupFlowPane.setPadding(new Insets(20, 0, 20, 0));

/* Adding Group label */
Label label = new Label(groupEntry.getKey());
label.getStyleClass().add(RegistrationConstants.DEMOGRAPHIC_GROUP_LABEL);
label.setPadding(new Insets(0, 0, 0, 55));
label.setPrefWidth(1200);
groupFlowPane.add(label, 0, 0, 2, 1);
}
int fieldIndex=0;
for(UiFieldDTO fieldDTO : groupEntry.getValue()) {
try {
FxControl fxControl = buildFxElement(fieldDTO);
if(fxControl.getNode() instanceof GridPane) {
((GridPane)fxControl.getNode()).prefWidthProperty().bind(groupFlowPane.widthProperty());
}

if(screenDTO.getName().equals("DemographicDetails")) {
fxControl.getNode().getStyleClass().add(RegistrationConstants.DEMOGRAPHIC_FIELD);
groupFlowPane.add( fxControl.getNode(), (fieldIndex % 2), (fieldIndex / 2) + 1);
fieldIndex++;
} else {
if(screenDTO.getName().equals("Documents")) {
fxControl.getNode().getStyleClass().add(RegistrationConstants.DOCUMENT_COMBOBOX_FIELD);
}
groupFlowPane.getChildren().add(fxControl.getNode());
}
} catch (Exception exception){
LOGGER.error("Failed to build control " + fieldDTO.getId(), exception);
}
}

//Hide introducer grouping for adults
if(groupEntry.getKey().equals("Introducer")) {
groupFlowPane.visibleProperty().bind(Bindings.or(
groupFlowPane.getChildren().get(1).visibleProperty(),
groupFlowPane.getChildren().get(2).visibleProperty())
);
}

gridPane.add(groupFlowPane, 0, rowIndex++);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1620,7 +1620,7 @@ public void handle(final MouseEvent mouseEvent) {
if (qualityScoreVal != 0) {
updateByAttempt(qualityScoreVal, getBioStreamImage(currentSubType, Modality.valueOf(currentModality), attempt),
getThresholdScoreInInt(getThresholdKeyByBioType(Modality.valueOf(currentModality))), biometricImage,
qualityText, bioProgress, qualityScore);
qualityText, bioProgress);
}

LOGGER.info(LOG_REG_BIOMETRIC_CONTROLLER, APPLICATION_NAME, APPLICATION_ID,
Expand Down
Loading