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 json prop for custom patient view sample type colors #10336

Merged
merged 3 commits into from
Aug 31, 2023
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
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 @@ -218,6 +218,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
Copy link
Contributor

Choose a reason for hiding this comment

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

@inodb this documentation is wrong now, correct? i mean, why is there a classpath there?

```
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