-
Notifications
You must be signed in to change notification settings - Fork 365
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
Highlight outdated feature entries on roadmap #4472
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -121,6 +121,7 @@ def test_feature_entry_to_json_basic__normal(self): | |
'by': '[email protected]', | ||
'when': expected_date | ||
}, | ||
'accurate_as_of': expected_date, | ||
'standards': { | ||
'spec': 'https://example.com/spec', | ||
'maturity': { | ||
|
@@ -206,6 +207,7 @@ def test_feature_entry_to_json_basic__feature_release(self): | |
'by': '[email protected]', | ||
'when': expected_date | ||
}, | ||
'accurate_as_of': expected_date, | ||
'standards': { | ||
'spec': 'https://example.com/spec', | ||
'maturity': { | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -37,6 +37,8 @@ class ChromedashRoadmapMilestoneCard extends LitElement { | |||||
showDates = false; | ||||||
@property({type: Boolean}) | ||||||
signedIn = false; | ||||||
@property({attribute: false}) | ||||||
stableMilestone!: number; | ||||||
|
||||||
/** | ||||||
* Returns the number of days between a and b. | ||||||
|
@@ -234,6 +236,34 @@ class ChromedashRoadmapMilestoneCard extends LitElement { | |||||
`; | ||||||
} | ||||||
|
||||||
// A feature is outdated if it is scheduled to ship in the next 2 milestones, | ||||||
// and its accurate_as_of date is at least 4 weeks ago. | ||||||
_isFeatureOutdated(accurateAsOf) { | ||||||
if (this.stableMilestone === 0) { | ||||||
return false; | ||||||
} | ||||||
// If this feature is not shipping within two upcoming milestones, return false. | ||||||
if ( | ||||||
!( | ||||||
this.stableMilestone + 1 === this.channel?.version || | ||||||
this.stableMilestone + 2 === this.channel?.version | ||||||
) | ||||||
) { | ||||||
return false; | ||||||
} | ||||||
if (!accurateAsOf) { | ||||||
return true; | ||||||
} | ||||||
const accuateDate = Date.parse(accurateAsOf); | ||||||
// 4-week period. | ||||||
const gracePeriod = 4 * 7 * 24 * 60 * 60 * 1000; | ||||||
if (accuateDate + gracePeriod < Date.now()) { | ||||||
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.
Suggested change
|
||||||
return true; | ||||||
} | ||||||
|
||||||
return false; | ||||||
} | ||||||
|
||||||
_cardFeatureItemTemplate(f, shippingType) { | ||||||
return html` | ||||||
<li | ||||||
|
@@ -249,6 +279,16 @@ class ChromedashRoadmapMilestoneCard extends LitElement { | |||||
${f.name} | ||||||
</a> | ||||||
<span class="icon_row"> | ||||||
${this._isFeatureOutdated(f.accurate_as_of) | ||||||
? html` | ||||||
<span | ||||||
class="tooltip" | ||||||
title="Feature outdated - last updated more than four weeks ago" | ||||||
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. It's not quite "updated". Perhaps:
Suggested change
|
||||||
> | ||||||
<iron-icon icon="chromestatus:error" data-tooltip></iron-icon> | ||||||
</span> | ||||||
` | ||||||
: nothing} | ||||||
Comment on lines
+282
to
+291
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. I note that you're missing a test for this behavior. |
||||||
${ORIGIN_TRIAL.includes(shippingType) | ||||||
? html` | ||||||
<span class="tooltip" title="Origin Trial"> | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.