Skip to content

Commit

Permalink
changelog history to reflect clones fixes mozilla#2377
Browse files Browse the repository at this point in the history
  • Loading branch information
tiftran committed Mar 16, 2020
1 parent 07f108e commit d05d5ff
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/experimenter/experiments/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -884,6 +884,7 @@ def clone(self, name, user):
changed_by=get_user_model().objects.get(id=user.id),
old_status=None,
new_status=ExperimentConstants.STATUS_DRAFT,
message=ExperimentChangeLog.STATUS_CLONED,
)

return cloned
Expand Down Expand Up @@ -990,6 +991,7 @@ class ExperimentChangeLog(models.Model):
STATUS_ACCEPTED_LIVE = "Launched Delivery"
STATUS_LIVE_COMPLETE = "Completed Delivery"
STATUS_ADDED_RESULTS = "Added Results"
STATUS_CLONED = "Cloned Experiment"

PRETTY_STATUS_LABELS = {
None: {Experiment.STATUS_DRAFT: STATUS_NONE_DRAFT},
Expand Down
8 changes: 8 additions & 0 deletions app/experimenter/templates/experiments/detail_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,14 @@ <h5 class="modal-title">Edited by {{user}} </h5>
</div>
</div>
</div>
{% elif user_change.message == user_change.STATUS_CLONED %}
<p class="ml-4">
<a href="{{experiment.parent.experiment_url}}">
<span class="fas fa-info-circle"></span>
{{user_change}}
</a>
</p>

{% else %}
<p class="ml-4 text-muted">{{ user_change }}</p>
{% endif %}
Expand Down

0 comments on commit d05d5ff

Please sign in to comment.