New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UX] Add "export" Drop-button actions for all exportable things. #2960

Open
jenlampton opened this Issue Jan 27, 2018 · 23 comments

Comments

Projects
None yet
5 participants
@jenlampton
Copy link
Member

jenlampton commented Jan 27, 2018

Describe your issue or idea

I'm really loving building a view on one site, exporting via the views drop-button action, and importing on another site. I'd love to be able to do the same with my blocks and layouts, and heck, anything that's exportable! Let's consistently provide this feature throughout core:

  • Menus #2969
  • Blocks #2970
  • Layouts #2116
  • Image styles
  • Text formats
  • User roles
  • Content types
  • Vocabularies
  • Views

Other ideas and existing issues:

  • Entire content type (with fields + instances) #408
  • Introduce a generic modal to be used when any "export config" link is clicked (UI consistency). Ideas for this modal include:
    • Preselecting the entire text ready to be copied, or providing a "copy to clipboard" functionality.
    • Perhaps have a "download configuration" link that saves the code to a file with the appropriate format/extension (view_name.view.inc for example for views).

Comment from @quicksketch on #2970 (comment)

... tacking on the group label and file name to the path seems unclean to me. Could we pass those as query string parameters instead, matching what we do for other similar prepopulation of fields (e.g. the module filter, views exposed filters, etc)? This would require updating config_export_single_form() to check the $_GET parameters for each field.

Comment from @jenlampton on #2970 (comment)

Yes, as long as that's a suitable API change, I'd love to see more use of the individual "Export" action throughout core.

Related issues:

  • #3467 Make date formats individually exportable

PR: backdrop/backdrop#2463

@jenlampton jenlampton changed the title [UX] Add an [UX] Add "export" Drop-button actions for exportable things. Jan 27, 2018

@jenlampton jenlampton changed the title [UX] Add "export" Drop-button actions for exportable things. [UX] Add "export" Drop-button actions for all exportable things. Jan 27, 2018

@olafgrabienski

This comment has been minimized.

Copy link

olafgrabienski commented Jan 27, 2018

Another idea (don't know if exportable): single content types including configuration, field and display settings

@jenlampton

This comment has been minimized.

Copy link
Member

jenlampton commented Jan 29, 2018

I think we have an issue for that already... #408

@olafgrabienski

This comment has been minimized.

Copy link

olafgrabienski commented Feb 9, 2018

@jenlampton I've updated the issue description to add links to sub-issues.

I saw also that in (the duplicate issue) #1833 there are some more ideas which we might add to the issue description.

@jenlampton jenlampton added this to the 1.10.0 milestone Feb 13, 2018

@jenlampton

This comment has been minimized.

Copy link
Member

jenlampton commented Feb 13, 2018

I saw also that in (the duplicate issue) #1833 there are some more ideas which we might add to the issue description.

I've updated our bullet-list to include everything that was over there.

I think this will be a fantastic UX improvement, so adding the milestone for 1.10. We'll see how many of these sub-issues will be ready by then, but let's give it a go :)

@jenlampton jenlampton changed the title [UX] Add "export" Drop-button actions for all exportable things. [META][UX] Add "export" Drop-button actions for all exportable things. Apr 28, 2018

@jenlampton jenlampton modified the milestones: 1.10.0, 1.11.0 May 2, 2018

@klonos

This comment has been minimized.

Copy link
Member

klonos commented Jul 3, 2018

This interests me a great deal. Do we have any UI guidelines/mockups/ideas of how this should look and work? I think that the place where this export functionality is located should be consistent throughout the admin UI, similar to how we have the "+Add XYZ" links at the top-left for listing pages.

@jenlampton

This comment has been minimized.

Copy link
Member

jenlampton commented Jul 3, 2018

I think we should stick with the current pattern of putting the drop-button in with the other actions. For most things it's self explanatory. See views for an example of how the rest of core should look & work.

@klonos

This comment has been minimized.

Copy link
Member

klonos commented Jul 3, 2018

Sure. So Views has an "Export" option in each drop-down for each individual view listed under /admin/structure/views, and it also provides an "Export view" option in the drop-down menu that is available within each individual view config page (top-right). I would appreciate an additional "Export all views" option in /admin/structure/views.

So similarly, say for the content types listing in /admin/structure/types I would expect an "Export" option in each drop-down for each individual content type, and also an "Export all content types" drop-down menu at the top-right. Not sure where to place a respective "Export content type" option within each individual content type "Configure" page though (to match what we have in the Views UI that is).

@jenlampton

This comment has been minimized.

Copy link
Member

jenlampton commented Jan 11, 2019

I've filed a single PR for this that includes many of the systems that need export links, since they all seemed to be relatively trivial. backdrop/backdrop#2463

@jenlampton jenlampton changed the title [META][UX] Add "export" Drop-button actions for all exportable things. [UX] Add "export" Drop-button actions for all exportable things. Jan 11, 2019

@klonos

This comment has been minimized.

Copy link
Member

klonos commented Jan 11, 2019

@jenlampton I have tested this on the PR sandbox and it works as expected, so RTBC on that aspect. But...

Minor nit: you have changed all the export button links on the views listing page to use a query, but you have not changed the export buttons when configuring each view individually.

Bigger nit (or a question): why use a query instead of /admin/config/development/configuration/single/export/[group_name]/[config_name]?

@docwilmot

This comment has been minimized.

Copy link
Contributor

docwilmot commented Jan 11, 2019

This is brilliant. Agree with @klonos questions though.

@jenlampton

This comment has been minimized.

Copy link
Member

jenlampton commented Jan 12, 2019

Views has an "Export" option in each drop-down for each individual view listed under /admin/structure/views

This PR fixes that one to use the new "supported" link format.

and it also provides an "Export view" option in the drop-down menu that is available within each individual view config page

Oops, missed that one. Will push an update!

I would appreciate an additional "Export all views" option in /admin/structure/views.

Sure, please open an issue :) This sounds a lot like #408, which is a new concept and we don't yet have the ability to do this (more than one config file, but not all of them) in core

I would expect an "Export" option in each drop-down for each individual content type

Yep, this PR adds those.

and also an "Export all content types" drop-down menu at the top-right.

Please also add this request to the new issue.

Not sure where to place a respective "Export content type" option within each individual content type "Configure" page though

I'm not sure this is necessary... In fact, I don't think it would be a good idea until we solve #408 because that's what people really want when they export a "Content type" not just the type name and settings, which is all this PR will provide.

Minor nit: you have changed all the export button links on the views listing page to use a query, but you have not changed the export buttons when configuring each view individually.

yes, missed that one :) will update shortly!

Bigger nit (or a question): why use a query instead of /admin/config/development/configuration/single/export/[group_name]/[config_name]?

Well, 1) Because @quicksketch told me to. But 2) passing in values in the URL would require some major updating to the menu entries to accept the new parameters, and also because our group names have uppercase characters and spaces we'd probably want to add a bunch of transformations, etc. Basically - this was the simplest / least change way to do it.

@jenlampton

This comment has been minimized.

Copy link
Member

jenlampton commented Jan 12, 2019

Okay, PR now also updates that second sneaky views export link!
backdrop/backdrop#2463

@docwilmot

This comment has been minimized.

Copy link
Contributor

docwilmot commented Jan 12, 2019

passing in values in the URL would require some major updating to the menu entries to accept the new parameters

but config_export_single_form(array $form, array &$form_state, $config_group = NULL, $config_name = NULL) already passes those url parts as parameters. So visiting URL admin/config/development/configuration/single/export/ANYGROUPNAME/ANY_CONFIG already works.

TBH I thought it shouldnt, but it does.

@jenlampton

This comment has been minimized.

Copy link
Member

jenlampton commented Jan 12, 2019

Yes, that's the hack I was using before for Views. It surprized @quicksketch too.

The issue is that the menu handler doesn't expect those values. This only works because of the weird Drupal/Backdrop bug that if the path foo exists, then foo/bar will "work" as will foo/bar/baz instead of properly 404ing.

If we were ever to fix that bug, all these hacks would break :)

@klonos

This comment has been minimized.

Copy link
Member

klonos commented Jan 12, 2019

Makes sense @jenlampton 👍 ...besides, using a query will allow to easily pass multiple things (groups and configs) as parameters if we decide to implement #408 or similar.

@quicksketch

This comment has been minimized.

Copy link
Member

quicksketch commented Jan 14, 2019

This looks good, and I like the new $_GET approach instead of tacking onto the URL as a path.

One thing that concerns me, should we provide a link to export content types when you can't really import it into another site? As exporting a content type doesn't include any fields. There's an existing issue for this at #408.

Should we just go ahead and provide the Export link anyway, even though it probably won't do what people want (yet)?

@quicksketch

This comment has been minimized.

Copy link
Member

quicksketch commented Jan 14, 2019

Views UI includes a test to check for the export link. That needs to be updated. I don't think my above comment needs to hold this up, but the tests need to pass.

@olafgrabienski

This comment has been minimized.

Copy link

olafgrabienski commented Jan 14, 2019

Should we just go ahead and provide the [content type] Export link anyway, even though it probably won't do what people want (yet)?

Maybe display a respective info message on the export page if the Configuration group is "Node types" (and remove it again once #408 is solved).

Btw, should and can we rename the mentioned Configuration group to "Content types"?

@jenlampton

This comment has been minimized.

Copy link
Member

jenlampton commented Jan 14, 2019

Should we just go ahead and provide the [content type] Export link anyway, even though it probably won't do what people want (yet)?

If this is a sticking point I say we include all the other links, and punt on this one. I agree it may cause a UX issue for people where there wasn't one before. Removed in the latest PR.

That [test] needs to be updated.

Done.

@klonos

This comment has been minimized.

Copy link
Member

klonos commented Jan 15, 2019

One thing that concerns me, should we provide a link to export content types when you can't really import it into another site? As exporting a content type doesn't include any fields. There's an existing issue for this at #408.

This is also mentioned in #3475, as it seems that users generally expect CMI to work similarly to Features (automatically export dependencies along with the thing selected).

@jenlampton

This comment has been minimized.

Copy link
Member

jenlampton commented Jan 15, 2019

Removed in the latest PR.

@jenlampton

This comment has been minimized.

Copy link
Member

jenlampton commented Jan 15, 2019

@quicksketch reports the current views "hack" as bug, so this issue can get into 1.12.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment