Skip to content

Commit

Permalink
Update darwin configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
dippindots committed Feb 5, 2024
1 parent 09de8a8 commit 812d439
Showing 1 changed file with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,9 @@ public enum FrontendProperty {
enable_treatment_groups("enable_treatment_groups", null),
comparison_categorical_na_values("comparison.categorical_na_values", null),
clinical_attribute_product_limit("clinical_attribute_product_limit", null),
skin_right_nav_show_web_tours("skin.right_nav.show_web_tours", "false");
skin_right_nav_show_web_tours("skin.right_nav.show_web_tours", "false"),

enable_darwin("enable_darwin", null);

private final String propertyName;
private final String defaultValue;
Expand Down Expand Up @@ -234,6 +236,8 @@ private String getPropertyValue(FrontendProperty property) {
return String.valueOf(!propertyValue.isEmpty());
case "frontendUrl":
return getFrontendUrl(propertyValue);
case "enable_darwin":
return enableDarwin();
// For others, just return the value in the properties file.
default:
return propertyValue;
Expand Down Expand Up @@ -327,6 +331,18 @@ public String getFrontendUrl(String propertyValue) {
return propertyValue;
}

public String enableDarwin() {
String darwinAuthUrl = env.getProperty("darwin.auth_url", "");
String ddpResponseUrl = env.getProperty("ddp.response_url", "");
String cisUser = env.getProperty("darwin.auth_url", "");
String darwinRegex = env.getProperty("darwin.regex", "");
if (!darwinAuthUrl.isBlank() && !ddpResponseUrl.isBlank() && !cisUser.isBlank() && !darwinRegex.isBlank()) {
return "\"true\"";
} else {
return "\"false\"";
}
}

/*
* Trim whitespace of url and append / if it does not exist. Return empty
* string otherwise.
Expand Down

0 comments on commit 812d439

Please sign in to comment.