Skip to content

Commit

Permalink
Add json prop for custom patient view sample type colors (#10336)
Browse files Browse the repository at this point in the history
  • Loading branch information
BasLee authored Aug 31, 2023
1 parent 27eaa9d commit 3f07318
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,12 @@ public void setOncoprintClinicalTracksConfigJson(String property) {
oncoprintClinicalTracksConfigJson = property;
}

private static String skinPatientViewCustomSampleTypeColorsJson;
@Value("${skin.patient_view.custom_sample_type_colors_json:}") // default is empty string
public void setSkinPatientViewCustomSampleTypeColorsJson(String property) {
skinPatientViewCustomSampleTypeColorsJson = property;
}

// properties for showing the right logo in the header_bar and default logo
public static final String SKIN_RIGHT_LOGO = "skin.right_logo";

Expand Down Expand Up @@ -1257,6 +1263,14 @@ public static String getOncoprintClinicalTracksConfigJson() {
}
}

public static String getSkinPatientViewCustomSampleTypeColorsJson() {
if (skinPatientViewCustomSampleTypeColorsJson.length() > 0) {
return readFile(skinPatientViewCustomSampleTypeColorsJson);
} else {
return null;
}
}

public static String getQuerySetsOfGenes() {
String fileName = portalProperties.getProperty(SETSOFGENES_LOCATION, null);
return readFile(fileName);
Expand Down
13 changes: 13 additions & 0 deletions docs/deployment/customization/portal.properties-Reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,19 @@ skin.patient_view.copy_number_table.columns.show_on_init=
skin.patient_view.structural_variant_table.columns.show_on_init=
```

### Define custom sample type colors
Define the colors of custom sample types in the patient view using a json object with for each sample type a color:
```
skin.patient_view.custom_sample_type_colors_json=classpath:/skin-patient-view-custom-sample-type-colors.json
```
Example of json file contents:
```json
{
"Primary": "green",
"Biopsy 3": "#00c040ff"
}
```

### Choose the display name for authenticated users

By default the display name for authenticated users is email, but it can be changed for the user name:
Expand Down
2 changes: 2 additions & 0 deletions portal/src/main/webapp/config_service.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@
obj.put("oncoprint_clinical_tracks_config_json",GlobalProperties.getOncoprintClinicalTracksConfigJson());
obj.put("skin_patient_view_custom_sample_type_colors_json", GlobalProperties.getSkinPatientViewCustomSampleTypeColorsJson());
obj.put("authenticationMethod",GlobalProperties.authenticationMethod());
obj.put("mskWholeSlideViewerToken", GlobalProperties.getMskWholeSlideViewerToken());
Expand Down

0 comments on commit 3f07318

Please sign in to comment.