Closed (duplicate)
Project:
Features
Version:
7.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
10 Jan 2012 at 23:34 UTC
Updated:
12 Oct 2012 at 06:38 UTC
Jump to comment: Most recent file
Comments
Comment #1
Grayside commentedI kind of like #1 and #3.
In the Features UI, add a little "x" button on hover over any element---automatic or specifically chosen.
Comment #2
xen commentedRegarding #1, Grayside http://drupal.org/project/features_plumber already does that. Maybe it should be in features?
I also like #3, complex as it is. It should be up to the feature creator whether views are a recommendation (bad name, providing a default view doesn't mean you're recommending the use of views) or a dependency.
Comment #3
Grayside commentedXen, agreed, Features Plumber and Features Tools are both a mix of corner case ideas and core concepts. I believe they spun off out of impatience with the long slowdown in movement in Features itself. Fed up with the slow process, I expect it will be up to Features maintainers or other developers to reach out and pull some of that functionality back in. E.g., Features Linking, more sophisticated viewing of components & component status via drush, etc.
Comment #4
hefox commentedBeginning of a patch. Works in ui, haven't touched drush, but need to totally redo the .admin stuff
Comment #5
hefox commentedNext step in the patch, moves processing into the form definition so that can store information in $form_state.
Here's a simple of info file produced
Note
Next I need to redo how the ajax is doing it. Currently features has a bug that autodetected items don't automatically appear as checked, leading to quite a confusing user expierence. This fixes it, but means the input has to be refreshed ever check.. not good. My guess is the quickest way is to add a "preview" button that the ajax is attached to, and remove the on each check previewing. Meh.
Comment #6
Grayside commentedI don't like using features_exclude as the root namespace.
Would it be too much complexity to use something like the Drush Make model, so:
or
which would dovetail with the idea I was fumbling for in #1397336-1: Developing contribable features that have items that may or may not be there on a drupal install:
Comment #7
hefox commentedToo much a chance to break existing contrib modules if changing the format of features -- not worth it.
Comment #8
Grayside commentedI'm saying to support both existing and "verbose" versions, as with Drush Make. That should retain compatibility with all existing features.
Comment #9
hefox commentedFeatures has hooks that pass around an array that becomes the info file. Anyone using $export['features'] in those various features will break if the logic is changed. It's not worth breaking all those modules.
Comment #10
Grayside commentedOkay, yeah. That makes sense. Still, not elegant. That kind of compatibility change should be reserved for a 7.x-2.0 upgrade...
Comment #11
hefox commentedStill buggy specially on recreate, but getting close.
Had to remove the ajax on the checkbox and add a preview button, cause can't really be changing the checkboxes on every single click cause it refreshes the entire element so noot usable. Would like some eyes.
Comment #12
hefox commentedFixed some bugs
To go over what and why of this patch:
Adds the ability to exclude; A new key is added to info, features_exclude, that indicates an item should be excluded. By unchecking the checkbox on the features create/recreate form, it removes the item, but only marks as exclude if the item was automatically added (to prevet it from being automatically added.
Changes features_populate function so it takes in information for export array (ie. features_exclude)
Changes the re/create form so that checkboxes don't automatically preview, instead there's a preview button :/. This is due to needing fix the bug that automatically added items are not checked every, making a very confusing user experience (need to uncheck them to remove them, aye!).
Adds a feature_base key that tracks what user has specially added to the export so can tell what was automatically added vs what wasn't, even while recreating. This might be able to be removed, but feel like it's a step forward to making features easier to use. Right now it's hard to tell whether automatically added items were purposefully added or not. If features_base isn't set for a module, features key is used so upgrade path should be fine.
edit: ack, white space got in. Trying to install a trailing white space plugin, but apparently it's freezing my IDE.
Comment #13
hefox commentedOkkkay, the "trailing white space" plugin has thrice frozen on me, so removes the white spaces manually. (Weird, used it on other computers before, sigh). I'm sure there's other coding style issues I need to cleanup but dinnertime.
Comment #14
webkenny commentedMarked #1601114: No field granularity allowed when selecting content types for export as the cousin (a.k.a duplicate) of this issue. :) - Happy to help here. I'll review the patches included.
Comment #15
ezra-g commentedAdding the 'commonslove' tag since this kind of granular exportability is key to making Commons (and other distributions) more extendable and maintainable.
Comment #16
mpotter commentedRe-rolled this against the latest 1.x-dev release to give it some love.
I like the approach of this. In fact, it took me a while to figure out how it works since it's so seamless with the existing checkboxes (compared with all the extra checkboxes added by features_plumber).
A couple of comments and requests for help:
1) I added a content-type to an export, then unchecked a couple of the fields that were auto-detected. When I downloaded the feature, I had some lines like:
features_exclude[dependencies][] = field_sql_storage
features_exclude[dependencies][] = text
features_exclude[dependencies][node] = node
in my feature.info file that don't seem right. I never explicitly unchecked any dependancies, so wondering why these got marked for exclusion. They are the "auto-detected" dependancies, but seems like they should be handled the same as other components we want to exclude.
2) For people used to the old checkbox UI, I think we need some improvements to remind people to Preview. I'd like to see some simple Javascript that highlights the Preview button whenever a change is made to the Components checkbox list. When the Preview button has been highlighted, I'd like to see the Download button disabled, with a comment "Preview before Downloading" or something like that. I just want to make sure people preview their feature to see what is going to be exported before using the Download function. Perhaps after clicking Preview (which would un-highlight the Preview button) maybe the Download button then gets highlighted? Any UX help here would be appreciated.
3) minor: not sure putting the Preview button on top of the exportable list is the best place...that column is already pretty large. Wonder if the Preview button could be right-aligned next to the Edit Components dropdown selector.
This is exactly the kind of usability improvements that I'd like to make to Features right now, so please help with this patch!
Comment #17
mpotter commentedOops, here is the patch file.
Comment #18
mpotter commentedWhen I was going through cleaning up the issue queue, this was the topic that had the most "dups". Lots of issues revolve around the current use of Ajax when you click a selection box for a component. I'm going to actively work on this issue and try to set up the javascript delay to auto-trigger the Preview button. I'm also bumping the priority on this because it tries to address the base cause of so many other issues and deserves more love.
Comment #19
mpotter commentedOh, and because of the extensive code changes in the latest -dev version, #17 no longer applied, so here is the latest patch. No changes, just building it vs the current -dev release.
Comment #20
mpotter commentedFrom #16, the issue with the field_sql_storage being added to the features_exclude[dependencies] was because of an older features export. If I exported the feature first using the latest -dev version (which no longer added the field_sql_storage), then this was fixed.
I'm going to take a stab at adding a javascript timer to auto-click the Preview button after a period of inactivity. What I'd like help with (hefox?) is determining if we really need the features_base[] stuff in the *.info file. It doubles the amount of code in that file and some people actually do edit their features by hand and this will really complicate that task. Hefox mentions above that he's not sure if the features_base stuff is needed, so let's see if we can come up with a version that doesn't require it.
Comment #21
hefox commentedFor the UI changes, I don't think the features_base stuff is needed. The features_base was for tracking what the user actually checked across creations. It'd allow stuff like detecting that dependency "views" was added automatically, and not by hand, and so if a feature features-update no longer auto detects views, it knows it can drop that views depedency. It would mean, to edit .info, instead of editing dependencies[] = "views", features[base][depdenceies][] = views would be edited.
It can be separated into a future issue imo.
Comment #22
mpotter commentedMaybe instead of exporting the "base" stuff (which doubles the number of *.info entries) we should just export the "auto-detected" stuff. This might also help for people who just edit the code file directly since you'd be able to easily tell if something in *.info was added explicitly or whether it was auto-detected (and then also if it was specifically excluded).
features[autodetect][dependencies][] = views
How does that sound?
Comment #23
socialnicheguru commentedwhy not just use ftools or features plumber?
Comment #24
Grayside commentedBecause the pratfalls and weakpoints of a module should be solved within the module if possible, and the solution can often be much better from inside than working around the edges. That is why modules that go into Drupal core often change.
Comment #25
mpotter commentedI have created a new Branch and topic to implement this issue: #1810134: Improve Features UI (featuresUI-1.1 branch)
Closing this issue now as a dup of the new work.
Comment #26
Grayside commentedI understood this as being more an architectural underpinning of features rather than part of the UI specifically. Either way, exciting to see these concepts move forward!