Skip to content

Commit 3b47b59

Browse files
authored
feat(nimbus): Add basic feature tracking table to feature health page. (#13749)
Because - We plan to track feature changes on the features health page This commit - Adds the basic layout of the feature tracking table complete with new Foxy! Fixes #13715
1 parent 2b5de93 commit 3b47b59

File tree

5 files changed

+122
-2
lines changed

5 files changed

+122
-2
lines changed

experimenter/experimenter/nimbus_ui/constants.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,11 @@ class NimbusUIConstants:
147147
experiences, etc. associated with your selected feature.""",
148148
}
149149

150+
FEATURE_PAGE_TOOLTIPS = {
151+
"feature_changes_tooltip": """This shows any changes made to the Nimbus feature
152+
manifest such as code changes for the feature you have chosen."""
153+
}
154+
150155
class ReviewRequestMessages(Enum):
151156
END_EXPERIMENT = "end this experiment"
152157
END_ENROLLMENT = "end enrollment for this experiment"

experimenter/experimenter/nimbus_ui/templates/nimbus_experiments/features.html

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,58 @@ <h5 class="fw-semibold">
331331
</div>
332332
</div>
333333
</div>
334+
<hr>
335+
<h5 class="fw-semibold">
336+
<img src="{% static 'assets/feature-changes.svg' %}"
337+
alt="Fox opening a box"
338+
style="width: 60px;
339+
height: auto" />
340+
Feature Changes
341+
<i class="fa-regular fa-circle-question"
342+
data-bs-toggle="tooltip"
343+
data-bs-placement="top"
344+
data-bs-title="{{ tooltips.feature_changes_tooltip }}"></i>
345+
|
346+
<span class="badge bg-secondary">Number of changes: {{ feature_changes.count|default:"0" }}</span>
347+
</h5>
348+
<div>
349+
<div id="feature-changes-table">
350+
<table class="table table-hover table-borderless align-middle mb-3">
351+
<thead>
352+
<tr>
353+
<th scope="col" class="fw-semibold text-body">
354+
<span>Feature Version</span>
355+
</th>
356+
<th scope="col" class="fw-semibold text-body">
357+
<span>Date / Time</span>
358+
</th>
359+
<th scope="col" class="fw-semibold text-body">
360+
<span>Change Size</span>
361+
</th>
362+
<th scope="col" class="fw-semibold text-body">
363+
<span>Change Diff</span>
364+
</th>
365+
</tr>
366+
</thead>
367+
<tbody>
368+
{% for change in feature_changes %}
369+
<tr scope="row">
370+
<td id="feature-version">{{ change.change_version|format_not_set }}</td>
371+
<td id="feature-change-date">{{ change.change_date|date:"m/d/Y @ H:i"|format_not_set }}</td>
372+
<td id="feature-change-size">{{ change.change_size|format_not_set }}</td>
373+
<td id="feature-change-complexity">{{ change.softvision_complexity|format_not_set }}</td>
374+
</tr>
375+
{% empty %}
376+
<tr>
377+
<td colspan="11" class="text-center text-muted py-5">No Tracked Feature Changes</td>
378+
</tr>
379+
</tr>
380+
{% endfor %}
381+
</tbody>
382+
</table>
383+
</div>
334384
</div>
335385
</div>
336386
</div>
387+
</div>
337388
{% endblock %}

experimenter/experimenter/nimbus_ui/tests/test_views.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3576,14 +3576,18 @@ def test_features_view_renders_table_with_correct_elements(
35763576
)
35773577

35783578
feature_id = self.feature_configs[feature_config].id
3579-
url = reverse("nimbus-ui-features")
35803579
response = self.client.get(
3581-
f"{url}?application={application.value}&feature_configs={feature_id}"
3580+
reverse("nimbus-ui-features"),
3581+
{
3582+
"application": application.value,
3583+
"feature_configs": feature_id,
3584+
},
35823585
)
35833586

35843587
self.assertEqual(response.status_code, 200)
35853588
self.assertContains(response, "deliveries-table")
35863589
self.assertContains(response, "qa-info-table")
3590+
self.assertContains(response, "feature-changes-table")
35873591
self.assertContains(response, experiment)
35883592

35893593
def test_features_view_deliveries_table_can_sort_by_recipe_name(self):

experimenter/experimenter/nimbus_ui/views.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,7 @@ def get_context_data(self, **kwargs):
764764
context = {
765765
"form": form,
766766
"links": NimbusUIConstants.FEATURE_PAGE_LINKS,
767+
"tooltips": NimbusUIConstants.FEATURE_PAGE_TOOLTIPS,
767768
"application": self.request.GET.get("application"),
768769
"feature_configs": self.request.GET.get("feature_configs"),
769770
"paginator": deliveries_paginator,

experimenter/experimenter/static/assets/feature-changes.svg

Lines changed: 59 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)