Problem/Motivation

We do a lot of our own listings around and about, and have hardcoded a lot of these rather than leveraging views. We should embrace Views and convert all the listings we can over to use views.

Proposed resolution

This is a meta issue, that tracks the other issues that need to be completed to add proper views integration. This work is being done in the 588728_view_integration branch of ergonlogic's sandbox.

Remaining tasks

The issues that need to be worked on are:

Original report by adrian

During the 0.1 development we had some basic support for views 1.x, but we ended up removing it because it would have taken too much work to support fully, and then we would have to rewrite it entirely for views 2.x

Now that we have a stable D6 release, it's time to work on views 2.x support for Aegir.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

anarcat’s picture

I think we should avoid *depending* on views and keep on doing our own stuff for now. Adding views hooks so that fields show up in views and can be part of filters is fine, however.

univate’s picture

Status: Active » Needs review
FileSize
21.57 KB

Here is a start, I think it defines almost all the main fields and there are a few filters as well, it probably needs a little more work, but its functional and you should be able to generate a lot of the current tables used in the hosting front end with this views support.

adrian’s picture

Status: Needs review » Needs work

this is excellent so far, but there needs to be some special handling regarding relationships.

it is giving us 'hosting site => platform id' and 'hosting site => profile id', but what it should be doing is generating a text field linked to the right node.

but really, this is almost committable.

adrian’s picture

I spent some time working on this , replacing the fields being exposed with relationships.

http://skitch.com/vertice/d1177/t

It also provides a new plugin type for site tables, and a default view with all the related fields.

Steven Jones’s picture

Project: Hosting » Hostmaster (Aegir)
Version: 6.x-0.4-alpha1 » 6.x-2.x-dev

I wonder if Adrian pushed this code somewhere, or if all we have is the screenshot.

Not having views integration is kinda silly at the moment, we should have this!

univate’s picture

Status: Needs work » Needs review
FileSize
32.54 KB

I think this issue can be marked as fixed.

The views integration I wrote above (or something based on it) was committed some time ago.

See the *.views.inc files, e.g:
profiles/hostmaster/modules/hosting/site/hosting_site.views.inc

And the code already has some default views that replicate some of the existing displays like site listing.

I know that I am using views to create a simple display of sites with an exposed filter to allow you to search
e.g.
views integration

Steven Jones’s picture

Status: Needs review » Fixed

Sweet, we can open new issues as required :)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Deciphered’s picture

Title: Views 2 support » Views integration
Status: Closed (fixed) » Active

Re-opening this issue as I've been doing a lot more working on the Aegir views integration of late, however part of what I've been doing requires Views 3.

Additionally, the work I'm doing includes Views Bulk Operation integration, so that the standard sites listing can be completely replaced with a View. Patches to start coming as soon as possible.

Deciphered’s picture

- Added Node operations: Verify, Disable and Enable
- Cleaned up existing Views integration.
- Fixed issue with field relationships (possibly a Views 3 issue?)
- Updated default views: VBO driven Sites list replacement and additional Tasks queue block.

Probably a few other things as well.

This requires Views 3 and VBO (with the following patch: http://drupal.org/files/views_row_classes-6.x-1.13-1843166-2.patch)

Deciphered’s picture

Status: Active » Needs review
FileSize
65.45 KB

Updated patch with missing file add/delete.

Marked as Need review, as while it still needs work, the functionality in the patch does work, it's just that there still needs to be a lot more added, more views, VBO actions, etc.

ergonlogic’s picture

Status: Needs review » Needs work

For my part, I'd like to see all our custom lists and bulk actions replaced by Views-based equivalents. This would make them (a) easier to modify and customize and (b) reduce the amount of custom code in Hostmaster, as these would essentially just be exported Views configs.

To that end, we'd need to ensure we're exposing as much as possible to Views. In particular, fields are very sparse for platforms and servers. Also, patching hostmaster.make to include the dependencies, might be a good idea too.

I'd suggest starting up a new meta issue to track the various components, and their statuses.

Deciphered’s picture

I did put that question to Anarcat on IRC but never heard anything back, it's also a reason I've been holding back on this issue.

Make the interface require Views will make things a lot easier for me to deal with and alot easier for users to understand, having it as an option only when Views is available is nice, but a bit confusing.

I will definitely continue onwards with the goal of using views as a requirement of Aegir not a supplement.

ergonlogic’s picture

Well, we'll still need the maintainers to agree to including dependencies on Views and vbo. But I think it's worth taking the initiative to assume they will. To that end, though, I think we should keep the current home-grown lists in place, and maybe add 'hosting/site2' and 'hosting2/platform' paths for the Views-based ones. At least for initial development, it seems like it would be easier to ensure we're maintaining the same (or better) functionality.

I've started a new branch in my hostmaster sandbox to help keep things straight, since my take on #1860842: Revamp the UI will require some of the work here, as I'm essentially building a Panels/Views based dashboard. I've gone ahead and patched the makefile, .gitignore, and enabled the rest of the fields for platforms.

Steven Jones’s picture

Well, we'll still need the maintainers to agree to including dependencies on Views and vbo.

Sorry that I've been absent for several months now, for my part we'd be crazy to not add a dependency on views and get rid of all our custom listing code, and use VBO to do the actions on those lists. Especially as Views and VBO are in D8 core now anyway.

So, consider adding Views and VBO to Aegir's make and requiring them a given.

Deciphered’s picture

I have to disagree on the 'hosting/site2' or 'hosting2/platform' approach, primarily because it's unnecessary for one to one testing of the old functionality (disable view, old page callback will come back through), but also because it means that things like the AJAX/JS for auto-refreshing the Queue and the lists will have to be doubled up which will make the cleanup all that much harder.

I'd prefer to take the approach of ripping out all old code in favour of the new approach, and for one-to-one testing to use the Aegir-UP Vagrant blueprint or similar.

Also, while I know it's not necessarily related to this issue, I'd also like to add Context for block layout, but we can probably discuss that elsewhere.

anarcat’s picture

Go for ditching the old code and depending on views in 2.x.

I wouldn't depend on context (or panels, for that matter), in 2.x however. But that could be an optional module, maybe even shipped with aegir as an experimental feature if it matures quickly enough.

Steven Jones’s picture

@ergonlogic could I have commit access to the sandbox please, do you also want to give it to Deciphered also, and we can work on the views integration over there before merging in?

We shouldn't really need context and panels because our UI is really simple. We could bring in Context if we needed it though I suppose.

ergonlogic’s picture

@darthsteven & @deciphered: Ok, I've granted you both access to write to the repo. I'll ask that you only push into the 588728_view_integration branch for the moment. Any idea where git.d.o per-issue repos stand? :)

Steven Jones’s picture

Title: Views integration » Meta: Views integration redux
Status: Needs work » Active

@ergonlogic lovely, thanks. I'm going to make this a meta issue and spin up some more issues on the sandbox project that cover some more of the views work.

Steven Jones’s picture

Issue summary: View changes

Updated issue summary.

Steven Jones’s picture

Issue summary: View changes

Updated issue summary.

Steven Jones’s picture

Issue summary: View changes

Updated issue summary.

Steven Jones’s picture

Issue summary: View changes

Updated issue summary.

Deciphered’s picture

So i've been doing some stuff today, ripping out old redundant code that's been replaced with Views and tidying up the Queue list view block and AJAX stuff a bit, which I will likely commit later today (minus upgrade path which I haven't done yet), but I wanted to throw a question to you guys in here for one of the things I have done for my personal version.

Basically, because I run Aegir for local dev, I have quite a large number of sandbox sites, and that can get a little annoying, so I have exposed some filters to the view as a block (hence the previous request for a top and bottom content region in the theme) that I have above the Site list view for filtering the list down.

Is this something that you would like to have as core functionality of Aegir or is this something that because the site is now views based you'd prefer people to just put in place themselves if they want it?

univate’s picture

I can give you my opinion as another user... actually if you scroll back to #6 you can see a view I already use.

I definitely think its really useful to have an exposed filter on the node title for searching for sites by their name.

Steven Jones’s picture

@Deciphered yeah adding a filter block is fine, I think we just need to think about which filters we should add, and we should make the distinction between the filters and actions really clear, because I find it's not always that obvious.

Deciphered’s picture

At the moment I just have the site name and profile as filters, open to discussion there. As for placement, I think it'd distinct enough, but will post screenshots tomorrow.

Deciphered’s picture

Screenshot, as promised.

Screenshot_8_01_13_6_26_AM-2.png

Please excuse the lack of navigation, it's just personal preference.

Steven Jones’s picture

Thanks for the screenshot.

I think that the filter section isn't very clear at the moment, and that we'll need to do some theming work to get the filter form to have a least a title of what that section is all about.

Great work otherwise!

Steven Jones’s picture

Issue summary: View changes

Updated issue summary.

Deciphered’s picture

Status: Active » Needs work
FileSize
63.27 KB
109.49 KB

Updated patch, still needs work, but I wanted to get back into it and I figured this would be a good way to start.

Not quite sure on the status of ergonlogic's sandbox repo anymore either.

Janky interdiff also attached, just due to me having quite a few other unrelated uncommitted changes in my local copy.

anarcat’s picture

Boy that's a huge patch! :) But great work, happy to see progress here.

I haven't had time to review/test, what work is remaining exactly?

Deciphered’s picture

The most important thing at the moment is the upgrade path.

There's still quite a bit of Views related stuff not integrated yet, but I will hopefully doing some more this weekend.

Will give a proper status update ASAP.

Deciphered’s picture

Updated patch:
- Added upgrade path.
- Implemented Views block on Profile packages, Client nodes and Platforms.
- Various other related changes.

anarcat’s picture

Is this ready for review then? :)

Thanks again for the good work.

Deciphered’s picture

Status: Needs work » Needs review

A review couldn't hurt, but some of the lists still haven't been converted into Views.

However, what is done should be good enough to review on it's own and could be committed (once reviewed) without the rest of the views being done.

I'll mark as 'needs review' for the moment.

Deciphered’s picture

Updated patch:
- Added Packages view
- Exposed fields to Servers to views

Edit: Ignore the interdiff, seems to be wrong....

Deciphered’s picture

Updated patch, fixed conflict with latest 6.x-2.x commit.

Getting rather difficult to manage this patch at the moment due to the vast size of it, hopefully it's still all good.

Deciphered’s picture

Updated patch:
- Fixed issue with Hosting package default views.
- Added 'Delta' field to Hosting tasks view (as per #1891808: A view for tasks' execution time)
- Some minor tweaks to some of the existing fields.

ergonlogic’s picture

Minor update to the patch with a recent change to hostmaster.make

ergonlogic’s picture

Added this patch as a mega commit to the new feature branch 'dev-588728-views-integration'.

ergonlogic’s picture

I just ran a hostmaster-migrate to a new platform built from the updated makefile, and everything appears to have worked.

Note that the following lists appear not to have been re-implemented with Views:

  • Task lists on Aegir entity nodes
  • Servers lists (/hosting/servers)
  • Platform comparison (for site migrate)
  • Task logs

Also, the packages tab was gone altogether from platform nodes. This was a quick fix in the validator types for the argument in hosting_package_list.

ergonlogic’s picture

Status: Needs review » Needs work

When installing Aegir from the feature branch (dev-588728-views-integration), a couple things break:

  • Views and vbo aren't enabled
  • 'Sites' menu item isn't created
ergonlogic’s picture

I added Views and VBO to the .install, but I'm seeing some oddities with the Views-based menu items.

ergonlogic’s picture

The problem with the menus appears to have been that we were still adding our custom menus in the install profile. I pulled those out, added views-based menus, and weighted them appropriately. Everything appears to work now.

Since anarcat's working on #1912134: split hosting in its standalone module, merging the dev branch was a little weird. In the end, I just applied the changes directly, and rolled them into a single commit in Hosting (http://drupalcode.org/project/hosting.git/commit/dc625d08c0a947157b74586..., where I had a chance to provide proper attributions) and another in Hostmaster (http://drupalcode.org/project/hostmaster.git/commit/b1bf8892781af1dd527b...).

I'm leaving as 'needs work' since #1876354: Convert list of servers to use views appears to still require work. Along with that, there were a couple more things I mentioned in #38, but I doubt those are in the scope of 'Views integration' per se.

Thanks to everyone who's participated in all the great work on this so far!

ergonlogic’s picture

Also, the task queue block isn't enabled in the install profile...

ergonlogic’s picture

Status: Needs work » Fixed

On second thought, since the lion's share of this is done, I'll close this meta issue, and we can work on whatever remains in the individual issues:

anarcat’s picture

note that this has severly broken the frontend, the site views and menus don't get installed which breaks the frontpage, amongst a lot of other things. see #2000228: Ensure upgrade path works for 2.x

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

add another views issue

  • Commit 041b1d2 on dev-dns, dev-features, dev-headless_install, dev-log_directory, dev-migrate_aliases, dev-multiserver-install, dev-newsiteform, dev-nginx, dev-platform_management, dev-ports, dev-purgebackup, dev-relationships, dev-restore, dev-server_nodetype, dev-services, dev-site_rename, dev-ssl, dev_dns, prod-koumbit, dev-ssl-ip-allocation-refactor, dev-1205458-move_sites_out_of_platforms, 7.x-3.x, dev-588728-views-integration, dev-1403208-new_roles, dev-helmo-3.x by anarcat:
    #588728 by univate - preliminary views2 support
    
    

  • Commit 041b1d2 on dev-dns, dev-features, dev-headless_install, dev-log_directory, dev-migrate_aliases, dev-multiserver-install, dev-newsiteform, dev-nginx, dev-platform_management, dev-ports, dev-purgebackup, dev-relationships, dev-restore, dev-server_nodetype, dev-services, dev-site_rename, dev-ssl, dev_dns, prod-koumbit, dev-ssl-ip-allocation-refactor, dev-1205458-move_sites_out_of_platforms, 7.x-3.x, dev-588728-views-integration, dev-1403208-new_roles, dev-helmo-3.x by anarcat:
    #588728 by univate - preliminary views2 support