Closed Bug 1017957 Opened 10 years ago Closed 10 years ago

Integrate Pulse website with PulseGuardian's web app

Categories

(Webtools :: Pulse, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mcote, Assigned: mcc.ricardo, Mentored)

References

()

Details

(Whiteboard: [lang=js])

Attachments

(1 file, 5 obsolete files)

47 bytes, text/x-github-pull-request
mcote
: review+
Details | Review
The Pulse website (http://pulse.mozilla.org) is a django app (http://hg.mozilla.org/automation/pulsewebsite/file/tip), but there's actually no working dynamic content.  I think the static content and any fixed/future dynamic content should all be combined with PulseGuardian into a new (flask-powered, since PulseGuardian works) web site/app at some point.
PulseGuardian now contains the home/Why page; the others still need to be added in one form or another.
This is actually a pretty simple bug; you just need a local RabbitMQ server set up or the test vagrant box as described in https://hg.mozilla.org/automation/mozillapulse/file/tip/HACKING.md, but you won't actually need to use it for anything (it's just required by PulseGuardian to work).  There are setup instructions for PulseGuardian in its README (https://github.com/mozilla/pulseguardian/blob/master/README.md).  The work is just porting over the static content, specifically the QuickStart and the Message Formats parts (the Why? is already in there, and the Roadmap section is essentially useless).

We should also make it possible to browse back to this info while logged in; right now, it seems that you need to log out to see the "What's Pulse?" info, since going to / when logged in automatically redirects you to /profile.  In general, the navigation needs to be cleaned up with a navigation bar or such.
Mentor: mcote
Whiteboard: [lang=js]
Attached file wip patch (v1) (obsolete) —
Assignee: nobody → ewong
Status: NEW → ASSIGNED
Pretty good start!  Now that there's a menu, we should also link to the current views, /register (if you have not registered a Pulse user) and /profile and /queues (if you have).  Also the UI could be improved a little (at least aligning the menu and the header).
Priority: -- → P2
Going to unassign this since I haven't heard back in a while.  Ricardo, feel free to pick it up--this one should be pretty straightforward.
Assignee: ewong → nobody
Sounds good! I'll start looking into it tomorrow.
Assignee: nobody → mcc.ricardo
(In reply to Mark Côté [:mcote] from comment #5)
> Going to unassign this since I haven't heard back in a while.  Ricardo, feel
> free to pick it up--this one should be pretty straightforward.

Sorry about.  Was trying to get the env. back up but was sidetracked with other stuff.  Glad to see someone'll work on this.
No problem, you made a good starting point. :)
Attached file Initial development. (obsolete) —
Hi Mark,

I did some work on this. Some notes:

- Added "Quickstart" and "Message Formats";
- Added "Why", linking to "index.html";
- Added menu options for "Register", "Profile" and "Queues", although I'm not sure if that's suppose to be that way. Also, in the case of "Queues", template it has to be improved. The 3 options are only being showed if the user is logged in;
- Current menu ordering doesn't seem to be the best. Any preference?
Attachment #8530850 - Flags: feedback?(mcote)
Comment on attachment 8530850 [details]
Initial development.

(In reply to Ricardo Castro from comment #9)
> - Added "Quickstart" and "Message Formats";
> - Added "Why", linking to "index.html";
> - Added menu options for "Register", "Profile" and "Queues", although I'm
> not sure if that's suppose to be that way. Also, in the case of "Queues",
> template it has to be improved. The 3 options are only being showed if the
> user is logged in;
> - Current menu ordering doesn't seem to be the best. Any preference?

Nice! Yeah I think we can make it clearer.  We don't need the "Register" page since we have the "+" link on the Profile page.  We should probably rename "Profile" to "Users" and then remove the queue section, putting it, as you say, as a proper template on the "Queues" page.
Attachment #8530850 - Flags: feedback?(mcote)
Sounds good :)
Attached file Pull request. (obsolete) —
- Added menu;
- "Queues" and "Users" only shown when user is logged in;
- Minor styling to make UI consistent.
Attachment #8491232 - Attachment is obsolete: true
Attachment #8530850 - Attachment is obsolete: true
Attachment #8532224 - Flags: review?(mcote)
Comment on attachment 8532224 [details] [review]
Pull request.

This appears to have several bugs:

* can't edit Pulse users
* queue page doesn't have option to auto-refresh
* got an exception when I added a created a queue in RabbitMQ and refreshed the queue page:

Traceback (most recent call last):
  File "/Users/mcote/projects/pulseguardian/lib/python2.6/site-packages/flask/app.py", line 1836, in __call__
    return self.wsgi_app(environ, start_response)
  File "/Users/mcote/projects/pulseguardian/lib/python2.6/site-packages/flask/app.py", line 1820, in wsgi_app
    response = self.make_response(self.handle_exception(e))
  File "/Users/mcote/projects/pulseguardian/lib/python2.6/site-packages/flask/app.py", line 1403, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/Users/mcote/projects/pulseguardian/lib/python2.6/site-packages/flask/app.py", line 1817, in wsgi_app
    response = self.full_dispatch_request()
  File "/Users/mcote/projects/pulseguardian/lib/python2.6/site-packages/flask/app.py", line 1477, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/Users/mcote/projects/pulseguardian/lib/python2.6/site-packages/flask/app.py", line 1381, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/Users/mcote/projects/pulseguardian/lib/python2.6/site-packages/flask/app.py", line 1475, in full_dispatch_request
    rv = self.dispatch_request()
  File "/Users/mcote/projects/pulseguardian/lib/python2.6/site-packages/flask/app.py", line 1461, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/Users/mcote/projects/pulseguardian/src/pulseguardian/pulseguardian/web.py", line 129, in decorated_function
    return f(*args, **kwargs)
  File "/Users/mcote/projects/pulseguardian/src/pulseguardian/pulseguardian/web.py", line 205, in queues
    no_owner_queues=no_owner_queues)
  File "/Users/mcote/projects/pulseguardian/lib/python2.6/site-packages/flask/templating.py", line 128, in render_template
    context, ctx.app)
  File "/Users/mcote/projects/pulseguardian/lib/python2.6/site-packages/flask/templating.py", line 110, in _render
    rv = template.render(context)
  File "/Users/mcote/projects/pulseguardian/lib/python2.6/site-packages/jinja2/environment.py", line 969, in render
    return self.environment.handle_exception(exc_info, True)
  File "/Users/mcote/projects/pulseguardian/lib/python2.6/site-packages/jinja2/environment.py", line 742, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/Users/mcote/projects/pulseguardian/src/pulseguardian/pulseguardian/templates/queues.html", line 1, in top-level template code
    {% extends 'base.html' %}
  File "/Users/mcote/projects/pulseguardian/src/pulseguardian/pulseguardian/templates/base.html", line 37, in top-level template code
    {% block body %}
  File "/Users/mcote/projects/pulseguardian/src/pulseguardian/pulseguardian/templates/queues.html", line 76, in block "body"
    {{ user_information(cur_user) }}
  File "/Users/mcote/projects/pulseguardian/src/pulseguardian/pulseguardian/templates/queues.html", line 11, in template
    {{ list_queues(pulse_user.queues) }}
UndefinedError: 'list_queues' is undefined

Also, thinking more about this, the Quick Start page actually probably belongs on the wiki, and the Message Formats page is not very helpful now that we have the Pulse Inspector.  So if you could put the Quick Start guide on the wiki, remove that page and the Message Formats page, and then put a prominent link to the wiki on the Why? page, that would be great. :)

Hm actually, why don't we rename "Why?" to "What's Pulse?" in the menu, to match the header of the page.
Attachment #8532224 - Flags: review?(mcote)
Ah. The 'Auto-Reload' I left it in the main page. Have to move that. 

As for the other 2 issues, the must have already been there. I only added the static content. I'll look into it and it can fix it :)
Both are tied to the client-side content (HTML, JS, and CSS) so I think perhaps you didn't adjust something correctly. :)
Just found out what's wrong. I messed up something when the 'fake account' option was added. 

> TypeError: navigator.id is undefined        base.js (line 28, col 4)
>	
>    navigator.id.watch({

	
If that option is not use, edit works as usual. Just need to find what's wrong :)
Moving 'base.js' to the if in the template that checks whether or not we're using the fake account seems to do the trick.
The error was due to the orders of 2 macros being switched.
Attached file Pull request. (obsolete) —
Fixed previously detected issues. 

Added link to Wiki. Now we're only missing adding the 'Quickstart' info to the Wiki.
Attachment #8532224 - Attachment is obsolete: true
Attachment #8533387 - Flags: review?(mcote)
Comment on attachment 8533387 [details] [review]
Pull request.

Better, but it seems the autoload on the Queues page doesn't actually work.  I created a queue but had to refresh the page to see it (at which point it displayed fine).

I notice in the web.py output that there's only one GET /queues call, when the page loads; if autoload was working, I'd probably see those displayed regularly.
Attachment #8533387 - Flags: review?(mcote)
I misspelled the id of the div. That's why reload wasn't working. 

That's a nice catch since it brought up another issue. The way it's working at the moment it does GET /queues and injects the returned html into that div. Since queues now has it's own page, the top of the page also gets returned. I'll fix that.
Attached file Pull request. (obsolete) —
Fixed auto-reload.
Attachment #8533387 - Attachment is obsolete: true
Attachment #8534011 - Flags: review?(mcote)
Comment on attachment 8534011 [details] [review]
Pull request.

Works great now!  Just a few little nits.
Attachment #8534011 - Flags: review?(mcote)
Attached file Pull request
Updated accordingly.
Attachment #8534011 - Attachment is obsolete: true
Attachment #8537166 - Flags: review?(mcote)
Comment on attachment 8537166 [details] [review]
Pull request

Thanks!

There were a few little whitespace problems, which I fixed on commit.  In the future please remove trailing whitespace, make sure each file ends with a newline, and don't use tabs (only spaces).  These things don't usually show up in the GitHub diff UI, but they're visible if you use "git diff" on the command line.
Attachment #8537166 - Flags: review?(mcote) → review+
https://github.com/mozilla/pulseguardian/commit/dc39df14696fa944ab1cffce4dd1a2679deaacb8

Will file another bug to get it deployed.
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You're absolutely right. I'll be sure to be more careful!
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: