Comments

tim.plunkett’s picture

Issue tags: +VDC, +CTools dependency
tim.plunkett’s picture

Title: Stop using CTools Export UI completely » Design and build a replacement for CTools Export UI

That was a bad title.

Since as of now CMI does not handle UI import/exports, but will in the future, the only part we need is listing, with the operations (hopefully in a dropbutton still, separate issue).

The closest thing to it in core is admin/structure/types.

What would be really great is VBO in core, and a view of views.

tim.plunkett’s picture

Status: Active » Needs review
StatusFileSize
new2.34 KB

In the meantime, #1764194: Convert export_ui to annotations was committed so the current export UI implementation needs to become an annotated plugin.

I hope I get this right on the first try, or the branch tests might fail.

tim.plunkett’s picture

Status: Needs review » Active
tim.plunkett’s picture

Assigned: Unassigned » damiankloip
StatusFileSize
new1.97 KB

Damian started http://drupal.org/sandbox/damiankloip/1778654 and it is AWESOME.

Just to try it out, I went and implemented it for Views.

It's just the listing, so the "add new view" and friends should be moved to views_ui_menu or something.

tim.plunkett’s picture

StatusFileSize
new4.94 KB

This is against the 8.x-list-links branch. It now looks exactly like the regular admin/structure/views, which is now at admin/structure/views2.

The only thing missing is the sorting.

aspilicious’s picture

Status: Active » Needs work
+++ b/lib/Drupal/views/Plugin/config/listing/ViewListing.phpundefined
@@ -0,0 +1,129 @@
+    $mappings['edit'] = array(

Can we use links here? Mapping confused me a lot. Maybe we should rename actionLinkMappings to actionLinks. It doesn't rly map anything it just builds a list of action links.

Views-admin.ctools.css contains ctools export css. Should we remove that too?

aspilicious’s picture

Status: Needs work » Active

whoops stupid dreditor

tim.plunkett’s picture

StatusFileSize
new22.96 KB

I pushed up a branch for this http://drupalcode.org/sandbox/damiankloip/1685040.git/shortlog/refs/head...

Here's a patch too.

dawehner’s picture

+++ b/views.installundefined
@@ -20,29 +20,12 @@ function views_install() {
-      'load callback' => 'views_storage_load',
-      'save callback' => 'views_storage_save',
-      'status callback' => 'views_storage_status',

We could probably get rid of these custom callbacks as well.

tim.plunkett’s picture

Agreed, pushed that up as well.

damiankloip’s picture

StatusFileSize
new8.14 KB

@tim.plunkett Nice start on this! :) I had an implementation on my local too, but as you have started here, we might as well go with this one. Here is an updated patch to work with the current '8.x-list' branch in the sandbox.

Most notably, I have changed the action links definitions to use 'href' instead of 'path' to be consistent with theme_links. I have also moved the hook_menu implementation into the plugin class. So we now have a hookMenu method that can be overridden/extended. Seems to be a better idea?

damiankloip’s picture

Status: Active » Needs review
StatusFileSize
new55.05 KB

Ok, here is a patch that includes the work from the core sandbox moved into a views_ui_listing module. This is the diff from the export-ui branch of the views sandbox. It is not anything permanent, we just want to maybe include this as an interim until we can get the listing stuff into core. Anyway, worth seeing what the testbot says. I just quickly did a diff againt 8.x-3.x, haven't had any time to check it and the patch in general is about all I had time to get done just now, so maybe the views_ui stuff is pretty rough.... But hey, It's temporary!

Status: Needs review » Needs work

The last submitted patch, views-1760284-14.patch, failed testing.

tim.plunkett’s picture

Status: Needs work » Needs review
StatusFileSize
new55.05 KB

I'm reasonably sure that #1780396: Namespaces of disabled modules are registered during test runs is causing these error. Added a workaround.

Status: Needs review » Needs work

The last submitted patch, views-1760284-16.patch, failed testing.

tim.plunkett’s picture

Status: Needs work » Needs review
StatusFileSize
new49.44 KB

Okay, I reverted the views_api and hook_hook_info stuff for now, that might just have to wait until the sandbox.

Status: Needs review » Needs work

The last submitted patch, views-1760284-18.patch, failed testing.

tim.plunkett’s picture

Status: Needs work » Needs review
StatusFileSize
new49.44 KB

views_ui_listing depended only on views, not views_ui

Status: Needs review » Needs work

The last submitted patch, views-1760284-20.patch, failed testing.

tim.plunkett’s picture

Status: Needs work » Needs review
StatusFileSize
new8.09 KB
new51.55 KB

This should make the enable/disable work with AJAX.

Status: Needs review » Needs work

The last submitted patch, views-1760284-22.patch, failed testing.

tim.plunkett’s picture

Status: Needs work » Needs review
StatusFileSize
new1.51 KB
new52.31 KB

Ah! My hack for #1780396: Namespaces of disabled modules are registered during test runs was backwards.
Also commented out the test for 'clone' for now (added a @todo).

Status: Needs review » Needs work

The last submitted patch, views-1760284-24.patch, failed testing.

tim.plunkett’s picture

Status: Needs work » Needs review
StatusFileSize
new8.95 KB
new61.26 KB

Alright, these last 3 were tests for functionality removed in this patch:

  • Views Templates
  • Importing views
  • The filters on the listing page (commented out, not removed, do we want this?)
tim.plunkett’s picture

After spending a good deal of time with this code, I don't actually think that listing should be done by plugins. It should be controllers, like the new form controllers for content entities.

The reason is this: all listing plugins are all gathered, instantiated, and run. Always. If someone wants to subclass ViewListing and use a new one, I don't know how they'd get it to run after ViewListing. Also, the View object doesn't even know that ViewListing exists, only the other way around.

Therefore, I think we should be adding a key like "listing controller class" or "list controller class" to hook_entity_info. ConfigEntityListingInterface can become either ConfigEntityListControllerInterface or just EntityListControllerInterface, because maybe someone doesn't want to build their listing with Views? Who knows.

tim.plunkett’s picture

StatusFileSize
new59.14 KB
new22.49 KB
new59.25 KB

This is what I had in mind.
Pushed to a new branch 1760284-export-ui-controller in case you guys dislike the idea.

Also attached a patch without the dependencies hack since its not using plugins.

Status: Needs review » Needs work

The last submitted patch, views-1760284-28-without-hack.patch, failed testing.

tim.plunkett’s picture

Status: Needs work » Needs review

Still too soon to remove that hack, back to CNR for the regular patch.

tim.plunkett’s picture

StatusFileSize
new59.2 KB

I debugged that problem. I think.

gábor hojtsy’s picture

This would be great as well for getting layout module (and its objects such as admin defined regions and layouts themselves) to core in Drupal 8. It is great seeing the general nature of the listing interface and base class is kept.

tim.plunkett’s picture

Assigned: damiankloip » Unassigned
Status: Needs review » Fixed

Merged in! I'll link to the core issue for this when I create it next.

tim.plunkett’s picture

Status: Fixed » Postponed
StatusFileSize
new17.49 KB

I opened #1781372: Add an API for listing (configuration) entities.
Reopening and postponing this issue on that, we'll need to switch our code over.

tim.plunkett’s picture

StatusFileSize
new18.26 KB

Rerolled for upstream fixes

tim.plunkett’s picture

Status: Postponed » Needs review
StatusFileSize
new10.58 KB
new29.83 KB

The core patch has noticeably diverged from our implementation. Here is an updated version of it that I think we should commit now, and then the do-not-test patch will be the one to commit later (which will probably still change more).

Status: Needs review » Needs work

The last submitted patch, views-1760284-36.patch, failed testing.

tim.plunkett’s picture

Status: Needs work » Needs review
StatusFileSize
new10.87 KB
new29.69 KB

Whoops, missed a change.

tim.plunkett’s picture

Status: Needs review » Postponed

Okay, I merged in #38, and updated 1760284-export-ui-controller with the do-not-test patch. Back to postponed.

http://drupalcode.org/project/views.git/commit/cb54638

tim.plunkett’s picture

Title: Design and build a replacement for CTools Export UI » Rewrite ViewListController to use the core EntityListController
Priority: Normal » Major
Status: Postponed » Needs review
StatusFileSize
new12.63 KB

YAY! The core patch went in.

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

Awesome

tim.plunkett’s picture

Status: Reviewed & tested by the community » Fixed

7 files changed, 37 insertions(+), 277 deletions(-)
http://drupalcode.org/project/views.git/commit/505fa87

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