Monday, July 2, 2012

Functional Connection Module

Hey there, so this past week I've been working out the kinks I've been avoiding having to deal with and "finalizing" as much as possible for the first fully working implementation of the connection module. And also doing pretty much all the work on ShowConnection. I feel like I've got an excellent handle on the URL configuration and redirect stuff, so I'm pretty pumped about this. This round the code seems to be free of stupid mistakes (e.g. if org_mentor is False and org_org_admin is False:, which Lenard pointed out to my amusement/horror) and does everything I think it's expected to. Excited? Wonderful, me too.


I had accidentally moved the line to run the method to create the entity inside of a transaction outside of the foor loop for users in OrgConnectionPage, so after fixing that and something else (I forget what it was) I got the form to start properly creating entities again. Speaking of the form, it also now supports either a drop-down or a radio button if you uncomment the code in order to allow an org admin to choose the role to offer the user. I also made some changes to the template that the views were using in order to properly display form erros this time around, which was causing a certain degree of frustration and occasional raging. So this is fully working by my expectations, but do let me know if there's anything else that this view is supposed to do other than create a GSoCConnection model. Oh, a screenshot you ask? Well alright.


Next, we have the user side of things. I modified pretty much the same stuff as OrgConnectionPage as I recall, which was basically just entity creation and template modification for errors. Here's what it looks like:

Most of the work was dedicated ShowConnectionPage. I messed around with the URL configuration in order to get it to display properly. You can get to this page through the dashboard, though now the dashboard will display ALL GSoCConnection objects rather than just those related to the current user or org admin. One thing I need to fix is the org_admin_for member of the RequestData object in the dashboard object that handles displaying the connections, as it's only populating with one org. In the meantime this view itself works with a proper checkAccess() method and template to display all of the buttons. Though the buttons could be spaced out and organized better; this will be a refinement I intend to tackle in the second half of GSoC :). A user and an org admin are presented with buttons that allow them to take action in response to the current state of the connection, notably that a user can accept only a mentoring role if they are offered an org admin role. There are a series of methods to handle promoting the user in the event that the org admin and user change their side of the connection to equivalent values. In the spirit of a gratuitous number of screenshots, here's a picture of a mentor invitation on the org admin side:


Among other modifications include changes to the show_connection() method in the soc/views/helper request_data module in order to reflect a change in URL schema, AccessChecker's canViewConnection() method in order to determine who can view a GSoCConnection, and the soc/views/helper/notification connectionContext() method and associated template for email messages when a new connection is formed.

All of the above changes can be found on the main repo in an updated version of the connection_demo branch, so feel free to give it a look. I won't go so far as to say that for a first version it's perfect, but I think it's a great basis upon which we can make refinements and improve this mechanism. I've still got a little time to make adjustments before the midterm evaluation, so if there's anything you would like to see added or done differently than let me know and I'll get it done.



No comments:

Post a Comment