As part of the d.o redesign of the project node UI, we're going to be moving more stuff out of the main content area and into blocks. See #372580: Move the project node links to blocks for more. However, while I was at DCDC, I sat down with Mark Boulton to talk through some of the specifics, and reiterated my support for adding something a lot like this from alpritt over at Project node UI redesign:

issue cockpit block mockup

He said something like that would be great, and wants to see that in the right sidebar on project nodes. Obviously, there's not going to be enough space to lay it out exactly like that -- we're going to probably need to do everything vertically instead of "two column". But, this would be a nice opportunity to clean up some of the weirdness with where the issue links are currently sprinkled in the default project links. Since there's all this additional information and the text field for the search box, we can't do this just using the API discussed at #372580. I think it's cool if project_issue just provides this block and the other links aren't part of the default project links -- sites that really want the current behavior can always disable the block and implement the hook to put the links how they want them.

Comments

mfb’s picture

Assigned: Unassigned » mfb
mfb’s picture

Has anyone thought about how to define an "unanswered" issue?

mfb’s picture

For now I am going to assume "unanswered" issues are those with the default status, and "active" issues are those with states in the default query (see checkboxes at admin/project/project-issue-status). Note, it's slightly confusing that the word "active" is used in two different contexts here.

mfb’s picture

Status: Active » Needs review
StatusFileSize
new6.71 KB

Here's what I have so far (probably needs refactoring etc.) i split it off into an include file to avoid module bloat.

drumm’s picture

This block should have a string key, maybe 'issue_cockpit'

mfb’s picture

StatusFileSize
new6.72 KB

added string key.

mfb’s picture

StatusFileSize
new6.74 KB

Removed the count of "active", "unanswered", "total" in favor of "open" and "total", which more easily matches up with existing functionality of this module. Also refactored to run fewer db queries (one query using GROUP BY category rather than a query for each category using WHERE).

dww’s picture

Status: Needs review » Needs work

Sweet, this is definitely getting closer. A few remaining problems:

A) It just prints out "( open)" for projects that have 0 open issues in a given category.

B) The default "create new" button (e.g. at http://drupal.org/project/issues/drupal) is actually labeled "Create a new issue", but the help text here says "handy 'create new' button". It's also a link, not a button. And maybe "handy" isn't the best language for this. ;) I know you're just exactly implementing the screenshot I posted, but that was just the general direction. I think you should feel completely empowered to improve the text or UI in any ways you see fit. ;)

C) Even though it's a smaller font, all the "total (N)" links draw a lot of my attention. I think it'd flow better (and save vertical space) if we tried it as:

Feature requests: 0 open, 1 total

It would be nice to leave all of "Feature requests" a link, too. Is this too weird?

Feature requests: 0 open, 1 total

D) Not sure, but wouldn't it be nice to be able to retain this block once we land on a given project's issue queue page? Seems slightly disorienting that after you submit the search box form, you're sent to a page where the block disappears (and, due to how the breadcrumbs work, there's actually no way to get back to the project page you were just viewing).

mfb’s picture

re: #8 D), anyone know the best way to get my project context (i.e. the view argument) when rendering the block on an issue queue page?

mfb’s picture

Status: Needs work » Needs review
StatusFileSize
new6.6 KB

For now I did not implement D). We'll need a nice solution for determining project context from the views pages, possibly making use of views_get_page_view() to get the views args.

dww’s picture

Status: Needs review » Fixed

Made a few changes:

- Fixed bug where the advanced search link was broken
- Added a "Subscribe via e-mail" link
- Moved the .inc file into includes and the .tpl.php file into a new "theme" directory
- Slightly changed the formatting of the block: "Feature requests: 0 open (1 total)" (at least for now)
- Added some PHPDoc to the new functions

Committed to HEAD:

http://drupal.org/cvs?commit=195420
http://drupal.org/cvs?commit=195426

Thanks!

dww’s picture

Issue tags: +needs drupal.org deployment

When this is deployed, we need to make sure we deploy both project and drupalorg.module at the same time (since the link sections it's trying to alter will be different). We also need to actually enable this block for bluebeach. The block itself is smart about only showing up on project nodes, so we just need to configure it to always appear in the right side-bar and give it the right weight.

dww’s picture

Status: Fixed » Needs work

FYI: this is now deployed on d6.d.o so folks can see how it looks:

http://d6.drupal.org/project/drupal
http://d6.drupal.org/project/project
http://d6.drupal.org/project/views
...

What do y'all think?

Also, I think we're going to want to roll our own caching for this block. The core block cache is going to be invalidated every time a comment or node is posted on d.o, which is going to be probably too frequently for that cache to do us much good. :(

dww’s picture

StatusFileSize
new40.83 KB

Here's a screenshot of what it looks like in "bluecheese", the redesign theme...

aclight’s picture

Shouldn't the "A" of "advanced search" be capitalized? Or is it part of the new style guide not to do so?

mfb’s picture

I was also wondering what the style guide says. The mockup had a mix of title case, lower case and sentence case.

dww’s picture

Yeah, I fixed the "Search" button and "Advanced search" link. I also did some other cleanup based on feedback in IRC the other night:
http://drupal.org/cvs?commit=199814
For example, there are now checkboxes when you configure the block to decide which categories you want to see the summary lines for. The general agreement was that seeing 'All issues' and 'Bug reports' was all you really need. But, instead of hard-coding those into the theme template, it was just as easy (both to code and to change) to make it a setting. So, if we ever change our minds and want to see other summary lines in there, it's a few clicks instead of dealing with the theme template.

This could probably still use some custom block caching, so still leaving this as "needs work"....

dww’s picture

Assigned: mfb » dww
Status: Needs work » Needs review
StatusFileSize
new8.81 KB

Now with custom caching for this block... This was a bit thorny to invalidate the block cache for the right project(s) when comments are added or deleted, but it's all working now. ;) I'll deploy this on d6.d.o for folks to play with it and see if they can break it.

dww’s picture

This is now deployed on d6.d.o for testing:

http://d6.drupal.org/project/drupal
http://d6.drupal.org/project/project
http://d6.drupal.org/project/views
...

If you add comments or new issues in any way that affects the totals for a project (e.g. new issue, moving an issue to another project, reclassifying a support request to a bug or vice versa, etc), you should see the totals change on all the relevant project node(s).

I also deployed the latest changes to bluebeach's style.css on there. Any final suggestions or problems before I deploy this for real on d.o?

hunmonk’s picture

Status: Needs review » Postponed (maintainer needs more info)

code looks good, i just have one concern:

i'm wondering why we're not using the standard drupal cache API for our block caching here? i believe cache get/set/clear_all would be fine here, i think we would just to adjust {project_issue_cache_block}'s schema to match the standard caching schema.

i would prefer to do it this way unless there is a compelling reason to do it otherwise. standardization == good.

dww’s picture

Status: Postponed (maintainer needs more info) » Needs review

@hunmonk: Thanks for the review.

Re #20: Because I've been repeatedly burned by the lameness that is core's cache API. For example, see #319486-3: Fetched update informations at every cron and beyond. One of these days in the near future, I have to write a patch for core to convert the cache table that update.module uses to make it not a "real" cache table so that it actually friggin' works for what it's supposed to work for. :( It's currently impossible to have non-volatile caches with the core cache API. To avoid jumping through a bunch of hoops, e.g. changing the memcache configuration on d.o when I deploy this change, I'm just doing my own table and cache API. Either we should use core's useless block caching (which will clear the cache effectively all the time -- no thanks), we shouldn't use any caching at all (and hope all these new queries don't piss off the DB maintainers), or we should have our own cache table so we can actually control when the cache is cleared and clear it at appropriate times (which is what this patch does). Yes, it'd be "nicer" in the abstract to use the standard mechanisms, but until those mechanisms doesn't actively harm things, I'm not going to be using them.

dww’s picture

StatusFileSize
new6.29 KB

Ok, after my experiences with #220592: Core cache API breaks update.module: fetches data way too often, kills site performance, etc and longer discussions with killes about memcache and friends, I've changed my mind on this a bit. I'm willing to use the core cache API (and the default {cache} table in fact) based on the following:

- So long as you use CACHE_PERMANENT (the default), the core cache API isn't quite as terribly broken as it seems.

- Sites that have a TON of projects are likely to be drupal.org and therefore, using memcache. Memcache will be faster/better for this than a separate table. Sites that don't have a ton of projects aren't going to care about a few blocks being cached directly in {cache} for this. It's certainly better than the core block cache since we invalidate at the right times, unlike {cache_block}.

- The volatility of the cache API and memcache isn't *that* big a deal for these blocks -- so we have to run a few (semi) expensive DB queries -- big deal. It's not like we've got to fetch data from updates.d.o or anything truly expensive.

So, here's a new patch that adds caching using cache_set|get and the default {cache} table. Tested locally and seems to do the right things. Any final complaints before I commit and deploy?

hunmonk’s picture

Status: Needs review » Reviewed & tested by the community

code looks good. if it's been tested, it's ready.

dww’s picture

Status: Reviewed & tested by the community » Needs work

Cool, committed to HEAD. Just needs deployment (along with the rest of this block). bluebeach already has reasonable CSS for this block, but bluecheese needs some.

dww’s picture

Issue tags: -needs drupal.org deployment

Now deployed.

Setting this back to "needs work" for some bluecheese CSS lovin'...

longwave’s picture

The "subscribe via email" link is incorrectly spelled as "subcribe".

Also, the "oldest open issue" line incorrectly reports 1 Jan 70 for projects with no issues (e.g. http://drupal.org/project/uc_domain)

longwave’s picture

Status: Needs work » Needs review
StatusFileSize
new2.01 KB

Patch attached for the two issues mentioned above.

dww’s picture

Status: Needs review » Needs work
Issue tags: +needs drupal.org deployment

@longwave: Thanks! Reviewed, tested, and committed to HEAD. I patched d.o as a temporary workaround, but we should really officially deploy this change via our usual SVN + vendor branch setup, so tagging as such.

Back to "needs work" for the bluecheese CSS...

greg.harvey’s picture

Block title could do with being "Issues for Module Name", e.g. "Issues for Views". I saw the new block and thought it was a general issue search, which was not what I wanted...

dww’s picture

@greg.harvey: Thanks for suggesting that, I see what you mean. However, I can definitely argue both sides of it... Most of the blocks on project nodes are specific to that project -- do we really want to duplicate "... for views" on every block? E.g. "Maintainers for Views", "Issues for Views", "Recent issues for Views", etc.

This is only going to get worse as we get further with the drupal.org redesign, since there are going to be even more project-specific blocks:
#372580: Move the project node links to blocks
#372027: Create "Links" block for project nodes
#371979: "Get Involved" Block on project pages
...
For some (out of date) examples of what we're kind of working towards, see:
http://infrastructure.drupal.org/drupal.org-style-guide/prototype/core.html
http://infrastructure.drupal.org/drupal.org-style-guide/prototype/module...

Seems like a slippery slope to put project names on all of them. :/ Granted, given that we still have the non-project blocks over there with the current design, there's a stronger case for using the project name on the project-specific blocks in the mean time. So, I might just temporarily roll out this change, anyway. But, I wanted to raise the point that it probably shouldn't stay like this, if we do it at all...

greg.harvey’s picture

Take your point. Would be useful in the now, perhaps not required for the full re-design. Will leave it with you guys. =)

dww’s picture

A (minor) bug I just noticed is that since the help text about searching for duplicates is enclosed in a test if the user has permission to create issues (e.g. they're logged in), sometimes a version of the block is cached which doesn't have that text (if an anon user happens to be the first visit a given project page after the cache is cleared). We should probably rip out the test and always print the help text...

mfb’s picture

Ah yes, this needed the role+page block caching, not custom per-project caching.

dww’s picture

Except the core role+page block caching is useless on a site like d.o, since the *entire* block cache is cleared every time anyone comments on the site. :(

mfb’s picture

ouch. where's the issue to fix this cache_clear_all() business.. :) e.g. allow sites to swap in their own custom cache-clearing logic or something like that.

dww’s picture

@mfb: Good question, I don't know. :(

I committed a fix to always display the help text, and also added the project title to the block title (for now).

Deployed on d.o as a local patch for now. I'm going to wait to officially deploy until some other goodies are fixed.

dww’s picture

dww’s picture

Issue tags: -needs drupal.org deployment

Ok, I deployed the latest changes on d.o.

Not sure what else is left in here. I guess it's bluecheese CSS + redesign stuff...

lisarex’s picture

Linking this from the Redesign project #661692: Meta issue for modules Project and Project issue tracking because this issue was tagged 'drupal.org redesign'

drumm’s picture

Status: Needs work » Fixed

Seems done to me.

dww’s picture

The project_issue feature is done, but from a redesign perspective, there's still more to do:

a) this block doesn't appear at http://redesign.drupal.org/project/drupal
b) last time I tried turning on the block with bluecheese, the CSS needed some help to not look so terrible

Where's the best place for such work? Should this be added to #693378: D&E: Modules needs sidebar content or a new issue in http://drupal.org/project/issues/redesign ?

drumm’s picture

Title: Add an "issue cockpit" block for project nodes » Theme "issue cockpit" block for project nodes
Project: Project issue tracking » Bluecheese
Version: 6.x-1.x-dev »
Category: feature » task
Status: Fixed » Active

a) fixed in drupalorg_update_6500(), check back tomorrow to see it.
b) bluecheese issue queue

dww’s picture

Title: Theme "issue cockpit" block for project nodes » Add an "issue cockpit" block for project nodes
Project: Bluecheese » Project issue tracking
Version: » 6.x-1.x-dev
Category: task » feature
Status: Active » Closed (fixed)

Actually, it looks like the bluecheese changes for this block are in the patch at #843872: Work on D&E core (and project pages). I'd rather leave this issue for the feature request for project_issue (which is long done) and handle the bluecheese stuff in another issue. Seems we don't need a duplicate one given the link above.

hunmonk’s picture

adding redesign tag