From 3001e694395a11940a1b1eed5fa21cdd44cc2d7b Mon Sep 17 00:00:00 2001 From: Jared Lockhart <119884+jaredlockhart@users.noreply.github.com> Date: Tue, 10 Dec 2024 11:58:59 -0500 Subject: [PATCH] feat(nimbus): add documentation links to new nimbus ui Because * We need to show the documentation links in the left sidebar * We want to show the new header with the title and timeline on every page This commit * Adds documentation links to the sidebar * Improves the styling of the sidebar * Moves the t new header to the base template so it appears on all pages fixes #11924 --- .../nimbus_ui_new/static/css/style.scss | 4 + .../templates/common/sidebar_link.html | 13 +- .../templates/common/with_sidebar.html | 2 + .../templates/nimbus_experiments/detail.html | 674 +++++++++--------- .../nimbus_experiments/edit_metrics.html | 158 ++-- .../nimbus_experiments/experiment_base.html | 32 +- .../sidebar.html} | 23 +- 7 files changed, 462 insertions(+), 444 deletions(-) rename experimenter/experimenter/nimbus_ui_new/templates/{common/experiment_sidebar.html => nimbus_experiments/sidebar.html} (59%) diff --git a/experimenter/experimenter/nimbus_ui_new/static/css/style.scss b/experimenter/experimenter/nimbus_ui_new/static/css/style.scss index f3b12c4776..a63a2e0656 100644 --- a/experimenter/experimenter/nimbus_ui_new/static/css/style.scss +++ b/experimenter/experimenter/nimbus_ui_new/static/css/style.scss @@ -118,3 +118,7 @@ } } } + +.nav-link-hover:hover { + background-color: var(--bs-secondary-bg); +} diff --git a/experimenter/experimenter/nimbus_ui_new/templates/common/sidebar_link.html b/experimenter/experimenter/nimbus_ui_new/templates/common/sidebar_link.html index eb5036d1f5..cd23b96bad 100644 --- a/experimenter/experimenter/nimbus_ui_new/templates/common/sidebar_link.html +++ b/experimenter/experimenter/nimbus_ui_new/templates/common/sidebar_link.html @@ -1,7 +1,6 @@ -
{{ experiment.slug }}
- {% if experiment.parent %} -- Cloned from - {{ experiment.parent.name }} -
- {% endif %} + + {% if experiment.audience_overlap_warnings %} + {% for warning in experiment.audience_overlap_warnings %} + - {% include "nimbus_experiments/timeline.html" %} + {% endfor %} + {% endif %} + + {% include "nimbus_experiments/takeaways_card.html" %} + +{{ warning.text }}
-Slug | +{{ experiment.slug }} | +Experiment owner | +{{ experiment.owner }} | +
---|---|---|---|
Application | +{{ experiment.get_application_display }} | +Public description | +{{ experiment.public_description|format_not_set }} | +
Feature config | ++ {% for feature in experiment.feature_configs.all %} + {{ feature.name }} - {{ feature.description }} + {% empty %} + Not set + {% endfor %} + | +Advanced targeting | +{{ experiment.targeting_config.name }} - {{ experiment.targeting_config.description }} | +
Hypothesis | +{{ experiment.hypothesis }} | +||
Primary Outcomes | ++ {% for outcome, url in primary_outcome_links %} + {{ outcome.title|remove_underscores }} + {% if not forloop.last %},{% endif %} + {% empty %} + Not set + {% endfor %} + | +||
Secondary Outcomes | ++ {% for outcome, url in secondary_outcome_links %} + {{ outcome.title|remove_underscores }} + {% if not forloop.last %},{% endif %} + {% empty %} + Not set + {% endfor %} + | +||
Segments | ++ {% for segment, url in segment_links %} + {{ segment.title|remove_underscores }} + {% if not forloop.last %},{% endif %} + {% empty %} + Not set + {% endfor %} + | +||
Team projects | +
+ {% for project in experiment.projects.all %}
+ {{ project }} + {% empty %} + Not set + {% endfor %} + |
+
{{ RISK_QUESTIONS.BRAND }} | ++ {% if experiment.risk_brand != None %} + {{ experiment.risk_brand|yesno:"Yes,No" }} + {% else %} + Not Set + {% endif %} + | +||
---|---|---|---|
+ {{ RISK_QUESTIONS.MESSAGE }} + Message Consult + | + +|||
{{ RISK_QUESTIONS.REVENUE }} | ++ {% if experiment.risk_revenue != None %} + {{ experiment.risk_revenue|yesno:"Yes,No" }} + {% else %} + Not Set + {% endif %} + | +||
{{ RISK_QUESTIONS.PARTNER }} | ++ {% if experiment.risk_partner_related != None %} + {{ experiment.risk_partner_related|yesno:"Yes,No" }} + {% else %} + Not Set + {% endif %} + | +
Slug | -{{ experiment.slug }} | -Experiment owner | -{{ experiment.owner }} | -
---|---|---|---|
Application | -{{ experiment.get_application_display }} | -Public description | -{{ experiment.public_description|format_not_set }} | -
Feature config | -- {% for feature in experiment.feature_configs.all %} - {{ feature.name }} - {{ feature.description }} - {% empty %} - Not set - {% endfor %} - | -Advanced targeting | -{{ experiment.targeting_config.name }} - {{ experiment.targeting_config.description }} | -
Hypothesis | -{{ experiment.hypothesis }} | -||
Primary Outcomes | -- {% for outcome, url in primary_outcome_links %} - {{ outcome.title|remove_underscores }} - {% if not forloop.last %},{% endif %} - {% empty %} - Not set - {% endfor %} - | -||
Secondary Outcomes | -- {% for outcome, url in secondary_outcome_links %} - {{ outcome.title|remove_underscores }} - {% if not forloop.last %},{% endif %} - {% empty %} - Not set - {% endfor %} - | -||
Segments | -- {% for segment, url in segment_links %} - {{ segment.title|remove_underscores }} - {% if not forloop.last %},{% endif %} - {% empty %} - Not set - {% endfor %} - | -||
Team projects | -
- {% for project in experiment.projects.all %}
- {{ project }} - {% empty %} - Not set - {% endfor %} - |
-
{{ RISK_QUESTIONS.BRAND }} | -
- {% if experiment.risk_brand != None %}
- {{ experiment.risk_brand|yesno:"Yes,No" }}
+
+
+ {% endwith %}
+
|
+ |||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Full targeting expression | +{{ experiment.targeting }} | +|||||||||||||||||||||||||||||||||||||
Recipe JSON | +
+
+
+
+
+
+ |
+
Channel | -{{ experiment.channel.title|default:"No Channel" }} | -Advanced Targeting | -{{ experiment.targeting_config.name }} | -||||
---|---|---|---|---|---|---|---|
Minimum version | -{{ experiment.firefox_min_version|parse_version }} | -Maximum version | -{{ experiment.firefox_max_version|parse_version }} | -||||
Locales | -
- {{ experiment.locales.all|join:" "|default:"All Locales" }} - |
- Countries | -
- {{ experiment.countries.all|join:" "| default:"All Countries" }} - |
- ||||
Expected enrolled clients | -{{ experiment.total_enrolled_clients }} | -Population % | -{{ experiment.population_percent|floatformat:"-1" }}% | -||||
Sticky enrollment | -{{ experiment.is_sticky }} | -||||||
Required experiments | -
- {% with experiment.required_experiments_branches.all as required_branches %}
- {% if required_branches %}
- {% for branch in required_branches %}
-
- {{ branch.child_experiment.name }}
- ({{ branch.branch_slug|add:" branch"|default:"All branches" }})
-
- - {% endfor %} - {% else %} - None - {% endif %} - {% endwith %} - |
- Excluded experiments | -
- {% with experiment.excluded_experiments_branches.all as excluded_branches %}
- {% if excluded_branches %}
- {% for branch in excluded_branches %}
-
- {{ branch.child_experiment.name }}
- ({{ branch.branch_slug|add:" branch"|default:"All branches" }})
-
- - {% endfor %} - {% else %} - None - {% endif %} - {% endwith %} - |
- ||||
Full targeting expression | -{{ experiment.targeting }} | +Slug | +{{ branch.slug|format_not_set }} | +Ratio | +{{ branch.ratio|format_not_set }} | ||
Recipe JSON | -
-
-
-
-
-
- |
+ Description | +{{ branch.description|format_not_set }} |
Slug | -{{ branch.slug|format_not_set }} | -Ratio | -{{ branch.ratio|format_not_set }} | -|
---|---|---|---|---|
Description | -{{ branch.description|format_not_set }} | -|||
{{ feature_value.feature_config.name|format_not_set }} Value | -
- {{ feature_value.value|format_not_set|format_json }}
- |
- |||
No Feature Values | -||||
Screenshots | +{{ feature_value.feature_config.name|format_not_set }} Value |
- {% for screenshot in branch.screenshots.all %}
-
- {% endfor %}
+ {{ feature_value.value|format_not_set|format_json }}
|