diff --git a/experimenter/experimenter/experiments/models.py b/experimenter/experimenter/experiments/models.py index 72034f81a5..e78a765a33 100644 --- a/experimenter/experimenter/experiments/models.py +++ b/experimenter/experimenter/experiments/models.py @@ -876,30 +876,35 @@ def timeline(self): "date": self.draft_date, "is_active": self.is_draft, "days": self.computed_draft_days, + "tooltip": NimbusUIConstants.TIMELINE_TOOLTIPS["Draft"], }, { "label": self.Status.PREVIEW, "date": self.preview_date, "is_active": self.is_preview, "days": self.computed_preview_days, + "tooltip": NimbusUIConstants.TIMELINE_TOOLTIPS["Preview"], }, { "label": self.PublishStatus.REVIEW, "date": self.review_date, "is_active": self.is_review, "days": self.computed_review_days, + "tooltip": NimbusUIConstants.TIMELINE_TOOLTIPS["Review"], }, { "label": NimbusConstants.ENROLLMENT, "date": self.start_date, "is_active": self.is_enrollment, "days": self.computed_enrollment_days, + "tooltip": NimbusUIConstants.TIMELINE_TOOLTIPS["Enrollment"], }, { "label": self.Status.COMPLETE, "date": self.computed_end_date, "is_active": self.is_complete, "days": self.computed_duration_days, + "tooltip": NimbusUIConstants.TIMELINE_TOOLTIPS["Complete"], }, ] if not self.is_rollout: @@ -910,6 +915,7 @@ def timeline(self): "date": self._enrollment_end_date, "is_active": self.is_observation, "days": self.computed_observations_days, + "tooltip": NimbusUIConstants.TIMELINE_TOOLTIPS["Observation"], }, ) diff --git a/experimenter/experimenter/experiments/tests/test_models.py b/experimenter/experimenter/experiments/tests/test_models.py index f1e69bfb0c..7a31e69f1d 100644 --- a/experimenter/experimenter/experiments/tests/test_models.py +++ b/experimenter/experimenter/experiments/tests/test_models.py @@ -1777,36 +1777,42 @@ def test_timeline_dates_includes_correct_status_dates_and_flags(self): "date": experiment.draft_date, "is_active": False, "days": 1, + "tooltip": NimbusUIConstants.TIMELINE_TOOLTIPS["Draft"], }, { "label": "Preview", "date": experiment.preview_date, "is_active": False, "days": 0, + "tooltip": NimbusUIConstants.TIMELINE_TOOLTIPS["Preview"], }, { "label": "Review", "date": experiment.review_date, "is_active": False, "days": 2, + "tooltip": NimbusUIConstants.TIMELINE_TOOLTIPS["Review"], }, { "label": NimbusConstants.ENROLLMENT, "date": experiment.start_date, "is_active": False, "days": 2, + "tooltip": NimbusUIConstants.TIMELINE_TOOLTIPS["Enrollment"], }, { "label": NimbusConstants.OBSERVATION, "date": experiment._enrollment_end_date, "is_active": False, "days": 2, + "tooltip": NimbusUIConstants.TIMELINE_TOOLTIPS["Observation"], }, { "label": "Complete", "date": experiment.computed_end_date, "is_active": True, "days": 4, + "tooltip": NimbusUIConstants.TIMELINE_TOOLTIPS["Complete"], }, ] @@ -1815,6 +1821,7 @@ def test_timeline_dates_includes_correct_status_dates_and_flags(self): self.assertEqual(timeline[i]["date"], expected["date"]) self.assertEqual(timeline[i]["is_active"], expected["is_active"]) self.assertEqual(timeline[i].get("days"), expected["days"]) + self.assertEqual(timeline[i].get("tooltip"), expected["tooltip"]) def test_timeline_dates_complete_is_active_when_status_is_complete(self): experiment = NimbusExperimentFactory.create_with_lifecycle( diff --git a/experimenter/experimenter/nimbus_ui_new/constants.py b/experimenter/experimenter/nimbus_ui_new/constants.py index 2deb8b41ae..5ed8a168f9 100644 --- a/experimenter/experimenter/nimbus_ui_new/constants.py +++ b/experimenter/experimenter/nimbus_ui_new/constants.py @@ -28,3 +28,24 @@ class NimbusUIConstants: proportion has accounted for this:""" AUDIENCE_OVERLAP_WARNING = "https://experimenter.info/faq/warnings/#audience-overlap" + + TIMELINE_TOOLTIPS = { + "Draft": ( + "The duration from the initial draft of the experiment to its entry " + "into either the preview or review stage." + ), + "Preview": ("The number of days the experiment has spent in the preview stage."), + "Review": ("The number of days the experiment has spent in the review stage."), + "Enrollment": ( + "The duration from the start to the end of the participant enrollment " + "period." + ), + "Complete": ( + "The total number of days from the start of participant enrollment " + "to the end of the experiment." + ), + "Observation": ( + "The number of days the experiment was observed after the enrollment " + "period ended." + ), + } diff --git a/experimenter/experimenter/nimbus_ui_new/templates/nimbus_experiments/experiment_base.html b/experimenter/experimenter/nimbus_ui_new/templates/nimbus_experiments/experiment_base.html index 549585dbcc..f1640af5d9 100644 --- a/experimenter/experimenter/nimbus_ui_new/templates/nimbus_experiments/experiment_base.html +++ b/experimenter/experimenter/nimbus_ui_new/templates/nimbus_experiments/experiment_base.html @@ -7,7 +7,7 @@ {% block main_content_header %}
-
+

{{ experiment.name }}

QA Status: {{ experiment.qa_status|default:"Not Set"|title }} @@ -22,12 +22,21 @@

{{ experiment.name }}

{% endif %}
-
+
    {% for status in experiment.timeline %}
  • {{ status.label }} {{ status.date|default:'---' }} + {% if status.days is not None %} +
    + {{ status.days }} day{{ status.days|pluralize }} + +
    + {% endif %}
  • {% endfor %}