Closed Bug 951896 Opened 12 years ago Closed 11 years ago

Redesign window.location.hash pattern to hold more data

Categories

(Data Platform and Tools :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jonasfj, Unassigned)

Details

telemetry.jquery.js implements filtering of histograms, hence manages, loading of histograms (using telemetry.js), creation and deletion of selectors and window.location.hash. I believe the ability for `telemetry.jquery.js` to handle is very nice. It makes `window.location.hash` ideal for small custom dashboard that just does one thing. However, for the main telemetry dashboard, we want to do more than one thing. We want more than one view, hence, we should disable hash management in `telemetry.jquery.js`, this can be done when the histogramfilter is created by switching the option `synchronizeStateWithHash` from true to false. To replace this we need something that histogramfilter filter setting the `state` to the desired state "<version>/<channel>/<measure>/<filter-option1>/..."-string, everything the window.location.hash changes. This can be done with: $("#histogram-filter").histogramfilter('state', state_string); Similarly, the state can be obtained with: $("#histogram-filter").histogramfilter('state'); Then the window.location.hash state can be managed somewhere else, that can do advanced parsing and deduce the other options from the string as well. For example we will probably want window.location.hash to encode: - "<version>/<channel>/<measure>/<filter-option1>/..." - what series are currently visible on the evolution plot - what date-range is currently selected, if any, - if we're displaying by build-dates or calendar-dates - if we're displaying as table or graph In the future we might also want to add options with parameters, like show percentile 35, or something. The most obvious way to do this is by adding flags after the state_string, like +from:<date>, or +as-table, or +percentile:50. Another, less readable option is querystring-like formatting with = and & so path=/../&from=<date>&as-table=true&...
This is fixed by raluca in her PRs... It's not perfect, it's somewhat hacked... but works so good for now..
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Product: Webtools → Data Platform and Tools
Component: Telemetry Dashboards (TMO) → General
You need to log in before you can comment on or make changes to this bug.