Skip to content

Fixed ticket_6217 #6245

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
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions docs/guides/feature-flags.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,3 @@ e.g. python-reno release notes manager is known to do that
``USE_TESTING_BUILD_IMAGE``: :featureflags:`USE_TESTING_BUILD_IMAGE`

``EXTERNAL_VERSION_BUILD``: :featureflags:`EXTERNAL_VERSION_BUILD`

``SEARCH_ANALYTICS``: :featureflags:`SEARCH_ANALYTICS`
6 changes: 0 additions & 6 deletions readthedocs/projects/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1443,8 +1443,6 @@ def add_features(sender, **kwargs):
EXTERNAL_VERSION_BUILD = 'external_version_build'
UPDATE_CONDA_STARTUP = 'update_conda_startup'
CONDA_APPEND_CORE_REQUIREMENTS = 'conda_append_core_requirements'
SEARCH_ANALYTICS = 'search_analytics'

FEATURES = (
(USE_SPHINX_LATEST, _('Use latest version of Sphinx')),
(ALLOW_DEPRECATED_WEBHOOKS, _('Allow deprecated webhook views')),
Expand Down Expand Up @@ -1495,10 +1493,6 @@ def add_features(sender, **kwargs):
CONDA_APPEND_CORE_REQUIREMENTS,
_('Append Read the Docs core requirements to environment.yml file'),
),
(
SEARCH_ANALYTICS,
_('Enable search analytics'),
)
)

projects = models.ManyToManyField(
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/projects/urls/private.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
r'^(?P<project_slug>[-\w]+)/search-analytics/$',
SearchAnalytics.as_view(),
name='projects_search_analytics',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only the flag should be removed, not the functionality

),
),
]

domain_urls = [
Expand Down
6 changes: 2 additions & 4 deletions readthedocs/projects/views/private.py
Original file line number Diff line number Diff line change
Expand Up @@ -945,9 +945,7 @@ def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
project = self.get_project()

context['show_analytics'] = project.has_feature(
Feature.SEARCH_ANALYTICS,
)

if not context['show_analytics']:
return context

Expand Down Expand Up @@ -1012,4 +1010,4 @@ def _search_analytics_csv_data(self):
content_type="text/csv",
)
response['Content-Disposition'] = f'attachment; filename="{file_name}"'
return response
return response
3 changes: 1 addition & 2 deletions readthedocs/rtd_tests/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,11 +274,10 @@ def setUp(self):
self.pip = Project.objects.get(slug='pip')
self.version = self.pip.versions.order_by('id').first()
self.analyics_page = reverse('projects_search_analytics', args=[self.pip.slug])

test_time = timezone.datetime(2019, 8, 2, 12, 0)
self.test_time = timezone.make_aware(test_time)

get(Feature, projects=[self.pip], feature_id=Feature.SEARCH_ANALYTICS)
get(Feature, projects=[self.pip])

def test_top_queries(self):
with mock.patch('django.utils.timezone.now') as test_time:
Expand Down
1 change: 0 additions & 1 deletion readthedocs/templates/projects/project_edit_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
<li class="{% block project-integrations-active %}{% endblock %}"><a href="{% url "projects_integrations" project.slug %}">{% trans "Integrations" %}</a></li>
<li class="{% block project-environment-variables-active %}{% endblock %}"><a href="{% url "projects_environmentvariables" project.slug %}">{% trans "Environment Variables" %}</a></li>
<li class="{% block project-notifications-active %}{% endblock %}"><a href="{% url "projects_notifications" project.slug %}">{% trans "Notifications" %}</a></li>
<li class="{% block project-search-analytics-active %}{% endblock %}"><a href="{% url "projects_search_analytics" project.slug %}">{% trans "Search Analytics" %}</a></li>
{% if USE_PROMOS %}
<li class="{% block project-ads-active %}{% endblock %}"><a href="{% url "projects_advertising" project.slug %}">{% trans "Advertising" %} </a></li>
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ <h2>{% trans "Overview of the past 1 month:" %}</h2>
{% 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 %}
Expand Down