diff --git a/docs/guides/feature-flags.rst b/docs/guides/feature-flags.rst index fbff80141c8..6f9ab0b5eff 100644 --- a/docs/guides/feature-flags.rst +++ b/docs/guides/feature-flags.rst @@ -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` diff --git a/readthedocs/projects/models.py b/readthedocs/projects/models.py index f31560a75fd..53ad3c02c88 100644 --- a/readthedocs/projects/models.py +++ b/readthedocs/projects/models.py @@ -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')), @@ -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( diff --git a/readthedocs/projects/urls/private.py b/readthedocs/projects/urls/private.py index ed9220f39b9..9e7cc400678 100644 --- a/readthedocs/projects/urls/private.py +++ b/readthedocs/projects/urls/private.py @@ -133,7 +133,7 @@ r'^(?P[-\w]+)/search-analytics/$', SearchAnalytics.as_view(), name='projects_search_analytics', - ), + ), ] domain_urls = [ diff --git a/readthedocs/projects/views/private.py b/readthedocs/projects/views/private.py index 72a0df2cd94..075e65b47a0 100644 --- a/readthedocs/projects/views/private.py +++ b/readthedocs/projects/views/private.py @@ -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 @@ -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 \ No newline at end of file diff --git a/readthedocs/rtd_tests/tests/test_views.py b/readthedocs/rtd_tests/tests/test_views.py index 66ae8f97ca9..46930660ce8 100644 --- a/readthedocs/rtd_tests/tests/test_views.py +++ b/readthedocs/rtd_tests/tests/test_views.py @@ -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: diff --git a/readthedocs/templates/projects/project_edit_base.html b/readthedocs/templates/projects/project_edit_base.html index e7fa71af179..8623a9aecb4 100644 --- a/readthedocs/templates/projects/project_edit_base.html +++ b/readthedocs/templates/projects/project_edit_base.html @@ -24,7 +24,6 @@
  • {% trans "Integrations" %}
  • {% trans "Environment Variables" %}
  • {% trans "Notifications" %}
  • -
  • {% trans "Search Analytics" %}
  • {% if USE_PROMOS %}
  • {% trans "Advertising" %}
  • {% endif %} diff --git a/readthedocs/templates/projects/projects_search_analytics.html b/readthedocs/templates/projects/projects_search_analytics.html index e162fd21e03..08767965479 100644 --- a/readthedocs/templates/projects/projects_search_analytics.html +++ b/readthedocs/templates/projects/projects_search_analytics.html @@ -50,9 +50,7 @@

    {% trans "Overview of the past 1 month:" %}

    {% blocktrans trimmed %} Hey there! This feature is currently in beta state and is available under a feature flag. - In case you want to test this feature and help giving us feedback, - please contact us via - GitHub issues. + {% endblocktrans %}

    {% endif %}