From 9118ccc72c8bfa9f3e489bd967d4bce9ba9a7b5a Mon Sep 17 00:00:00 2001 From: Jason Robbins Date: Mon, 14 Mar 2022 16:13:41 -0700 Subject: [PATCH] Don't offer stars to signed out users. (#1786) --- static/elements/chromedash-feature-table.js | 17 +---------------- static/elements/chromedash-feature.js | 10 +--------- .../chromedash-roadmap-milestone-card.js | 11 +---------- static/js-src/feature-page.js | 8 -------- templates/_base.html | 9 +-------- templates/feature.html | 9 +-------- 6 files changed, 5 insertions(+), 59 deletions(-) diff --git a/static/elements/chromedash-feature-table.js b/static/elements/chromedash-feature-table.js index 3def49ce..f90758fa 100644 --- a/static/elements/chromedash-feature-table.js +++ b/static/elements/chromedash-feature-table.js @@ -207,19 +207,6 @@ class ChromedashFeatureTable extends LitElement { `; } - renderSignedOutStarIcon() { - return html` - - - - - - - `; - } - renderIcons(feature) { if (this.signedIn) { return html` @@ -228,9 +215,7 @@ class ChromedashFeatureTable extends LitElement { ${this.renderStarIcon(feature)} `; } else { - return html` - ${this.renderSignedOutStarIcon()} - `; + return nothing; } } diff --git a/static/elements/chromedash-feature.js b/static/elements/chromedash-feature.js index 889eb587..b6b05471 100644 --- a/static/elements/chromedash-feature.js +++ b/static/elements/chromedash-feature.js @@ -273,15 +273,7 @@ class ChromedashFeature extends LitElement { class="pushicon"> - ` : html` - - - - - - `} + ` : nothing} diff --git a/static/elements/chromedash-roadmap-milestone-card.js b/static/elements/chromedash-roadmap-milestone-card.js index 74fffe62..f556da16 100644 --- a/static/elements/chromedash-roadmap-milestone-card.js +++ b/static/elements/chromedash-roadmap-milestone-card.js @@ -178,16 +178,7 @@ class ChromedashRoadmapMilestoneCard extends LitElement { @click="${this.toggleStar}"> - ` : html` - - - - - - - `} + ` : nothing} diff --git a/static/js-src/feature-page.js b/static/js-src/feature-page.js index b377bc1b..c55cd127 100644 --- a/static/js-src/feature-page.js +++ b/static/js-src/feature-page.js @@ -90,14 +90,6 @@ window.csClient.getStars().then((subscribedFeatures) => { } }); -const starWhenSignedOutEl = document.querySelector('#star-when-signed-out'); -if (starWhenSignedOutEl) { - starWhenSignedOutEl.addEventListener('click', function(event) { - event.preventDefault(); - window.promptSignIn(event); - }); -} - const starWhenSignedInEl = document.querySelector('#star-when-signed-in'); if (starWhenSignedInEl) { starWhenSignedInEl.addEventListener('click', function(event) { diff --git a/templates/_base.html b/templates/_base.html index a9e90e62..7b93cff6 100644 --- a/templates/_base.html +++ b/templates/_base.html @@ -83,15 +83,8 @@ limitations under the License. }); } - function promptSignIn(e) { - e.preventDefault(); - e.stopPropagation(); - } - - // This happens when an anon visitor tries to view a page that - // requires being signed in. We cannot promptSignIn(), because - // lacking a user-initiated event, the popup will be blocked. + // requires being signed in. const urlParams = new URLSearchParams(window.location.search); if (urlParams.get("loginStatus") == 'False') { alert('Please log in.'); diff --git a/templates/feature.html b/templates/feature.html index 68fc76ec..d24c9306 100644 --- a/templates/feature.html +++ b/templates/feature.html @@ -18,7 +18,7 @@ {% block rss %} {% endblock %} - + {% block subheader %}
@@ -29,13 +29,6 @@ class="pushicon"> - {% else %} - - - - - {% endif %}