Closed Bug 709812 Opened 14 years ago Closed 14 years ago

Move Firefox versions to a global constant

Categories

(Mozilla QA Graveyard :: Mozmill Result Dashboard, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: davehunt, Assigned: davehunt)

References

Details

(Keywords: push-needed)

Attachments

(2 files, 3 obsolete files)

This would reduce duplication and maintenance when updating the report filters, and also allow the upcoming endurance charts page to dynamically preset the latest version.
Assignee: nobody → dave.hunt
Blocks: 708059
Comment on attachment 580945 [details] [diff] [review] Moved Firefox versions to a global constant. v1.0 >+++ b/_attachments/js/dashboard.js >@@ -1,6 +1,7 @@ > var BYTE_TO_MEGABYTE = 1/1048576; > var MAX_CHART_CHECKPOINTS = 450; > var METRIC_UNAVAILABLE = "--"; >+var FIREFOX_VERSIONS = ["11.0", "10.0", "9.0", "8.0", "3.6"] Please move it to the very top of this file or even better include it from a versions.js file so we have it separated from this large dashboard code. > var context = this; >+ context.firefox_versions = FIREFOX_VERSIONS; > request({url: '/_view/functional_reports?' + $.param(query)}, function (err, resp) { > if (err) window.alert(err); I would bind it directly to the Sammy app by placing it into it's constructor. That way we would only have to set it once. >+ {{#firefox_versions}} >+ <span>{{{.}}}</span> >+ {{/firefox_versions}} nit: 2 spaces indentation.
Attachment #580945 - Flags: review?(hskupin) → review-
(In reply to Henrik Skupin (:whimboo) from comment #2) > Comment on attachment 580945 [details] [diff] [review] > Moved Firefox versions to a global constant. v1.0 > > >+++ b/_attachments/js/dashboard.js > >@@ -1,6 +1,7 @@ > > var BYTE_TO_MEGABYTE = 1/1048576; > > var MAX_CHART_CHECKPOINTS = 450; > > var METRIC_UNAVAILABLE = "--"; > >+var FIREFOX_VERSIONS = ["11.0", "10.0", "9.0", "8.0", "3.6"] > > Please move it to the very top of this file or even better include it from a > versions.js file so we have it separated from this large dashboard code. Moving it to a separate file sounds great, but I'm not sure how I'd achieve this. I tried adding a versions.js but this didn't work - I assume I need to reference this new file somehow. > > > var context = this; > >+ context.firefox_versions = FIREFOX_VERSIONS; > > request({url: '/_view/functional_reports?' + $.param(query)}, function (err, resp) { > > if (err) window.alert(err); > > I would bind it directly to the Sammy app by placing it into it's > constructor. That way we would only have to set it once. I have tried doing this by adding this.firefox_versions to the app constructor, however this does not appear to be available in the event context. If I use context.firefox_versions = app.firefox_versions it works, but I might as well reference the global constant directly. > >+ {{#firefox_versions}} > >+ <span>{{{.}}}</span> > >+ {{/firefox_versions}} > > nit: 2 spaces indentation. Fixed.
Attachment #580945 - Attachment is obsolete: true
Attachment #581226 - Flags: feedback?(hskupin)
Disregard my comment about moving to a separate file, we cleared this up on IRC.
Attachment #581226 - Attachment is obsolete: true
Attachment #581226 - Flags: feedback?(hskupin)
Attachment #581229 - Flags: feedback?(hskupin)
Comment on attachment 581229 [details] [diff] [review] Moved Firefox versions to a global constant. v1.2 >+ <script language="javascript" type="text/javascript" src="js/versions.js"></script> You will also have to add this file to the patch. It's missing right now. >+ this.firefox_versions = FIREFOX_VERSIONS; >+ So does that work now or is this property still not accessible from within the event callback and template?
Attachment #581229 - Flags: feedback?(hskupin) → feedback-
Comment on attachment 581927 [details] Pointer to Github pull request: https://github.com/whimboo/mozmill-dashboard/pull/5 Sorry, I submitted this pull request but didn't update the bug due to issues I was having with the github tweaks addon.
Attachment #581927 - Flags: review?(hskupin)
Comment on attachment 581927 [details] Pointer to Github pull request: https://github.com/whimboo/mozmill-dashboard/pull/5 Looks good to me. Just fix the outstanding review comments and it will be ready to land.
Attachment #581927 - Flags: review?(hskupin) → review+
Comment on attachment 583112 [details] Pointer to Github pull request: https://github.com/whimboo/mozmill-dashboard/pull/5 Implemented suggested changes.
Attachment #583112 - Flags: review?(hskupin)
Attachment #581927 - Attachment is obsolete: true
Comment on attachment 583112 [details] Pointer to Github pull request: https://github.com/whimboo/mozmill-dashboard/pull/5 r=me with the one remaining issue fixed. Please squash all commits into a single one before merging your branch.
Attachment #583112 - Flags: review?(hskupin) → review+
Status: NEW → RESOLVED
Closed: 14 years ago
Keywords: push-needed
Resolution: --- → FIXED
Product: Mozilla QA → Mozilla QA Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: