-
Notifications
You must be signed in to change notification settings - Fork 220
feat(nimbus): create overview edit form #14185
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
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...rimenter/experimenter/experiments/migrations/0307_nimbusexperiment_next_steps_and_more.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # Generated by Django 5.2.9 on 2025-12-18 17:43 | ||
|
|
||
| from django.db import migrations, models | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
|
|
||
| dependencies = [ | ||
| ('experiments', '0306_remove_nimbusexperiment_qa_run_test_plan_and_more'), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.AddField( | ||
| model_name='nimbusexperiment', | ||
| name='next_steps', | ||
| field=models.TextField(blank=True, null=True, verbose_name='Next Steps'), | ||
| ), | ||
| migrations.AddField( | ||
| model_name='nimbusexperiment', | ||
| name='project_impact', | ||
| field=models.CharField(blank=True, choices=[('HIGH', 'High'), ('MODERATE', 'Moderate'), ('TARGETED', 'Targeted')], default=None, max_length=255, null=True, verbose_name='Project Impact'), | ||
| ), | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,7 @@ | ||
| from enum import Enum | ||
|
|
||
| from experimenter.experiments.constants import NimbusConstants | ||
|
|
||
|
|
||
| class NimbusUIConstants: | ||
| HYPOTHESIS_PLACEHOLDER = """ | ||
|
|
@@ -178,6 +180,32 @@ class NimbusUIConstants: | |
| "for the selected versions." | ||
| ) | ||
|
|
||
| KEY_TAKEAWAYS_EMPTY_TEXT = """Was your hypothesis right, wrong, or somewhere in | ||
| between? Call out what changed in a meaningful way (ideally things that were | ||
| statistically significant).""" | ||
|
|
||
| NEXT_STEPS_EMPTY_TEXT = """Ship, stop, or iterate? If shipping, how do we roll it | ||
| out? If iterating, what signals suggest it's worth more testing?""" | ||
|
|
||
| PROJECT_IMPACT_EMPTY_TEXT = """Rate the overall business impact of this project. Did | ||
| it shift key company metrics, or did it mainly deliver targeted learnings? Your | ||
| rating helps teams filter, compare, and learn from experiments across the org.""" | ||
|
|
||
| PROJECT_IMPACT_SUBTITLES = { | ||
| NimbusConstants.ProjectImpact.HIGH: ( | ||
| "Moved key company metrics or made visible progress toward " | ||
| "broader goals. Worth sharing across teams or with leadership." | ||
| ), | ||
| NimbusConstants.ProjectImpact.MODERATE: ( | ||
| "Provided meaningful progress or insights, with impact more " | ||
| "localized than company-wide." | ||
| ), | ||
| NimbusConstants.ProjectImpact.TARGETED: ( | ||
| "Met intended goals and delivered useful learnings, though " | ||
| "it didn't shift broader metrics." | ||
| ), | ||
| } | ||
|
Comment on lines
+194
to
+207
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. May be you just want to keep this and remove the other one |
||
|
|
||
| class ReviewRequestMessages(Enum): | ||
| END_EXPERIMENT = "end this experiment" | ||
| END_ENROLLMENT = "end enrollment for this experiment" | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
94 changes: 94 additions & 0 deletions
94
experimenter/experimenter/nimbus_ui/templates/common/edit_outcome_summary_form.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| <form class="accordion" | ||
| method="post" | ||
| hx-post="{% url 'nimbus-ui-edit-outcome-summary' slug=experiment.slug %}" | ||
| id="edit-summary-form-{{ experiment.slug }}"> | ||
| {% csrf_token %} | ||
| <div class="accordion-item border border-1 rounded-4 mt-4 py-4 px-5"> | ||
| <button class="accordion-button shadow-none bg-transparent text-body" | ||
| type="button" | ||
| data-bs-toggle="collapse" | ||
| data-bs-target="#key-takeaways-{{ experiment_slug }}-{{ branch.slug }}" | ||
| aria-expanded="true" | ||
| aria-controls="key-takeaways-{{ experiment_slug }}-{{ branch.slug }}"> | ||
| <div class="d-flex flex-column align-items-start"> | ||
| <div class="d-flex align-items-center gap-2 mb-2"> | ||
| <h5 class="mb-0">Key takeaways</h5> | ||
| {% if not experiment.takeaways_summary %} | ||
| <span class="badge rounded-pill text-bg-warning bg-opacity-25 border border-secondary-subtle">Incomplete</span> | ||
| {% endif %} | ||
| </div> | ||
| <small class="text-muted">{{ NimbusUIConstants.KEY_TAKEAWAYS_EMPTY_TEXT }}</small> | ||
| </div> | ||
| </button> | ||
| <div id="key-takeaways-{{ experiment_slug }}-{{ branch.slug }}" | ||
| class="accordion-collapse collapse show"> | ||
| <div class="accordion-body">{{ edit_outcome_summary_form.takeaways_summary }}</div> | ||
| </div> | ||
| </div> | ||
| <div class="accordion-item border border-1 rounded-4 mt-4 py-4 px-5"> | ||
| <button class="accordion-button shadow-none bg-transparent text-body" | ||
| type="button" | ||
| data-bs-toggle="collapse" | ||
| data-bs-target="#next-steps-{{ experiment_slug }}-{{ branch.slug }}" | ||
| aria-expanded="true" | ||
| aria-controls="next-steps-{{ experiment_slug }}-{{ branch.slug }}"> | ||
| <div class="d-flex flex-column align-items-start"> | ||
| <div class="d-flex align-items-center gap-2 mb-2"> | ||
| <h5 class="mb-0">Next Steps</h5> | ||
| {% if not experiment.next_steps %} | ||
| <span class="badge rounded-pill text-bg-warning bg-opacity-25 border border-secondary-subtle">Incomplete</span> | ||
| {% endif %} | ||
| </div> | ||
| <small class="text-muted">{{ NimbusUIConstants.NEXT_STEPS_EMPTY_TEXT }}</small> | ||
| </div> | ||
| </button> | ||
| <div id="next-steps-{{ experiment_slug }}-{{ branch.slug }}" | ||
| class="accordion-collapse collapse show"> | ||
| <div class="accordion-body">{{ edit_outcome_summary_form.next_steps }}</div> | ||
| </div> | ||
| </div> | ||
| <div class="accordion-item border border-1 rounded-4 mt-4 py-4 px-5"> | ||
| <button class="accordion-button shadow-none bg-transparent text-body" | ||
| type="button" | ||
| data-bs-toggle="collapse" | ||
| data-bs-target="#project-impact-{{ experiment_slug }}-{{ branch.slug }}" | ||
| aria-expanded="true" | ||
| aria-controls="project-impact-{{ experiment_slug }}-{{ branch.slug }}"> | ||
| <div class="d-flex flex-column align-items-start"> | ||
| <div class="d-flex align-items-center gap-2 mb-2"> | ||
| <h5 class="mb-0">Project Impact</h5> | ||
| {% if not experiment.project_impact %} | ||
| <span class="badge rounded-pill text-bg-warning bg-opacity-25 border border-secondary-subtle">Incomplete</span> | ||
| {% endif %} | ||
| </div> | ||
| <small class="text-muted">{{ NimbusUIConstants.PROJECT_IMPACT_EMPTY_TEXT }}</small> | ||
| </div> | ||
| </button> | ||
| <div id="project-impact-{{ experiment_slug }}-{{ branch.slug }}" | ||
| class="accordion-collapse collapse show"> | ||
| <div class="accordion-body d-flex flex-column gap-4"> | ||
| {% for radio in edit_outcome_summary_form.project_impact %} | ||
| <div class="project-impact-option {{ key }}"> | ||
| <label class="d-flex gap-3 align-items-center"> | ||
| <div style="transform: scale(1.75)">{{ radio.tag }}</div> | ||
| <div class="ms-2"> | ||
| <div>{{ radio.choice_label }} impact</div> | ||
| <small class="option-subtitle text-muted"> | ||
| {% for key, subtitle in NimbusUIConstants.PROJECT_IMPACT_SUBTITLES.items %} | ||
| {% if key == radio.choice_label|upper %}{{ subtitle }}{% endif %} | ||
| {% endfor %} | ||
| </small> | ||
| </div> | ||
| </label> | ||
| </div> | ||
| {% endfor %} | ||
| </div> | ||
| </div> | ||
| </div> | ||
| <div class="modal-footer border-0"> | ||
| <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button> | ||
| <button type="submit" | ||
| class="btn btn-primary" | ||
| form="edit-summary-form-{{ experiment.slug }}">Save changes</button> | ||
| </div> | ||
| </form> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.