Don't offer stars to signed out users. (#1786)
This commit is contained in:
Родитель
c5b4f276df
Коммит
9118ccc72c
|
@ -207,19 +207,6 @@ class ChromedashFeatureTable extends LitElement {
|
|||
`;
|
||||
}
|
||||
|
||||
renderSignedOutStarIcon() {
|
||||
return html`
|
||||
<span class="tooltip"
|
||||
title="Sign in to get email notifications for updates">
|
||||
<a href="#" @click="${window.promptSignIn}" data-tooltip>
|
||||
<iron-icon icon="chromestatus:star-border"
|
||||
class="pushicon">
|
||||
</iron-icon>
|
||||
</a>
|
||||
</span>
|
||||
`;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -273,15 +273,7 @@ class ChromedashFeature extends LitElement {
|
|||
class="pushicon"></iron-icon>
|
||||
</a>
|
||||
</span>
|
||||
` : html`
|
||||
<span class="tooltip"
|
||||
title="Sign in to get email notifications for updates">
|
||||
<a href="#" @click="${window.promptSignIn}" data-tooltip>
|
||||
<iron-icon icon="chromestatus:star-border"
|
||||
class="pushicon"></iron-icon>
|
||||
</a>
|
||||
</span>
|
||||
`}
|
||||
` : nothing}
|
||||
<span class="tooltip" title="File a bug against this feature">
|
||||
<a href="${ifDefined(this._newBugUrl)}" data-tooltip>
|
||||
<iron-icon icon="chromestatus:bug-report"></iron-icon>
|
||||
|
|
|
@ -178,16 +178,7 @@ class ChromedashRoadmapMilestoneCard extends LitElement {
|
|||
@click="${this.toggleStar}">
|
||||
</iron-icon>
|
||||
</span>
|
||||
` : html`
|
||||
<span class="tooltip"
|
||||
title="Sign in to get email notifications for updates">
|
||||
<a href="#" @click="${window.promptSignIn}" data-tooltip>
|
||||
<iron-icon icon="chromestatus:star-border"
|
||||
class="pushicon">
|
||||
</iron-icon>
|
||||
</a>
|
||||
</span>
|
||||
`}
|
||||
` : nothing}
|
||||
</span>
|
||||
</li>
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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.');
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
{% block rss %}
|
||||
<link rel="alternate" type="application/rss+xml" href="https://chromestatus.com/features.xml" title="All features" />
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block subheader %}
|
||||
<div id="subheader" style="display:block">
|
||||
<div style="float:right">
|
||||
|
@ -29,13 +29,6 @@
|
|||
class="pushicon"></iron-icon>
|
||||
</a>
|
||||
</span>
|
||||
{% else %}
|
||||
<span class="tooltip" title="Sign in to get email notifications for updates">
|
||||
<a href="#" id="star-when-signed-out" data-tooltip>
|
||||
<iron-icon icon="chromestatus:star-border"
|
||||
class="pushicon"></iron-icon>
|
||||
</a>
|
||||
</span>
|
||||
{% endif %}
|
||||
<span class="tooltip" title="File a bug against this feature">
|
||||
<a href="{{ new_crbug_url }}" class="newbug" data-tooltip target="_blank" rel="noopener">
|
||||
|
|
Загрузка…
Ссылка в новой задаче