Skip to content

Commit

Permalink
Update download control options (#10264)
Browse files Browse the repository at this point in the history
  • Loading branch information
kalletlak authored Jul 12, 2023
1 parent 249d4ca commit 2712b20
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1262,4 +1262,20 @@ public static String getReferenceGenomeName() {
public static String getOncoKbToken() {
return portalProperties.getProperty(ONCOKB_TOKEN, null);
}

public static String getDownloadControl() {
String downloadControlOption = getProperty("skin.hide_download_controls");
/*
skin.hide_download_controls return_value
true hide
false show
data data
null/empty show
*/
switch ((downloadControlOption != null) ? downloadControlOption.trim().toLowerCase() : "false") {
case "true" : return "hide";
case "data" : return "data";
default: return "show";
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -243,11 +243,9 @@ Below you can find the complete list of all the available skin properties.
</tr>
<tr>
<td>skin.hide_download_controls</td>
<td>removes all download and copy-to-clipboard options.</td>
<td>show</td>
<td>
string. "show" enables all download and copy-to-clipboard options. "data" disables data download but keeps figure and top-level data. "hide" disables all the download and copy-to-keyboard options.
</td>
<td>controls download options in UI. **true**: hides all download options. **false**: shows all download options. **data**: disable data download but not figure download</td>
<td>false</td>
<td>true / false / data</td>
</tr>
<tr>
<td>skin.show_settings_menu</td>
Expand Down
3 changes: 2 additions & 1 deletion portal/src/main/webapp/config_service.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@
"skin.patient_view.copy_number_table.columns.show_on_init",
"skin.patient_view.structural_variant_table.columns.show_on_init",
"comparison.categorical_na_values",
"skin.hide_download_controls",
"study_download_url",
"skin.home_page.show_reference_genome"
};
Expand Down Expand Up @@ -203,6 +202,8 @@
obj.put("oncoKbTokenDefined", !StringUtils.isEmpty(GlobalProperties.getOncoKbToken()));
obj.put("sessionServiceEnabled", !StringUtils.isEmpty(GlobalProperties.getSessionServiceUrl()));
obj.put("skin_hide_download_controls", GlobalProperties.getDownloadControl());
out.println(obj.toJSONString());
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/portal.properties.EXAMPLE
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ skin.study_view.link_text=To build your own case set, try out our enhanced Study
# skin.home_page.show_reference_genome=false

## setting controlling whether Download tabs and download/copy-to-clipboard controls should be shown
# skin.hide_download_controls=show
# skin.hide_download_controls=false

## setting controlling which name should be used to display the authenticated user (email, or username)
# skin.user_display_name=email
Expand Down

0 comments on commit 2712b20

Please sign in to comment.