From 28a859e8dc623d49e38b74e3a788dfc47981287a Mon Sep 17 00:00:00 2001 From: Martin Cech Date: Wed, 1 May 2019 12:36:15 -0400 Subject: [PATCH 1/2] hide favorite button for anons --- .../galaxy/scripts/entry/panels/tool-panel.js | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/client/galaxy/scripts/entry/panels/tool-panel.js b/client/galaxy/scripts/entry/panels/tool-panel.js index 49b36eb9414..3c0dbb1a699 100644 --- a/client/galaxy/scripts/entry/panels/tool-panel.js +++ b/client/galaxy/scripts/entry/panels/tool-panel.js @@ -43,26 +43,29 @@ var ToolPanel = Backbone.View.extend({ default_genome: config.default_genome, default_extension: config.default_extension }); + let panel_buttons = [this.upload_button]; // add favorite filter button - this.favorite_button = new Buttons.ButtonLink({ - cls: "panel-header-button", - title: _l("Show favorites"), - icon: "fa fa-star-o", - onclick: e => { - $("#tool-search-query") - .val("#favorites") - .trigger("change"); - } - }); - + if (Galaxy.user && Galaxy.user.id){ + this.favorite_button = new Buttons.ButtonLink({ + cls: "panel-header-button", + title: _l("Show favorites"), + icon: "fa fa-star-o", + onclick: e => { + $("#tool-search-query") + .val("#favorites") + .trigger("change"); + } + }); + panel_buttons.push(this.favorite_button); + } // add uploader button to Galaxy object Galaxy.upload = this.upload_button; // components for panel definition this.model = new Backbone.Model({ title: _l("Tools"), - buttons: [this.upload_button, this.favorite_button] + buttons: panel_buttons }); // build body template From e9c31a16245897ffc3b57ed64000eb557a7e0cea Mon Sep 17 00:00:00 2001 From: Dannon Date: Thu, 2 May 2019 10:18:02 -0400 Subject: [PATCH 2/2] use const instead of let Co-Authored-By: martenson --- client/galaxy/scripts/entry/panels/tool-panel.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/galaxy/scripts/entry/panels/tool-panel.js b/client/galaxy/scripts/entry/panels/tool-panel.js index 3c0dbb1a699..0a617a1cc81 100644 --- a/client/galaxy/scripts/entry/panels/tool-panel.js +++ b/client/galaxy/scripts/entry/panels/tool-panel.js @@ -43,7 +43,7 @@ var ToolPanel = Backbone.View.extend({ default_genome: config.default_genome, default_extension: config.default_extension }); - let panel_buttons = [this.upload_button]; + const panel_buttons = [this.upload_button]; // add favorite filter button if (Galaxy.user && Galaxy.user.id){