Skip to content

Request to enable SEARCH_ANALYTICS feature flag for project frc-docs #6510

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

Closed
Daltz333 opened this issue Jan 9, 2020 · 4 comments
Closed
Labels
Bug A bug Good First Issue Good for new contributors

Comments

@Daltz333
Copy link

Daltz333 commented Jan 9, 2020

Details

@stsewd
Copy link
Member

stsewd commented Jan 9, 2020

This feature should have been already live after #6447. Looks like we forgot to remove the show_analytics check in the template

https://github.com/readthedocs/readthedocs.org/blob/master/readthedocs/templates/projects/projects_search_analytics.html

@stsewd stsewd added Bug A bug Good First Issue Good for new contributors labels Jan 9, 2020
@Parth1811
Copy link
Contributor

Hey, I would like to fix this. May need some help though :)
Correct me if I'm wrong, do we simply have to remove this if condition and delete the else block. Essentially always executing the if block

{% if show_analytics %}
<h3>{% trans "Top queries" %}</h3>
<div class="module-list">
<div class="module-list-wrapper">
<ul class="long-list-overflow">
{% for query, count in queries %}
<li class="module-item">
{{ query }}
<span class="right quiet">
{{ count }} search{{ count|pluralize:"es" }}
</span>
</li>
{% empty %}
<li class="module-item">
<p class="quiet">
{% trans 'No date available.' %}
</p>
</li>
{% endfor %}
</ul>
</div>
</div>
<br/>
{% if query_count_of_1_month.labels and query_count_of_1_month.int_data %}
<h2>{% trans "Overview of the past 1 month:" %}</h2>
<canvas id="analytics-chart-last-7-days" width="400" height="150"></canvas>
{% endif %}
<br />
<form method="get">
<button type="submit" name="download" value="true">{% trans "Download all data" %}</button>
</form>
{% else %}
<p class="empty">
{% blocktrans trimmed %}
Hey there! This feature is currently in beta state and is available under a
<a href='https://docs.readthedocs.io/page/guides/feature-flags.html#available-flags'>feature flag</a>.
In case you want to test this feature and help giving us feedback,
please contact us via
<a href='https://github.com/readthedocs/readthedocs.org/issues/new?title=Request%20to%20enable%20SEARCH_ANALYTICS%20feature%20flag%20for%20project%20{{ project }}'>GitHub issues</a>.
{% endblocktrans %}
</p>
{% endif %}

@stsewd
Copy link
Member

stsewd commented Jan 9, 2020

@Parth1811 yes. There is another check for show_analytics in that file that should be removed as well.

@Parth1811
Copy link
Contributor

Ok got it.

{% if query_count_of_1_month.labels and query_count_of_1_month.int_data and show_analytics %}

Parth1811 added a commit to Parth1811/readthedocs.org that referenced this issue Jan 9, 2020
…e template

This patch removes the check of `show_analytics` variable in
`templates/projects/project_search_analytics.html` which were expected after
fixing readthedocs#6447
@stsewd stsewd closed this as completed in e94fb4c Jan 13, 2020
stsewd added a commit that referenced this issue Jan 13, 2020
Fixes #6510 -- Removed the `show_analytics` checks from the template
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug Good First Issue Good for new contributors
Projects
None yet
Development

No branches or pull requests

3 participants