Skip to content

Commit

Permalink
Merge pull request #3645 from /issues/3644/1
Browse files Browse the repository at this point in the history
Fixes #3644 - Add a "moved" milestone
  • Loading branch information
karlcow authored Nov 21, 2021
2 parents bd8e621 + c64b8b9 commit 67f2831
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 7 deletions.
7 changes: 4 additions & 3 deletions config/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,10 @@
'fixed': {'id': 0, 'order': 2, 'state': 'closed'},
'incomplete': {'id': 0, 'order': 3, 'state': 'closed'},
'invalid': {'id': 0, 'order': 4, 'state': 'closed'},
'non-compat': {'id': 0, 'order': 5, 'state': 'closed'},
'wontfix': {'id': 0, 'order': 6, 'state': 'closed'},
'worksforme': {'id': 0, 'order': 7, 'state': 'closed'}}
'moved': {'id': 0, 'order': 5, 'state': 'closed'},
'non-compat': {'id': 0, 'order': 6, 'state': 'closed'},
'wontfix': {'id': 0, 'order': 7, 'state': 'closed'},
'worksforme': {'id': 0, 'order': 8, 'state': 'closed'}}

# We don't need to compute for every requests.
OPEN_STATUSES = [status for status in STATUSES
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/config/milestones_content.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tests/fixtures/config/milestones_content_plus.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tests/unit/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def tearDown(self):

def test_update_status_config(self):
"""Update statuses with real milestones id."""
expected = {'sitewait': {'state': 'open', 'id': 5, 'order': 5}, 'worksforme': {'state': 'closed', 'id': 11, 'order': 7}, 'non-compat': {'state': 'closed', 'id': 12, 'order': 5}, 'needsdiagnosis': {'state': 'open', 'id': 2, 'order': 2}, 'contactready': {'state': 'open', 'id': 4, 'order': 4}, 'wontfix': {'state': 'closed', 'id': 6, 'order': 6}, 'needscontact': {'state': 'open', 'id': 3, 'order': 3}, 'invalid': {'state': 'closed', 'id': 8, 'order': 4}, 'needstriage': {'state': 'open', 'id': 1, 'order': 1}, 'duplicate': {'state': 'closed', 'id': 10, 'order': 1}, 'fixed': {'state': 'closed', 'id': 9, 'order': 2}, 'incomplete': {'state': 'closed', 'id': 7, 'order': 3}} # noqa
expected = {'sitewait': {'state': 'open', 'id': 5, 'order': 5}, 'worksforme': {'state': 'closed', 'id': 11, 'order': 8}, 'non-compat': {'state': 'closed', 'id': 12, 'order': 6}, 'needsdiagnosis': {'state': 'open', 'id': 2, 'order': 2}, 'contactready': {'state': 'open', 'id': 4, 'order': 4}, 'wontfix': {'state': 'closed', 'id': 6, 'order': 7}, 'needscontact': {'state': 'open', 'id': 3, 'order': 3}, 'invalid': {'state': 'closed', 'id': 8, 'order': 4}, 'needstriage': {'state': 'open', 'id': 1, 'order': 1}, 'duplicate': {'state': 'closed', 'id': 10, 'order': 1}, 'fixed': {'state': 'closed', 'id': 9, 'order': 2}, 'incomplete': {'state': 'closed', 'id': 7, 'order': 3}, 'moved': {'state': 'closed', 'id': 13, 'order': 5}} # noqa
# Normal Case
milestones_json = json_data('milestones_content.json')
actual = update_status_config(milestones_json)
Expand Down
1 change: 1 addition & 0 deletions webcompat/static/js/lib/models/issue.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export const Issue = Backbone.Model.extend({
var milestoneClass;
if (response.milestone) {
milestone = response.milestone.title;
milestoneClass = response.milestone.title;
} else {
if (isLoggedIn) {
milestone = "Fix me: assign a status";
Expand Down
1 change: 1 addition & 0 deletions webcompat/templates/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ def format_milestone_title(issue_data):
'sitewait': 'Site Contacted',
'wontfix': 'Won\'t Fix',
'worksforme': 'Works For Me',
'moved': 'Moved'
}
state = issue_data.get('state')
milestone = issue_data.get('milestone')
Expand Down
2 changes: 1 addition & 1 deletion webcompat/templates/issue/issue-milestones.jst
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
<span class="label label-<%= data.milestoneClass %> js-Milestone">
<%= data.milestone %>
</span>
</span>
</div>
</script>

0 comments on commit 67f2831

Please sign in to comment.